Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Api keys

List Api Keys

get

List API keys associated with a service account.

Args: service_account_id: ID of the service account to which the API keys belong. hydrate: Flag deciding whether to hydrate the output model(s) by including metadata fields in the response. filter_model: Filter model used for pagination, sorting, filtering

Returns: All API keys matching the filter and associated with the supplied service account.

Authorizations
OAuth2passwordRequired
Token URL:
Path parameters
service_account_idstring · uuidRequired
Query parameters
hydratebooleanOptionalDefault: false
sort_bystringOptionalDefault: created
logical_operatorstring · enumOptional

Logical Ops to use to combine filters on list methods.

Default: andPossible values:
pageinteger · min: 1OptionalDefault: 1
sizeinteger · min: 1 · max: 10000OptionalDefault: 20
idany of · nullableOptional
string · uuidOptional
or
stringOptional
or
createdany of · nullableOptional
string · date-timeOptional
or
stringOptional
or
updatedany of · nullableOptional
string · date-timeOptional
or
stringOptional
or
service_accountstring · uuid · nullableOptional
nameany of · nullableOptional
stringOptional
or
string[]Optional
descriptionany of · nullableOptional
stringOptional
or
string[]Optional
activeany of · nullableOptional
booleanOptional
or
stringOptional
last_loginany of · nullableOptional
string · date-timeOptional
or
stringOptional
or
last_rotatedany of · nullableOptional
string · date-timeOptional
or
stringOptional
or
Responses
200

Successful Response

application/json
indexintegerRequired
max_sizeintegerRequired
total_pagesintegerRequired
totalintegerRequired
get/api/v1/service_accounts/{service_account_id}/api_keys
GET /api/v1/service_accounts/{service_account_id}/api_keys HTTP/1.1
Authorization: Bearer YOUR_OAUTH2_TOKEN
Accept: */*
{
  "index": 1,
  "max_size": 1,
  "total_pages": 1,
  "total": 1,
  "items": [
    {
      "body": {
        "created": "2026-01-01T00:00:00.000Z",
        "updated": "2026-01-01T00:00:00.000Z",
        "key": "text",
        "active": true,
        "service_account": {
          "body": {
            "created": "2026-01-01T00:00:00.000Z",
            "updated": "2026-01-01T00:00:00.000Z",
            "full_name": "",
            "active": false,
            "avatar_url": "text"
          },
          "metadata": {
            "description": "",
            "external_user_id": "123e4567-e89b-12d3-a456-426614174000"
          },
          "resources": {
            "ANY_ADDITIONAL_PROPERTY": "anything"
          },
          "id": "123e4567-e89b-12d3-a456-426614174000",
          "permission_denied": false,
          "name": "text"
        }
      },
      "metadata": {
        "description": "",
        "retain_period_minutes": 1,
        "last_login": "2026-01-01T00:00:00.000Z",
        "last_rotated": "2026-01-01T00:00:00.000Z"
      },
      "resources": {
        "ANY_ADDITIONAL_PROPERTY": "anything"
      },
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "permission_denied": false,
      "name": "text"
    }
  ]
}

Create Api Key

post

Creates an API key for a service account.

Args: service_account_id: ID of the service account for which to create the API key. api_key: API key to create. auth_context: The authentication context.

Returns: The created API key.

Raises: IllegalOperationError: If the service account was created via external authentication.

Authorizations
OAuth2passwordRequired
Token URL:
Path parameters
service_account_idstring · uuidRequired
Body

Request model for API keys.

namestring · max: 255Required
descriptionstring · max: 65535 · nullableOptional
Responses
200

Successful Response

application/json

Response model for API keys.

idstring · uuidRequired
permission_deniedbooleanOptionalDefault: false
namestring · max: 255Required
post/api/v1/service_accounts/{service_account_id}/api_keys
POST /api/v1/service_accounts/{service_account_id}/api_keys HTTP/1.1
Authorization: Bearer YOUR_OAUTH2_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 36

{
  "name": "text",
  "description": "text"
}
{
  "body": {
    "created": "2026-01-01T00:00:00.000Z",
    "updated": "2026-01-01T00:00:00.000Z",
    "key": "text",
    "active": true,
    "service_account": {
      "body": {
        "created": "2026-01-01T00:00:00.000Z",
        "updated": "2026-01-01T00:00:00.000Z",
        "full_name": "",
        "active": false,
        "avatar_url": "text"
      },
      "metadata": {
        "description": "",
        "external_user_id": "123e4567-e89b-12d3-a456-426614174000"
      },
      "resources": {
        "ANY_ADDITIONAL_PROPERTY": "anything"
      },
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "permission_denied": false,
      "name": "text"
    }
  },
  "metadata": {
    "description": "",
    "retain_period_minutes": 1,
    "last_login": "2026-01-01T00:00:00.000Z",
    "last_rotated": "2026-01-01T00:00:00.000Z"
  },
  "resources": {
    "ANY_ADDITIONAL_PROPERTY": "anything"
  },
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "permission_denied": false,
  "name": "text"
}

Get Api Key

get

Returns the requested API key.

Args: service_account_id: ID of the service account to which the API key belongs. hydrate: Flag deciding whether to hydrate the output model(s) by including metadata fields in the response. api_key_name_or_id: Name or ID of the API key to return.

Returns: The requested API key.

Authorizations
OAuth2passwordRequired
Token URL:
Path parameters
service_account_idstring · uuidRequired
api_key_name_or_idany ofRequired
stringOptional
or
string · uuidOptional
Query parameters
hydratebooleanOptionalDefault: true
Responses
200

Successful Response

application/json

Response model for API keys.

idstring · uuidRequired
permission_deniedbooleanOptionalDefault: false
namestring · max: 255Required
get/api/v1/service_accounts/{service_account_id}/api_keys/{api_key_name_or_id}
GET /api/v1/service_accounts/{service_account_id}/api_keys/{api_key_name_or_id} HTTP/1.1
Authorization: Bearer YOUR_OAUTH2_TOKEN
Accept: */*
{
  "body": {
    "created": "2026-01-01T00:00:00.000Z",
    "updated": "2026-01-01T00:00:00.000Z",
    "key": "text",
    "active": true,
    "service_account": {
      "body": {
        "created": "2026-01-01T00:00:00.000Z",
        "updated": "2026-01-01T00:00:00.000Z",
        "full_name": "",
        "active": false,
        "avatar_url": "text"
      },
      "metadata": {
        "description": "",
        "external_user_id": "123e4567-e89b-12d3-a456-426614174000"
      },
      "resources": {
        "ANY_ADDITIONAL_PROPERTY": "anything"
      },
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "permission_denied": false,
      "name": "text"
    }
  },
  "metadata": {
    "description": "",
    "retain_period_minutes": 1,
    "last_login": "2026-01-01T00:00:00.000Z",
    "last_rotated": "2026-01-01T00:00:00.000Z"
  },
  "resources": {
    "ANY_ADDITIONAL_PROPERTY": "anything"
  },
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "permission_denied": false,
  "name": "text"
}

