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-keysResponse · 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
| Field | Type | Description |
|---|---|---|
idrequired | string · path | The organization's id (`org_…`), from `GET /whoami` or Organization → API. |
workspace_idrequired | string · path | The workspace's id (`ws_…`). |
Request body2 fields
| Field | Type | Description |
|---|---|---|
namerequired | string | — |
scope | enumfull | sending | read_only | — |
Response · 201 fields7 fields
| Field | Type | Description |
|---|---|---|
objectrequired | enumapi_key | — |
idrequired | string | `key_…` |
keyrequired | string | The secret, shown once. |
prefixrequired | string | — |
scoperequired | enumfull | sending | read_only | — |
capabilitiesrequired | string[] | — |
workspace_idrequired | string | — |
201401403404422429