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, and the variables the version declares. See Variables you declare.

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. Read it from GET /api/v11/{tenant_id}/messaging/voice/locales, because the list grows.

Variables you declare

A version can declare variables of its own, such as a duration, and the text reads each one with its double braces. A call gives each variable a value in the params of its send. The SecureAuth SMS Provider checks the value, and the call reads it aloud.

A version declares each variable one of two ways:

Field What it holds
variables A list of allowed values per variable: 1 to 20 different values, each 1 to 32 characters. A call's value must be one of them.
variable_formats A format per variable. digits takes a value of min_length to max_length digits, each 1 to 3, and needs max_length. phone takes a phone number of 7 to 15 digits, country code included.

A voice version has no time format. A version can have at most one phone variable, and at most 10 variables across both fields. A variable sits in one field, never both. A name uses lowercase letters, digits and underscores, and the text must use it. Never declare code, code_length or support_phone: the SecureAuth SMS Provider fills them.

Declare them when you create a template, add a language or create a version, and a check takes them too. A version returns both fields, empty when it declares none.

A variable that breaks a rule fails the request:

Problem Answer
An empty list or value, more than 20 values, a repeated value, a value over 32 characters, more than 10 variables in one field, a type other than digits or phone, or a length below 1 or above 15 400 bad_request
A name with anything but lowercase letters, digits and underscores 422 malformed, and details.variable names it
More than 10 variables across both fields, a variable in both, a reserved name, a name over 64 characters, a variable the text doesn't use, a value with a new line, a control character or any of { } < > $, a digits length over 3 or without max_length, a phone length under 7, or a second phone variable 422 malformed from the SecureAuth SMS Provider. details.variable names the variable when one is at fault.

A call whose live version declares variables needs a value for each. A missing value, or one the version doesn't allow, fails the call with template_params_invalid, and nothing is called. The verification's last_failure_variable names the variable when the provider reports one, and resend_failure_variable does for a failed resend. 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. A call never falls back to your default template for this. A version that declares none ignores params, so one set of params can serve a text and its "call me" call when the variable names match.

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, 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, except a template named default that isn't your default template.

A language is live while its published version is active and SecureAuth has approved it. A call tries its own language, such as en-GB, then that language alone, en, then the template's default language. It reads the first one that is live and allows its code's length.

Each version is written for codes up to a number of digits, max_code_digits. A language whose live version allows fewer digits than the code has is skipped. With no language left in a named template, the call reads your default template. With none left in your default template, it reads the call text SecureAuth manages for your organization. A text can't fail a call, but a variable can. See Variables you declare.

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.

If voice templates aren't turned on for your organization's messaging account, the tab says that instead. While SecureAuth manages your call texts, or your messaging account can't change them, the tab is read-only. See Read-only states.

Write voice templates in the dashboard

Once SecureAuth turns on self-service for you, you can write voice templates on the Voice tab. Each control appears only when you hold its permission: 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.

Start a template

Click the + icon (New template) beside the search box. Pick a starting point:

  • Sign-in code
  • Card activation
  • Copy a live text, which starts from your default template's live text in its default language. It shows only when you have one.
  • Start blank

You can change every word before you save. Until you save, the template sits under Draft in the list, marked as not saved.

To add a version, select a template and click New version. To add a language, click + Add language after its language tabs. It shows while the template lacks a language you can add.

Write the text

Give a new template a name. The screen says whether it is available, taken or not allowed. A name uses lower-case letters, digits, hyphens and underscores, and starts with a letter or digit. A disabled template keeps its name, so it stays taken. Calls that name default read your default call text, so a template named default plays only while it's your default template.

Pick the language. A new template's first language becomes its default. A new language offers only the languages the template lacks. A new version keeps the language of the tab you came from.

Set Longest code, from 4 to 10 digits. A call with a longer code reads another text. Lower it only when your codes are shorter, which leaves room for words.

Write the Call text. The Insert buttons add the code, the code length and your support number where the cursor is. The counter shows the length against the 500-character limit.

