Verify API
Verify sends one-time codes by SMS or email and checks the code the person types. MsGine generates the code, sends it, expires it and limits the attempts, so your system never stores a code.
All paths are under https://api.msgine.net/api/v1. Every endpoint needs the VERIFY scope (FULL_ACCESS also works).
| Method | Path | Purpose |
|---|---|---|
POST | /developers/verify | Send a code |
POST | /developers/verify/:id/check | Check a code against a verification |
POST | /developers/verify/check | Check a code against the recipient's latest verification |
GET | /developers/verify/:id | Read a verification |
POST | /developers/verify/:id/resend | Send the same code again |
POST | /developers/verify/:id/cancel | Cancel a pending verification |
Send a code
curl -X POST https://api.msgine.net/api/v1/developers/verify \
-H "X-Api-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"to": "+256701234567",
"channel": "sms",
"appName": "Acme"
}'| Parameter | Type | Required | Description |
|---|---|---|---|
to | string | Yes | Phone number for sms (+256…, 256… or 07…), email address for email |
channel | string | Yes | sms or email |
appName | string | Yes | Your app's name in the message, 1 to 30 letters, digits, spaces or . & ' - |
codeLength | number | No | 4 to 8 digits. Default 6 |
expiresIn | number | No | Seconds the code is valid, 60 to 1800. Default 600 |
from | string | No | SMS: your approved sender ID (default MsGine). Email: an address on your verified domain |
androidAppHash | string | No | Your Android app's 11-character SMS Retriever hash, so the app reads the code itself |
idempotencyKey | string | No | Up to 100 characters. Retrying with the same key returns the first result |
The person receives:
482913 is your Acme verification code. It expires in 10 minutes. Do not share it.Status Code: 200 OK
{
"id": "1f72f4c5-4646-4940-aca0-8235999e2a31",
"to": "+2567••••4567",
"channel": "sms",
"status": "pending",
"attemptsLeft": 5,
"sendsLeft": 2,
"expiresAt": "2026-12-02T13:51:59.601Z",
"approvedAt": null,
"sandbox": false,
"createdAt": "2026-12-02T13:41:59.601Z"
}Starting again for a recipient that already has a pending verification sends the same code again and returns that verification, so a double tap on "Send code" never sends two different codes.
Check a code
curl -X POST https://api.msgine.net/api/v1/developers/verify/1f72f4c5-4646-4940-aca0-8235999e2a31/check \
-H "X-Api-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "code": "482913" }'| Parameter | Type | Required | Description |
|---|---|---|---|
code | string | Yes | 4 to 8 digits |
Status Code: 200 OK, for a right or a wrong code
{
"id": "1f72f4c5-4646-4940-aca0-8235999e2a31",
"to": "+2567••••4567",
"channel": "sms",
"status": "approved",
"attemptsLeft": 4,
"sendsLeft": 2,
"expiresAt": "2026-12-02T13:51:59.601Z",
"approvedAt": "2026-12-02T13:42:30.118Z",
"sandbox": false,
"createdAt": "2026-12-02T13:41:59.601Z",
"valid": true
}valid says whether the code matched. A wrong code returns valid: false with attemptsLeft; after the fifth wrong code status becomes failed. A code is accepted once: checking an approved, failed or cancelled verification returns verification_closed, and an expired one verification_expired.
If you do not keep the verification id, check by recipient instead. It uses the latest verification for that number or address:
curl -X POST https://api.msgine.net/api/v1/developers/verify/check \
-H "X-Api-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "to": "0701234567", "code": "482913" }'Resend, read and cancel
POST /developers/verify/:id/resend sends the same code again. Each verification can be sent three times, at least 30 seconds apart; sooner returns verify_rate_limited with Retry-After, a fourth send verification_send_limit.
GET /developers/verify/:id returns the verification. POST /developers/verify/:id/cancel cancels a pending one; the code stops working at once.
Statuses
| Status | Meaning |
|---|---|
pending | Sent, waiting for the right code |
approved | The right code was entered |
failed | Five wrong codes |
expired | The time ran out |
canceled | Cancelled with /cancel |
Limits
| Limit | Value |
|---|---|
| Wrong codes per verification | 5 |
| Sends per verification | 3, at least 30 seconds apart |
| Codes per number, per account | 5 every 10 minutes |
| Codes per account | 5,000 an hour (ask support to raise it) |
| SMS destinations | Uganda (+256); other countries on request |
A request over a limit returns 429 verify_rate_limited with a Retry-After header. A number in a country that is not enabled returns country_not_allowed before anything is sent or charged.
Webhooks
Subscribe a webhook to verification.approved or verification.failed:
{
"event": "verification.approved",
"channel": "verification",
"messageId": "1f72f4c5-4646-4940-aca0-8235999e2a31",
"timestamp": "2026-12-02T13:42:30.118Z",
"data": {
"verificationId": "1f72f4c5-4646-4940-aca0-8235999e2a31",
"to": "+256701234567",
"channel": "sms",
"status": "approved",
"attempts": 1,
"sends": 1
}
}Privacy
The code never appears in API responses, webhooks or your message history. Message history shows ****** is your Acme verification code…, and the body of a verification email is blanked once the verification closes.
Price
Each code sent is charged at its channel's price (SMS UGX 30, email from your bundle), plus UGX 20 when a code is approved (UGX 10 above 100,000 approved verifications in a month). Nothing is charged for a code refused by a limit.
Testing
Sandbox keys send nothing and charge nothing, and accept a code of zeros (000000 for six digits).
SDKs
The SDKs wrap these endpoints as verify.start, verify.check, verify.checkRecipient, verify.get, verify.resend and verify.cancel.