SMS#
Use the SMS delivery method to send a one-time code in a text message. The user enters the code in your application, and your application reports it to the Verification API.
How it works#
You start a verification with
delivery_methodset tosms.The Verification API sends a text message containing a newly generated numeric code to the destination.
The user enters the code in your application.
Your application reports the
codeto the report endpoint.If the code matches, the verification status becomes
verified.
Starting an SMS verification#
Set delivery_method to sms. Add optional SMS settings in an sms object inside
data. The API reads this object only when delivery_method is sms.
Use languages to select the preferred message-template languages. Use app_hash with
Android SMS Retriever so a compatible Android application can capture the incoming code
automatically.
The following example uses HTTP Basic authentication and requests the en-US message
template:
http
POST /api/v1/verifications HTTP/1.1
Host: verification.didww.com
Content-Type: application/json
Accept: application/json
Authorization: Basic eW91cl9hcHBfa2V5OnlvdXJfYXBwX3NlY3JldA==
{
"data": {
"destination": "+4915112345678",
"delivery_method": "sms",
"sms": {
"languages": ["en-US"]
}
}
}
curl
curl -i -X POST https://verification.didww.com/api/v1/verifications -H "Accept: application/json" -H "Content-Type: application/json" --data-raw '{"data": {"delivery_method": "sms", "destination": "+4915112345678", "sms": {"languages": ["en-US"]}}}' --user your_app_key:your_app_secret
response
HTTP/1.1 201 Created
Content-Type: application/json
{
"data": {
"id": "0f9c8b7a-1e2d-4c3b-9a8f-7e6d5c4b3a21",
"destination": "4915112345678",
"delivery_method": "sms",
"fee": "0.06",
"status": "pending",
"error_code": null,
"error_detail": null,
"expires_at": "2026-07-15T10:02:00.000Z",
"sms": {
"template": "Your code is {{CODE}}",
"language": "en-US",
"interception_timeout": 120
}
}
}
This response shows an approved start with status pending. A 201 Created response
can also contain status denied when a request callback rejects the verification.
Always inspect status and error_code.
A pending status means the verification was accepted for delivery. It does not confirm
that the text message reached the destination.
The response includes an sms object containing SMS-specific information:
templatecontains the message template.{{CODE}}marks where the generated code appears.languageis the language the API selected, which is not necessarily the first one requested. Compare it with the list you sent to detect a fallback toen-US.interception_timeoutspecifies how long an on-device SMS listener should remain active. It does not control verification expiry. Manual code entry remains available untilexpires_at.app_hashis returned only when the supplied hash was accepted and stored for the verification.
Supported languages#
Pass sms.languages as BCP 47 tags, most preferred first. The first supported tag wins;
if none of them is supported, the message is sent in en-US.
Tags are matched exactly, so the region subtag is required: pl does not match
pl-PL and falls back to en-US. A tag that is not a well-formed BCP 47 tag is
rejected with languages_invalid instead.
Read sms.language from the response to see which language was actually used.
The following language tags are supported:
BCP 47 tag |
Language |
|---|---|
|
Bulgarian (Bulgaria) |
|
Bosnian (Bosnia and Herzegovina) |
|
Czech (Czechia) |
|
Danish (Denmark) |
|
German (Germany) |
|
Greek (Greece) |
|
English (United Kingdom) |
|
English (United States) |
|
Spanish (Latin America) |
|
Spanish (Spain) |
|
Estonian (Estonia) |
|
Finnish (Finland) |
|
French (France) |
|
Hebrew (Israel) |
|
Croatian (Croatia) |
|
Hungarian (Hungary) |
|
Icelandic (Iceland) |
|
Italian (Italy) |
|
Japanese (Japan) |
|
Georgian (Georgia) |
|
Lithuanian (Lithuania) |
|
Latvian (Latvia) |
|
Macedonian (North Macedonia) |
|
Malay (Malaysia) |
|
Maltese (Malta) |
|
Norwegian Bokmål (Norway) |
|
Dutch (Netherlands) |
|
Polish (Poland) |
|
Portuguese (Brazil) |
|
Portuguese (Portugal) |
|
Romanian (Romania) |
|
Russian (Russia) |
|
Slovak (Slovakia) |
|
Slovenian (Slovenia) |
|
Albanian (Albania) |
|
Serbian (Serbia) |
|
Swedish (Sweden) |
|
Thai (Thailand) |
|
Ukrainian (Ukraine) |
|
Chinese Simplified (China) |
|
Chinese Traditional (Hong Kong) |
Reporting the code#
Submit the code the user received. The delivery_method must match the verification.
The following example reports a correct code and returns status verified:
http
PATCH /api/v1/verifications/0f9c8b7a-1e2d-4c3b-9a8f-7e6d5c4b3a21 HTTP/1.1
Host: verification.didww.com
Content-Type: application/json
Accept: application/json
Authorization: Basic eW91cl9hcHBfa2V5OnlvdXJfYXBwX3NlY3JldA==
{
"data": {
"delivery_method": "sms",
"code": "123456"
}
}
curl
curl -i -X PATCH https://verification.didww.com/api/v1/verifications/0f9c8b7a-1e2d-4c3b-9a8f-7e6d5c4b3a21 -H "Accept: application/json" -H "Content-Type: application/json" --data-raw '{"data": {"code": "123456", "delivery_method": "sms"}}' --user your_app_key:your_app_secret
response
HTTP/1.1 200 OK
Content-Type: application/json
{
"data": {
"id": "0f9c8b7a-1e2d-4c3b-9a8f-7e6d5c4b3a21",
"destination": "4915112345678",
"delivery_method": "sms",
"fee": "0.06",
"status": "verified",
"error_code": null,
"error_detail": null,
"expires_at": "2026-07-15T10:02:00.000Z",
"sms": {
"template": "Your code is {{CODE}}",
"language": "en-US",
"interception_timeout": 120
}
}
}
The response above shows a successful report. The API returns 200 OK with status
verified when the submitted code matches.
If the submitted code is incorrect, the API returns the following response:
HTTP/1.1 422 Unprocessable Content
Content-Type: application/json
{
"errors": [
{
"code": "code_invalid",
"detail": "code is invalid"
}
]
}
After an incorrect report, the verification remains pending, and the user can submit
another code until the attempt limit is reached. After three unsuccessful reports, the
verification becomes failed with error_code too_many_attempts.
Next steps#
Start a verification: Review all start-request and response fields.
Report a verification: Review all report-request and response fields.