Messaging verifications
Verifications lists every verification code your organization sent, newest first. Each row shows the masked number, the channel, the template, whether the code was verified, and how its last delivery went. Select a row to see each delivery and how long it took.
Verifications are under Messaging while SecureAuth has turned Messaging on for your organization. See Messaging section.
How long a delivery took
A verification's page leads with how long its delivery took, from the send to the delivery report. After a resend, it times the last delivery that arrived and says how long the code took from the first request.
Below that, a timeline draws each delivery from the request to its outcome, and a table lists each delivery's send and delivery times to the millisecond. A delivery that arrived after the code expired, late or not, marks the expiry on its line.
A verified code ends its timeline at Verified, with the time Workforce Authority received the approval and how long after the delivery it came. When that delivery has no time, such as an answered call, the wait runs from the request. With no stored request time either, the step shows only the time. A code verified before Workforce Authority kept this time reads time not reported.
| Shown | Meaning |
|---|---|
| Whole seconds, with a duration such as under 3 s | The text's report had no time, so the page uses when the report reached the SecureAuth SMS Provider, to the second. Durations that end at that report are upper bounds. |
| Late | The SecureAuth SMS Provider marked the text's report late. Without its verdict, a text is late when it arrived after the code expired. A late text that arrived after expiry says by how much. |
| No duration | The delivery failed, or a call was answered with no reported time. Neither has a delivery time. |
Once the SecureAuth SMS Provider forgets a verification, the page shows its stored record, with every delivery. Each delivery is timed from when Workforce Authority received its send or resend request. A delivery with no stored request time shows only when it arrived. A record stored before Workforce Authority kept each delivery shows only the last one.
A stored record doesn't keep the Whole seconds mark, so a delivery time to the second reads as exact. If such a time, rounded down to the second, lands before its request, the delivery shows no duration.
How a call ended
A code sent by voice call shows the call's status in place of a delivery status.
| Status | Meaning |
|---|---|
| Calling or Ringing | The call is still being placed. |
| Answered or voicemail | Someone or a voicemail box picked up. The phone network can't tell the two apart. |
| Not answered, Busy | Nobody picked up, or the line was busy. |
| Canceled, Blocked | The call didn't go through. |
| Call failed | The call never connected. |
| Unknown | The outcome was never reported. The call may still have gone through. |
Answered or voicemail doesn't prove the person heard the code. A phone's call screening may keep a call from ringing, even when it shows this status. It doesn't stop every call. On iPhone, that setting is Screen Unknown Callers, under Settings > Apps > Phone.
Request fields in the API
Every Messaging POST, PATCH or DELETE request takes its fields in the JSON body. A key in the query string is refused with 422 malformed, and nothing is sent or changed. The exceptions are a search's page_token, page_size and page, and a country withdrawal's locale. A body that fails validation, such as one missing a required field, is refused with 400 bad_request before the query string is checked. GET requests keep their query parameters.
Voice templates in the API
A voice send can name the voice template the call reads, in template, such as login-voice. A name is lower case and never carries a locale; the locale goes in locale beside it. A Hong Kong Chinese call sends "template": "web-registration" with "locale": "zh-HK", not one name such as zh-HK_web-registration, which fails with 400 bad_request. SecureAuth sets up your organization's voice templates, unless it lets you write your own. Leave template out, or send default, and the call reads your default voice template. A name your organization doesn't have fails the send with template_not_found.
A named template is read in the call's locale, such as en-GB, then in its language, en, then in the template's default locale. A call reads only a version that is published, active, approved by SecureAuth and allows a code that long. It skips any other version and tries the next locale. With no such version in any of them, the call reads your default voice template the same way, then the call text SecureAuth manages for your organization. The send doesn't fail. A template that isn't approved and published yet still places the call, in your default wording. The verification still returns the name you sent.
params fill the voice template's variables, and every call of the verification, "call me" included, carries them. A voice template ignores a param it doesn't use, so one set of params can serve the text and the call when the variable names match. A send takes at most 20 params; more fails with 400 bad_request.
The SecureAuth SMS Provider checks each value against the version's approved list or format. A call with a missing or refused value fails with template_params_invalid, and no call is placed. The call never falls back to your default template for this. last_failure_variable names the variable on a failed send, and resend_failure_variable on a failed resend, when the provider reports one. When allowed values together break a voice text rule, the field names each of the version's variables the text uses, comma-separated. Neither holds a value. After a voice resend of a text verification, resend_failure_variable names a variable of the default voice template the call reads, not of the text template the verification shows.
Send template and params in the JSON body, on either channel. Either one in the query string is refused with 422 malformed, and nothing is sent.
The verification returns the voice template in template. It is null when the send named none.
A resend can't name a template. A voice verification's resend asks for the template its send named, with the same fallback. A voice resend of a text verification reads your default voice template.
Your own code in the API
A send can carry your own code in code, in place of the code the SecureAuth SMS Provider generates. SecureAuth turns this on for your organization. Until then, a send with a code fails with customer_codes_not_enabled.
| Channel | Code |
|---|---|
sms |
4 to 16 letters or digits, such as Ab12Cd34 |
voice |
4 to 10 digits, such as 012345 |
Send the code as a JSON string. A code that breaks its channel's rule is refused with 422 invalid_code, and nothing is sent. So is a JSON number, which would lose a code's leading zeros.
A retry with the same Idempotency-Key answers the first send's verification, even with another code, and sends nothing.
A template version created before codes could reach 16 characters was checked with a 10-character code. If a longer code pushes its text past your SMS segment limit, the send fails with template_params_invalid.
A check ignores letter case, so ab12cd matches AB12CD.
A call reads the code aloud. A listener can't hear letter case, and letters such as B and D sound alike, so a call reads only digits, up to 10. A voice resend of a text verification whose code has letters or more than 10 digits fails, with voice_needs_numeric_code in resend_failure_reason. Nothing is called, and the code still checks. The resend still counts toward the number's send limit.
If your users can ask for a call, send a numeric code of 4 to 10 digits.
Delivery time in the API
Each delivery in a verification's API response carries delivered_at. For a text, it is the time in the text's delivery report. For a call, it is the time the call was answered. When a text's report has no time, delivered_at is the time the report reached the SecureAuth SMS Provider.
delivered_at is null until the text is delivered or the call is answered. It stays null for a failed delivery and for a call with no reported time.
delivered_at_approximate is true when a text's report had no time, so delivered_at is in whole seconds. late_receipt is the SecureAuth SMS Provider's verdict on whether the report arrived late: true, false, or null when it gives none.
Listing and searching verifications return your organization's stored records. Fetching one returns its stored record too while its send is queued, after its send failed, and once the SecureAuth SMS Provider forgets it. A stored record carries the last delivery's time as last_delivered_at. It includes text delivery reports that arrive late, up to 12 hours after the send.
A stored record also carries last_send_requested_at, when Workforce Authority received the send or resend behind that delivery. Subtract it from last_delivered_at for how long the delivery took. last_late_receipt is that delivery's late_receipt.
Fetching a stored record also returns deliveries: every delivery Workforce Authority stored, oldest first. Each carries its own channel, status, failure_category, failure_reason, send_requested_at, delivered_at and late_receipt. Listing and searching leave deliveries out. It is empty for a record stored before Workforce Authority kept each delivery.
To measure how long a code took, subtract the time you sent the request from delivered_at. The result includes the SecureAuth SMS Provider's and the phone network's delay. It also includes any difference between your clock and the clock that stamped delivered_at.
Verification time in the API
Every response that returns a verification carries verified_at: when Workforce Authority received the SecureAuth SMS Provider's approval of the code. The SecureAuth SMS Provider reports no approval time, so Workforce Authority records its own as it relays the approving check. That is at most one check round trip after the SecureAuth SMS Provider approved the code. The check response doesn't carry it, so look the verification up after an approved check.
verified_at is null until a check is approved, and for a verification approved before Workforce Authority kept this time. A later check or lookup never changes it. Stored records keep it.
Your own ID in the API
A send can carry your own ID for it, such as your transaction ID, in client_reference in the JSON body. It takes 1 to 128 printable ASCII characters (letters, digits and punctuation, no spaces), kept exactly as you send them. null is refused with 400 bad_request. Any other malformed value, or a client_reference in the query string, is refused with 422 malformed. Either way, no code is sent.
The send, resend, lookup, list and search responses return client_reference. To find the verifications sent under one ID, pass client_reference to the list as a query parameter, or in the search body. The match is exact, and every match comes back, newest first: the ID need not be unique, so a retry can reuse it. A filter value that a send would refuse answers 400 bad_request. Stored records keep it too, so the lookup works after the SecureAuth SMS Provider forgets a verification. You can also check a code by it: see Check a code.
client_reference appears in logs. Never put personal data in it, such as a name, a phone number or an account number.
Warnings in the API
The SecureAuth SMS Provider can answer a send with warnings, hints that never stop the code. Workforce Authority keeps them on the verification. The lookup, list and search return them in warnings, a list of { "code", "message" }.
template_renamed means the send named its template by an old name. The warning didn't stop the send; the delivery's status says whether the code went out. Switch to the name the message gives before the old name is released. See Rename a template.
A resend's warnings join the send's, and each is kept once. A call carries none, so a voice resend keeps the text's warnings.
The 202 of a send or resend never carries warnings, because it answers before the SecureAuth SMS Provider does. Look the verification up instead. warnings is absent when there are none. New codes can appear, so show or log any code you don't know. Stored records keep them.
Sends are queued
A send or resend answers 202 once Workforce Authority's own checks pass. The SecureAuth SMS Provider gets the request a moment later. To see how it went, fetch the verification by its id, or list your verifications.
| Status | Meaning |
|---|---|
queued |
Workforce Authority hasn't recorded the SecureAuth SMS Provider's answer to the send yet. A send's 202 returns this. expires_at, country, attempts and max_attempts are null, and deliveries is empty. |
pending |
The SecureAuth SMS Provider took the send, and the code can be checked. A resend's 202 returns this, with resend_status queued. |
failed, with last_failure_category send_failed |
The send failed. last_failure_reason holds the error code. |
Filter by status=failed for verifications that failed their checks, such as too many wrong codes. Filter by status=send_failed for sends that failed. The two never overlap.
Workforce Authority answers its own refusals at once, and nothing is sent. They cover a malformed request, a bad number, channel, template, code or client_reference, the send limit (429), and Messaging turned off (403).
Refusals from the SecureAuth SMS Provider arrive later, on the verification, as a failed send. They prove no code went out: malformed, idempotency_key_reused, rate_limited, invalid_phone, invalid_country, country_blocked, country_not_allowed, country_not_declared, country_rule_violation, premium_number_blocked, template_not_found, template_disabled, template_not_approved, template_params_invalid, template_too_long, locale_not_published, locale_removed, voice_not_enabled and customer_codes_not_enabled. A resend can also be refused by voice_not_yet_available, voice_needs_numeric_code, resend_in_progress, verification_not_pending or verification_not_found.
After any other error, one added later included, the code may have gone out. Today those are provider_error, idempotency_key_in_progress (the SecureAuth SMS Provider was still sending when the send window ran out), and Workforce Authority's own send_stale (the send window, 30 seconds from the request, ran out), send_lost (no answer was recorded), messaging_unavailable, messaging_not_enabled, upstream_auth_failed and upstream_error.
A failed resend leaves the verification pending, so its code still checks. Its resend_status turns failed, with the error code in resend_failure_reason. Each error means the same as on a send. Once a resend goes out, resend_status is null again.
While a send is queued, a check or resend answers 409 send_in_progress. While a resend is queued, another resend answers 409 resend_in_progress. Both carry Retry-After, in seconds. A check while only a resend is queued checks as usual. Once a send has failed, a check or resend answers 409 verification_not_pending.
A repeat with the same Idempotency-Key answers the first verification and sends nothing. A send's repeat compares the number and channel, not the code, so a repeat with another code still answers the first send's verification. Once Workforce Authority has accepted the key, a repeat doesn't count against the send limits, so it never answers 429. A resend's repeat answers 409 verification_not_pending once the verification is no longer pending. A key reused for a send to another number or by another channel, or for a resend of another verification, answers 422 idempotency_key_reused. A verification keeps only its latest resend's key: once a later resend replaces it, the old key counts as new. A key whose send or resend failed stays spent, so try again with a new key. After a 503 on a send or resend, retry with the same key. That never sends a second code.
IDs across an upgrade
Every response returns Workforce Authority's own id for a verification it holds a record of, the same from the 202 on. The SecureAuth SMS Provider's ID still works wherever a request takes an ID. Earlier releases returned the SecureAuth SMS Provider's ID once the code was sent, and do again after a rollback. Across an upgrade or a rollback, match a verification by the ID you hold or by client_reference, never by the id a later response returns.
Check a code
You can check the code a user entered in two ways:
| Request | Checks |
|---|---|
POST /api/v11/{tenant_id}/messaging/verifications/{verification_id}/check, with code in the body |
The verification with that ID |
POST /api/v11/{tenant_id}/messaging/verifications/check, with client_reference and code in the body |
Your organization's newest verification sent with that client_reference, skipping failed sends |
Check by ID when you can. An ID names exactly one verification. A client_reference can be sent more than once, by a retry or by your own reuse, and a check by it reaches only the newest verification that carries it, skipping failed sends (last_failure_category: send_failed). Any other match is checkable only by its ID. A skipped send's code may still have gone out; checked by reference, it counts as a wrong code. With only failed sends under the reference, the check answers 409 verification_not_pending. A check never tries every match, because each check spends one of a verification's attempts.
Both checks answer the same way for the same verification: 200 whether or not the code matched, with status: approved the only success. Both read code from the JSON body. A code in the query string is refused with 422 malformed.
A check by client_reference reads both fields from the JSON body. One missing there, or a null client_reference, is refused with 400 bad_request. A client_reference in the query string as well is refused with 422 malformed, and so is any other client_reference that a send would refuse. When none of your organization's verifications carries it, the check answers 404 verification_not_found.
Place a test call
Test voice call calls a real number and reads it a code. It needs permission to send verifications and to read them. Organization administrators have both.
-
From the left navigation, click Messaging, then Verifications, and click Test voice call.
-
In Phone number, enter the number, starting with + and the country code.
-
To hear a voice template other than your default, pick it in Call text. The list starts with your default, then your other active voice templates whose default language is live: a call without values names no language, so that's the one sure to play. The list shows only when you can read templates and have a template besides the default. When it doesn't show, the call reads your default text. When the text takes values, pick its Language and a value for each, and the call names that language.
-
Click Call. A real call goes out, and it counts toward the number's send limit. The dialog shows Queued until the call goes out, then its status. A refused call returns to the form with the reason.
-
Enter the code from the call and click Check.
The dialog shows the masked number, the call's status and roughly how long the code has left. Call again calls with the same code. The dialog shows the new call as queued until the call goes out. Until the next call is allowed, the button shows the time left. When voice calls aren't turned on for your organization, nothing is sent and the dialog says so.
If the phone doesn't ring, try turning off its call screening, then click Call again. On iPhone, set Screen Unknown Callers to Never. See How a call ended.
Once you close the dialog, the list reloads. The call is the newest row, unless your filters leave it out.