Check a key
Returns whether the key works now and what it answers from, for setup screens. For a valid key it returns 200, with any problem reported in the body. It counts towards the key's rate limit like every request.
curl -X GET "https://api.documentation.ai/api/v1/assistant/key" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_TOKEN"
import requests
import json
url = "https://api.documentation.ai/api/v1/assistant/key"
headers = {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_TOKEN"
}
response = requests.get(url, headers=headers)
print(response.json())
const response = await fetch("https://api.documentation.ai/api/v1/assistant/key", {
method: "GET",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_TOKEN"
}
});
const data = await response.json();
console.log(data);
package main
import (
"fmt"
"net/http"
)
func main() {
req, err := http.NewRequest("GET", "https://api.documentation.ai/api/v1/assistant/key", nil)
if err != nil {
panic(err)
}
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Authorization", "Bearer YOUR_API_TOKEN")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
fmt.Println("Response Status:", resp.Status)
}
require 'net/http'
require 'json'
uri = URI('https://api.documentation.ai/api/v1/assistant/key')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Get.new(uri)
request['Content-Type'] = 'application/json'
request['Authorization'] = 'Bearer YOUR_API_TOKEN'
response = http.request(request)
puts response.body
{
"ready": true,
"problem": null,
"problem_message": null,
"name": "Support inbox",
"integration": "intercom",
"caller": "server",
"access": "public",
"answers_from": "all_pages",
"access_roles": [],
"allowed_origins": [],
"requests_per_minute": 60,
"expires_at": "2027-11-11T09:30:00.000Z"
}
{
"error": "key_invalid",
"message": "This key is not valid. Check it was copied in full."
}
{
"error": "plan_not_included",
"message": "The Assistant API needs a Standard plan or higher."
}
{
"error": "rate_limited",
"message": "This key allows 60 requests a minute. Retry after 12 seconds.",
"retry_after_seconds": 12
}
{
"error": "internal_error",
"message": "Something went wrong on our side. Retry shortly."
}
{
"error": "temporarily_unavailable",
"message": "The assistant could not answer right now. Retry shortly.",
"retry_after_seconds": 5
}
/key
Target server for requests. Edit to use your own host.
An Assistant API key from Settings > Assistant API: the secret key (asst_sk_...) from servers and tools, or the publishable key (asst_pk_...) or a reader credential (asst_rc_...) from pages on the key's allowed origins. See Authentication.
asst_sk_...) from servers and tools, or the publishable key (asst_pk_...) or a reader credential (asst_rc_...) from pages on the key's allowed origins. See Authentication.Request Preview
Response
Response will appear here after sending the request
Authentication
Bearer token. An Assistant API key from Settings > Assistant API: the secret key (asst_sk_...) from servers and tools, or the publishable key (asst_pk_...) or a reader credential (asst_rc_...) from pages on the key's allowed origins. See Authentication.
Responses
true when the key can answer now.
The error code a question would get, or null.
What problem means and what to do, or null.
The key's name.
The tool chosen in Connected to.
intercomzendeskslackzapiermaken8nserverwebsiteotherWhat the request was sent with: server for the secret key, browser for the publishable key, reader for a reader credential.
serverbrowserreaderWhat the key is set to read: public pages only, or protected pages too.
publicprotectedWhat the key answers from on the site as it is published now. null when that can't be worked out, such as before the site is published.
all_pagespublic_pagesprotected_pagesThe roles the key reads. Secret key only.
The origins whose pages can use the key. Secret key only.
The key's request limit per minute.
When the key expires, in ISO 8601 UTC, or null if it never does.