Skip to content

Verify an email code and create a session.

POST
/api/auth/email-codes/verify
Code sample: Shell / cURL
curl --request POST \
--url https://auth.example.com/api/auth/email-codes/verify \
--header 'Content-Type: application/json' \
--data '{ "email": "[email protected]", "code": "123456" }'
Media type application/json
object
email
required
string format: email
code
required
string
Example
{
"email": "[email protected]",
"code": "123456"
}

Successful JSON response.

Media type application/json
object
success
required
boolean
sessionId
required
string
userId
required
string
user
required
object
id
string
email
Any of:
string format: email
name
Any of:
string
email_verified
One of:
boolean
created_at
string
updated_at
string
last_login_at
Any of:
string
user_type
string
Example
{
"success": true,
"sessionId": "sess_123",
"userId": "user_123",
"user": {
"id": "user_123",
"email": "[email protected]",
"name": "Example User",
"email_verified": 1
}
}