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 rolearrow-up-right 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" }
  ]
}
circle-info

Note: Users with custom roles can only create API keys assigned to roles with equal or fewer permissions than their own.

Operations

List API keys

get

List API keys

The API key used to make the request must have the Edit API keys permission

Authorizations
AuthorizationstringRequired

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.

Query parameters
pageSizeinteger · int32Required

Number of results to return per page, between 1 and 1000. Default 250.

Default: 250
pageinteger · int32Required

Page number to return, 0-indexed. Default 0.

Default: 0
Responses
chevron-right
200

Successfully found API keys

pageinteger · int32Required

Current page number, 0-indexed

totalinteger · int32Required

Total number of results

totalPagesinteger · int32Required

Total number of pages

get
/api/v1/auth/key

Get API key

get

Get API key

Authorizations
AuthorizationstringRequired

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.

Path parameters
cidstringRequired

The unique, auto-generated identifier for the API key

Example: ak1234567890abcdef
Responses
chevron-right
200

Successfully found API key

cidstringRequired

ID of the API key

Example: ak1234567890abcdef
createdDatestring · date-timeRequired

Creation date of the API key

Example: 2025-01-15T22:47:30Z
descriptionstringOptional

Description of the API key

Example: API Key used for entities scanner script
expirationDatestring · date-timeOptional

Expiration date of the API key

last4stringRequired

Last 4 characters of the API key

Example: 0kAg
namestringOptional

Name of the API key

Example: Entities scanner
get
/api/v1/auth/key/{cid}

Create API key

post

Create new API key.

The API key used to make the request must have the Edit API keys permission

Authorizations
AuthorizationstringRequired

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.

Body
descriptionstringOptional

Description of the API key

Example: API Key used for entities scanner script
expirationDatestring · date-timeOptional

Expiration date of the API key. Format: ISO8601 with timezone offset

namestringRequired

Name of the API key

Example: Entities scanner
Responses
chevron-right
200

Successfully created API key

apiKeystringRequired

Value of the API key created. You will not be able to see this key again

Example: 3WpQ3WpQ3WpQ3WpQ
descriptionstringOptional

Description of the API key

Example: API Key used for entities scanner script
expirationDatestring · date-timeOptional

Expiration date of the API key

namestringOptional

Name of the API key

Example: Entities scanner
post
/api/v1/auth/key

Update API key

put

Update API key

The API key used to make the request must have the Edit API keys permission

Authorizations
AuthorizationstringRequired

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.

Path parameters
cidstringRequired

The unique, auto-generated identifier for the API key

Example: ak1234567890abcdef
Body
descriptionstringOptional

Description of the API key

Example: API Key used for entities scanner script
namestringRequired

Name of the API key

Example: Entities scanner
Responses
chevron-right
200

Successfully updated API key

cidstringRequired

ID of the API key

Example: ak1234567890abcdef
createdDatestring · date-timeRequired

Creation date of the API key

Example: 2025-01-15T22:47:30Z
descriptionstringOptional

Description of the API key

Example: API Key used for entities scanner script
expirationDatestring · date-timeOptional

Expiration date of the API key

last4stringRequired

Last 4 characters of the API key

Example: 0kAg
namestringOptional

Name of the API key

Example: Entities scanner
put
/api/v1/auth/key/{cid}

Delete API key

delete

Delete API key

The API key used to make the request must have the Edit API keys permission

Authorizations
AuthorizationstringRequired

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.

Path parameters
cidstringRequired

The unique, auto-generated identifier for the API key

Example: ak1234567890abcdef
Responses
chevron-right
200

Successfully deleted API key

No content

delete
/api/v1/auth/key/{cid}

No content

Last updated

Was this helpful?