Authenticate with an OTP
This endpoint is used to authenticate a user with a one-time password (OTP) that's sent to the user's email address. If the OTP is correct, the user will receive a PASETO token that must be included in the Authorization
header in subsequent requests to permissioned endpoints.
Endpoint Information
- Method:
POST
- URL:
/v1/auth/otp/authenticate
- Authentication Required: No
Request body
The request body must include:
email
– A string representing the user's email addressotp
– A string representing the one-time password
Example request
{
"email": "user@example.com",
"otp": "123456"
}
Responses
As a response for the correct OTP, the user will receive a PASETO token that must be included in the Authorization
header in subsequent requests to permissioned endpoints.
✅ 200 – Success
{
"message": "OTP authenticated successfully",
"data": "v4.public.eyJlbWFpbCI6InVzZXJAbmFtZS5jb20iLCJleHAiOiIyMDI0LTExLTE5VDEzOjQwOjI4LjUwNloiLCJpYXQiOiIyMDI0LTExLTE5VDEzOjQwOjI0LjkwN1oifV8e6JgzP1sEfGGwHKQNH-OYOdY7acXbmb7SeEzHoTCNHWfBp8c5roLyBV74K2qRchttxX8Alym_Bn8SRFuTQAc"
}