Verifies a one-time password for a given email and optionally returns user information.
cURL
curl --request POST \ --url https://api.oneofnone.io/v1/access/otp/verify \ --header 'Content-Type: application/json' \ --header 'x-api-key: <api-key>' \ --data ' { "email": "[email protected]", "code": "<string>", "include_user": false } '
{ "success": true, "message": "OTP verified successfully", "user": { "id": "5d162e6f-20ed-4a8c-b7bb-44a53b6f7d8a", "email": "[email protected]", "phone": "+15551234567", "metadata": { "preferences": { "notifications": true } }, "login_count": 5, "last_login_at": "2023-01-01T12:00:00Z", "created_at": "2023-01-01T12:00:00Z", "updated_at": "2023-01-01T12:00:00Z", "avatar_url": "https://example.com/avatars/user.jpg" } }
The API key required for accessing protected routes. It should be included in the request headers as x-api-key.
x-api-key
The email address for which the OTP was generated.
The OTP code to verify.
6
If true, includes user information in the response.
OTP verified successfully.
Indicates whether the OTP verification was successful.
true
Confirmation message that the OTP has been verified.
"OTP verified successfully"
User information, included only if include_user is true.
Show child attributes