Platform API reference

Platform API · Platform-Api-Keys

get/v1/api-keys/selfAuth

Describe the workspace key making this request: its name, workspace, expiry and what it may do in plain sentences. Call it with `Authorization: Bearer pcft_live_…` to test a key right after minting it.

Response · 200

key_id*string · uuid

Id of the key that made this request.

name*string

Name given to the key when it was minted.

Example: "Production mailer"

workspace_id*string · uuid

Id of the workspace the key belongs to (also `workspace.id`). The SDKs read it once per process to bind `workspace_id` on product calls.

workspace*object

The workspace the key belongs to.

expires_at*string · date-time

When the key stops working. `null` means it never expires.

allowed*array

What the key may do, one plain sentence per action, as `<Product>: <action>`. A sentence ends in `(only some resources)` when the key holds the action on specific resources only, `(with exceptions)` when some resources are denied, and `(with conditions)` when it applies only under a condition. Empty when the key can do nothing.

Example: ["Mail: Read domains and templates","Mail: Send email from your verified domains"]

actions*array

The permission catalog actions behind `allowed`, in the same order.

Example: ["mail.read","mail.send"]

Example

Request

GET https://api.platform-auth.productcraft.co/v1/api-keys/self
Authorization: Bearer YOUR_TOKEN

Response

{
  "key_id": "00000000-0000-0000-0000-000000000000",
  "name": "Production mailer",
  "workspace_id": "00000000-0000-0000-0000-000000000000",
  "workspace": {},
  "expires_at": "2026-01-01T00:00:00.000Z",
  "allowed": [
    "Mail: Read domains and templates",
    "Mail: Send email from your verified domains"
  ],
  "actions": [
    "mail.read",
    "mail.send"
  ]
}