Skip to main content
POST
/
signin
/
email-password
Sign in with email and password
curl --request POST \
  --url https://{subdomain}.auth.{region}.nhost.run/v1/signin/email-password \
  --header 'Content-Type: application/json' \
  --data '{
  "email": "john.smith@nhost.io",
  "password": "Str0ngPassw#ord-94|%"
}'
{
  "session": {
    "accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
    "accessTokenExpiresIn": 900,
    "refreshTokenId": "2c35b6f3-c4b9-48e3-978a-d4d0f1d42e24",
    "refreshToken": "2c35b6f3-c4b9-48e3-978a-d4d0f1d42e24",
    "user": {
      "avatarUrl": "https://myapp.com/avatars/user123.jpg",
      "createdAt": "2023-01-15T12:34:56Z",
      "defaultRole": "user",
      "displayName": "John Smith",
      "email": "john.smith@nhost.io",
      "emailVerified": true,
      "id": "2c35b6f3-c4b9-48e3-978a-d4d0f1d42e24",
      "isAnonymous": false,
      "locale": "en",
      "metadata": {
        "firstName": "John",
        "lastName": "Smith"
      },
      "phoneNumber": "+12025550123",
      "phoneNumberVerified": false,
      "roles": [
        "user",
        "customer"
      ],
      "activeMfaType": "<string>"
    }
  },
  "mfa": {
    "ticket": "mfaTotp:abc123def456"
  }
}

Body

application/json

User credentials for email and password authentication

Request to authenticate using email and password

email
string<email>
required

User's email address

Example:

"john.smith@nhost.io"

password
string
required

User's password

Required string length: 3 - 50
Example:

"Str0ngPassw#ord-94|%"

Response

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

session
object

User authentication session containing tokens and user information

mfa
object

Challenge payload for multi-factor authentication

I