Title
Create new category
Edit page index title
Edit category
Edit link
Templates
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.
xxxxxxxxxxPOST https://age.yoti.com/api/v1/templates| Header | Description |
|---|---|
| Authorization | API Key for the Yoti Age Verification API. Should be sent as Bearer {{API_TOKEN}} . |
| Content-Type | application/json |
| Yoti-SDK-Id | Your unique Yoti-Sdk-Id (uuid), obtained from the Yoti Hub. |
Request body
The following is an example of a template object in JSON format.
xxxxxxxxxx{ "type": "OVER", "methods": [ { "method": "AGE_ESTIMATION", "threshold": 21, "age_estimation_allowed": true, "age_estimation_threshold": 0, "retry_limit": 1 }, { "method": "DOC_SCAN", "threshold": 18 } ], "callback": { "url": "string", "auto": true }, "notification_url": "https://example.com/updates", "block_biometric_consent": false, "cancel_url": "string", "retry_enabled": false, "resume_enabled": false, "synchronous_checks": false, "double_blind": false}Configuration parameters
Templates share most of the parameters used to create a session.
| Parameter | Type | Example value(s) | Description |
|---|---|---|---|
type | string | OVER | Define the type of age verification approach. There are 3 available options:
|
methods | object | - | Contain the list of methods that are enabled in the template |
method | string | AGE_ESTIMATION | Enable specific method(s) for age verification in the template There are multiple options:
|
threshold | integer | 18 | Age threshold for under/over age limits |
retry_limit | integer | 1 | Number of total attempts allowed for this method |
callback | object | { "auto": true, "url": "https://www.example.com"} | The URL to redirect your user to after they complete age verification. The Note: If not specified in the template, it can be set per session. |
notification_url | string | https://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_consent | boolean | false | 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_url | string | https://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_enabled | boolean | false | You 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_enabled | boolean | false | This 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_checks | boolean | false | 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
xxxxxxxxxx{ "id": "3344111e-2e22-33ee-a4a4-6d7a89c9ea0a"}| Parameter | Description |
|---|---|
id | The template ID (UUID) |
Fetch a template
You can also fetch a template by querying the template ID.
xxxxxxxxxxGET https://age.yoti.com/api/v1/templates/<template_id>| Header | Description |
|---|---|
| Authorization | API Key for the Yoti Age Verification API. Should be sent as Bearer {{API_TOKEN}} . |
| Content-Type | application/json |
| Yoti-SDK-Id | Your unique Yoti-Sdk-Id (uuid), obtained from the Yoti Hub. |
| Paremeter | Description |
|---|---|
template_id | Template ID (UUID) obtained from the previous template creation |
Response
A template object will be returned upon a successful request.
xxxxxxxxxx{ "id": "3344111e-2e22-33ee-a4a4-6d7a89c9ea0a", "sdk_id": "003aa00c-11c2-2bbe-aad3-4feaff445557", "type": "OVER", "notification_url": "https://webhook.example.com", "block_biometric_consent": false, "rule_id": "8bd4314c-a3e3-331d-bbbc-1c2e57a18d40", "cancel_url": "https://example.com/cancel", "retry_enabled": false, "resume_enabled": false, "synchronous_checks": false, "double_blind": false, "created_at": "2026-06-01T14:53:21.846Z", "callback": { "url": "https://yoti.com", "auto": true }, "methods": { "type": "OVER", "method": "AGE_ESTIMATION", "threshold": 21, "age_estimation_allowed": true, "age_estimation_threshold": 0, "authentication": false, "retry_limit": 1 }}List out all the templates created
You can fetch the list of all created templates. No parameters are required.
xxxxxxxxxxGET https://age.yoti.com/api/v1/templates| Header | Description |
|---|---|
| Authorization | API Key for the Yoti Age Verification API. Should be sent as Bearer {{API_TOKEN}} . |
| Content-Type | application/json |
| Yoti-SDK-Id | Your unique Yoti-Sdk-Id (uuid), obtained from the Yoti Hub. |
Response
xxxxxxxxxx{ "total": 1, "templates": [ { ... } ]}| Parameter | Description |
|---|---|
total | Total number of templates created |
templates | Contains 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. |
Got a question? Contact us here.