Skip to main content
Pinecone Docs
current

Search documentation

Type to search this documentation.

Link a connector with an API key

Link a key-based provider by supplying its API key directly, instead of running the OAuth flow.

POST /connectors/keys/{provider}

cURL
curl --request POST \
  --url https://{host}/api/connectors/keys/{provider} \
  --header 'Authorization: Bearer <token>' \
  --header 'X-Pinecone-Api-Version: <x-pinecone-api-version>' \
  --header 'Content-Type: application/json' \
  --data '{
  "api_key": "<string>",
  "account_label": "<string>"
}'
Python
import requests

url = "https://{host}/api/connectors/keys/{provider}"

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

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

print(response.text)
JavaScript
const options = {method: "POST", headers: {"Authorization": "Bearer <token>", "X-Pinecone-Api-Version": "<x-pinecone-api-version>", "Content-Type": "application/json"}, body: JSON.stringify({
  "api_key": "<string>",
  "account_label": "<string>"
})};

fetch("https://{host}/api/connectors/keys/{provider}", 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/connectors/keys/{provider}",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "{\"api_key\":\"<string>\",\"account_label\":\"<string>\"}",
  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/connectors/keys/{provider}"

	payload := strings.NewReader("{\"api_key\":\"<string>\",\"account_label\":\"<string>\"}")

	req, _ := http.NewRequest("POST", 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.post("https://{host}/api/connectors/keys/{provider}")
  .header("Authorization", "Bearer <token>")
  .header("X-Pinecone-Api-Version", "<x-pinecone-api-version>")
  .header("Content-Type", "application/json")
  .body("{\"api_key\":\"<string>\",\"account_label\":\"<string>\"}")
  .asString();
Ruby
require 'uri'
require 'net/http'

url = URI("https://{host}/api/connectors/keys/{provider}")

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

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

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
providerstringrequired

A key-based provider (e.g. parallel)

Typestring
api_keystringrequired

The provider's API key. Stored encrypted and never returned.

Typestring
account_label?string

Optional display label

Typestring

200 — The linked connector

A linked project connector, secrets stripped. There is no config field — the domain model carries a provider-specific blob, but no provider populates one today.

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
Suggest an edit

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

Export
Documentation menu