Skip to main content

Age gate

An age gate is a mechanism used to collect and verify a user's age before allowing access to age-restricted content, features, or services. The k-ID API provides endpoints for managing age gates and determining what actions are required based on the player's age and jurisdiction.

Building a custom age gate UI?

For design recommendations on age sliders, date pickers, consent flows, and accessibility, see the UX guidelines.

Getting age gate requirements

Call /age-gate/get-requirements with the player's jurisdiction to determine:

  • Whether an age gate should be displayed (shouldDisplay)
  • What age collection methods are approved (approvedAgeCollectionMethods)
  • Age thresholds:
    • digitalConsentAge: The minimum age at which a player can provide digital consent
    • civilAge: The civil/contract age at which a player is considered a legal adult
    • minimumAge: The minimum age required to access the platform/game
  • Whether age assurance is required (ageAssuranceRequired)

Example request

GET /api/v1/age-gate/get-requirements?jurisdiction=US-CA
Authorization: Bearer your-api-key

Example response

{
"shouldDisplay": true,
"ageAssuranceRequired": true,
"digitalConsentAge": 13,
"civilAge": 18,
"minimumAge": 0,
"approvedAgeCollectionMethods": [
"date-of-birth",
"age-slider",
"platform-account"
]
}

Checking age for access

After collecting the player's age, call /age-gate/check with the date of birth and jurisdiction to determine the next step:

  • PROHIBITED: The player's age is below the minimum age for the game. The player should be blocked from continuing.
  • CHALLENGE: The player's age requires Verifiable Parental Consent. A challenge is created and must be approved by a trusted adult.
  • PASS: The player can continue into the game. A session is created or returned.

Example request

POST /api/v1/age-gate/check
Content-Type: application/json
Authorization: Bearer your-api-key

{
"jurisdiction": "US-CA",
"dateOfBirth": "2015-04-15"
}

Example CHALLENGE response

{
"status": "CHALLENGE",
"challenge": {
"challengeId": "683409f1-2930-4132-89ad-827462eed9af",
"oneTimePassword": "ABC123",
"type": "CHALLENGE_PARENTAL_CONSENT",
"url": "https://family.k-id.com/authorize?otp=ABC123"
}
}

Example PASS response

{
"status": "PASS",
"session": {
"sessionId": "608616da-4fd2-4742-82bf-ec1d4ffd8187",
"ageStatus": "LEGAL_ADULT",
"dateOfBirth": "2005-04-15",
"jurisdiction": "US-CA",
"permissions": [...],
"status": "ACTIVE"
}
}

Using platform age category APIs

Some platforms provide APIs that return an age category rather than a specific age or date of birth. For example, Meta Horizon provides a GetAgeCategory API that returns the categories CH (child, ages 10-12), TN (teen, ages 13-17), or AD (adult, ages 18+).

When using a platform's age category API, you need to convert the category to an age range for the player's jurisdiction, then use that age range with k-ID's age gate system.

Example: Using Meta Horizon's GetAgeCategory API

Here's a complete example of how to integrate Meta Horizon's age category API with k-ID:

  1. Get the age category from Meta Horizon
// Meta Horizon Unity SDK example
var ageCategory = PlatformService.GetAgeCategory();
// Returns: "CH" (child, ages 10-12), "TN" (teen, ages 13-17), or "AD" (adult, ages 18+)
  1. Convert the category to an age range
POST /api/v1/age-gate/get-platform-age-range
Content-Type: application/json
Authorization: Bearer your-api-key

{
"jurisdiction": "US-CA",
"platform": {
"name": "meta-horizon",
"category": "TN"
}
}

Response:

{
"ageLow": 13,
"ageHigh": 17
}
  1. Use the lowest age with the age gate check

Use the ageLow value (13 in this example) as the age parameter when calling /age-gate/check:

POST /api/v1/age-gate/check
Content-Type: application/json
Authorization: Bearer your-api-key

{
"jurisdiction": "US-CA",
"age": 13
}

This ensures that the platform's verified age category is properly converted to a specific age value that can be used with k-ID's age gate system while maintaining compliance with jurisdiction-specific requirements.

Date of birth format

For information about date of birth formats and requirements, see Age Gate in the Core concepts section.

Default permissions

If /age-gate/get-requirements responds with shouldDisplay = false, then no age gate should be shown and the player's date of birth isn't defined. In this case, the game still creates a Session by retrieving default permissions for the jurisdiction by calling /age-gate/get-default-permissions, which means that permissions don't vary based on age in this jurisdiction. Some features in a game might be prohibited for all age audiences based on jurisdiction, so the game should still consult the Session permissions to check whether a feature can be enabled.