/{app_slug}/v1/authorizeVerify a token + check one or more permissions
Returns `{ authorized: boolean }`. Pass `permission` (string) for a single check, or `permissions` (array) when ALL must be held. Token source: `body.token` if provided, else the `Authorization: Bearer <jwt>` header. At least one must be present.
Path parameters
app_slug*stringSlug of the app.
Request body
tokenstringJWT to verify and authorize. Optional — if omitted, the token is read from the `Authorization: Bearer <jwt>` header.
permissionstringSingle permission to check, e.g. 'user.read'. Use this OR `permissions`.
Example: "invoice.read"
permissionsarrayMultiple permissions; the token must hold ALL of them.
Response · 200
authorized*booleanTrue when the token is valid and holds every requested permission.
errorstringFailure code on `authorized: false`.
missing_permissionsarrayPermissions the token does not hold.
Example
Request
POST https://api.auth.productcraft.co/{app_slug}/v1/authorize
Content-Type: application/json
{
"token": "string",
"permission": "invoice.read",
"permissions": [
"string"
]
}Response
{
"authorized": false,
"error": "string",
"missing_permissions": [
"string"
]
}