7. Implement the ATS Refresh Envelope API

Refreshing envelopes is an important step to keep the match rate as high as possible for your users. Existing envelopes can be exchanged for fresh envelopes by calling:

https://api.rlcdn.com/api/identity/envelope/refresh?pid=[placement id]&it=[envelope type]&iv=[envelope value]&ct=[consent type]&cv=[consent string]

This will reset the envelope expiration to the maximum allowed value.

pidint32Your Placement ID.
itint32The envelope type of the call:
- "19" corresponds to regular ATS envelopes.
cvint32The type of consent passed to the API.
- "4" represents a TCF v2 consent string for EU/EEA traffic.
- "3" represents a CCPA consent string for U.S. traffic (optional).
cvstringThe consent string. See Step 2: Provide a Valid Consent String for examples.

Check out our API Reference page to help you generate the call.

When to Call the Refresh API

We highly recommend calling the Refresh Envelope API on the first subsequent page load after a user authenticates and again every 30 minutes when a user enters a new page or refreshes the current page.

Refreshing an Expired Envelope

When you call the Refresh Envelope API on an expired envelope; you will receive a 204 response. In this case, you'll need to discard the expired envelope and fetch another envelope with the ATS Envelope API.