/v1/auth/signinSign 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.
Request body
identifier*stringEmail or username
Example: "user@example.com"
password*stringUser password
Example: "MySecurePassword123"
session_durationobjectSession duration: "short" (24h), "long" (90d), or integer seconds (3600–7776000). Defaults to 30 days.
Example: "short"
Response · 200 Token response
access_token*stringAccess token (JWT)
Example: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
refresh_tokenstringRefresh token (JWT)
Example: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
token_type*stringToken type
Example: "Bearer"
expires_in*numberAccess token TTL in seconds
Example: 3600
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
{
"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"refresh_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"token_type": "Bearer",
"expires_in": 3600
}