---
type: api
title: Update the connector error field
description: Set the error field for the connector.
url: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/elasticsearch/operation/operation-connector-update-error
resource: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/elasticsearch/operation/operation-connector-update-error
products:
  - Elasticsearch
---

# Update the connector error field

Availability: Experimental since 8.12

## Paths

- `PUT` `/_connector/{connector_id}/_error`

#### Path parameters

- `connector_id` (string) — required
  The unique identifier of the connector to be updated

## Description

Set the error field for the connector.
If the error provided in the request body is non-null, the connector’s status is updated to error.
Otherwise, if the error is reset to null, the connector status is updated to connected.

## Authentication

- Api key: `Authorization: <value>`
  Elasticsearch APIs support 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}"
  ```
  
  To get API keys, use the `/_security/api_key` APIs.
- Basic: `Authorization: Basic <credentials>`
- Bearer: `Authorization: Bearer <token>`
  Elasticsearch APIs support the use of bearer tokens in the `Authorization` HTTP header to authenticate with the API.
  For examples, refer to [Token-based authentication services](https://www.elastic.co/docs/deploy-manage/users-roles/cluster-or-deployment-auth/token-based-authentication-services)

## Request body

`application/json`

- `error` (union string) — required — nullable

## Response

`application/json`

- `result` (enum)
  Values: `created`, `updated`, `deleted`, `not_found`, `noop`
## Code examples

#### Console

```console
PUT _connector/my-connector/_error
{
    "error": "Houston, we have a problem!"
}
```

#### JavaScript

```javascript
const response = await client.connector.updateError({
  connector_id: "my-connector",
  error: "Houston, we have a problem!",
});
```

#### Python

```python
resp = client.connector.update_error(
    connector_id="my-connector",
    error="Houston, we have a problem!",
)
```

#### curl

```curl
curl -X PUT "$ELASTICSEARCH_URL/_connector/my-connector/_error" \
  -H "Authorization: ApiKey $ELASTIC_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "error": "Houston, we have a problem!"
  }'
```

#### Java

```java
client.connector().updateError(u -> u
    .connectorId("my-connector")
    .error("Houston, we have a problem!")
);
```

#### PHP

```php
$resp = $client->connector()->updateError([
    "connector_id" => "my-connector",
    "body" => [
        "error" => "Houston, we have a problem!",
    ],
]);
```

#### Ruby

```ruby
response = client.connector.update_error(
  connector_id: "my-connector",
  body: {
    "error": "Houston, we have a problem!"
  }
)
```

## Response examples

#### Connector update error response example1

```json
{
  "result": "updated"
}
```

