---
type: api
title: Create a connector sync job
description: Create a connector sync job document in the internal index and initialize its counters and timestamps with default values.
url: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch-serverless/operation/operation-connector-sync-job-post
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch-serverless/operation/operation-connector-sync-job-post
products:
  - Elasticsearch Serverless
---

# Create a connector sync job

Availability:

## Paths

- `POST` `/_connector/_sync_job`

- [Api key auth](/elastic/docs-builder/docs/4371/api/doc/elasticsearch-serverless/authentication#apikeyauth)

## Description

Create a connector sync job document in the internal index and initialize its counters and timestamps with default values.

## Request Body

`application/json`

- `id` (string Id) — required
  The id of the associated connector
- `job_type` (enum SyncJobType) — optional
  Values: `full`, `incremental`, `access_control`
- `trigger_method` (enum SyncJobTriggerMethod) — optional
  Values: `on_demand`, `scheduled`

## Response

`application/json`

- `id` (string Id)
## Code Examples

#### Console

```console
POST _connector/_sync_job
{
  "id": "connector-id",
  "job_type": "full",
  "trigger_method": "on_demand"
}
```

#### JavaScript

```javascript
const response = await client.connector.syncJobPost({
  id: "connector-id",
  job_type: "full",
  trigger_method: "on_demand",
});
```

#### Python

```python
resp = client.connector.sync_job_post(
    id="connector-id",
    job_type="full",
    trigger_method="on_demand",
)
```

#### curl

```curl
curl -X POST "$ELASTICSEARCH_URL/_connector/_sync_job" \
  -H "Authorization: ApiKey $ELASTIC_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "id": "connector-id",
    "job_type": "full",
    "trigger_method": "on_demand"
  }'
```

#### Java

```java
client.connector().syncJobPost(s -> s
    .id("connector-id")
    .jobType(SyncJobType.Full)
    .triggerMethod(SyncJobTriggerMethod.OnDemand)
);
```

#### PHP

```php
$resp = $client->connector()->syncJobPost([
    "body" => [
        "id" => "connector-id",
        "job_type" => "full",
        "trigger_method" => "on_demand",
    ],
]);
```

#### Ruby

```ruby
response = client.connector.sync_job_post(
  body: {
    "id": "connector-id",
    "job_type": "full",
    "trigger_method": "on_demand"
  }
)
```

