Auth API reference

Auth API · Apps

patch/v1/apps/{app_id}Auth

Update app display name, slug, metadata, and retention settings

Path parameters

app_id*string

Id of the app.

Request body

display_namestring

New display name

Example: "Acme Corp"

slugstring

Rename the app's slug. The old slug remains resolvable for 30 days as a JWKS-URL alias so existing customer-side verifiers don't break instantly. Same shape as the create-slug: lowercase alphanumeric + hyphens, 3–48 chars, not shaped like a UUID.

Example: "acme-corp"

metadataobject

Your own key/value data for this app. It replaces the stored metadata, and keys are kept exactly as you send them. The `auth` key holds the app's sign-in settings, which you change with `PATCH /v1/apps/{appId}/auth-config` (it checks every value): leave `auth` out and it is kept as it is, or send it back unchanged. A different `auth` value is refused with 400 `AUTH_SETTINGS_IN_METADATA`.

Example: {"plan":"pro","region":"us-east-1"}

audit_retention_daysnumber

Days of `audit_log` history kept for this app. A nightly job deletes rows older than this. Minimum 30 days so an incident review always has a month to look at; maximum 3650 (10 years).

Example: 365

webhook_attempt_retention_daysnumber

Days of outbound-webhook delivery-attempt history kept for this app. Attempts are a debugging aid rather than a compliance record, hence the shorter floor.

Example: 30

Response · 200

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

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

{
  "display_name": "Acme Corp",
  "slug": "acme-corp",
  "metadata": {
    "plan": "pro",
    "region": "us-east-1"
  },
  "audit_retention_days": 365,
  "webhook_attempt_retention_days": 30
}

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
}