---
type: api
title: Set a connector sync job error
description: Set the `error` field for a connector sync job and set its `status` to `error`.
url: https://www.elastic.co/elastic/docs-builder/docs/4641/api/doc/elasticsearch/v9/operation/operation-connector-sync-job-error
resource: https://www.elastic.co/elastic/docs-builder/docs/4641/api/doc/elasticsearch/v9/operation/operation-connector-sync-job-error
products:
  - Elasticsearch
---

# Set a connector sync job error

Authentication: required

Availability: Experimental

## Paths

- `PUT` `/_connector/_sync_job/{connector_sync_job_id}/_error`

#### Path parameters

- `connector_sync_job_id` (string) — required
  The unique identifier for the connector sync job.

## Description

Set the `error` field for a connector sync job and set its `status` to `error`.

To sync data using self-managed connectors, you need to deploy the Elastic connector service on your own infrastructure.
This service runs automatically on Elastic Cloud for Elastic managed connectors.

## Request body

`application/json`

- `error` (string) — required
  The error for the connector sync job error field.

## Response

`application/json`

Type: `object`

## Code examples

#### Console

```console
PUT _connector/_sync_job/my-connector-sync-job/_error
{
    "error": "some-error"
}
```

#### JavaScript

```javascript
const response = await client.connector.syncJobError({
  connector_sync_job_id: "my-connector-sync-job",
  error: "some-error",
});
```

#### Python

```python
resp = client.connector.sync_job_error(
    connector_sync_job_id="my-connector-sync-job",
    error="some-error",
)
```

#### curl

```curl
curl -X PUT "$ELASTICSEARCH_URL/_connector/_sync_job/my-connector-sync-job/_error" \
  -H "Authorization: ApiKey $ELASTIC_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "error": "some-error"
  }'
```

#### Java

```java
client.connector().syncJobError(s -> s
    .connectorSyncJobId("my-connector-sync-job")
    .error("some-error")
);
```

#### PHP

```php
$resp = $client->connector()->syncJobError([
    "connector_sync_job_id" => "my-connector-sync-job",
    "body" => [
        "error" => "some-error",
    ],
]);
```

#### Ruby

```ruby
response = client.connector.sync_job_error(
  connector_sync_job_id: "my-connector-sync-job",
  body: {
    "error": "some-error"
  }
)
```

## Response examples

#### 200

`application/json`

Generated from the API spec. Values are representative. Unions use the first variant; deeply nested or large bodies may omit fields.

```json
{}
```

