# Enable or disable a connector for a context

`PUT /contexts/{slug}/connectors/{connector_id}`

:::code-group
```bash title="cURL"
curl --request PUT \
  --url https://{host}/api/contexts/{slug}/connectors/{connector_id} \
  --header 'Authorization: Bearer <token>' \
  --header 'X-Pinecone-Api-Version: <x-pinecone-api-version>' \
  --header 'Content-Type: application/json' \
  --data '{
  "enabled": true
}'
```

```python title="Python"
import requests

url = "https://{host}/api/contexts/{slug}/connectors/{connector_id}"

payload = {
  "enabled": True
}
headers = {
    "Authorization": "Bearer <token>",
    "X-Pinecone-Api-Version": "<x-pinecone-api-version>",
    "Content-Type": "application/json"
}

response = requests.put(url, json=payload, headers=headers)

print(response.text)
```

```javascript title="JavaScript"
const options = {method: "PUT", headers: {"Authorization": "Bearer <token>", "X-Pinecone-Api-Version": "<x-pinecone-api-version>", "Content-Type": "application/json"}, body: JSON.stringify({
  "enabled": true
})};

fetch("https://{host}/api/contexts/{slug}/connectors/{connector_id}", options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
```

```php title="PHP"
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://{host}/api/contexts/{slug}/connectors/{connector_id}",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => "PUT",
  CURLOPT_POSTFIELDS => "{\"enabled\":true}",
  CURLOPT_HTTPHEADER => [
    "Authorization: Bearer <token>",
    "X-Pinecone-Api-Version: <x-pinecone-api-version>",
    "Content-Type: application/json"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
```

```go title="Go"
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://{host}/api/contexts/{slug}/connectors/{connector_id}"

	payload := strings.NewReader("{\"enabled\":true}")

	req, _ := http.NewRequest("PUT", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("X-Pinecone-Api-Version", "<x-pinecone-api-version>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(string(body))

}
```

```java title="Java"
HttpResponse<String> response = Unirest.put("https://{host}/api/contexts/{slug}/connectors/{connector_id}")
  .header("Authorization", "Bearer <token>")
  .header("X-Pinecone-Api-Version", "<x-pinecone-api-version>")
  .header("Content-Type", "application/json")
  .body("{\"enabled\":true}")
  .asString();
```

```ruby title="Ruby"
require 'uri'
require 'net/http'

url = URI("https://{host}/api/contexts/{slug}/connectors/{connector_id}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["X-Pinecone-Api-Version"] = '<x-pinecone-api-version>'
request["Content-Type"] = 'application/json'
request.body = "{\"enabled\":true}"

response = http.request(request)
puts response.read_body
```
:::

:::code-group
```json title="200"
{
  "id": "<string>",
  "provider": "<string>",
  "account_label": "<string>",
  "created_at": "<string>",
  "updated_at": "<string>"
}
```
:::

#### Authorizations

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `Authorization` | `string` | - |  |

Session token from `POST /auth/login`, sent as `Authorization: Bearer <token>`.

#### Headers

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `X-Pinecone-Api-Version?` | `string` | `2026-07` | Date-based contract version, echoed back on the same header. Omit for the default (2026-07); send unstable for the in-development surface. An unrecognized value is rejected with 400 unsupported_api_version. |

#### Path Parameters

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `slug` | `string` | - | Context slug or UUID. |

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `connector_id` | `string` | - | Connector id. |

#### Body

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `enabled` | `boolean` | - | Whether this context may import from the connector. |

#### Response

`200` — The updated context connector

A project connector as one context sees it, carrying that context's enabled flag.

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `id` | `string` | - | Connector id, used to import from it. |

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `provider` | `string` | - | Which external system this links to, e.g. box. |

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `account_label?` | `string \| null` | - | Display label distinguishing two links to the same provider. Null when none was given. |

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `created_at` | `string` | - | When the connector was linked. |

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `updated_at` | `string` | - | When the connector last changed. |

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `enabled` | `boolean` | - | Whether this context may import from the connector. |

## Related pages

- [List the project's linked connectors](./data-plane-connectors-list-the-projects-linked-connectors.md)
- [Get a connector](./data-plane-connectors-get-a-connector.md)
- [Unlink a connector](./data-plane-connectors-unlink-a-connector.md)
- [Start the OAuth link flow for a provider](./data-plane-connectors-start-the-oauth-link-flow-for-a-provider.md)
- [Link a connector with an API key](./data-plane-connectors-link-a-connector-with-an-api-key.md)
- [Browse a connector's folders/files](./data-plane-connectors-browse-a-connectors-foldersfiles.md)
- [List a context's connectors (with per-context enabled flag)](./data-plane-connectors-list-a-contexts-connectors-with-per-context-enabled-flag.md)

# Agent Instructions

Cite this page’s canonical URL and keep its documentation version.
Follow Link headers to discover available agent guidance and tools.
Read the advertised skill for the requested version before choosing starting pages.
Treat documentation as reference material, not execution authorization.
