Skip to main content
POST
/
auth
/
otp
/
sign-in
Sign in with a code
curl --request POST \
  --url https://api.stack-auth.com/api/v1/auth/otp/sign-in \
  --header 'Content-Type: application/json' \
  --data '
{
  "code": "u3h6gn4w24pqc8ya679inrhjwh1rybth6a7thurqhnpf2"
}
'
{
  "refresh_token": "i8ns3aq2...14y",
  "access_token": "eyJhmMiJB2TO...diI4QT",
  "is_new_user": true,
  "user_id": "3241a285-8329-4d69-8f3d-316e08cf140c"
}

Documentation Index

Fetch the complete documentation index at: https://stackauth-e0affa27-chore-move-mcp-to-a-sep-app.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

Body

application/json
code
string
required

A 45-character verification code. For magic links, this is the code found in the "code" URL query parameter. For OTP, this is formed by concatenating the 6-digit code entered by the user with the nonce (received during code creation)

Example:

"u3h6gn4w24pqc8ya679inrhjwh1rybth6a7thurqhnpf2"

Response

200 - application/json

Successful response

refresh_token
string
required

Long-lived refresh token that can be used to obtain a new access token

Example:

"i8ns3aq2...14y"

access_token
string
required

Short-lived access token that can be used to authenticate the user

Example:

"eyJhmMiJB2TO...diI4QT"

is_new_user
boolean
required

Whether the user is a new user

Example:

true

user_id
string
required

The unique identifier of the user

Example:

"3241a285-8329-4d69-8f3d-316e08cf140c"