POST
/
v1
/
access
/
otp
/
verify
Verify OTP
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": "jsmith@example.com",
  "code": "<string>",
  "include_user": false
}'
{
  "success": true,
  "message": "OTP verified successfully",
  "user": {
    "id": "5d162e6f-20ed-4a8c-b7bb-44a53b6f7d8a",
    "email": "user@example.com",
    "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"
  }
}

Authorizations

x-api-key
string
header
required

The API key required for accessing protected routes. It should be included in the request headers as x-api-key.

Body

application/json
email
string<email>
required

The email address for which the OTP was generated.

code
string
required

The OTP code to verify.

Required string length: 6
include_user
boolean
default:false

If true, includes user information in the response.

Response

OTP verified successfully.

success
boolean
required

Indicates whether the OTP verification was successful.

Example:

true

message
string
required

Confirmation message that the OTP has been verified.

Example:

"OTP verified successfully"

user
object

User information, included only if include_user is true.