POST /data/deletion-optout/advertiser (External Provider)

Enables you to delete data from audience segments for the specified user ID on behalf of an advertiser.

If you're a merchant or data partner looking to delete IDs shared with The Trade Desk via a product catalog, use the POST /data/deletion-optout/merchant endpoint.

Setup

Here's what you need to know to use this endpoint:

IMPORTANT: If you are using signature header authentication instead of token authentication, encode the body of your request with your secret key using the TtdSignature and TtdSignature-dp header.

Request preparation guidelines

Here are some recommendations for preparing requests:

Request example with different ID types

The following is a POST /data/deletion-optout/advertiser example with an external provider and different types of IDs in the Items array used for demonstration purposes.

{
    "DataProviderId": "PROVIDER_ID_PLACEHOLDER",
    "AdvertiserId": "ADVERTISER_ID_PLACEHOLDER",
    "Items": [
        {
            "TDID": "123e4567-e89b-12d3-a456-426652340000",
            "DAID": "a9342d1f-69f1-4bf8-bc2b-1f20eb451f21",
            "UID2": "48MjlfIUZpOKNAm9nod7/jCLAXUYsnE1tpVHQSDS0uo=",
            "UID2Token": "AdvertisingTokenmZ4dZgeuXXl6DhoXqbRXQbHlHhA96leN94U1uavZVspwKXlfWETZ3bbesPFFvJxNLLySg4QEYHUAiyUrNncgnm7ppu0mi6wU2CW6hssiuEkKfstbo9XWgRUbWNTM+ewMzXXM8G9j8Q=", 
            "ID5": "ID5-c62drGF0EC6wsCZVFDbTbZwi33eB0uZTIC8FxJpzsQ", //This must be a decrypted ID5 ID
            "netID": "vp3hsuQk0I8gUEh-Y4gm3R6e8Wm7z8vkWrp_kjlXtKgbIYraTgAmKfm5kbo660gMo2lR4w",
            "FirstId": "8934d279bba4c7d652a02f624dc334e3",
            "UtiqId": "7f3ac21e-0d94-4b8a-9c17-6ee2f0a5d3b1"
        }
    ],
    "RequestType": 0
}

NOTE: If you prefer, you can list different IDs separately in the Items object. This does not affect how the IDs are processed.

Request example with the same ID type

The following is a POST /data/deletion-optout/advertiser example with an external provider and the same types of IDs in the Items array, RampID, used for demonstration purposes.

{
    "DataProviderId": "PROVIDER_ID_PLACEHOLDER",
    "AdvertiserId": "ADVERTISER_ID_PLACEHOLDER",
    "Items": [
        {
            "RampID": "XY1005wXyWPB1SgpMUKIpzA0I3UaLEz-2lg0wFAr1PWK7FMhs"  // This is a 49-character RampID example.
        },
        {
            "RampID": "Xi1005p_iYcKP7ZlvFwwK9EwR8GKl_VJqIWUhEaAFmHLAjNOQ9b6OQzSkA43XiVFcTYQ9X"  // This is a 70-character RampID example.
        }
    ],
    "RequestType": 0
}

Request object properties

The following table lists the POST /data/deletion-optout/advertiser request object properties.

Property Required? Data Type Description
DataProviderId Required String The provider ID supplied to you by your Technical Account Manager.
AdvertiserId Required String The advertiser ID for the partner on whose behalf you are deleting data. The ID can be looked up on the advertiser preferences page in the platform UI.
Items Required Object Array You can delete multiple IDs in the same request by listing them as separate items.
IMPORTANT: Only one of the supported IDs is allowed per object in the array.
For object properties, see Item object.
RequestType Optional Integer The type of data processing you are requesting:
  • 0 - ID opt-out (default value). We'll opt out the ID from your data segments by setting its TTL value to 0, thereby limiting its targeting in your campaigns.
  • 1 - ID deletion. We'll delete the ID from your datasets, including data segments and REDS feeds.

Items object array

The following table lists the properties required for each array object in the Items object array.

Property Required? Data Type Description
ID_TYPE_PLACEHOLDER Required String A supported ID type. Only one ID is allowed per object in the Items array, but the array may contain objects with different ID types.

Supported ID types

The following table lists the ID types currently supported in Items object arrays. Each array object must contain one ID.

