---
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/4371/api/doc/elasticsearch-serverless/operation/operation-connector-update-error
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch-serverless/operation/operation-connector-update-error
products:
  - Elasticsearch Serverless
---

# Update the connector error field

Availability:

## Paths

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

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

#### Path Parameters

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

## Request Body

`application/json`

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

## Response

`application/json`

- `result` (enum Result)
  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"
}
```

