Platform API reference

Platform API · Authentication

post/v1/auth/signin

Sign in with email/username and password

Every failed attempt answers `401 INVALID_CREDENTIALS`, whatever went wrong: unknown identifier, wrong password, an account with no password credential, an account locked out through a different identifier, an account an operator has blocked, and a wrong password against a suspended or deactivated account. The responses are deliberately identical in body and timing, so sign-in never reveals whether an account exists. An account with two-step sign-in on answers `200` with a challenge instead of tokens (`mfa_required: true`, `mfa_token`, `factors`): finish with `POST /v1/auth/mfa/verify`. Tell the two apart by `mfa_required`. The challenge is only ever returned for a correct password.

Request body

identifier*string

Email or username

Example: "user@example.com"

password*string

User password

Example: "MySecurePassword123"

session_durationobject

Session duration: "short" (24h), "long" (90d), or integer seconds (3600–7776000). Defaults to 30 days.

Example: "short"

Response · 200 Tokens, or (two-step sign-in on) a challenge to finish with `POST /v1/auth/mfa/verify`.

object

Example

Request

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

{
  "identifier": "user@example.com",
  "password": "MySecurePassword123",
  "session_duration": "short"
}

Response

{}