Redact-ID.com

API Integration

This page documents how your website can use Redact-ID to verify its users age.

Flow Overview

Your website will include a special link to Redact-ID. After the verification process, the user will return to your website with POST data. This POST will contain a special certificate of age in JWT format. You can then update your own user database, or assign the user a special cookie, or however you wish to handle this.

Library

You may wish to refer to (or directly use) the Age Verification PHP Library, which integrates with this service (among others).

The reference for Redact-ID specifically is at this file.

API Step by Step

1. Setup site on Redact-ID

Create a new website entry:

Sign up for a billing plan, such as the free development testing plan.

2. Launch

On your website, create a link that launches Redact-ID. This link is the one listed as "Verification Link" in your site page on Redact-ID. It will look like
https://redact-id.com/verify.php?site=KEYWORDHERE

3. User Verifies

At this point, the user verifies on Redact-ID.

4. Parse JWT

The user returns to your website at the redirect URL you entered earlier.

The user will provide to your site a POST with the variable 'redactJwt' set to JWT format data.

You can use a library to parse and validate the JWT. You will want a library that can handle EdDSA signature encryption. (example)

The header of the JWT is:

{
  "typ": "JWT",
  "alg": "EdDSA"
}

The payload of the JWT will look like this:

{
  "iat": 1762915265,
  "nbf": 1762915265,
  "exp": 1762915565,
  "iss": "https://redact-id.com",
  "aud": "https://your-website.example.com/ageBlock.php?provider=RedactID&linkback",
  "sub": "test",
  "jti": "56a90e356913f3c189bf35.40508390",
  "reference": "136a953ab8fac9c5be96c20ed7fa9cdb062d6abaa733d0faff2ff32588d90745",
  "18plus": true,
  "ip": "127.0.0.1"
}

The signature of the JWT will follow at the end. Our public key is: 9VwhyP2YI9IeQtt0oMgNfE6jTY/cqo9x40JiY7tEONQ= which you must use to validate the JWT is authentic.

At a minimum, your site should check the JWT signature is valid, the 18plus status, and the iat/exp timing fields.


Back to account