> For the complete documentation index, see [llms.txt](https://api-docs.getflipturn.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://api-docs.getflipturn.com/errors.md).

# Errors

## GET /api/errors

Retrieve a list of charger errors. This is the same set of rows shown in the Charger errors report in the application.

Results are returned in reverse chronological order (most recent first) and are paginated with an opaque cursor (up to 2000 rows per page); see [Pagination and Error Handling](/pagination-and-errors.md) for details about the pagination approach.

### Parameters

Parameters should be passed as query parameters on the URL. For parameters that accept a list of IDs, pass the param multiple times, e.g. `&organizationIds=1&organizationIds=2`.

* `afterTimestamp` - ISO 8601 date string. Only return errors whose timestamp is greater than or equal to this time.
* `beforeTimestamp` - ISO 8601 date string. Only return errors whose timestamp is less than or equal to this time.
* `organizationIds` - Filter to organizations if using an API key that has access to multiple organizations.
* `siteIds` - Restrict to errors on chargers at these sites. Pass the parameter multiple times for multiple ids.
* `chargerIds` - Restrict to errors on these chargers. Pass the parameter multiple times for multiple ids.
* `nextPageCursor` - When the filters match more than one page of data, pass this value (returned in the previous response) to fetch the next page. Keep all other parameters the same as in the previous request.

### Response

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

```ts
{
  data: {
    id: number; // charging port status id, stable across requests
    timestamp: string; // ISO 8601 format, when the error was reported by the charger
    ocppErrorCode: string; // Error code field from OCPP
    vendorErrorCode: string | null; // Vendor error code field from OCPP
    ocppInfo: string | null; // Info field from OCPP
    ocppStatus: string; // OCPP status the port was in when the error was reported (e.g. Faulted)
    
    // 'endedCharging' = error ended an in-progress session
    // 'preventedCharging' = error blocked a session from starting
    // 'muted' = error triggered an alert that was muted
    // 'other' = error did not fit any of the above buckets
    errorCategory: 'endedCharging' | 'preventedCharging' | 'muted' | 'other';
    // Linked charging session, only set if this error caused or occurred during a session
    chargingSession: {
      id: number;
      startTime: string; // ISO 8601 format
      endTime: string | null; // ISO 8601 format
      durationSeconds: number | null;
      energyDeliveredKwh: number | null;
      socStartPercent: number | null; // State of charge at start of session, if reported
      socEndPercent: number | null; // State of charge at end of session, if reported
    } | 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;
    organization: {
      id: number;
      name: string;
    } | null;
  }[];
  pagination: {
    hasNextPage: boolean;
    nextPageCursor: string | null;
  };
}
```

### Example request and response

Request:

```sh
curl "https://api.getflipturn.com/api/errors?afterTimestamp=2024-04-30T01:00:07.321Z" -H "Authorization: Bearer {token}"
```

Response:

```js
{
  "data": [{
    "id": 4567,
    "timestamp": "2024-04-30T18:23:11.000Z",
    "ocppErrorCode": "GroundFailure",
    "vendorErrorCode": "0x10",
    "ocppInfo": "Ground fault detected on connector 1",
    "ocppStatus": "Faulted",
    "errorCategory": "endedCharging",
    "chargingSession": {
      "id": 1234,
      "startTime": "2024-04-30T18:00:00.000Z",
      "endTime": "2024-04-30T18:23:11.000Z",
      "durationSeconds": 1391,
      "energyDeliveredKwh": 12.4,
      "socStartPercent": 30,
      "socEndPercent": 80
    },
    "site": {
      "id": 1,
      "name": "Site 1",
      "locationId": "LOC123"
    },
    "charger": {
      "id": 2,
      "name": "Main Charger",
      "manufacturer": "ABB",
      "model": "Terra 54",
      "networkServiceProvider": "Flipturn",
      "chargerType": "DCFC",
      "serialNumber": "SN123456",
      "numberOfPorts": 2,
      "latitude": 37.7749,
      "longitude": -122.4194,
      "externalId": "EXT123",
      "ocppId": "OCPP123"
    },
    "port": {
      "id": 3,
      "name": "Port A",
      "portNumber": 1,
      "maximumPowerKw": 50
    },
    "organization": {
      "id": 1,
      "name": "My Organization"
    }
  }
  // more items
  ],
  "pagination": {
    "hasNextPage": true,
    "nextPageCursor": "NDMyNDc2"
  }
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://api-docs.getflipturn.com/errors.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
