Alerts

GET /api/alerts

Retrieve a list of all alerts.

Parameters

Parameters should be passed as query parameters on the URL.

  • startTimestampAfter - ISO 8601 date string to filter the list to only alerts sent after this time

  • alertRecipientIds - Only query for alerts sent to specific recipient IDs. To query for several recipient ids, use the same query parameter several times. For example, '&alertRecipientIds=1&alertRecipientIds=2&alertRecipientIds=3' would query for alert recipients with IDs [1, 2, 3].

  • includeMuted - (Defaults to false) Filter out alerts that were not sent to users.

  • nextPageCursor - When the filters match more than one page of data, pass this paramter to fetch the next page

Response

The JSON response will contain a data field with a list of alerts matching the filters, and a pagination field containing pagination details.

{
  data: {
    id: number;
    type: 'lowBattery' | 'chargingCompleted' | 'chargingSessionError' | 'offlineCharger' | 'lateCharging';
    startTimestamp: string; // ISO 8601 format
    muted: boolean;
    // Alert-specific fields (only one will be populated depending on the alert type)
    lowBattery: {
      socThreshold: number | null;
      socPercent: number | null;
    } | null;
    chargingCompleted: {
      socThreshold: number | null;
      socPercent: number | null;
    } | null;
    chargingSessionError: {
      status: string | null; // Charger OCPP status -- available, etc
      ocppErrorCode: string | null;
      ocppVendorErrorCode: string | null;
      ocppInfo: string | null;
      errorContext: string | null; // Charging ended early, charging failed to start, etc
    } | null;
    offlineCharger: {
      thresholdMinutes: number | null;
    } | null;
    lateCharging: {
      originalEta: string | null; // ISO 8601 format
      currentEta: string | null; // ISO 8601 format
      originalDepartureTime: string | null; // ISO 8601 format
      currentDepartureTime: string | null; // ISO 8601 format
    } | null;
    // Additional optional details
    chargingSession: {
      id: number;
      startTime: string; // ISO 8601 format
      endTime: string | null; // ISO 8601 format
      durationSeconds: number | null;
      energyDeliveredKwh: number | null;
      socStartPercent: number | null;
      socEndPercent: number | null;
    } | null;
    site: {
      id: number;
      name: string;
      locationId: string | null;
    } | null;
    charger: {
      id: number;
      name: string;
      manufacturer: string | null;
      model: string | null;
      networkServiceProvider: string;
      chargerType: string;
      serialNumber: string | null;
      numberOfPorts: number;
      latitude: number | null;
      longitude: number | null;
      externalId: string | null;
      ocppId: string | null;
    } | null;
    port: {
      id: number;
      name: string;
      portNumber: number;
      maximumPowerKw: number | null;
    } | null;
    vehicle: {
      id: number;
      make: string | null;
      model: string | null;
      name: string | null;
      vin: string | null;
    } | null;
    organization: {
      id: number;
      name: string;
    } | null;
  }
  [];
}

Example request and response

Request:

Response:

Last updated