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
| Header | Type | Description |
|---|---|---|
| X-API-Key | string | Your Rasel API key. Send it on every documented request except inbound webhooks. * |
Request body
| Field | Type | Description | Example |
|---|---|---|---|
| verificationId | string | Identifier returned from the verification send step. Prefer this on resend and verify. | |
| to | string | 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. | |
| code | string | Machine-readable error or verification code, depending on the endpoint. * |
Response Fields
| Field | Type | Description | Example |
|---|---|---|---|
| verificationId | string | Identifier returned from the verification send step. Prefer this on resend and verify. | |
| verified | enum | True when the submitted code matches. | |
| alreadyVerified | boolean | True when the attempt was already verified. | |
| verifiedAt | string | Timestamp of a successful verification. | |
| remainingAttempts | number | Remaining verify attempts, or null when not applicable. |
Status Codes
| Status | Description |
|---|---|
| 200 | Success. |
| 400 | Invalid request, validation error, or the resource cannot be used in this state. |
| 404 | Resource not found for this API key owner. |
| 410 | The verification code has expired. |
| 429 | Rate limit exceeded, or the maximum number of verification attempts was reached. |
| 401 | Missing 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.