Opt-out API
When a user on your platform opts out of the sale or sharing of their personal information, send that opt-out to Disco. The opt-out API takes many opt-outs in a single request.
What an opt-out does. It takes effect automatically and applies to future ad requests. Disco applies it across its entire network, not only on your surfaces, regardless of which publisher ID sent it.
What it does not do. This API records opt-outs only. It does not delete data. Data deletion requests follow a separate process.
1. What you need
Your Disco publisher ID. Your Disco account manager can give it to you. If your company has more than one publisher ID, use any one of them: opt-outs apply network-wide either way.
2. Send opt-outs in batches
The endpoint is built for batches. Collect your users' opt-outs and send them together in one request, rather than calling the endpoint once per user as each opt-out happens.
Endpoint
POST https://identity.disconetwork.com/opt-out/
The trailing slash is optional.
Headers
| Header | Value |
|---|---|
Content-Type | application/json |
publisher-id | Your Disco publisher ID |
Body
A JSON array. Each item is one opt-out:
| Field | Required | Value |
|---|---|---|
identifier_type | Yes | EMAIL or EMAIL_HASH |
identifier | Yes | The user's email address, or the SHA-256 hash of it |
The body must be an array, even when you send a single opt-out.
Sending hashed emails. Lowercase the email address and remove any leading or trailing spaces, then hash it with SHA-256 and send the hex string. Disco hashes plain email addresses the same way, so a hashed and an unhashed opt-out for the same person match.
3. Examples
cURL
curl -X POST "https://identity.disconetwork.com/opt-out/" \
-H "Content-Type: application/json" \
-H "publisher-id: YOUR_PUBLISHER_ID" \
-d '[
{ "identifier_type": "EMAIL", "identifier": "shopper1@example.com" },
{ "identifier_type": "EMAIL_HASH", "identifier": "9b3db0d73baaf0b50d72297a9f31480fac59eb67cb78042e9d00904c73c7b4e3" }
]'
The second item is the SHA-256 hash of shopper2@example.com.
JavaScript (server side)
const optOuts = [
{ identifier_type: "EMAIL", identifier: "shopper1@example.com" },
{ identifier_type: "EMAIL", identifier: "shopper2@example.com" },
];
const response = await fetch("https://identity.disconetwork.com/opt-out/", {
method: "POST",
headers: {
"Content-Type": "application/json",
"publisher-id": "YOUR_PUBLISHER_ID",
},
body: JSON.stringify(optOuts),
});
console.log(response.status); // 201 when the batch is accepted
4. Responses
| Status | Meaning |
|---|---|
201 | The batch was accepted. Body: {"status": "201 - Created"} |
400 | The body is not a JSON array, or an item is missing a field or has an invalid identifier_type. |
401 | The publisher-id header is missing. |
One invalid item rejects the whole batch. If any item fails validation, nothing in the request is saved. Fix the item and send the full batch again.
Resending is safe. If Disco already has an opt-out, sending it again is not an error. The duplicate is skipped and the rest of the batch is saved.
5. Users who contact Disco directly
Users can also opt out with Disco directly, and Disco honors Global Privacy Control signals. See the Notice of Right to Opt Out of Sale and Sharing/Targeted Advertising.