v2

latestOpenAPI 3.1.12026-07-2613060964.2 KB

Create Workspace API Key

Create a new API key scoped to this workspace.

The full api_key secret is returned only once in the create response. Store it securely - it cannot be retrieved later.

post/v1/{workspace}/ws_api_key/

Path parameters

workspacestring required

Workspace slug (e.g. staging, production).

Request body

namestring required

Label for the API key.

descriptionstring nullable

Optional notes for operators.

Example request

{
  "name": "backend-prod"
}

Response

API key created. api_key is returned only once - store it securely.

idstring

Unique identifier of the API key.

masked_api_keystring

Masked preview of the API key used in list responses.

is_deletedboolean

Indicates whether the API key has been deleted.

namestring

Label for the API key.

allowed_domainsstring[]

Domains allowed to use this key.

created_atstring date-time

Timestamp when the API key was created.

deleted_atstring date-time nullable

Timestamp when the API key was deleted, if applicable.

api_keystring

Full secret API key. Returned only once at creation - store it securely and never commit to source control.

Example response

{
  "id": "ws_apik_exampleId01",
  "masked_api_key": "SS.XXXXXXX*****",
  "name": "backend-prod",
  "created_by": {
    "name": "System User",
    "email": "user@example.com"
  },
  "deleted_by": {
    "name": "System User",
    "email": "user@example.com"
  },
  "api_key": "SS.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
}