Platform API reference

Platform API · Introspect

post/v1/introspect/api-keyAuth

Resolve a Platform API Key (PAK) to its workspace + IAM-style policy. Call it with the key a request to your backend carried, cache the answer for up to 60 seconds, and allow an action only when the returned `policy` allows it on the resource.

Response · 201

is_valid*boolean

Always `true` on a 200: unknown, revoked and expired keys answer 401.

workspace_id*string · uuid

Id of the workspace the key belongs to.

policy*array

Merged effective policy across every managed policy bound to this PAK.

created_by*string · uuid

Account id of the person who minted the key, or `null` when that account is gone.

api_key_id*string · uuid

Id of the key.

Example

Request

POST https://api.platform-auth.productcraft.co/v1/introspect/api-key
Authorization: Bearer YOUR_TOKEN

Response

{
  "is_valid": false,
  "workspace_id": "00000000-0000-0000-0000-000000000000",
  "policy": [
    {
      "effect": "allow",
      "actions": [
        "social.read",
        "social.list"
      ],
      "resources": [
        "*"
      ]
    }
  ],
  "created_by": "00000000-0000-0000-0000-000000000000",
  "api_key_id": "00000000-0000-0000-0000-000000000000"
}