Auth API reference

Auth API · Consumer-Auth

post/{app_slug}/v1/auth/signin

Sign in an EndUser

Authenticate with username or verified primary email + password. When the account has no enabled MFA factors, returns a fresh access + refresh token pair (`ConsumerTokenResponseDto` shape). When the account has any enabled factor, returns an MFA challenge instead (`ConsumerMfaChallengeResponseDto` shape, `mfa_required: true`). In that case no session has been created yet — complete the challenge via `POST /auth/mfa/verify` (or `/auth/mfa/recover`) to receive the token pair. When the app runs `auth_config.mfa: "required"` and the account has NO enabled factor, returns a third shape (`ConsumerMfaEnrollmentRequiredResponseDto`, `mfa_enrollment_required: true`) — again no session — which is completed via `POST /auth/mfa/enroll` + `/auth/mfa/enroll/verify`. Inside `mfa_grace_days` of account creation that case instead returns the ordinary token pair with `mfa_enrollment_due_at` set.

Path parameters

app_slug*string

Slug of the app.

Request body

identifier*string

Username or verified primary email — either accepted. Secondary or unverified emails do not authenticate.

Example: "jane_doe"

password*string

EndUser password.

Example: "correct horse battery staple"

tenant_idstring

Optional tenant UUID. When set, the issued JWT carries `tid` + `trole` claims and the user must already be a member of that tenant — non-membership returns 403.

Response · 200 A normal token response, an MFA challenge, or an MFA enrolment demand — distinguish by `mfa_required` / `mfa_enrollment_required`. Neither flag present means a session was minted.

object

Example

Request

POST https://api.auth.productcraft.co/{app_slug}/v1/auth/signin
Content-Type: application/json

{
  "identifier": "jane_doe",
  "password": "correct horse battery staple",
  "tenant_id": "string"
}

Response

{}