Making Data API calls

To upload data to The Trade Desk platform using the Data API, authenticate each request with an API token and choose a data center.

NOTE: Token authentication is the standard method for all Data API calls. If your account currently authenticates with secret keys, update your integration to use tokens instead.

To call a Data API endpoint, you need the following:

API credentials from your Account Manager.
An API token, generated and placed in the header of your request.

To generate a token, follow the Create an API token instructions.

Create an API token

You can create tokens with a lifetime range of one week to one year using the OpenTTD access management app.

To generate an API token, complete the following steps:

  1. Log in with your The Trade Desk account credentials.
  2. Navigate directly to the OpenTTD Access Management app.
  3. Click Generate Token / Key. The Generate API Token dialog appears.
  4. Enter a descriptive name for your token. For example, include the tool name for which it will be used or any other details that will help you distinguish between multiple tokens later.
  5. In the Application field, select Platform API.
  6. Select the token lifetime based on your key rotation strategy and integration needs.
  7. Click Save. A confirmation message appears with an API token.
  8. Copy the displayed API token, save it to your secrets management system for future reference, and then close the message.
  9. Include the token as the TTD-Auth value in the headers of all API calls that use tokens, for instance, as shown in the following example.
Content-Type: application/json
TTD-Auth: IBqLpJBhK/UnugaMLo56tUittjoBsjG1KCZ0FxxkIoY=

IMPORTANT: Save your API token in your secrets management system, you cannot retrieve or regenerate the same token. If you lose it, you must create a new token.

To change the lifetime of a token or otherwise update it, you need to revoke it, generate a new token, and then replace the tokens in your integration. For details, see Platform authentication.

For details on specific workflows, see Getting started with data integrations and Data integration, ID deletion and opt-out.

Data centers

NOTE: Privacy-related restrictions may apply to certain locations and types of data.

The following table lists the URLs and locations of the third-party data servers to which you can upload your data:

Location Base URL Notes
Global https://bulk-data.adsrvr.org This location is actually on the US East Coast, but we replicate to other data centers globally.
China https://data-cn2.adsrvr.cn This location is specifically for data providers whose data originates from China. This location will not replicate to locations outside of China.

Here's what you need to know about uploading data:

Signature header authentication for commerce data (legacy)

NOTE: To authenticate to the Data API, you must use token authentication. Secret keys and signature headers are legacy authentication methods.

The Data API use signature headers for authentication. To avoid errors, each request must include the following:

The following is an example of a Postman pre-request script that calculates the value of the TtdSignature header sent in the request:

//hmac : TtdSignature
postman.clearGlobalVariable("hmac");
var secretKey = "DATA_PROVIDER_SECRET_KEY_PLACEHOLDER";
var sha1 = CryptoJS.HmacSHA1(request.data, secretKey);
var base = CryptoJS.enc.Base64.stringify(sha1);
postman.setGlobalVariable("hmac", base);

FAQs

The following is the most commonly asked questions about using the Data API.

Where can I find my secret key?

You must contact your Technical Account Manager. See also Secret keys.

How do I troubleshoot my signature header authentication?

When you send requests using the signature header, validation applies to check your header type with the value. If your API call fails with a signature header authentication response, check the documentation for the Data API endpoint you're using. There is a table of error information for each endpoint.

How do I authenticate for uploading real-time conversion event data?

The POST /track/realtimeconversion endpoint does not require authentication.