/v1/appsAuthCreate 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-KeystringStripe-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*stringURL-friendly app slug (lowercase letters, digits, hyphens).
Example: "acme-app"
display_name*stringDisplay name shown in the console.
Example: "Acme"
workspace_id*stringUUID 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*stringUnique identifier of the app.
slug*stringURL-safe identifier of the app, unique within its parent.
Example: "acme-app"
display_name*stringHuman-readable name of the app.
Example: "Acme"
workspace_id*stringOwning workspace UUID.
status*objectApp status: `active`, `suspended` (sign-ins refused) or `archived`.
environment*objectWhich 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*stringAccount that created the app.
metadata*objectFree-form JSON object you attach to the app; returned as stored.
created_at*string · date-timeWhen the app was created (ISO 8601).
updated_at*string · date-timeWhen the app was last changed (ISO 8601).
audit_retention_days*numberDays of `audit_log` history kept for this app. A nightly job deletes rows older than this. 30-3650.
Example: 365
webhook_attempt_retention_days*numberDays 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"
}import { Auth } from "@productcraft/auth";
// Admin routes read PRODUCTCRAFT_API_KEY; consumer routes need no key
const auth = new Auth();
const app = await auth.apps.create({
display_name: "Acme",
slug: "acme-app",
workspace_id: "835015dc-7bde-4a8a-b306-c066d4733b90",
});auth.apps.create(params, options?): Auth.App
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
}