Update Api Key

put

Updates an API key for a service account.

Args: service_account_id: ID of the service account to which the API key belongs. api_key_name_or_id: Name or ID of the API key to update. api_key_update: API key update. auth_context: The authentication context.

Returns: The updated API key.

Raises: IllegalOperationError: If the service account was created via external authentication.

Authorizations
OAuth2passwordRequired
Token URL:
Path parameters
service_account_idstring · uuidRequired
api_key_name_or_idany ofRequired
stringOptional
or
string · uuidOptional
Body

Update model for API keys.

namestring · max: 255 · nullableOptional
descriptionstring · max: 65535 · nullableOptional
activeboolean · nullableOptional
Responses
200

Successful Response

application/json

Response model for API keys.

idstring · uuidRequired
permission_deniedbooleanOptionalDefault: false
namestring · max: 255Required
put/api/v1/service_accounts/{service_account_id}/api_keys/{api_key_name_or_id}
PUT /api/v1/service_accounts/{service_account_id}/api_keys/{api_key_name_or_id} HTTP/1.1
Authorization: Bearer YOUR_OAUTH2_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 50

{
  "name": "text",
  "description": "text",
  "active": true
}
{
  "body": {
    "created": "2026-01-01T00:00:00.000Z",
    "updated": "2026-01-01T00:00:00.000Z",
    "key": "text",
    "active": true,
    "service_account": {
      "body": {
        "created": "2026-01-01T00:00:00.000Z",
        "updated": "2026-01-01T00:00:00.000Z",
        "full_name": "",
        "active": false,
        "avatar_url": "text"
      },
      "metadata": {
        "description": "",
        "external_user_id": "123e4567-e89b-12d3-a456-426614174000"
      },
      "resources": {
        "ANY_ADDITIONAL_PROPERTY": "anything"
      },
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "permission_denied": false,
      "name": "text"
    }
  },
  "metadata": {
    "description": "",
    "retain_period_minutes": 1,
    "last_login": "2026-01-01T00:00:00.000Z",
    "last_rotated": "2026-01-01T00:00:00.000Z"
  },
  "resources": {
    "ANY_ADDITIONAL_PROPERTY": "anything"
  },
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "permission_denied": false,
  "name": "text"
}

Delete Api Key

delete

Deletes an API key.

Args: service_account_id: ID of the service account to which the API key belongs. api_key_name_or_id: Name or ID of the API key to delete. auth_context: The authentication context.

Authorizations
OAuth2passwordRequired
Token URL:
Path parameters
service_account_idstring · uuidRequired
api_key_name_or_idany ofRequired
stringOptional
or
string · uuidOptional
Responses
200

Successful Response

application/json
anyOptional
delete/api/v1/service_accounts/{service_account_id}/api_keys/{api_key_name_or_id}
DELETE /api/v1/service_accounts/{service_account_id}/api_keys/{api_key_name_or_id} HTTP/1.1
Authorization: Bearer YOUR_OAUTH2_TOKEN
Accept: */*

No content

ZenML Scarf

Last updated

Was this helpful?