Skip to main content
Pinecone Docs
current

Search documentation

Type to search this documentation.

Enable or disable a connector for a context

Enable or disable one connector for this context.

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

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
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
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
<?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
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
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
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
200
{
  "id": "<string>",
  "provider": "<string>",
  "account_label": "<string>",
  "created_at": "<string>",
  "updated_at": "<string>"
}
Authorizationstringrequired

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

X-Pinecone-Api-Version?string

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.

Typestring
Default2026-07
slugstringrequired

Context slug or UUID.

Typestring
connector_idstringrequired

Connector id.

Typestring
enabledbooleanrequired

Whether this context may import from the connector.

Typeboolean

200 — The updated context connector

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

idstringrequired

Connector id, used to import from it.

Typestring
providerstringrequired

Which external system this links to, e.g. box.

Typestring
account_label?string | null

Display label distinguishing two links to the same provider. Null when none was given.

Typestring | null
created_atstringrequired

When the connector was linked.

Typestring
updated_atstringrequired

When the connector last changed.

Typestring
enabledbooleanrequired

Whether this context may import from the connector.

Typeboolean
Suggest an edit

Propose a replacement for this page. The site team reviews it before applying any changes.

Export
Documentation menu