Auth API reference

Auth API · App-Notification-Settings

patch/v1/apps/{app_id}/notification-settingsAuth

Update the per-app notification settings. Each field is independently optional; null clears that slot.

Turning `notifications_via_envoi` on (from off) creates the default template of every empty slot in the workspace's Mail templates (`auth-verification`, `auth-welcome`, `auth-password-reset`, `auth-invite`, `auth-mfa-code`, `auth-sign-in`), reusing a template that already has that name, and fills the slot. Templates are created with your own Mail access; a slot that could not be created stays empty. A slot you clear later is not refilled until emails are switched off and on again, or you name it in `seed_defaults`.

Path parameters

app_id*string

Id of the app.

Request body

notifications_via_envoiboolean

Master switch. When false (default) no notification mail goes out — customers handle email via webhooks. When true, every populated template slot fires through the workspace Mail domain.

sender_modeenum (2)

Where the From comes from. `workspace` (the default for new apps): the workspace default sender set in Mail, resolved at send time, so changing it in Mail changes it for every product. `custom`: `default_sender_address`. Sending `default_sender_address` without `sender_mode` sets `custom`.

Example: "workspace"

default_sender_addressstring · email

The From used when `sender_mode` is `custom` (kept, but unused, in `workspace` mode). Must belong to a verified domain owned by this app's workspace. null clears it. Setting it without `sender_mode` switches the app to `custom`.

verification_template_namestring

Mail template name fired when an end-user needs to verify their email. Must already exist in the workspace template store.

welcome_template_namestring

Mail template name fired right after an end-user verifies their email (welcome message).

password_reset_template_namestring

Mail template name fired when an end-user requests a password reset.

invite_template_namestring

Mail template name fired when an end-user is invited into the app (`POST /v1/apps/:appId/end-users/invites` with an `email`). Until this slot is populated the invite row is still created and the code returned, but no email is dispatched.

mfa_code_template_namestring

Mail template name fired when an email-type MFA factor needs a sign-in / step-up code delivered. Required (along with the master switch + sender) before email MFA factors can complete a challenge.

sign_in_template_namestring

Mail template for passwordless email sign-in (magic link and/or code). Required before email sign-in (`auth_config.passwordless_email`) can send. Variables: `appName`, `code`, `signInUrl`, `expiresInMinutes`.

seed_defaultsarray

Create the default template for these slots when they are empty, as switching emails on does (for a slot added after you switched them on). Slots that already name a template are left alone. Values: `verification`, `welcome`, `password_reset`, `invite`, `mfa_code`, `sign_in`.

web_originstring

Public origin of the customer's portal (e.g. `https://portal.dispute.markets`). Used to build clickable buttons in the verification + password-reset emails. Must be `https://host[:port]` or `http://localhost[:port]`; no path, no userinfo. Null clears the override and falls back to code-only delivery.

Response · 200 Updated settings.

app_id*string

App UUID.

notifications_via_envoi*boolean

Master switch — when true, every populated template slot fires through the workspace Mail domain.

sender_mode*object

Where the From comes from: `workspace` (the workspace default sender set in Mail; the default for new apps) or `custom` (`default_sender_address`). Apps that had an address before this setting existed are `custom`.

Example: "workspace"

effective_sender*object

The sender Auth emails actually go out from, with its live verification status in Mail.

default_sender_address*string

The From used when `sender_mode` is `custom`; `null` when unset.

verification_template_name*string

Mail template fired for end-user email verification; `null` when unset.

welcome_template_name*string

Mail template fired right after a successful verification.

password_reset_template_name*string

Mail template fired on password-reset request.

invite_template_name*string

Mail template fired when an end-user is invited into the app; `null` when unset (the invite row and code are still created, but no email goes out).

mfa_code_template_name*string

Mail template fired to deliver email-MFA sign-in / step-up codes; `null` when unset (email MFA challenges fail loudly until configured).

sign_in_template_name*string

Mail template for passwordless email sign-in (magic link and/or code); `null` when unset (email sign-in answers 412 until configured).

web_origin*string

Public origin of the customer's portal used to render clickable buttons in verification + password-reset emails (`https://host[:port]` or `http://localhost[:port]`); `null` when unset.

created_at*string · date-time

Row created at, ISO 8601.

updated_at*string · date-time

Row last updated at, ISO 8601.

Example

Request

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

{
  "notifications_via_envoi": false,
  "sender_mode": "workspace",
  "default_sender_address": "user@example.com",
  "verification_template_name": "string",
  "welcome_template_name": "string",
  "password_reset_template_name": "string",
  "invite_template_name": "string",
  "mfa_code_template_name": "string",
  "sign_in_template_name": "string",
  "seed_defaults": [
    "verification"
  ],
  "web_origin": "string"
}

Response

{
  "app_id": "string",
  "notifications_via_envoi": false,
  "sender_mode": "workspace",
  "effective_sender": {},
  "default_sender_address": "string",
  "verification_template_name": "string",
  "welcome_template_name": "string",
  "password_reset_template_name": "string",
  "invite_template_name": "string",
  "mfa_code_template_name": "string",
  "sign_in_template_name": "string",
  "web_origin": "string",
  "created_at": "2026-01-01T00:00:00.000Z",
  "updated_at": "2026-01-01T00:00:00.000Z"
}