Platform API reference

Platform API · Platform-Api-Keys

get/v1/workspaces/{workspace_slug}/api-keysAuth

List the API keys in this workspace

Newest first, as the standard cursor-paginated `{data, pagination}` envelope (20 per page, at most 100). Plaintext tokens are never returned, only prefixes and metadata. **Deprecated legacy shape:** a request that sends neither `limit` nor `cursor` gets a bare JSON array of every key (capped at 1000), unless its `User-Agent` is a ProductCraft SDK (`productcraft-…`), which always gets the envelope. The array is kept only for `@productcraft/platform-auth` 0.0.x clients and is removed in the platform API's next major version; send `limit` (or use an SDK).

Path parameters

workspace_slug*string

Slug of the workspace. Platform routes name the workspace by slug, positionally in the SDK (`platform.workspaces.retrieve("acme")`); the product APIs bind `workspace_id` instead.

Query parameters

limitinteger

Page size. Defaults to 20, clamped to 100.

cursorstring

Opaque `next_cursor` from the previous page.

include_revokedboolean

Send `false` to leave revoked keys out (the console's default view). Expired keys are still listed: they show what needs replacing. The deprecated bare array ignores it.

Response · 200 One page of keys.

data*array

One page of API keys, newest first.

pagination*object
next_cursor*string

Pass as `cursor` to get the next page; `null` on the last page.

Example: null

has_more*boolean

Whether another page follows this one.

Example: false

Example

Request

GET https://api.platform-auth.productcraft.co/v1/workspaces/{workspace_slug}/api-keys
Authorization: Bearer YOUR_TOKEN

Response

{
  "data": [
    {
      "id": "00000000-0000-0000-0000-000000000000",
      "workspace_id": "00000000-0000-0000-0000-000000000000",
      "created_by": "00000000-0000-0000-0000-000000000000",
      "name": "string",
      "description": "string",
      "token_prefix": "pcft_live_abc123",
      "policies": [
        {
          "id": "00000000-0000-0000-0000-000000000000",
          "name": "mail-readonly",
          "description": "string"
        }
      ],
      "last_used_at": "2026-01-01T00:00:00.000Z",
      "revoked_at": "2026-01-01T00:00:00.000Z",
      "expires_at": "2026-01-01T00:00:00.000Z",
      "rotated_from": "00000000-0000-0000-0000-000000000000",
      "status": {},
      "created_at": "2026-01-01T00:00:00.000Z",
      "updated_at": "2026-01-01T00:00:00.000Z"
    }
  ],
  "pagination": {
    "next_cursor": null,
    "has_more": false
  }
}