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

# Delete a connector

Availability: Beta

## Paths

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

#### Path parameters

- `connector_id` (string) — required
  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.

## Authentication

- Api key: `Authorization: <value>`
  Elasticsearch APIs use key-based authentication.
  You must create an API key and use the encoded value in the request header.
  For example:
  
  
  ```
  curl -X GET "${ES_URL}/_cat/indices?v=true" \
    -H "Authorization: ApiKey ${API_KEY}"
  ```
  
  For more information about where to find API keys for the Elasticsearch endpoint (${ES_URL}) for a project, go to [Get started with Elasticsearch Serverless](https://www.elastic.co/docs/solutions/search/serverless-elasticsearch-get-started).

## Query string parameters

- `delete_sync_jobs` (boolean · default: false) — optional
  A flag indicating if associated sync jobs should be also removed.
- `hard` (boolean · default: false) — optional
  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
}
```

