---
type: api
title: Update the connector service type
description: Update the connector service type
url: https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-connector-update-service-type
resource: https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-connector-update-service-type
products:
  - Elasticsearch
---

# Update the connector service type

Authentication: required

Availability: Beta since 8.12

## Paths

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

#### Path parameters

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

## Request body

`application/json`

- `service_type` (string) — required

## Response

`application/json`

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

#### Console

```console
PUT _connector/my-connector/_service_type
{
    "service_type": "sharepoint_online"
}
```

#### JavaScript

```javascript
const response = await client.connector.updateServiceType({
  connector_id: "my-connector",
  service_type: "sharepoint_online",
});
```

#### Python

```python
resp = client.connector.update_service_type(
    connector_id="my-connector",
    service_type="sharepoint_online",
)
```

#### curl

```curl
curl -X PUT "$ELASTICSEARCH_URL/_connector/my-connector/_service_type" \
  -H "Authorization: ApiKey $ELASTIC_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "service_type": "sharepoint_online"
  }'
```

#### Java

```java
client.connector().updateServiceType(u -> u
    .connectorId("my-connector")
    .serviceType("sharepoint_online")
);
```

#### PHP

```php
$resp = $client->connector()->updateServiceType([
    "connector_id" => "my-connector",
    "body" => [
        "service_type" => "sharepoint_online",
    ],
]);
```

#### Ruby

```ruby
response = client.connector.update_service_type(
  connector_id: "my-connector",
  body: {
    "service_type": "sharepoint_online"
  }
)
```

## Response examples

#### Connector update service type response example1

`application/json`

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

