API Keys
4 operations.
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/v1/api-keys | List API keys |
| POST | /api/v1/api-keys | Create 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
| Name | Type | Required | Description |
|---|---|---|---|
| limit | integer | optional | Sets the maximum number of resources returned in this page. Applies to List API keys. |
| cursor | string | optional | Opaque cursor returned by the previous page; omit it to read the first page. Applies to List API keys. |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | Response for status 200 | application/json object
|
| 400 | Bad Request | application/json PublicApiError
|
| 401 | Authentication failed. Possible reasons: - Authorization header is not provided - Invalid API key - Session expired | application/json PublicApiError
|
| 403 | Access denied. The authenticated user does not have permission to perform this action. | application/json PublicApiError
|
| 422 | Request validation failed. Check the request body, query parameters, or path parameters. | application/json PublicApiError
|
| 500 | The server could not complete the request. | application/json PublicApiError
|
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
| Name | Type | Required | Description |
|---|---|---|---|
| name | string | optional | |
| grants | one of 4 types | required | |
| expiresIn | integer | optional | |
| expiresAt | one of 2 types | optional |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | Response for status 200 | application/json object
|
| 400 | Bad Request | application/json PublicApiError
|
| 401 | Authentication failed. Possible reasons: - Authorization header is not provided - Invalid API key - Session expired | application/json PublicApiError
|
| 403 | Access denied. The authenticated user does not have permission to perform this action. | application/json PublicApiError
|
| 404 | Resource not found. | application/json PublicApiError
|
| 422 | Request validation failed. Check the request body, query parameters, or path parameters. | application/json PublicApiError
|
| 500 | The server could not complete the request. | application/json PublicApiError
|
Get an API key
GET/api/v1/api-keys/{apiKeyId}
Parameters
path
| Name | Type | Required | Description |
|---|---|---|---|
| apiKeyId | string | required | Identifies the API key being attached or removed. Applies to Get an API key. |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | Response for status 200 | application/json object
|
| 400 | The request is malformed or cannot be processed. | application/json PublicApiError
|
| 401 | Authentication failed. Possible reasons: - Authorization header is not provided - Invalid API key - Session expired | application/json PublicApiError
|
| 403 | Access denied. The authenticated user does not have permission to perform this action. | application/json PublicApiError
|
| 404 | Resource not found. | application/json PublicApiError
|
| 422 | Request validation failed. Check the request body, query parameters, or path parameters. | application/json PublicApiError
|
| 500 | The server could not complete the request. | application/json PublicApiError
|
Revoke an API key
DELETE/api/v1/api-keys/{apiKeyId}
Parameters
path
| Name | Type | Required | Description |
|---|---|---|---|
| apiKeyId | string | required | Identifies the API key being attached or removed. Applies to Revoke an API key. |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | Response for status 200 | application/json object
|
| 400 | The request is malformed or cannot be processed. | application/json PublicApiError
|
| 401 | Authentication failed. Possible reasons: - Authorization header is not provided - Invalid API key - Session expired | application/json PublicApiError
|
| 403 | Access denied. The authenticated user does not have permission to perform this action. | application/json PublicApiError
|
| 404 | Resource not found. | application/json PublicApiError
|
| 422 | Request validation failed. Check the request body, query parameters, or path parameters. | application/json PublicApiError
|
| 500 | The server could not complete the request. | application/json PublicApiError
|