Mint a workspace key

Mint a workspace key

POST/api/v1/organizations/{id}/workspaces/{workspace_id}/api-keys

POST /organizations/{id}/workspaces/{workspace_id}/api-keys
# API: no generated example for POST https://www.unitpost.com/api/v1/organizations/:id/workspaces/:workspace_id/api-keys
Response · 201
{
  "object": "api_key",
  "id": "id_123",
  "key": "string",
  "prefix": "string",
  "scope": "full",
  "capabilities": [
    "string"
  ],
  "workspace_id": "workspace_123"
}

A workspace key for one of the organization's workspaces: it reaches only that workspace, can't manage keys, and is revoked with the organization key that minted it. The secret is returned once. Takes an organization key (ok_live_…) with organizations:write.

Parameters2 fields
FieldTypeDescription
idrequiredstring · pathThe organization's id (`org_…`), from `GET /whoami` or Organization → API.
workspace_idrequiredstring · pathThe workspace's id (`ws_…`).
Request body2 fields
FieldTypeDescription
namerequiredstring—
scopeenumfull | sending | read_only—
Response · 201 fields7 fields
FieldTypeDescription
objectrequiredenumapi_key—
idrequiredstring`key_…`
keyrequiredstringThe secret, shown once.
prefixrequiredstring—
scoperequiredenumfull | sending | read_only—
capabilitiesrequiredstring[]—
workspace_idrequiredstring—
201401403404422429

Search docs and guides

Search the docs and product guides.