API Keys
Use these operations to interact with API keys in Cortex.
Required permissions
Your API token must have the Edit API keys permission.
Roles
When creating an API key, you must specify roles. Each role requires a type field set to DEFAULT or CUSTOM. You can assign multiple roles (both default and custom) to a single API key.
Default roles use the role field to specify the permission level. Allowed values: READ_ONLY, USER, ADMIN.
{
"type": "DEFAULT",
"role": "READ_ONLY"
}Custom roles use the tag field (not role) to reference a custom role by its unique tag:
{
"type": "CUSTOM",
"tag": "custom-role-tag"
}Example payload with multiple roles:
{
"name": "Entities scanner",
"roles": [
{ "type": "DEFAULT", "role": "ADMIN" },
{ "type": "CUSTOM", "tag": "custom-role-tag" }
]
}Operations
List API keys
The API key used to make the request must have the Edit API keys permission
All requests to the Cortex API need to provide an Authorization: Bearer <token> header, where <token> is an API key created in the Settings page of your workspace.
Number of results to return per page, between 1 and 1000. Default 250.
250Page number to return, 0-indexed. Default 0.
0Successfully found API keys
Current page number, 0-indexed
Total number of results
Total number of pages
Bad request
The client has exceeded the rate limit by performing too many requests in a short period. Retry the request after a delay.
GET /api/v1/auth/key?pageSize=250&page=0 HTTP/1.1
Host: api.getcortexapp.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"apiKeys": [
{
"cid": "ak1234567890abcdef",
"createdDate": "2025-01-15T22:47:30Z",
"description": "API Key used for entities scanner script",
"expirationDate": "2026-01-01T00:00:00.000Z",
"last4": "0kAg",
"name": "Entities scanner",
"roles": [
{
"type": "text",
"role": "READ_ONLY"
}
]
}
],
"page": 1,
"total": 1,
"totalPages": 1
}Get API key
All requests to the Cortex API need to provide an Authorization: Bearer <token> header, where <token> is an API key created in the Settings page of your workspace.
The unique, auto-generated identifier for the API key
ak1234567890abcdefSuccessfully found API key
ID of the API key
ak1234567890abcdefCreation date of the API key
2025-01-15T22:47:30ZDescription of the API key
API Key used for entities scanner scriptExpiration date of the API key
Last 4 characters of the API key
0kAgName of the API key
Entities scannerBad request
API key not found
The client has exceeded the rate limit by performing too many requests in a short period. Retry the request after a delay.
GET /api/v1/auth/key/{cid} HTTP/1.1
Host: api.getcortexapp.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"cid": "ak1234567890abcdef",
"createdDate": "2025-01-15T22:47:30Z",
"description": "API Key used for entities scanner script",
"expirationDate": "2026-01-01T00:00:00.000Z",
"last4": "0kAg",
"name": "Entities scanner",
"roles": [
{
"type": "text",
"role": "READ_ONLY"
}
]
}Create new API key.
The API key used to make the request must have the Edit API keys permission
All requests to the Cortex API need to provide an Authorization: Bearer <token> header, where <token> is an API key created in the Settings page of your workspace.
Description of the API key
API Key used for entities scanner scriptExpiration date of the API key. Format: ISO8601 with timezone offset
Name of the API key
Entities scannerSuccessfully created API key
Value of the API key created. You will not be able to see this key again
3WpQ3WpQ3WpQ3WpQDescription of the API key
API Key used for entities scanner scriptExpiration date of the API key
Name of the API key
Entities scannerBad request
Access denied
The client has exceeded the rate limit by performing too many requests in a short period. Retry the request after a delay.
POST /api/v1/auth/key HTTP/1.1
Host: api.getcortexapp.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 173
{
"description": "API Key used for entities scanner script",
"expirationDate": "2026-01-01T00:00:00.000Z",
"name": "Entities scanner",
"roles": [
{
"type": "text",
"role": "READ_ONLY"
}
]
}{
"apiKey": "3WpQ3WpQ3WpQ3WpQ",
"description": "API Key used for entities scanner script",
"expirationDate": "2026-01-01T00:00:00.000Z",
"name": "Entities scanner",
"roles": [
{
"type": "text",
"role": "READ_ONLY"
}
]
}Update API key
The API key used to make the request must have the Edit API keys permission
All requests to the Cortex API need to provide an Authorization: Bearer <token> header, where <token> is an API key created in the Settings page of your workspace.
The unique, auto-generated identifier for the API key
ak1234567890abcdefDescription of the API key
API Key used for entities scanner scriptName of the API key
Entities scannerSuccessfully updated API key
ID of the API key
ak1234567890abcdefCreation date of the API key
2025-01-15T22:47:30ZDescription of the API key
API Key used for entities scanner scriptExpiration date of the API key
Last 4 characters of the API key
0kAgName of the API key
Entities scannerBad request
Access denied
API key not found
The client has exceeded the rate limit by performing too many requests in a short period. Retry the request after a delay.
PUT /api/v1/auth/key/{cid} HTTP/1.1
Host: api.getcortexapp.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 84
{
"description": "API Key used for entities scanner script",
"name": "Entities scanner"
}{
"cid": "ak1234567890abcdef",
"createdDate": "2025-01-15T22:47:30Z",
"description": "API Key used for entities scanner script",
"expirationDate": "2026-01-01T00:00:00.000Z",
"last4": "0kAg",
"name": "Entities scanner",
"roles": [
{
"type": "text",
"role": "READ_ONLY"
}
]
}Delete API key
The API key used to make the request must have the Edit API keys permission
All requests to the Cortex API need to provide an Authorization: Bearer <token> header, where <token> is an API key created in the Settings page of your workspace.
The unique, auto-generated identifier for the API key
ak1234567890abcdefSuccessfully deleted API key
No content
Bad request
Access denied
API key not found
The client has exceeded the rate limit by performing too many requests in a short period. Retry the request after a delay.
DELETE /api/v1/auth/key/{cid} HTTP/1.1
Host: api.getcortexapp.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
No content
Last updated
Was this helpful?