Rasel / Docs
EN
POST/api/v2/verification/verify

Verify the code

Checks the latest code that was sent. Prefer verificationId plus code. to plus code is accepted as fallback.

When to use it. After the user types the code in your app.

Code example

Correct: Correct verification

curl --location 'https://raselsms.com/api/v2/verification/verify' \--header 'X-API-Key: YOUR_API_KEY' \--header 'Content-Type: application/json' \--data '{"verificationId":"6800abc123def4567890fedc","code":"123456"}'

Incorrect: Incorrect: wrong code

curl --location 'https://raselsms.com/api/v2/verification/verify' \--header 'X-API-Key: YOUR_API_KEY' \--header 'Content-Type: application/json' \--data '{"verificationId":"6800abc123def4567890fedc","code":"000000"}'

Each failed attempt decrements remainingAttempts until lockout.

Response example

200 — Correct verification

{  "verificationId": "6800abc123def4567890fedc",  "verified": true,  "alreadyVerified": false,  "verifiedAt": "2026-09-05T10:02:11.000Z",  "remainingAttempts": null}

400 — Incorrect: wrong code

{  "success": false,  "code": "VERIFICATION_INVALID_CODE",  "error": "Invalid verification code",  "verificationId": "6800abc123def4567890fedc",  "verified": false,  "remainingAttempts": 2}

Each failed attempt decrements remainingAttempts until lockout.

401 — Invalid API key.

{  "success": false,  "requestId": "msgreq_1739012345678_abc123",  "code": "UNAUTHORIZED",  "error": "Missing or invalid API key"}

HTTP request

POST /api/v2/verification/verify

Request Headers

HeaderTypeDescription
X-API-KeystringYour Rasel API key. Send it on every documented request except inbound webhooks. *

Request body

FieldTypeDescriptionExample
verificationIdstringIdentifier returned from the verification send step. Prefer this on resend and verify.
tostringRecipient: E.164 phone, email when channel is email, WhatsApp group JID, Telegram chat id, or a string array of up to 100 recipients for an official batch.
codestringMachine-readable error or verification code, depending on the endpoint. *

Response Fields

FieldTypeDescriptionExample
verificationIdstringIdentifier returned from the verification send step. Prefer this on resend and verify.
verifiedenumTrue when the submitted code matches.
alreadyVerifiedbooleanTrue when the attempt was already verified.
verifiedAtstringTimestamp of a successful verification.
remainingAttemptsnumberRemaining verify attempts, or null when not applicable.

Status Codes

StatusDescription
200Success.
400Invalid request, validation error, or the resource cannot be used in this state.
404Resource not found for this API key owner.
410The verification code has expired.
429Rate limit exceeded, or the maximum number of verification attempts was reached.
401Missing or invalid API key.

Cases to handle

  • Error codes: VERIFICATION_NOT_FOUND, VERIFICATION_EXPIRED, VERIFICATION_INVALID_CODE, VERIFICATION_MAX_ATTEMPTS_EXCEEDED, VERIFICATION_RESEND_COOLDOWN, VERIFICATION_MAX_RESENDS_EXCEEDED, VERIFICATION_CHANNEL_NOT_AVAILABLE.

Try it

Parameters

Recipient: E.164 phone, email when channel is email, WhatsApp group JID, Telegram chat id, or a string array of up to 100 recipients for an official batch.

Identifier returned from the verification send step. Prefer this on resend and verify.

Machine-readable error or verification code, depending on the endpoint.

Request

{}

Response

Send a request to see the response.