Sign in with email and password
POST /signin/email-password
Authenticate a user with their email and password. Returns a session object or MFA challenge if two-factor authentication is enabled.
Request Body required
Section titled “Request Body required ”User credentials for email and password authentication
Request to authenticate using email and password
object
User’s email address
Example
john.smith@nhost.ioUser’s password
Example
Str0ngPassw#ord-94|%Responses
Section titled “ Responses ”Authentication successful. If MFA is enabled, a challenge will be returned instead of a session.
Response for email-password authentication that may include a session or MFA challenge
object
User authentication session containing tokens and user information
object
JWT token for authenticating API requests
Example
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...Expiration time of the access token in seconds
Example
900Identifier for the refresh token
Example
2c35b6f3-c4b9-48e3-978a-d4d0f1d42e24Token used to refresh the access token
Example
2c35b6f3-c4b9-48e3-978a-d4d0f1d42e24User profile and account information
object
URL to the user’s profile picture
Example
https://myapp.com/avatars/user123.jpgTimestamp when the user account was created
Example
2023-01-15T12:34:56ZDefault authorization role for the user
Example
userUser’s display name
Example
John SmithUser’s email address
Example
john.smith@nhost.ioWhether the user’s email has been verified
Example
trueUnique identifier for the user
Example
2c35b6f3-c4b9-48e3-978a-d4d0f1d42e24Whether this is an anonymous user account
User’s preferred locale (language code)
Example
enCustom metadata associated with the user
object
Example
{ "firstName": "John", "lastName": "Smith"}User’s phone number
Example
+12025550123Whether the user’s phone number has been verified
List of roles assigned to the user
Example
[ "user", "customer"]Active MFA type for the user
Challenge payload for multi-factor authentication
object
Ticket to use when completing the MFA challenge
Example
mfaTotp:abc123def456default
Section titled “default ”An error occurred while processing the request
Standardized error response
object
HTTP status error code
Example
400Human-friendly error message
Example
Invalid email formatError code identifying the specific application error