Email OTP API

API reference

Base URL: https://softwearapp.com/otp-api/api/v1

POST /send

Send a new OTP email.

FieldTypeDescription
emailstringRecipient email (required)
200 OK
{"ok":true,"request_id":"req_8Hk2…","expires_in":600}

POST /verify

Check a code the user typed.

FieldTypeDescription
request_idstringFrom /send
otpstringDigits typed by the user
200 OK
{"ok":true,"verified":true,"email":"user@example.com"}

POST /resend

Invalidate the old code and send a new one.

FieldTypeDescription
request_idstringPrevious request
200 OK
{"ok":true,"request_id":"req_N3w…","expires_in":600}

GET /status/{request_id}

Current state of a request.

200 OK
{"ok":true,"request_id":"req_…","status":"verified","attempts":1}

Errors

HTTPerrorMeaning
401missing_api_credentials / invalid_api_credentialsCheck X-Api-Key and X-Api-Secret
422invalid_email / invalid_otpBad input or wrong code (attempts_left returned)
404request_not_foundUnknown request_id for this project
409already_verifiedThe code was already used
410otp_expired / request_blockedSend a new OTP
429quota_exceeded / rate_limited / too_many_attemptsSlow down or upgrade your plan
502delivery_failedEmail could not be delivered