Skip to the page

API reference

API keys

Create, list, rotate and revoke the API keys of a workspace.

GET List active API keys

/api/clist/v1/workspaces/{workspaceId}/api-keys

API key scope: workspace.manage_api_keys

Never the full key or its hash: only the display prefix and last four characters.

Parameters

NameInTypeRequiredDescription
workspaceIdpathstring (uuid)yes

Responses

  • 200 application/json
    • api_keys array of object required
      • id string (uuid) required
      • name string or null required
      • display_prefix string required E.g. "clk_ab12"; the full key is never shown again.
      • display_suffix string required The key’s last four characters.
      • scopes array of string, one of: "workspace.view", "workspace.update", "workspace.manage_members", "workspace.delete", "workspace.audit_log", "workspace.manage_api_keys", "workspace.manage_groups", "workspace.manage_checklists" required
      • created_at string (date-time) required UTC instant (ISO 8601, ending in Z). Nothing in the API is a local time.
      • rotated_at string (date-time) or null required UTC instant (ISO 8601, ending in Z). Nothing in the API is a local time.
      • holder_user_id string (uuid) or null required Who holds the key: the person who created it or last rotated it (or holds the key that did). The key stops working, and is revoked, when they leave the workspace or their account is suspended or deleted; rotating it hands it to whoever rotates. null: an older key whose issuer was not recorded.
      • holder_display_name string or null required The holder's name while they are a member.

Errors come in the error format.

POST Create an API key

/api/clist/v1/workspaces/{workspaceId}/api-keys

API key scope: workspace.manage_api_keys

The full key is returned only in this response; store it now. the caller (or, for an API key, its holder) holds the new key; a key whose holder was never recorded cannot create or rotate keys (forbidden, holder_not_recorded).

Parameters

NameInTypeRequiredDescription
workspaceIdpathstring (uuid)yes

Request

Request body application/json (required): object

  • name string (up to 200 characters)
  • scopes array of string, one of: "workspace.view", "workspace.update", "workspace.manage_members", "workspace.delete", "workspace.audit_log", "workspace.manage_api_keys", "workspace.manage_groups", "workspace.manage_checklists" required Any of the same action names the authorization layer checks.

Responses

  • 201 application/json
    • id string (uuid) required
    • name string or null required
    • display_prefix string required E.g. "clk_ab12"; the full key is never shown again.
    • display_suffix string required The key’s last four characters.
    • scopes array of string, one of: "workspace.view", "workspace.update", "workspace.manage_members", "workspace.delete", "workspace.audit_log", "workspace.manage_api_keys", "workspace.manage_groups", "workspace.manage_checklists" required
    • created_at string (date-time) required UTC instant (ISO 8601, ending in Z). Nothing in the API is a local time.
    • rotated_at string (date-time) or null required UTC instant (ISO 8601, ending in Z). Nothing in the API is a local time.
    • holder_user_id string (uuid) or null required Who holds the key: the person who created it or last rotated it (or holds the key that did). The key stops working, and is revoked, when they leave the workspace or their account is suspended or deleted; rotating it hands it to whoever rotates. null: an older key whose issuer was not recorded.
    • holder_display_name string or null required The holder's name while they are a member.
    • token string required The full key. Shown here once; there is no way to see it again.

Errors come in the error format.

DELETE Revoke an API key

/api/clist/v1/workspaces/{workspaceId}/api-keys/{keyId}

API key scope: workspace.manage_api_keys

not_found for an unknown or already-revoked key.

Parameters

NameInTypeRequiredDescription
workspaceIdpathstring (uuid)yes
keyIdpathstring (uuid)yes

Responses

  • 204 no body

Errors come in the error format.

POST Rotate an API key

/api/clist/v1/workspaces/{workspaceId}/api-keys/{keyId}/rotate

API key scope: workspace.manage_api_keys

Issues a new value for an existing key; the old value stops working immediately. The new value is returned only here. not_found for an unknown or revoked key.

Parameters

NameInTypeRequiredDescription
workspaceIdpathstring (uuid)yes
keyIdpathstring (uuid)yes

Responses

  • 200 application/json
    • id string (uuid) required
    • name string or null required
    • display_prefix string required E.g. "clk_ab12"; the full key is never shown again.
    • display_suffix string required The key’s last four characters.
    • scopes array of string, one of: "workspace.view", "workspace.update", "workspace.manage_members", "workspace.delete", "workspace.audit_log", "workspace.manage_api_keys", "workspace.manage_groups", "workspace.manage_checklists" required
    • created_at string (date-time) required UTC instant (ISO 8601, ending in Z). Nothing in the API is a local time.
    • rotated_at string (date-time) or null required UTC instant (ISO 8601, ending in Z). Nothing in the API is a local time.
    • holder_user_id string (uuid) or null required Who holds the key: the person who created it or last rotated it (or holds the key that did). The key stops working, and is revoked, when they leave the workspace or their account is suspended or deleted; rotating it hands it to whoever rotates. null: an older key whose issuer was not recorded.
    • holder_display_name string or null required The holder's name while they are a member.
    • token string required The full key. Shown here once; there is no way to see it again.

Errors come in the error format.