Check the text as you type

Shortly after you stop typing, the screen checks the text. Under What the call says, it shows the words a call reads, with a sample code as long as your longest code.

A meter shows the estimated seconds against the 42-second budget, with the 46-second cut-off marked. The estimate is labelled approximate until the SecureAuth SMS Provider has timed real calls in that language. Past the budget the end of the call may be cut, and SecureAuth's timed call decides. Past the cut-off callers miss the end, so shorten the text.

A text that breaks a rule shows the rule under the text, and Save stays off until you fix it. If the SecureAuth SMS Provider can't check the text, the screen says so and you can still save. The save runs the same rules.

Listen

Listen (approximate) reads the text aloud with a voice on your device. The call's voice and timing differ. The button stays off, with a reason, when your browser has no voice for the language on your device or can't read text aloud. The screen never uses an online voice. To hear the real call, call a test number.

Save

Click Save version and its number. Saving sends the version to SecureAuth for approval. A saved version never changes, and calls don't read it until it is published. While another version of the language is live, calls keep reading it until you publish the new one.

The screen then shows the saved version, with a notice that it's waiting for SecureAuth.

If the SecureAuth SMS Provider doesn't answer, your text stays on screen, but the save may have gone through anyway. Check the template before you save again.

The path to live

A version that isn't live shows a Path to live card with the steps still ahead:

  1. Saved.
  2. Hear it on a call, recommended. Call a test number. Saving never requires it.
  3. SecureAuth approves. SecureAuth times the version on its own test call, then approves it or leaves a note. If it rejects the version, read the note and write a new version.
  4. Publish. Available once the version is approved.
  5. Make it the default, optional. It shows when the template isn't your default.

Call a test number

Click Call a test number and pick a number from the list. SecureAuth adds test numbers, up to five. The list shows each number masked, with its label and country. If SecureAuth hasn't added one, the list says so.

The call reads that version with a sample code. A test call approves nothing, and works on a version that isn't approved. Your organization can place five test calls every 10 minutes, and a daily number that SecureAuth sets. SecureAuth's own test calls count toward it. When you reach a limit, the button waits and shows when it frees up.

If the SecureAuth SMS Provider is slow to answer, the phone may still ring. Wait a minute before you call again.

Publish

Click Publish version and its number, and confirm. Calls in that language read it within a minute, in place of the live version.

Set the default template and language

Open More actions to:

  • Make default call text. Calls that name no template read it. Until one of its languages is live, or with no default template, they read the call text SecureAuth manages for your organization.
  • Make a live language the default language. A call tries its own locale, then its language, then the template's default locale. It never reads another live language. While the default language has nothing live, a call with nothing live in its own locale or language skips the template. The screen warns you, and tells you to publish in that language or make a live language the default.

Disable a template

Open More actions and click Disable template. Calls that name it read another call text within a minute. A disabled template can't be turned back on, and its name stays taken. Disabling your default template leaves calls that name no template reading the call text SecureAuth manages.

Read-only states

The screen says What it means
Your call texts are managed by SecureAuth. SecureAuth writes your voice templates. Contact SecureAuth to change one.
Your messaging account can't change voice templates. You can still read them. Contact SecureAuth to allow changes.

In both, an unsaved draft stays on screen as read-only. Use Copy text to keep it. When SecureAuth switches self-service off, an open screen learns it only when a change or test call is refused, or when you reload the page. It then turns read-only.

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. It also answers while other template requests are in progress. Try again shortly.

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 test numbers that the template test call (POST …/test_calls) can ring

A check sends locale and body, and can send max_code_digits, variables and variable_formats, 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 version 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. A check with a key in its query string fails with 422 malformed.

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, and the variables and variable_formats the text uses. 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. Until one of its languages is live, or 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 malformed The request has a key in its query string rather than the JSON body, a variable name breaks the rule, or the SecureAuth SMS Provider can't accept a variable. details.variable names the variable when one is at fault. See Variables you declare.
422 template_rule_violation The version breaks a voice 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.