---
type: api
title: Update the connector index name
description: Update the `index_name` field of a connector, specifying the index where the data ingested by the connector is stored.
url: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v9/operation/operation-connector-update-index-name
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v9/operation/operation-connector-update-index-name
products:
  - Elasticsearch
---

# Update the connector index name

Availability: 8.12+

## Paths

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

- [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 updated

## Description

Update the `index_name` field of a connector, specifying the index where the data ingested by the connector is stored.

## Request Body

`application/json`

- `index_name` (union IndexName | NullValue) — required — nullable

## Response

`application/json`

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

#### Console

```console
PUT _connector/my-connector/_index_name
{
    "index_name": "data-from-my-google-drive"
}
```

#### JavaScript

```javascript
const response = await client.connector.updateIndexName({
  connector_id: "my-connector",
  index_name: "data-from-my-google-drive",
});
```

#### Python

```python
resp = client.connector.update_index_name(
    connector_id="my-connector",
    index_name="data-from-my-google-drive",
)
```

#### curl

```curl
curl -X PUT "$ELASTICSEARCH_URL/_connector/my-connector/_index_name" \
  -H "Authorization: ApiKey $ELASTIC_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "index_name": "data-from-my-google-drive"
  }'
```

#### Java

```java
client.connector().updateIndexName(u -> u
    .connectorId("my-connector")
    .indexName("data-from-my-google-drive")
);
```

#### PHP

```php
$resp = $client->connector()->updateIndexName([
    "connector_id" => "my-connector",
    "body" => [
        "index_name" => "data-from-my-google-drive",
    ],
]);
```

#### Ruby

```ruby
response = client.connector.update_index_name(
  connector_id: "my-connector",
  body: {
    "index_name": "data-from-my-google-drive"
  }
)
```

## Response Examples

#### Connector update index name response example1

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

