/v1/workspaces/{workspace_slug}/api-keys/{id}/bindingsAuthReplace the managed-policy bindings on a PAK. Re-runs caller-narrowing on the merged union of statements.
Path parameters
workspace_slug*stringSlug 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.
id*string · uuidId of the api key.
Request body
policy_ids*arrayReplacement set of managed-policy IDs. Empty array is rejected — revoke the PAK to disable it.
Example: ["11111111-1111-1111-1111-111111111111"]
Response · 200 Updated PAK with new bindings.
id*string · uuidId of the key.
workspace_id*string · uuidId of the workspace the key belongs to.
created_by*string · uuidAccount id of who minted the key, or `null` when that account is gone.
name*stringName of the key.
description*stringWhat the key is for, when set.
token_prefix*stringThe first ~14 chars of the token (prefix). Plaintext token is never returned after mint.
Example: "pcft_live_abc123"
policies*arrayManaged policies currently bound to this PAK.
last_used_at*string · date-timeWhen the key last authenticated a request, or `null` if never.
revoked_at*string · date-timeWhen the key was revoked, or `null` while it is not.
expires_at*string · date-timeWhen this key stops introspecting. `null` means it never expires.
rotated_from*string · uuidId of the key this one replaced, when it was minted by a rotation.
status*objectLifecycle state at the time of the request. Only `active` keys introspect. `revoked` beats `expired` — revocation is a deliberate act by a named actor and the row keeps saying so.
created_at*string · date-timeWhen the key was minted.
updated_at*string · date-timeWhen the key was last changed.
Example
Request
PATCH https://api.platform-auth.productcraft.co/v1/workspaces/{workspace_slug}/api-keys/{id}/bindings
Authorization: Bearer YOUR_TOKEN
Content-Type: application/json
{
"policy_ids": [
"11111111-1111-1111-1111-111111111111"
]
}Response
{
"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"
}