Documentation menu

API Keys

4 operations.

MethodEndpointDescription
GET/api/v1/api-keysList API keys
POST/api/v1/api-keysCreate an API key
GET/api/v1/api-keys/{apiKeyId}Get an API key
DELETE/api/v1/api-keys/{apiKeyId}Revoke an API key

List API keys

GET/api/v1/api-keys

Parameters

query

NameTypeRequiredDescription
limitintegeroptionalSets the maximum number of resources returned in this page. Applies to List API keys.
cursorstringoptionalOpaque cursor returned by the previous page; omit it to read the first page. Applies to List API keys.

Responses

StatusDescriptionBody
200Response for status 200
application/json
object
  • apiKeys (required): array<object>
  • pagination (required): object
400Bad Request
application/json
PublicApiError
  • error (required): object
401Authentication failed. Possible reasons: - Authorization header is not provided - Invalid API key - Session expired
application/json
PublicApiError
  • error (required): object
403Access denied. The authenticated user does not have permission to perform this action.
application/json
PublicApiError
  • error (required): object
422Request validation failed. Check the request body, query parameters, or path parameters.
application/json
PublicApiError
  • error (required): object
500The server could not complete the request.
application/json
PublicApiError
  • error (required): object

Create an API key

POST/api/v1/api-keys

Requires api-keys:create. Creates a user-managed API key with the requested Organization, Project, Agent, or Environment grants in the authenticated Organization. The new key's grants and expiry are independent of the calling key. Rotate by creating a replacement and revoking the old key.

Request body

required — Request body for: Create an API key.

application/json

NameTypeRequiredDescription
namestringoptional
grantsone of 4 typesrequired
expiresInintegeroptional
expiresAtone of 2 typesoptional

Responses

StatusDescriptionBody
200Response for status 200
application/json
object
  • data (required): object
400Bad Request
application/json
PublicApiError
  • error (required): object
401Authentication failed. Possible reasons: - Authorization header is not provided - Invalid API key - Session expired
application/json
PublicApiError
  • error (required): object
403Access denied. The authenticated user does not have permission to perform this action.
application/json
PublicApiError
  • error (required): object
404Resource not found.
application/json
PublicApiError
  • error (required): object
422Request validation failed. Check the request body, query parameters, or path parameters.
application/json
PublicApiError
  • error (required): object
500The server could not complete the request.
application/json
PublicApiError
  • error (required): object

Get an API key

GET/api/v1/api-keys/{apiKeyId}

Parameters

path

NameTypeRequiredDescription
apiKeyIdstringrequiredIdentifies the API key being attached or removed. Applies to Get an API key.

Responses

StatusDescriptionBody
200Response for status 200
application/json
object
  • data (required): object
400The request is malformed or cannot be processed.
application/json
PublicApiError
  • error (required): object
401Authentication failed. Possible reasons: - Authorization header is not provided - Invalid API key - Session expired
application/json
PublicApiError
  • error (required): object
403Access denied. The authenticated user does not have permission to perform this action.
application/json
PublicApiError
  • error (required): object
404Resource not found.
application/json
PublicApiError
  • error (required): object
422Request validation failed. Check the request body, query parameters, or path parameters.
application/json
PublicApiError
  • error (required): object
500The server could not complete the request.
application/json
PublicApiError
  • error (required): object

Revoke an API key

DELETE/api/v1/api-keys/{apiKeyId}

Parameters

path

NameTypeRequiredDescription
apiKeyIdstringrequiredIdentifies the API key being attached or removed. Applies to Revoke an API key.

Responses

StatusDescriptionBody
200Response for status 200
application/json
object
  • data (required): object
400The request is malformed or cannot be processed.
application/json
PublicApiError
  • error (required): object
401Authentication failed. Possible reasons: - Authorization header is not provided - Invalid API key - Session expired
application/json
PublicApiError
  • error (required): object
403Access denied. The authenticated user does not have permission to perform this action.
application/json
PublicApiError
  • error (required): object
404Resource not found.
application/json
PublicApiError
  • error (required): object
422Request validation failed. Check the request body, query parameters, or path parameters.
application/json
PublicApiError
  • error (required): object
500The server could not complete the request.
application/json
PublicApiError
  • error (required): object