Auth API reference

Auth API · Apps

post/v1/appsAuth

Create a new app owned by the caller

The new app starts with emails to its users turned on: they go out from the workspace default sender chosen in Mail, and the default verification, welcome, password-reset, invite and sign-in code templates are created in the workspace's Mail templates (an existing template with the same name is reused). Change or turn this off with `PATCH /v1/apps/{appId}/notification-settings`. **Sign-up starts off.** A new app has `signup_enabled: false`, so `POST /{app_slug}/v1/auth/signup` answers 403 `FORBIDDEN` ("Signup is disabled for this app") until you turn it on with `PATCH /v1/apps/{app_id}/auth-config` and `{ "signup_enabled": true }`. Sign-in, invites and admin-created users work either way.

Headers

Idempotency-Keystring

Stripe-style idempotency key. Provisioning a new app mints JWKS keys + system roles + permissions; a retry without an idempotency key would create a second app the customer can't tell apart. 24h TTL.

Request body

slug*string

URL-friendly app slug (lowercase letters, digits, hyphens).

Example: "acme-app"

display_name*string

Display name shown in the console.

Example: "Acme"

workspace_id*string

UUID of the platform workspace that will own the new app. The caller must hold `auth.create` on this workspace.

Example: "835015dc-7bde-4a8a-b306-c066d4733b90"

environmentenum (3)

Which environment this app is. Omit for `production` — the historical behaviour and the value every existing app has. Cannot be changed later; clone the app instead.

Response · 201 App created.

id*string

Unique identifier of the app.

slug*string

URL-safe identifier of the app, unique within its parent.

Example: "acme-app"

display_name*string

Human-readable name of the app.

Example: "Acme"

workspace_id*string

Owning workspace UUID.

status*object

App status: `active`, `suspended` (sign-ins refused) or `archived`.

environment*object

Which environment this app IS. One app is one environment — there is no switch; a staging app is a separate app created via `POST /v1/apps/:appId/clone`. Set at create time and never changed afterwards. Every app that predates this field is `production`.

Example: "production"

created_by*string

Account that created the app.

metadata*object

Free-form JSON object you attach to the app; returned as stored.

created_at*string · date-time

When the app was created (ISO 8601).

updated_at*string · date-time

When the app was last changed (ISO 8601).

audit_retention_days*number

Days of `audit_log` history kept for this app. A nightly job deletes rows older than this. 30-3650.

Example: 365

webhook_attempt_retention_days*number

Days of outbound-webhook delivery-attempt history kept for this app. 7-365.

Example: 30

Example

Request

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

{
  "slug": "acme-app",
  "display_name": "Acme",
  "workspace_id": "835015dc-7bde-4a8a-b306-c066d4733b90",
  "environment": "production"
}

Response

{
  "id": "string",
  "slug": "acme-app",
  "display_name": "Acme",
  "workspace_id": "string",
  "status": {},
  "environment": "production",
  "created_by": "string",
  "metadata": {},
  "created_at": "2026-01-01T00:00:00.000Z",
  "updated_at": "2026-01-01T00:00:00.000Z",
  "audit_retention_days": 365,
  "webhook_attempt_retention_days": 30
}