Auth Management API.
Set up and run your Auth apps from code: apps, keys, end users, roles, tenants and webhooks.
Call these with a workspace API key (pcft_live_…) as a bearer token. Each route names the auth.* action its key needs; the Full access preset covers them. The end-user sign-in endpoints your app calls are in the Consumer API reference.
Base URL
https://api.auth.productcraft.coAuth
Authorization: Bearer …Spec version
OpenAPI spec
https://api.auth.productcraft.co/docs-jsonApi-Keys
App API keys (`hdk_live_…`) scoped to explicit permissions: mint, list, rotate and revoke them.
- get
/v1/apps/{app_id}/api-keysList API keys for an app (no raw secret), newest first. - post
/v1/apps/{app_id}/api-keysMint a new hdk_live_* API key with an explicit permission scope. - delete
/v1/apps/{app_id}/api-keys/{key_id}Revoke an API key. - post
/v1/apps/{app_id}/api-keys/{key_id}/rotateMint a replacement for an existing key, carrying its name and permissions over.
App-Audit
The app audit log: every sign-in, change and admin action, with filters and an NDJSON or CSV export.
App-Audit-Sink
Ship the app audit log to your own HTTPS endpoint in signed batches: configure, test, rotate the secret and disconnect.
- get
/v1/apps/{app_id}/audit-sinkCurrent audit sink for this app, or 404 when none is configured. - put
/v1/apps/{app_id}/audit-sinkCreate or replace the audit sink. - patch
/v1/apps/{app_id}/audit-sinkChange the address or switch export on or off, keeping the signing secret. - delete
/v1/apps/{app_id}/audit-sinkRemove the audit sink. - get
/v1/apps/{app_id}/audit-sink/setup-statusGet the audit export checklist: destination, receiver test and delivery. - post
/v1/apps/{app_id}/audit-sink/rotate-secretIssue a new signing secret, returned exactly once. - post
/v1/apps/{app_id}/audit-sink/testSend a test batch to the receiver now and report what it answered.
App-Notification-Settings
Which emails the app sends its users (verification, password reset, invites, MFA codes) and the sender they come from.
App-Outbound-Webhooks
The legacy single webhook of an app (deprecated; use `app-webhooks`).
- get
/v1/apps/{app_id}/webhookRead the app's first webhook endpoint (or null if it has none). - put
/v1/apps/{app_id}/webhookCreate or replace the app's first webhook endpoint. - delete
/v1/apps/{app_id}/webhookDelete the app's first webhook endpoint. - post
/v1/apps/{app_id}/webhook/rotate-secretRotate the signing secret of the first endpoint. - get
/v1/apps/{app_id}/webhook/attemptsWebhook delivery attempts to any of this app's endpoints, newest first, with status code, latency and error. - get
/v1/apps/{app_id}/webhook/dead-lettersEvents the first endpoint never accepted and that will not be retried automatically, newest first. - post
/v1/apps/{app_id}/webhook/dead-letters/{dead_letter_id}/replayRe-deliver one dead-lettered event to the first endpoint. - post
/v1/apps/{app_id}/webhook/dead-letters/replayReplay every unreplayed dead letter of the first endpoint, oldest first.
App-Webhooks
Webhook endpoints that receive the app's user, session, tenant and security events, their delivery log and replays.
- get
/v1/apps/{app_id}/webhooks/event-typesList the events an endpoint can subscribe to. - get
/v1/apps/{app_id}/webhooks/endpointsList webhook endpoints, oldest first. - post
/v1/apps/{app_id}/webhooks/endpointsAdd a webhook endpoint. - get
/v1/apps/{app_id}/webhooks/endpoints/{endpoint_id}Get one webhook endpoint (without its secret). - patch
/v1/apps/{app_id}/webhooks/endpoints/{endpoint_id}Change a webhook endpoint: URL, description, events, on/off. - delete
/v1/apps/{app_id}/webhooks/endpoints/{endpoint_id}Delete a webhook endpoint. - post
/v1/apps/{app_id}/webhooks/endpoints/{endpoint_id}/rotate-secretRotate the signing secret. - post
/v1/apps/{app_id}/webhooks/endpoints/{endpoint_id}/testSend a test event to this endpoint now and return the result. - get
/v1/apps/{app_id}/webhooks/eventsList webhook events, newest first (kept for 30 days). - get
/v1/apps/{app_id}/webhooks/events/{event_id}Get one webhook event with every delivery attempt. - post
/v1/apps/{app_id}/webhooks/events/{event_id}/replaySend a logged event again, to its endpoints or to one endpoint.
Apps
Auth apps in your workspaces: create, clone, read, update, suspend and delete them, their members, and their sign-in, OAuth provider and passkey settings.
- get
/v1/appsList apps in workspaces the caller is a member of. - post
/v1/appsCreate a new app owned by the caller - post
/v1/apps/{app_id}/cloneCreate a second app in the same workspace whose configuration matches this one — the "staging app" flow. - get
/v1/apps/{app_id}Get app details - patch
/v1/apps/{app_id}Update app display name, slug, metadata, and retention settings - delete
/v1/apps/{app_id}Delete an app permanently - patch
/v1/apps/{app_id}/statusUpdate app status (active, suspended, archived) - get
/v1/apps/{app_id}/membersList app members (PlatformUser view of EndUser memberships) - delete
/v1/apps/{app_id}/members/{account_id}Remove a member from the app - get
/v1/apps/{app_id}/auth-configGet the per-app auth config (signup, signin, password policy, sessions). - patch
/v1/apps/{app_id}/auth-configUpdate the per-app auth config. - get
/v1/apps/{app_id}/auth-config/providersList federated sign-in providers Auth supports, with their setup status for this app. - post
/v1/apps/{app_id}/auth-config/providers/oidc/discoverCheck an OpenID Connect issuer before adding it as a sign-in provider. - get
/v1/apps/{app_id}/auth-config/providers/{provider}Get the config for one (app, provider). - put
/v1/apps/{app_id}/auth-config/providers/{provider}Write or replace the config for an (app, provider). - patch
/v1/apps/{app_id}/auth-config/providers/{provider}Partially update the config for an (app, provider). - delete
/v1/apps/{app_id}/auth-config/providers/{provider}Remove the config for an (app, provider). - post
/v1/apps/{app_id}/auth-config/providers/{provider}/checkCheck the saved provider credentials with the provider. - get
/v1/apps/{app_id}/webauthn-configGet the per-app passkey (WebAuthn) relying-party settings. - put
/v1/apps/{app_id}/webauthn-configSet the per-app passkey (WebAuthn) relying-party settings. - get
/v1/apps/{app_id}/setup-statusGet the setup checklist for an app: what works, what is missing, and where to fix it. - post
/v1/apps/{app_id}/sign-in-testsStart a sign-in test: prove sign-in works without creating a user. - get
/v1/apps/{app_id}/sign-in-tests/{test_id}Get a sign-in test and its result. - get
/v1/apps/{app_id}/custom-domainsList the app's custom domains (at most one). - post
/v1/apps/{app_id}/custom-domainsAdd a custom domain (such as auth.acme.com) for this app's sign-in. - get
/v1/apps/{app_id}/custom-domains/{domain_id}Get a custom domain and the last check of its records. - delete
/v1/apps/{app_id}/custom-domains/{domain_id}Remove the custom domain. - post
/v1/apps/{app_id}/custom-domains/{domain_id}/checkCheck the custom domain's DNS records now. - post
/v1/apps/{app_id}/custom-domains/{domain_id}/applySet up the custom domain's DNS records in one step with a short-lived Cloudflare or DigitalOcean API token. - get
/v1/apps/{app_id}/custom-domains/{domain_id}/exportDownload the custom domain's DNS records as a BIND zone fragment or a CSV.
Credentials
M2M clients: machine credentials that obtain tokens with the client-credentials grant, and their scopes.
- get
/v1/apps/{app_id}/credentialsList M2M clients - post
/v1/apps/{app_id}/credentialsCreate a new M2M client - get
/v1/apps/{app_id}/credentials/{client_id}Get M2M client details - patch
/v1/apps/{app_id}/credentials/{client_id}Update M2M client status - delete
/v1/apps/{app_id}/credentials/{client_id}Delete an M2M client - post
/v1/apps/{app_id}/credentials/{client_id}/rotateRotate M2M client secret - put
/v1/apps/{app_id}/credentials/{client_id}/scopesSet scopes for an M2M client
End-User-Insights
Sign-in and risk insights across the app's users, and the activity of one user.
- get
/v1/apps/{app_id}/end-user-insightsAuth health for this app over the last 30 days: verification completion, sign-in failure rate, MFA adoption,… - get
/v1/apps/{app_id}/end-user-insights/users/{user_id}One end-user's recorded activity: their audit trail, their sessions with device/IP, and their enrolled factors.
End-User-Invites
Invite people to the app by email: create, list and revoke invites.
End-Users
Your app's users from the admin side: list, search, export and import them, change status and role, revoke sessions, and manage their contacts.
- get
/v1/apps/{app_id}/end-usersList end-users in this app (cursor-paginated). - get
/v1/apps/{app_id}/end-users/exportStream this app's end-user directory as NDJSON or CSV, applying the list's `?status=` / `?search=` / `?provider=`… - post
/v1/apps/{app_id}/end-users/importQueue a bulk end-user import. - get
/v1/apps/{app_id}/end-users/import/{job_id}Import job status and per-row error report. - get
/v1/apps/{app_id}/end-users/{user_id}Get one end-user. - patch
/v1/apps/{app_id}/end-users/{user_id}Update end-user display name, primary email, or metadata keys (merged). - delete
/v1/apps/{app_id}/end-users/{user_id}Delete an end-user permanently. - patch
/v1/apps/{app_id}/end-users/{user_id}/statusChange end-user status (active / suspended / deactivated). - patch
/v1/apps/{app_id}/end-users/{user_id}/roleAssign an end-user a role. - post
/v1/apps/{app_id}/end-users/{user_id}/sessions/revoke-allRevoke every active session for an end-user. - post
/v1/apps/{app_id}/end-users/{user_id}/mfa/require-reenrollmentForce an end-user back through MFA enrolment - post
/v1/apps/{app_id}/end-users/{user_id}/resend-verificationResend verification to the primary email contact. - post
/v1/apps/{app_id}/end-users/bulk-revoke-sessionsBulk-revoke sessions across a selection. - post
/v1/apps/{app_id}/end-users/bulk-update-statusBulk-update status across a selection. - post
/v1/apps/{app_id}/end-users/bulk-update-roleBulk-assign a role across a selection. - post
/v1/apps/{app_id}/end-users/bulk-deleteBulk-delete accounts across a selection. - get
/v1/apps/{app_id}/end-users/{user_id}/contactsList an end-user's contacts. - post
/v1/apps/{app_id}/end-users/{user_id}/contactsAdd a contact for an end-user (unverified). - delete
/v1/apps/{app_id}/end-users/{user_id}/contacts/{contact_id}Delete a contact from an end-user. - post
/v1/apps/{app_id}/end-users/{user_id}/contacts/{contact_id}/promotePromote a verified contact to primary. - post
/v1/apps/{app_id}/end-users/{user_id}/contacts/{contact_id}/resend-verificationReissue a verification code for a contact. - get
/v1/apps/{app_id}/unverified-account-expiryGet the unverified-account expiry setting and how many accounts it deleted in the last 30 days. - post
/v1/apps/{app_id}/unverified-account-expiry/runRun the unverified-account expiry for this app now (or as a dry run).
Permissions
The app's permission catalogue (`resource.action` keys) and which routes enforce them.
- get
/v1/apps/{app_id}/permissionsList all permissions (system + custom) - post
/v1/apps/{app_id}/permissionsCreate a custom permission - get
/v1/apps/{app_id}/permissions/enforcementList permissions that at least one Consumer-API route enforces - delete
/v1/apps/{app_id}/permissions/{permission_key}Delete a custom permission
Platform-Stats
Auth totals and a daily series for the workspace dashboard.
Roles
App roles, the permissions each grants, and role assignment.
- get
/v1/apps/{app_id}/rolesList all roles in an app. - post
/v1/apps/{app_id}/rolesCreate a new role (no permissions yet — set them via PUT /:roleName/permissions) - get
/v1/apps/{app_id}/roles/permissionsList all available permissions - get
/v1/apps/{app_id}/roles/{role_name}Get role details with permissions - patch
/v1/apps/{app_id}/roles/{role_name}Update role name or description - delete
/v1/apps/{app_id}/roles/{role_name}Delete a custom role - put
/v1/apps/{app_id}/roles/{role_name}/permissionsSet permissions for a role (caller-narrowed: caller must hold every requested permission) - post
/v1/apps/{app_id}/roles/assignAssign a role to a user
Tenant-Api-Keys
Every tenant's API keys (`pctk_…`) from the admin side, the key settings, and revocation.
- get
/v1/apps/{app_id}/tenant-api-keysList the app's tenant API keys - get
/v1/apps/{app_id}/tenant-api-keys/configRead the app's tenant API key settings - put
/v1/apps/{app_id}/tenant-api-keys/configChange the app's tenant API key settings, or suspend its keys - delete
/v1/apps/{app_id}/tenant-api-keys/{key_id}Revoke a tenant's API key
Tenants
Tenants (organisations inside your app) from the admin side: create, update and delete them, their members and invites.
- get
/v1/apps/{app_id}/tenantsList tenants in this app, paginated by created_at desc. - post
/v1/apps/{app_id}/tenantsCreate a tenant in this app. - get
/v1/apps/{app_id}/tenants/{tenant_id}Get a single tenant by id or display id. - patch
/v1/apps/{app_id}/tenants/{tenant_id}Update a tenant (display_name, slug, status, metadata). - delete
/v1/apps/{app_id}/tenants/{tenant_id}Delete a tenant. - get
/v1/apps/{app_id}/tenants/{tenant_id}/membersList members of a tenant, newest membership first. - post
/v1/apps/{app_id}/tenants/{tenant_id}/membersAdd a member to a tenant. - patch
/v1/apps/{app_id}/tenants/{tenant_id}/members/{account_id}Change a member's role inside a tenant. - delete
/v1/apps/{app_id}/tenants/{tenant_id}/members/{account_id}Remove a member from a tenant. - get
/v1/apps/{app_id}/tenants/{tenant_id}/invitesList a tenant's invites, newest first. - post
/v1/apps/{app_id}/tenants/{tenant_id}/invitesInvite an email address into a tenant. - delete
/v1/apps/{app_id}/tenants/{tenant_id}/invites/{invite_id}Revoke a pending invite.