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

NameTypeDescription

Authorization*

string

Bearer ${API_KEY}

{
    "api_keys": [
        {
            "id": "00n06yx75dzuxz2lgi",
            "name": "default api key",
            "created_at": "2023-06-09T06:34:37.685Z",
            "is_active": true
        }
    ]
}

Create an API Key

You are allowed to have 2 active API keys per user at any one time

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

NameTypeDescription

Authorization*

string

Bearer ${API_KEY}

Content-Type*

string

application/json

Request Body

NameTypeDescription

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"
}

422: Unprocessable Entity error types

Value from APIDescription

MAX_KEYS_REACHED

You have reached the maximum active API keys for your user. Maximum: 2

Deactivate an API Key

It is possible to deactivate the key you use to authenticate the request to deactivate. This is for security purposes should your key be compromised. Be aware that if you deactivate your last key you will need to contact support@thallo.io to request a new one.

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

NameTypeDescription

API_KEY_ID*

string

The id of the API key you would like to deactivate.

Headers

NameTypeDescription

Authorization*

string

Bearer ${API_KEY}

422: Unprocessable Entity error types

Value from APIDescription

API_KEY_NOT_EXISTS

Api key not found

Last updated