OTP
Verify OTP
Verify a submitted email code against the live idempotent OTP record.
Verify code
cURLcurl --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 key
AuthorizationrequiredUse the same server API key model as send. Verification should happen from your backend.
Request
emailstringrequiredEmail address originally used to request the code.
purposestringrequiredThe exact purpose used when the code was sent.
idstringrequiredChallenge id returned by the send endpoint.
codestringrequiredCode 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"
}