# List sync errors

URL: https://docs.sparklayer.io/developers/api/sync-log/get-sync-logging-status-errors
Operation: `GET /api/v1/sync-log/{integration}/{data_type}/errors` (operationId `getLoggingStatusErrors`)
OpenAPI spec: https://docs.sparklayer.io/openapi/sync-log.yaml

Returns the sync status for the integration and data type together with its logged errors (at most 5,000). Returns `404` if no full sync has been recorded for them yet.

`GET /api/v1/sync-log/{integration}/{data_type}/errors`

**Base URLs:** `https://app.sparklayer.io` (Live), `https://test.app.sparklayer.io` (Test)

**Authentication:** send `Authorization: Bearer <access_token>` and `Site-Id: <site id>` with every request. Get the token from [Get an access token](https://docs.sparklayer.io/developers/api/core/get-an-access-token.md); see [Authentication](https://docs.sparklayer.io/developers/authentication.md).

### Example request

```bash
curl "https://app.sparklayer.io/api/v1/sync-log/shopify/products/errors" \
  -H "Authorization: Bearer $SPARKLAYER_TOKEN" \
  -H "Site-Id: $SPARKLAYER_SITE_ID"
```

Set `SPARKLAYER_TOKEN` to an access token and `SPARKLAYER_SITE_ID` to your Site ID. For the test environment, use `https://test.app.sparklayer.io`.

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `integration` | string | Yes | The integration the sync log belongs to, such as `shopify`. Logs are kept separately for each integration and data type. Example: `shopify` |
| `data_type` | "products" \| "customers" \| "merchant" \| "purchases" \| "pricing" \| "accountancy" | Yes | The type of data the sync log is for. Example: `products` |

### Header parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `Site-Id` | string | Yes | Your SparkLayer Site ID, from Settings > API in the SparkLayer Dashboard. Example: `jones-climbing` |

### Responses

#### 200: The sync status and its logged errors.

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `started_full_sync` | string (date-time) | | Started full sync |
| `last_full_sync` | string (date-time) | | Last full sync |
| `last_full_sync_succeeded` | boolean | | Was the last full sync successful? A successful sync may still have logging errors. A failed full sync may indicate integration configuration issues or timeout. |
| `last_partial_sync` | string (date-time) | | |
| `error_count` | integer | | Sync errors count |
| `errors` | object[] | | |
| `errors[].external_id` | string | | External ID. Length: min 1, max 64. |
| `errors[].external_url` | string | | External URL. Length: min 1, max 1024. |
| `errors[].visible_name` | string | | User friendly name. Length: max 1024. |
| `errors[].api_response` | string | | API response from sync. Length: min 1, max 4294967295. |
| `errors[].friendly_error` | string | | User friendly error. Length: min 1, max 4294967295. |

```json
{
  "started_full_sync": "2023-01-01T01:01:01Z",
  "last_full_sync": "2023-01-01T01:01:01Z",
  "last_full_sync_succeeded": true,
  "last_partial_sync": "2023-01-01T01:01:01Z",
  "error_count": 3,
  "errors": [
    {
      "external_id": "ABC-123",
      "external_url": "https://example.com/products/ABC-123",
      "visible_name": "The ABC 123 Book",
      "api_response": "Error - Product ABC-123 not found",
      "friendly_error": "ABC-123 not found"
    }
  ]
}
```

#### Other statuses: An error. The body describes the problem: see [Errors](https://docs.sparklayer.io/developers/errors.md).

`application/problem+json`: the standard error body (below).

### Error body

Error responses with a body use this RFC 7807 problem details object. See [Errors](https://docs.sparklayer.io/developers/errors.md) for every status code and which errors to retry.

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `detail` | string | | Human-readable summary of the error |
| `status` | integer | | HTTP Status code returned from API |
| `title` | string | | Machine-readable error code |
| `type` | string | | |

```json
{
  "detail": "Data Validation Failed",
  "status": 400,
  "title": "invalid-api-request-contents",
  "type": "https://hub.sparklayer.io/tech-docs"
}
```