Property Data Type Description
TDID GUID The Trade Desk 36-character GUID (including dashes) for this user.
DAID GUID The raw device ID for this user, sent in 36-character GUID format (including dashes). Use the iOS ID for advertisers (IDFA) or Android advertising ID (AAID).
UID2 String The raw UID2 value, also known as UID2. This value is case-sensitive. Raw UID2s are generated and managed using UID2 APIs. See also Unified IDs.
UID2Token String The encrypted UID2 token, also known as an advertising token. This token is case-sensitive. Tokens are generated and managed using UID2 APIs. For details about UID2 APIs, see UID2 Endpoints. For details about UID2 tokens, see Raw IDs vs. tokens.
EUID String The raw European Unified ID value, also known as EUID. This value is case-sensitive. EUID offers user transparency and privacy controls designed to meet market requirements in European regions with the same normalization and encoding of PII as UID2. See also European Unified ID Overview.
EUIDToken String The encrypted EUID token, also known as an advertising token. This token is case-sensitive. For details, see Unified IDs.
RampID String The 49-character or 70-character RampID (previously known as IdentityLink or IDL).
IMPORTANT: This must be a RampID from LiveRamp that is mapped specifically for The Trade Desk. For details about mapping a RampID, see LiveRamp documentation.
ID5 String The ID5 for the user. Data providers holding these IDs should engage with ID5 directly to obtain the necessary decryption keys. For details about ID5, see the ID5 site.
IMPORTANT: The ID5 ID is supported only in Europe and must be in decrypted form.
netID String The user's netID as a 70-character Base64-encoded string. For details about netID, see the netID Developer Zone.
IMPORTANT: This ID is supported only in Europe.
FirstId String The user's First-id, a first-party cookie typically set by publishers in France. For details about First-id, see the First-id site.
IMPORTANT: This ID is supported only in Europe.
UtiqId String The Utiq ID for the user. Data providers holding these IDs should engage with Utiq directly to obtain the necessary decryption keys. For details on Utiq, see the Utiq site.
IMPORTANT: This ID is supported only in Europe and may be uploaded in encrypted or decrypted form.

Versioning

Two versions of the Data API are available. The difference is the response format. For details, see API versions. This documentation includes both versions of the response error information.

API versions

Version 2 of the Data API is available, and includes improvements to the API response. Version 1 is fully supported, but is being deprecated. We recommend upgrading as soon as possible.

To use version 2, see Response (v2).

For details on the version timeline, see Data API version 2 with improved error handling and response format.

The following table compares the two versions.

Comparison aspect Version 1 (default) Version 2 (recommended)
HTTP status codes Inconsistent and sometimes not general (for example, 400 BadRequest instead of 401 Unauthorized for an authentication issue) Two types of improvement:
  • Codes are more specific: For example, 401 Unauthorized for an authentication issue.
  • Improved consistency: Failed lines only appear in 200 OK responses.
Deserialization errors Entire request fails Per-item errors surfaced in FailedLines
FailedLines error codes Compact, undocumented Named codes with full reference
FailedLine properties TDID, DataName, ErrorCode, Message Adds ItemNumber
Response message format for failed requests Plain string JSON with ErrorCode and Message fields
Consistency of error responses for failed requests Varies by endpoint Consistent across endpoints
Requires custom header No Yes: see Using the custom header

Using the custom header

To use version 2, add the following custom header:

For example: TTD-Version: 2

NOTE: The custom header is required only if you want to use a version that is not the default. Valid values for this header are 1 or 2, and if you're using the default version, currently version 1, there is no need to include the extra header.

What you need to know

Here's what you need to know about returned responses for both versions:

IMPORTANT: A 200 OK status code does not indicate complete success. Always check the FailedLines array for line-level errors.

Response (v2)

To use version 2, you'll need to:

The following sections provide details about success and failed responses for version 2, including response format, response examples, and error messaging.

Success response (v2)

If the request is successful, the response has an HTTP status code of 200 OK and includes a FailedLines array with details of any items that were not processed.

Success response example (v2)

The following is an example of a success response with one FailedLines entry:

{
  "FailedLines": [
    {
      "ErrorCode": "ItemDeserializationError",
      "Message": "Item number 2: A deserialization error occurred. Could not find member 'xTDID' on object of type 'AdvertiserDataItem'. Path 'Items[1].xTDID', line 14, position 16.",
      "ItemNumber": "2"
    }
  ]
}

Success response object properties

The following table lists the object properties for a successful response.

Property Data type Description
FailedLines Object Array If all lines are successful, this array is returned empty. Otherwise, it lists any lines that failed, which you can use to troubleshoot errors that occurred in your request. For object properties, see Failed Line object properties (v2).

FailedLine object properties (v2)

The following table lists the FailedLine object properties for version 2 of the Data APIs.

Property Data type Description
TDID GUID The Trade Desk 36-character GUID (including dashes) for this user. Included in the response only if applicable.
DataName String The segment name specified for the ID in the request. Included in the response only if applicable.
ItemNumber String The index of the failed item in the request.
ErrorCode String For details, see FailedLine error codes and messages (v2).
Message String For details, see FailedLine error codes and messages (v2).

FailedLine error codes and messages (v2)

The following table lists the error codes that might be returned from this endpoint in a FailedLine entry in the FailedLines object, with the reason for each error. This information is for version 2 of the Data API.

