SecureAuth Workforce Authority

Voice templates

A voice template is the text a verification call reads. SecureAuth tests and approves every version. While self-service is off for your organization, SecureAuth also writes your voice templates. You can always read them in the dashboard or through the Core APIs.

Like a Messaging template, a voice template has one or more languages, and each language has numbered versions. A version keeps the text, code length and support number it was created with, though it can still be approved, published or disabled.

What a voice text can say

A voice text is at most 500 characters. It can use three variables, which the SecureAuth SMS Provider fills in for each call:

Variable What the call reads
{{code}} The code, one digit at a time. The text uses it one to three times.
{{code_length}} How many digits the code has.
{{support_phone}} Your support number, as SecureAuth stored it when the version was created.

A text can use only the languages the locales list returns. Today those are en, en-US, en-GB, en-CA, en-AU and en-IN.

A call lasts at most 46 seconds. A text should take no more than 42 seconds to read, or the call may be cut before it ends. Each version carries an estimate of how long it takes. SecureAuth times the version on a real call before approving it.

Which text a call reads

A call that names no template reads your default template. Without one, or while nothing in it is live, it reads the call text SecureAuth manages for your organization. A test call from the dashboard can name any template whose default language is live.

A language is live while its published version is active and SecureAuth has approved it. A call reads only a live language. When the call's own language isn't live, it reads the template's default language.

Each version is written for codes up to a number of digits, max_code_digits. A call with a longer code reads another text. A call never fails because of its text.

Read voice templates in the dashboard

From the left navigation, click Messaging, then Templates, and open the Voice tab. You need the same permission as for Messaging templates.

The list shows your default template first, then your other templates, then the disabled ones. Each active template shows its languages and the version live in each, and says so when SecureAuth rejected its latest change. Search by name or language.

Select a template to see, for each language:

  • The call text, with its variables.
  • What the call says, with a sample code as long as the longest code the version reads.
  • Each version's approval, and SecureAuth's note on a rejected one.
  • The longest code the version reads and your support number.
  • How long the call takes, once SecureAuth has timed it on a test call.

The tab is read-only. While SecureAuth manages your call texts, a banner says so; to change one, contact SecureAuth. If voice templates aren't turned on for your organization's messaging account, the tab says that instead.

Read voice templates in the API

Request What it returns
GET /api/v11/{tenant_id}/messaging/voice/templates Every voice template, with its languages, versions, approvals and published versions
GET /api/v11/{tenant_id}/messaging/voice/templates/{name} One voice template
GET /api/v11/{tenant_id}/messaging/voice/locales The languages a text can use, with the time budget
GET /api/v11/{tenant_id}/messaging/voice/settings Your default template, support number and daily test call allowance

The token needs the same scope and permission as reading Messaging templates. Each version shows its approval: pending, approved or rejected, with SecureAuth's note on why it rejected one.

Error Meaning
403 voice_templates_not_provisioned Voice templates aren't turned on for your organization's messaging account. Contact SecureAuth.
403 messaging_not_enabled Messaging is off for your organization.
404 template_not_found Your organization has no voice template with that name.
503 messaging_unavailable The SecureAuth SMS Provider can't reach its templates. Try again later.

Check a voice text in the API

Request What it does
POST /api/v11/{tenant_id}/messaging/voice/templates/check Shows how a call would read a draft text, without saving it
GET /api/v11/{tenant_id}/messaging/voice/test_numbers Lists the numbers a test call can ring

A check sends locale and body, and can send max_code_digits, as a new version does. Any other field, such as params, fails with 400. A text that breaks a rule still answers 200:

Field What it holds
valid true when the text breaks no rule, so a new version with it would be accepted
rendered_text The text as a call reads it, with a sample code and your support number
duration The SecureAuth SMS Provider's estimate of how long the call takes, as on a version
violations The rule the text breaks, by code, such as body_too_long or keypad_or_callback. Empty when valid is true.
warnings Hints that never block, such as over_budget

A new version runs the same check and refuses what it reports. A check saves nothing, and works before SecureAuth turns on self-service for you.

Each test number has an id, a label, a country, the time SecureAuth added it as added_at, and masked, the number with its middle digits hidden, such as +1•••••4567. The full number is never returned. SecureAuth adds and removes test numbers, up to five.

Both need the same permission as reading voice templates. Test numbers need the same scope too. A check takes either that scope or eG:v11:messaging:templates:write. Both fail with the read errors above, except 404.

Write voice templates in the API

SecureAuth writes your organization's voice templates until it turns on self-service for you. From then on, you can write them too. The settings request shows which: self_service is true once you can.

