---
type: api
title: Delete a connector
description: Removes a connector and associated sync jobs.
url: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v9/operation/operation-connector-delete
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v9/operation/operation-connector-delete
products:
  - Elasticsearch
---

# Delete a connector

Availability: 8.12+

## Paths

- `DELETE` `/_connector/{connector_id}`

- [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_id` (string Id)
  The unique identifier of the connector to be deleted

## Description

Removes a connector and associated sync jobs.
This is a destructive action that is not recoverable.
NOTE: This action doesn’t delete any API keys, ingest pipelines, or data indices associated with the connector.
These need to be removed manually.

## Query String Parameters

- `delete_sync_jobs` (boolean · default: false)
  A flag indicating if associated sync jobs should be also removed.
- `hard` (boolean · default: false)
  A flag indicating if the connector should be hard deleted.

## Response

`application/json`

- `acknowledged` (boolean)
  For a successful response, this value is always true. On failure, an exception is returned instead.
## Code Examples

#### Console

```console
DELETE _connector/my-connector-id&delete_sync_jobs=true
```

#### JavaScript

```javascript
const response = await client.connector.delete({
  connector_id: "my-connector-id&delete_sync_jobs=true",
});
```

#### Python

```python
resp = client.connector.delete(
    connector_id="my-connector-id&delete_sync_jobs=true",
)
```

#### curl

```curl
curl -X DELETE "$ELASTICSEARCH_URL/_connector/my-connector-id&delete_sync_jobs=true" \
  -H "Authorization: ApiKey $ELASTIC_API_KEY"
```

#### Java

```java
client.connector().delete(d -> d
    .connectorId("my-connector-id&delete_sync_jobs=true")
);
```

#### PHP

```php
$resp = $client->connector()->delete([
    "connector_id" => "my-connector-id&delete_sync_jobs=true",
]);
```

#### Ruby

```ruby
response = client.connector.delete(
  connector_id: "my-connector-id&delete_sync_jobs=true"
)
```

## Response Examples

#### Connector delete response example1

```json
{
    "acknowledged": true
}
```