Error code Reason
BaseBidCPMMetadataTooLong The BaseBidCPMMetadata string on a data element exceeds 36 characters.
MissingUserId No TDID could be resolved from the item's identity fields.
UserNotMapped Provided user id cannot be mapped to a TDID.
InvalidBidFactor Provided BidFactor is invalid.
DataNameTooLong Data Name is too long.
InvalidTtlInMinutes Invalid TtlInMinutes value provided.
InvalidBaseBidCPM Invalid BaseBidCPM value provided.
InvalidDataOwnerId Invalid DataOwnerId value provided.
InvalidParameterFormat A parameter on the item is not of expected format.
TargetingDataCreationLimitExceeded The partner has reached the cap on new targeting data segment creation.
TargetingDataCountLimitExceeded The partner has reached the total targeting data element count cap.
TenantRestrictionsExternalData The partner's tenant policy prohibits pushing data to the current cloud provider.
TargetingDataDisabled Targeting data ingestion has been disabled.
ItemDeserializationError A deserialization error occurred while processing the item.
Unknown Empty data name, ReplaceExistingData requests, or any unidentifiable reason for failure.

Failed response (v2)

If the request fails with no lines processed, a failed response is returned.

Failed response example (v2)

The error response is JSON and includes ErrorCode and Message properties. For example, the following response would return a 403 Forbidden HTTP status code:

{
  "ErrorCode": "TargetingDataLimitReached",
  "Message": "The maximum allowed targeting data elements limit for the specified advertiser/data provider has been reached."
}

Failed response object properties (v2)

The following table lists the object properties for a failed response.

Property Data type Description
ErrorCode String For details, see FailedLine error codes and messages (v2).
Message String For details, see FailedLine error codes and messages (v2).

Failed response error codes and messages (v2)

The following table provides a list of common failed response errors and their respective HTTP status codes.

HTTP status code Error code Reason
400 (Bad Request) UnknownRequest The requested resource could not be recognized.
400 (Bad Request) IncorrectContent A field in the request body contains an invalid value.
400 (Bad Request) MissingData A required field in the request body was absent or empty.
400 (Bad Request) SerializationFailed Request body could not be deserialized - verify the JSON is valid and matches the expected schema.
401 (Unauthorized) AuthenticationFailed The provided credentials could not be authenticated - verify credentials.
401 (Unauthorized) InvalidToken The provided token is invalid - verify token.
403 (Forbidden) IncorrectPermissions The provided credentials lack the required permissions for the specified ID.
403 (Forbidden) AdvertiserMisconfigured The provided AdvertiserId is not configured to send data on the requested resource.
403 (Forbidden) DataProviderMisconfigured The provided DataProviderId is not configured to send data on the requested resource.
403 (Forbidden) MerchantMisconfigured The provided MerchantId is not configured to send data on the requested resource.
403 (Forbidden) TargetingDataLimitReached The maximum allowed targeting data elements limit for the specified advertiser/data provider has been reached.
404 (Not Found) EndpointNotConfigured The requested endpoint is not configured to accept this type of request.
413 (Content Too Large) MaxRequestSizeExceeded Request payload exceeds the maximum allowed size.
429 (Too Many Requests) N/A Rate limit for an API endpoint was exceeded.

IMPORTANT: When the rate limit for an API endpoint is exceeded, the server returns a 429 status code and prevents execution. Your code must be able to handle this type of error. For example, upon receiving a 429 error, wait up to one hour before retrying or reduce request volume to remain within rate limits. See also Rate limits.

Response (v1, legacy)

Version 1 is the default. The following sections provide details about error responses for version 1, including response format and error messaging.

Success response object properties

The following table lists the object properties for a successful response.

Property Data Type Description
FailedLines Object Array If all lines are successful, this array is returned empty. Otherwise, it lists any lines that failed, which you can use to troubleshoot errors that occurred in your request. For object properties, see Failed Line object properties (v1).

FailedLine object properties (v1)

The following table lists the FailedLine object properties for version 1 of the Data APIs.

Property Data type Description
TDID GUID The Trade Desk 36-character GUID (including dashes) for this user.
DataName String The segment name specified for the ID in the request.
ErrorCode String A compact code indicating the nature of the error.
Message String A message providing details of the error.

Failed response error codes and messages (v1)

If the request fails with no lines processed, a failed response is returned. In version 1, the error response is a string. The following table provides a list of common errors and their respective HTTP status codes.

ID Error HTTP status code Error message
1 Request sent without any body (empty) 400 Bad Request "Missing request data."
2 Request sent without TTD signature HEADER attribute 400 Bad Request "Requests must have a TtdSignature header value."
3 Request sent with incorrect TTD signature in HEADER 400 Bad Request "The signature does not match the request body for advertiser: 'abcdefgh'. NOTE: [provider for 3rd party endpoint]."
4 Requested advertiser does not have a secret key 400 Bad Request "This advertiser has not been configured to accept data: ‘abcdefgh'. NOTE: [provider for 3rd party endpoint]."
5 Request sent with an empty 'Items attribute' array 400 Bad Request "Items attribute must be a non-empty list."
6 General processing error (possible invalid values in Items) 400 Bad Request "A deserialization error occurred."
7 Failed to parse TDID, DAID, UID2, RampID, EUID, or failed to decrypt UID2Token or EUIDToken 200 OK "Invalid (ID type)" or "Failed to decrypt (token type)"