---
type: api
title: Claim a connector sync job
description: This action updates the job status to `in_progress` and sets the `last_seen` and `started_at` timestamps to the current time.
url: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v9/operation/operation-connector-sync-job-claim
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v9/operation/operation-connector-sync-job-claim
products:
  - Elasticsearch
---

# Claim a connector sync job

Availability:

## Paths

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

- [Api key auth](/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v9/authentication#apikeyauth)
- [Basic auth](/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v9/authentication#basicauth)
- [Bearer auth](/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v9/authentication#bearerauth)

#### Path Parameters

- `connector_sync_job_id` (string Id)
  The unique identifier of the connector sync job.

## Description

This action updates the job status to `in_progress` and sets the `last_seen` and `started_at` timestamps to the current time.
Additionally, it can set the `sync_cursor` property for the sync job.

This API is not intended for direct connector management by users.
It supports the implementation of services that utilize the connector protocol to communicate with Elasticsearch.

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`

- `sync_cursor` (object) — optional
  The cursor object from the last incremental sync job.
This should reference the `sync_cursor` field in the connector state for which the job runs.
- `worker_hostname` (string) — required
  The host name of the current system that will run the job.

## Response

`application/json`

Type: `object`

## Code Examples

#### Console

```console
PUT _connector/_sync_job/my-connector-sync-job-id/_claim
{
  "worker_hostname": "some-machine"
}
```

#### JavaScript

```javascript
const response = await client.connector.syncJobClaim({
  connector_sync_job_id: "my-connector-sync-job-id",
  worker_hostname: "some-machine",
});
```

#### Python

```python
resp = client.connector.sync_job_claim(
    connector_sync_job_id="my-connector-sync-job-id",
    worker_hostname="some-machine",
)
```

#### curl

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

#### Java

```java
client.connector().syncJobClaim(s -> s
    .connectorSyncJobId("my-connector-sync-job-id")
    .workerHostname("some-machine")
);
```

#### PHP

```php
$resp = $client->connector()->syncJobClaim([
    "connector_sync_job_id" => "my-connector-sync-job-id",
    "body" => [
        "worker_hostname" => "some-machine",
    ],
]);
```

#### Ruby

```ruby
response = client.connector.sync_job_claim(
  connector_sync_job_id: "my-connector-sync-job-id",
  body: {
    "worker_hostname": "some-machine"
  }
)
```

