API Key Management
List API Keys for your User
Example cURL Request
curl --request GET 'https://${BASE_URL}/api/api-keys' \
--header 'Authorization: Bearer ${API_KEY}'Endpoint Specification
Get your user
GET /api/api-keys
Get all of the API keys for your user
Headers
Name
Type
Description
Authorization*
string
Bearer ${API_KEY}
{
"api_keys": [
{
"id": "00n06yx75dzuxz2lgi",
"name": "default api key",
"created_at": "2023-06-09T06:34:37.685Z",
"is_active": true
}
]
}{
api_keys: Array<{
id: string
name: string
created_at: string
is_active: boolean
}>
}{
"statusCode": 500,
"message": "Internal server error"
}{
statusCode: number
message: string
}Create an API Key
Example cURL Request
curl --request POST 'https://${BASE_URL}/api/api-keys' \
--header 'Authorization: Bearer ${API_KEY}' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "new api key",
"deactivate_current": false
}'Endpoint Specification
Create a new API key
POST /api/api-keys
Create a new API key and optionally deactivate the API key used to authenticate this request
Headers
Name
Type
Description
Authorization*
string
Bearer ${API_KEY}
Content-Type*
string
application/json
Request Body
Name
Type
Description
name*
string
The name associated with the new API key.
deactivate_current*
boolean
Set to true if you wish to deactivate the key you use to authenticate this request.
{
"api_key": "18077981128785C05993E9C685FD52410BADCD994B3C1D0365A0C7088BA5BAC1"
}{
api_key: string
}{
"error": "Forbidden",
"message": "Permission denied according to assigned roles.",
"statusCode": 403
}{
statusCode: number
message: string
error: string
}{
"statusCode": 422,
"timestamp": "2023-06-11T09:23:27.078Z",
"url": "/api/api-keys",
"error": "MAX_KEYS_REACHED",
"message": "You have reached the maximum active API keys for your user. Maximum: 2"
}{
statusCode: number
timestamp: string
url: string
error: string
message: string | string[]
}{
"statusCode": 500,
"message": "Internal server error"
}{
statusCode: number
message: string
}422: Unprocessable Entity error types
error typesValue from API
Description
MAX_KEYS_REACHED
You have reached the maximum active API keys for your user. Maximum: 2
Deactivate an API Key
Example cURL Request
curl --request DELETE 'https://${BASE_URL}/api/api-keys/${API_KEY_ID}' \
--header 'Authorization: Bearer ${API_KEY}'Endpoint Specification
Deactivate an API key
DELETE /api/api-keys/${API_KEY_ID}
Deactivate an API key by its id
Path Parameters
Name
Type
Description
API_KEY_ID*
string
The id of the API key you would like to deactivate.
Headers
Name
Type
Description
Authorization*
string
Bearer ${API_KEY}
{
"statusCode": 422,
"timestamp": "2023-06-11T09:23:27.078Z",
"url": "/api/api-keys",
"error": "API_KEY_NOT_EXISTS",
"message": "Api key not found"
}{
statusCode: number
timestamp: string
url: string
error: string
message: string | string[]
}{
"statusCode": 500,
"message": "Internal server error"
}{
statusCode: number
message: string
}422: Unprocessable Entity error types
error typesValue from API
Description
API_KEY_NOT_EXISTS
Api key not found
Last updated