Templates

AI Tools

In the Age Verification Service (AVS), a Template is a standardised, predefined blueprint that dictates exactly how an age verification check should be configured and performed.

It acts as a governance tool for clients, bridging the gap between compliance requirements and technical execution. By using templates, business administrators can ensure their development teams deploy consistent, approved age-checking methods without risk of mis-configuration.

Templates allow you to pre-define configurations for Age Verification sessions, eliminating the need to rebuild complex settings each time. This enhances consistency across your organization by preventing unintended, on-the-fly modifications.

This approach is good for:

  • Session Blueprints: Instead of configuring an age check from scratch every time, developers create a new age session simply by declaring which template to use.
  • Immutability: To ensure strict compliance and auditability, templates are immutable—once a template is created, it cannot be altered or modified.
  • Enforced Compliance: To prevent accidental or unapproved configurations, Yoti can turn on a restriction requiring that all new age sessions must be generated using an established template.

Create a template

To use the Templates feature, you need to create a template first.

http
Copy
HeaderDescription
AuthorizationAPI Key for the Yoti Age Verification API. Should be sent as Bearer {{API_TOKEN}} .
Content-Typeapplication/json
Yoti-SDK-IdYour unique Yoti-Sdk-Id (uuid), obtained from the Yoti Hub.

Request body

The following is an example of a template object in JSON format.

JSON
Copy

Configuration parameters

Templates share most of the parameters used to create a session.

ParameterTypeExample value(s)Description
typestringOVER

Define the type of age verification approach. There are 3 available options:

  • OVER - verify whether the user is over the threshold
  • UNDER - verify whether the user is below the threshold
  • AGE - return the estimated age of the user
methodsobject-Contain the list of methods that are enabled in the template
methodstringAGE_ESTIMATION

Enable specific method(s) for age verification in the template There are multiple options:

  • AGE_ESTIMATION
  • DOC_SCAN
  • DIGITAL_ID
  • CREDIT_CARD
  • MOBILE
  • EMAIL
thresholdinteger18Age threshold for under/over age limits
retry_limitinteger1Number of total attempts allowed for this method
callbackobject{ "auto": true, "url": "https://www.example.com"}

The URL to redirect your user to after they complete age verification. The sessionId will be appended as a query parameter. Setting auto to true will automatically redirect users after verification.

Note: If not specified in the template, it can be set per session.

notification_urlstringhttps://example.com/updates

The URL where the results of an age verification should be sent. This endpoint must use HTTPS and accept POST requests for notifications.

Note: If not specified in the template, it can be set per session.

block_biometric_consentbooleanfalse

For several American states (currently Texas, Illinois, and Washington US states*), the law mandates that you must collect the user’s specific consent to collect their biometric details for our liveness or face matching feature to be compliant with the US legislation.

*and any other countries or states within countries. If you choose to only request specific consent in the above "territories", you must provide details of the effective geo-location software you use to prevent any individuals located in one of these territories from accessing the Yoti service without prior giving specific consent.

Setting to true bypasses this screen. We recommend keeping this value to the default (false) to enable consent for all users.

cancel_urlstringhttps://yourdomain.example

You can specify a cancel URL; if the user opens AVS and decides that they don't want to continue, then they can be taken to a specific place rather than going back in the browser. If you would like to see how this looks, please head over here.

Note: If not specified in the template, it can be set per session.

retry_enabledbooleanfalseYou can give the user the ability to retry verifying their age if an attempt fails. Webhooks are sent for each age verification attempt, so some could show up as "FAIL" even if the user eventually passes.
resume_enabledbooleanfalseThis allows the user to resume a session (if the link is re-accessed). The user can be resent the link if, for instance, the doc_scan session fails, so that they can retry.
synchronous_checksbooleanfalse

If set to true, ensures that all methods have a result ready before the user is redirected to the callback URL.

Default is false; this primarily affects document checks and credit card checks, as these are async.

Response

JSON
Copy
ParameterDescription
idThe template ID (UUID)

Fetch a template

You can also fetch a template by querying the template ID.

HTTP
Copy
HeaderDescription
AuthorizationAPI Key for the Yoti Age Verification API. Should be sent as Bearer {{API_TOKEN}} .
Content-Typeapplication/json
Yoti-SDK-IdYour unique Yoti-Sdk-Id (uuid), obtained from the Yoti Hub.
ParemeterDescription
template_idTemplate ID (UUID) obtained from the previous template creation

Response

A template object will be returned upon a successful request.

JSON
Copy

List out all the templates created

You can fetch the list of all created templates. No parameters are required.

HTTP
Copy
HeaderDescription
AuthorizationAPI Key for the Yoti Age Verification API. Should be sent as Bearer {{API_TOKEN}} .
Content-Typeapplication/json
Yoti-SDK-IdYour unique Yoti-Sdk-Id (uuid), obtained from the Yoti Hub.

Response

JSON
Copy
ParameterDescription
totalTotal number of templates created
templatesContains a list of template objects. Each template object represents one template. An example of a template object can be found in the "Fetch a template" section.
VariableType to search · ESC to discard
GlossaryType to search · ESC to discard
InsertType to search · ESC to discard
No matches