API Keys
List API Keys
List your organization’s API keys and the permissions each one holds.
POST
/
keys
/
list
List API Keys
curl --request POST \
--url https://api.bland.ai/keys/list \
--header 'Content-Type: application/json' \
--header 'authorization: <authorization>' \
--data '
{
"type": "<string>",
"target_id": "<string>"
}
'import requests
url = "https://api.bland.ai/keys/list"
payload = {
"type": "<string>",
"target_id": "<string>"
}
headers = {
"authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({type: '<string>', target_id: '<string>'})
};
fetch('https://api.bland.ai/keys/list', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.bland.ai/keys/list",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'type' => '<string>',
'target_id' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"authorization: <authorization>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.bland.ai/keys/list"
payload := strings.NewReader("{\n \"type\": \"<string>\",\n \"target_id\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("authorization", "<authorization>")
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))
}HttpResponse<String> response = Unirest.post("https://api.bland.ai/keys/list")
.header("authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"type\": \"<string>\",\n \"target_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.bland.ai/keys/list")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"type\": \"<string>\",\n \"target_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"keys": [
{
"key": "org_9f3c1a7b2d",
"owner": "3c2f7a91-1b4e-4d6a-9e0f-5a8b7c6d5e4f",
"name": "Production server",
"scopes": null
},
{
"key": "org_s_4b1e9c07",
"owner": "3c2f7a91-1b4e-4d6a-9e0f-5a8b7c6d5e4f",
"name": "Pathway CI",
"scopes": ["agents:read", "agents:write"]
}
],
"scoped_keys_enabled": true,
"restricted_keys_available": true
},
"errors": null
}
Headers
Body
Response
The organization’s keys. Each entry identifies a key by its first 14 characters and never includes the full value.
The first 14 characters of the key. Pass this value to Rename API Key and Delete API Key.
The ID of the user who created the key, when known. A restricted key belongs to the organization and keeps working after its creator leaves.
The permissions the key holds, with implied permissions included.
null means the key has full access. See Restricted keys.Whether your organization can create restricted keys. When
false, POST /keys/create with scopes returns 403 with the error SCOPED_KEYS_NOT_ENABLED.Whether restricted key creation is currently available for your organization. This is
false when the rollout is not enabled, your organization runs on a pinned deployment, or the availability check fails. POST /keys/create checks again: it returns 403 with SCOPED_KEYS_NOT_ENABLED when the rollout is not enabled, or 409 with RESTRICTED_KEYS_UNAVAILABLE when enabled but blocked by a pinned deployment. A false value alone does not identify the reason. See Pinned deployments.{
"data": {
"keys": [
{
"key": "org_9f3c1a7b2d",
"owner": "3c2f7a91-1b4e-4d6a-9e0f-5a8b7c6d5e4f",
"name": "Production server",
"scopes": null
},
{
"key": "org_s_4b1e9c07",
"owner": "3c2f7a91-1b4e-4d6a-9e0f-5a8b7c6d5e4f",
"name": "Pathway CI",
"scopes": ["agents:read", "agents:write"]
}
],
"scoped_keys_enabled": true,
"restricted_keys_available": true
},
"errors": null
}
Docs for agents: llms.txt
Was this page helpful?
⌘I
List API Keys
curl --request POST \
--url https://api.bland.ai/keys/list \
--header 'Content-Type: application/json' \
--header 'authorization: <authorization>' \
--data '
{
"type": "<string>",
"target_id": "<string>"
}
'import requests
url = "https://api.bland.ai/keys/list"
payload = {
"type": "<string>",
"target_id": "<string>"
}
headers = {
"authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({type: '<string>', target_id: '<string>'})
};
fetch('https://api.bland.ai/keys/list', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.bland.ai/keys/list",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'type' => '<string>',
'target_id' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"authorization: <authorization>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.bland.ai/keys/list"
payload := strings.NewReader("{\n \"type\": \"<string>\",\n \"target_id\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("authorization", "<authorization>")
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))
}HttpResponse<String> response = Unirest.post("https://api.bland.ai/keys/list")
.header("authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"type\": \"<string>\",\n \"target_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.bland.ai/keys/list")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"type\": \"<string>\",\n \"target_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"keys": [
{
"key": "org_9f3c1a7b2d",
"owner": "3c2f7a91-1b4e-4d6a-9e0f-5a8b7c6d5e4f",
"name": "Production server",
"scopes": null
},
{
"key": "org_s_4b1e9c07",
"owner": "3c2f7a91-1b4e-4d6a-9e0f-5a8b7c6d5e4f",
"name": "Pathway CI",
"scopes": ["agents:read", "agents:write"]
}
],
"scoped_keys_enabled": true,
"restricted_keys_available": true
},
"errors": null
}