Auth API reference

Auth API · Permissions

post/v1/apps/{app_id}/permissionsAuth

Create a custom permission

Path parameters

app_id*string

Id of the app.

Headers

Idempotency-Keystring

Retry safety: a repeat with the same key and body replays the first response instead of creating a permission again. Same key with a different body: 409 `IDEMPOTENCY_KEY_REUSE`. 24 h window.

Request body

resource*string

Resource name

Example: "project"

action*string

Action name

Example: "read"

descriptionstring

Free-text description of the create permission, or `null`.

Example: "View projects"

Response · 201 Permission created.

id*string

Permission row UUID.

app_id*string

App scope. `null` for system permissions.

resource*string

Resource half of the permission key (`resource.action`).

Example: "user"

action*string

Action half of the permission key (`resource.action`).

Example: "read"

description*string

Free-text description of what this permission allows.

created_at*string · date-time

When the permission was created (ISO 8601).

Example

Request

POST https://api.auth.productcraft.co/v1/apps/{app_id}/permissions
Authorization: Bearer YOUR_TOKEN
Content-Type: application/json

{
  "resource": "project",
  "action": "read",
  "description": "View projects"
}

Response

{
  "id": "string",
  "app_id": "string",
  "resource": "user",
  "action": "read",
  "description": "string",
  "created_at": "2026-01-01T00:00:00.000Z"
}