OTP

Verify OTP

Verify a submitted email code against the live idempotent OTP record.

Copy page
POST/v1/verify

Verify code

cURL
curl --request POST \
  --url https://api.sendotp.email/v1/verify \
  --header "Authorization: Bearer $SENDOTP_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{"email":"[email protected]","purpose":"report-access","id":"otp_01JZ4NQ8F2T7G2A9J6P0G5QX3K","code":"493021"}'

200

The submitted code matched.
{
  "valid": true
}

Overview

Checks the submitted challenge id and code for the normalized email and purpose. Rejections include explicit reasons so callers can measure expired, superseded, locked, and wrong-code outcomes.

Authorization

Bearer API keyAuthorizationrequired

Use the same server API key model as send. Verification should happen from your backend.

Request

emailstringrequired

Email address originally used to request the code.

purposestringrequired

The exact purpose used when the code was sent.

idstringrequired

Challenge id returned by the send endpoint.

codestringrequired

Code entered by the user from their email.

Responses

200

The submitted code matched.

{
  "valid": true
}
200

The challenge was expired, superseded, locked, or the code was wrong.

{
  "valid": false,
  "reason": "wrong_code"
}