Request What it does
POST /api/v11/{tenant_id}/messaging/voice/templates Creates version 1 of a template in one language. A name you already have in another language gains this one.
POST /api/v11/{tenant_id}/messaging/voice/templates/{name}/locales Adds a language to a template you have, at version 1
POST /api/v11/{tenant_id}/messaging/voice/templates/{name}/versions Creates the next version of a language
POST /api/v11/{tenant_id}/messaging/voice/templates/{name}/publish Makes an approved version the one calls read, or rolls back to an earlier one
DELETE /api/v11/{tenant_id}/messaging/voice/templates/{name} Disables the template, in every language and version
PATCH /api/v11/{tenant_id}/messaging/voice/templates/{name} Sets the template's default language
PATCH /api/v11/{tenant_id}/messaging/voice/settings Sets or clears your default template
POST /api/v11/{tenant_id}/messaging/voice/templates/{name}/test_calls Calls one of your test numbers and reads it a version

A create sends name, locale and body. A new language or version sends locale and body. Each can also send max_code_digits, from 4 to 10, which is 10 when left out. A publish sends locale and version, and a disable sends no body. Any other field in those bodies, such as params, fails with 400 and changes nothing.

A default language sends default_locale. It must be live in the template, or the request fails with 422 locale_not_published. A default template sends default_template, the name of one of your templates, or null to clear it. The template needn't be live yet; calls skip it until a language is. With no default template, a call that names none reads the call text SecureAuth manages for your organization.

A new version waits for SecureAuth's approval, and calls keep reading the live one. The answer carries the version's duration estimate and a warnings list. over_budget means the estimate is over 42 seconds, so the call may be cut. It never blocks the version; SecureAuth's timed call decides.

Calls normally read a published version or a new default, or stop reading a disabled template, within a minute. While the SecureAuth SMS Provider can't reach its templates, calls may keep reading the previous text for up to 15 minutes.

A disabled template can't be enabled again, and its name stays taken. A disabled default template stays named in the settings; calls skip it and read the call text SecureAuth manages for your organization.

Creating a template or adding a language needs permission to create templates; a new version, a default language or a test call, to update them; publishing or choosing the default template, to publish them; disabling, to disable them. Organization administrators have all four. The token needs the eG:v11:messaging:templates:write scope, or eG:v11:messaging:templates:publish to publish or choose the default template.

The read errors above apply to writes too, apart from voice_templates_not_provisioned. A write can also fail with:

Error Meaning
400 bad_request The request body has a field a write doesn't take, such as params, or a value out of range.
403 voice_template_writes_not_provisioned Your organization's messaging account isn't allowed to make that change, though it may still read voice templates. Contact SecureAuth.
403 voice_templates_self_service_off SecureAuth writes your organization's voice templates. Contact SecureAuth to change one.
404 template_not_found Your organization has no voice template with that name, or the language has no such version.
409 template_exists The template already has that language.
409 template_disabled The template is disabled. On a publish it can mean only that version is, and on a new version only that language. A disabled template's name can't be used again.
422 template_rule_violation The text breaks a voice text rule. details.rule names it, such as body_too_long or keypad_or_callback.
422 template_not_approved SecureAuth hasn't approved that version, so it can't be published.

Test calls

A test call rings one of your organization's test numbers and reads it a version, with a sample code. It sends locale, version and test_number_id, the test number's id. SecureAuth adds your test numbers. A test call never takes a phone number: a body with one fails with 400, and the answer holds none.

Any active version can be tested, approved or not. A test call approves nothing; SecureAuth approves a version after timing it on its own call.

The answer is 201, with the call's status: accepted, or unknown when the SecureAuth SMS Provider can't tell whether the call went out, so the phone may still ring. No later status can be read. Whoever answers hears the text. estimated_seconds is the version's duration estimate. measured_seconds is null, because only SecureAuth times calls.

A 503 can follow a call that still rings, when the SecureAuth SMS Provider took too long to answer; wait for it before you try again.

Your organization can place five test calls every 10 minutes, and test_calls_per_day a day, which the settings show. SecureAuth sets that number, 20 unless it changed it, and its own test calls of your templates count toward it. Test calls don't count toward your verification limits. The dashboard's Test voice call isn't one of them: it rings any number, and counts toward that number's send limit.

A test call can also fail with:

Error Meaning
403 voice_not_enabled Voice calls aren't turned on for your organization. Contact SecureAuth.
404 test_number_not_found test_number_id names none of your organization's test numbers.
422 country_not_allowed Your organization can't call that test number's country.
422 premium_number_blocked The test number is a premium-rate number, which test calls never ring.
429 rate_limited A test call limit is reached. details.limit names it, test_calls_per_actor_10m or test_calls_per_customer_day, and the Retry-After header says how many seconds to wait.
502 provider_error The call couldn't be placed. Try again later.