CRM data integration (legacy REST API)
NOTE: This guide covers the legacy CRM API. You can still use it to upload email addresses and phone numbers, but we recommend the First-Party Data Uploader. For an overview of all upload options, see ID-based first-party data.
Customer relationship management (CRM) data is first-party data that includes all client information collected and shared across your organization. You can integrate your CRM data to create data segments for audience targeting and conversion measurement.
The following sections list and define the supported ID types and detail the data upload steps.
Supported ID types
The following table lists the ID types supported by the CRM Data REST API, including their regional availability.
NOTE: Email addresses and phone numbers are processed through our CRM Data Onboarding Service and converted to UID2 or EUID for audience targeting and measurement. For examples of normalized or hashed values, see PII normalization, hashing, and encoding.
| ID Type | ID Category | Description |
|---|---|---|
Email |
Direct identifier | Personally identifiable information (PII) sent as an email addresses. |
EmailHashedUnifiedId2 |
Direct identifier | PII sent as normalized, Base64-encoded SHA-256 hash of a normalized email address, ready for conversion to UID2. |
Phone |
Direct identifier (APAC, NAMER) | PII sent as phone numbers. |
PhoneHashed |
Direct identifier (APAC, NAMER) | PII sent as normalized, Base64-encoded SHA-256 hash of a normalized phone number. |
UID2 |
Direct identifier | The raw Unified ID 2.0 value, also known as UID2. This value is case-sensitive. Raw UID2s are generated and managed using UID2 APIs. See also Unified IDs. |
UID2Token |
Direct identifier | 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 |
Direct identifier | 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 |
Direct identifier | The encrypted EUID token, also known as an advertising token. This token is case-sensitive. For details, see Unified IDs. |
IDL |
Anonymous identifier | 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 |
Anonymous identifier (EU) | 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 |
Anonymous identifier (EU) | 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 |
Anonymous identifier (France) | 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. |
TDID |
Anonymous identifier | The Trade Desk 36-character (including dashes) global unique ID (GUID) for this user. |
DAID |
Anonymous identifier | 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). |
NPI |
Direct identifier | The National Provider Identifier (NPI) for a healthcare provider. |
IPv4 |
Anonymous identifier | An IPv4 address. |
Data upload methods
There are several ways of uploading data to The Trade Desk platform. If you're a UID2 participant, you can build segments with the mapped UIDs using The Trade Desk Data API. You can also upload UIDs using the Data API. For details, see Third-party audience data integration. Otherwise, you can use the CRM Data API or the UID Mapping Service and Data API to onboard other types of data. For an overview of all upload options, see also ID-based first-party data.
UID mapping service and Data API vs. CRM Data Platform API
The choice between using UID Mapping Service and Data API or the CRM Data Platform API depends on what types of data you process, and how much maintenance you need.
Here are the following use cases:
- UID Mapping Service for first-party and third-party data integrations.
- Data API for first-party and third-party data integrations onboarding IDs.
- CRM Data Platform API for uploading first-party data with email addresses and phone numbers.
The following diagram shows the differences in steps when choosing the UID Mapping Service and Data API, or the CRM Data Platform API.
NOTE: If you have multiple PII types with an email address or phone number, then you can use the CRM Data API to onboard the data.
The following table compares the two methods for uploading first-party data.
| Comparison Aspect | UID Identity Mapping Service and Data API | CRM Data Platform API |
|---|---|---|
| Create UID2s from email addresses, phone numbers, or their respective hashes | Yes | Yes |
| Retrieve UID-to-DII mapping that can be sent to other services | Yes | No |
| Set time-to-live (TTL) | Yes, per user | Yes, per batch upload |
| Manage and refresh token on behalf of the user | No, each operator must do this on their own. | Yes |
IMPORTANT: For details on authentication, see Foundations.
Using CRM Data Platform API
Here's what you need to know about using the CRM Data Platform API:
- To be able to use the API, be sure to contact your Technical Account Manager for the appropriate permissions.
- The API requires or returns multiple IDs that identify different data. For details on what they are and how to look up their values, see CRM data and segment IDs.
- The API can be used by advertisers and data partners to push data on behalf of the advertiser. If you are an external provider uploading or managing data on behalf of an advertiser, be sure to work with your Technical Account Manager to obtain your data provider ID to complete the
DataProviderIdproperty. - There are two types of segments you can create: targeting and conversion.
- Emails and phone numbers are hashed immediately and the raw data is deleted. Be sure to normalize and hash encode hashed email addresses and phone numbers before uploading your data.
- You must generate a unique, auto-expiring, single-use drop endpoint to upload new or update existing data in a segment. This drop endpoint must be regenerated after each use regardless of success or failure. For details, see CRM data upload tasks.
- There are two ways to update a segment. You can add new data on top of the existing data, or replace it completely by setting the
MergeModeproperty to eitherAddorReplace. You cannot replace data in conversion segments. - Apply conversion tracking tags to campaigns before sending conversions.
Special requirements
If you are an advertiser in the Medical Health industry category, make sure the audience data you upload complies with the following requirements:
- It must not contain data about individuals in Washington or Nevada.
- It must include only the following data:
- Consented data: You have affirmative consent from the individual to use and disclose data about their health for advertising purposes.
- Modeled data: Identifiers are associated with individuals for whom you have no knowledge or evidence suggesting specific health conditions.
CRM data and segment IDs
The following table lists alphabetically the different types of IDs that the CRM Data Platform API requires or returns. It also explains where or how you can look up their values instead of storing them.
| ID Property | Description | Value Origin or Location |
|---|---|---|
AdvertiserId |
Identifies the advertiser that owns a CRM data segment. | This ID is assigned by The Trade Desk platform. You can look it up in the platform UI. |
CrmDataId |
Identifies a CRM data segment for metadata purposes. For example, this ID is used as a path parameter in several CRM Data Platform API. | This ID is returned in the POST /v3/crmdata/{segmentType}/segment response. You can look it up by querying segments for the advertiser. |
DataProviderId |
Identifies the external provider authorized by the advertiser to upload and manage their CRM data. | Include only if you are uploading data as an external provider of advertiser data. |
FirstPartyDataId |
Identifies a CRM data segment for retargeting purposes. You can create data groups, create audiences, and assign audiences to ad groups for targeting. | This ID is returned in the POST /v3/crmdata/{segmentType}/segment response. You can look it up by querying segments for the advertiser or, if you know the CRM data ID, by looking up the specific segment. |
ReferenceId |
Identifies the CRM data uploaded to a segment with a unique, auto-expiring, single-use drop endpoint. This ID is used for checking the data processing status. | This ID is returned in the POST /v3/crmdata/{segmentType}/segment/{advertiserId}/{crmDataId} response along with the drop URL. IMPORTANT: Be sure to save this ID for subsequent status checks. |
CRM data upload tasks
To upload first-party data using the CRM Data Platform API, complete the following steps.
| Step | Task | API Suite | Endpoint | Notes |
|---|---|---|---|---|
| 1 | Create a data segment. | Platform | POST /v3/crmdata/{segmentType}/segment | During this step, you specify the region from which your data originates. Returns the CrmDataId value used subsequently as a path parameter by most CRM data endpoints. |
| 2 | (Required only for conversion segments.) Attach the data segment to a campaign. |
Platform | PUT /v3/campaign | IMPORTANT: You must attach your conversion segment to a campaign through the UI or the Public API, including the GET /v3/trackingtag/{trackingTagId} endpoint. You cannot attribute upload data to a campaign until this is complete. |
| 3 | Generate a unique, auto-expiring, single-use drop endpoint for uploading your CRM data. | Platform | POST /v3/crmdata/{segmentType}/segment/{advertiserId}/{crmDataId} | IMPORTANT: This drop endpoint must be regenerated after each use regardless of success or failure. During this step, you specify the type of PII you will be uploading and your merging preferences. Be sure to note the returned ReferenceId value that is required to check the status of CRM data processing. |
| 4 | Upload your CRM data to the generated drop endpoint. | Data | PUT {dropurl} |
The drop URL auto-expires after an hour. IMPORTANT: You can use the drop URL only one time, even if it is still live or fails. See also FAQs. |
| 5 | Check the status of CRM data processing. | Platform | GET /v3/crmdata/{segmentType}/segment/{advertiserId}/{crmDataId}/{referenceId} | Returns only the drop processing details. Here's what you need to know:
|
| 6 | (Optional) Look up your data segment. For example, to check its status or active IDs. | Platform | GET /v3/crmdata/{segmentType}/segment/{advertiserId}/{crmDataId} | You can also look up all data segments for an advertiser. |
Create a data segment
To create a CRM data segment, in a POST /v3/crmdata/{segmentType}/segment call, specify the following:
The value of the {segmentType} path parameter for the type of segment you want to create: targeting or conversion.
The ID of the advertiser who owns this segment.
A descriptive segment name.
The geographical region from which the data originates or is allowed to be stored.
Here's what you need to know:
- If you are an external provider uploading data on behalf of an advertiser, you must include your data provider ID. If you don't have one, contact your Technical Account Manager.
- If you call this endpoint with the same parameters, new segments will be created with the same name but different
CrmDataIdvalues. - To upload EUIDs, you must set the
Regionproperty value toEU.
IMPORTANT: When you create a segment with the
Regionproperty value set toEU, you may not yet upload phone numbers or hashed phone numbers.
Request example
Here's an example of a POST /v3/crmdata/{segmentType}/segment request to create a segment for targeting or conversion.
{
"AdvertiserId": "abcd1234",
"SegmentName": "CRM Upload 2024-02-03",
"Region": "US",
"DataProviderId": "fghi6789"
}
Response examples
A successful response for targeting returns a first-party data ID, which is used for retargeting, and a CRM data ID for subsequent data upload and update requests.
Here's an example of a POST /v3/crmdata/targeting/segment response:
{
"CrmDataId": "ab1cd3e",
"FirstPartyDataId": 987654
}
Here's an example of a POST /v3/crmdata/conversion/segment response:
{
"CrmDataId": "ab1cd3e"
}
A successful response for conversion returns the CRM data ID for subsequent data upload and update requests.
NOTE: You can save the
CrmDataIdvalue from the response or look it up later as needed. For details, see CRM data and segment IDs.
Generate a data drop endpoint
To create a unique, auto-expiring, single-use drop endpoint for uploading your CRM data, in a POST /v3/crmdata/{segmentType}/segment/{advertiserId}/{crmDataId} request, specify the following:
Path parameters:
- The type of segments you want to upload:
targetingorconversion. - The ID of the advertiser that owns the segment.
- The ID of the CRM data segment to create a file drop for. This ID is returned as
CrmDataIdin the POST /v3/crmdata/{segmentType}/segment response. See also CRM data and segment IDs.
IMPORTANT: To prevent upload errors, make sure the segment ID does not contain trailing spaces. For example, IDs
ab1cd3eandab1cd3e(with a space) are treated as different segments.- The type of segments you want to upload:
Request body properties, such as the PII type, whether you want the data to be added to existing data or replace it, how long the IDs in the segment should remain active, and whether you want the data to be retained and refreshed or just processed and discarded.
NOTE: For segments created from email or phone number identifiers, the maximum TTL is 90 days (
129600minutes). If you submit a request with a TTL greater than 90 days, the request is still accepted, but the TTL is automatically reduced to 90 days.
When uploading different segment types, refer to the following table for details.
| Segment Type | Notes |
|---|---|
| Targeting | Each drop must have a unique PII type. After uploading multiple drops, the segment may include multiple PII types. |
| Conversion | Each drop can include multiple PII types. The PII type declared in the call is ignored. Instead, The Trade Desk uses the PII type from the header in the conversion data upload file. NOTE: You cannot replace data in conversion segments, only add. |
IMPORTANT: Each segment requires a drop URL. On failure, you must generate a new drop URL.
Request examples
Here's an example of a POST /v3/crmdata/targeting/segment/abcd1234/ab1cd3e request for targeting created in the preceding step.
{
"PiiType": "UID2Token",
"MergeMode": "Add",
"DataProviderId": "fghi6789",
"TtlInMinutes": 129600
}
Here's an example of a POST /v3/crmdata/conversion/segment/abcd1234/ab1cd3e request for conversion created in the preceding step.
{
"MergeMode": "Add",
"DataProviderId": "fghi6789"
}
Response example
A successful response returns a signed URL for sending data and a reference ID, which you can use to check the status of the file processing after you send your data.
Here's an example of a POST /v3/crmdata/{segmentType}/segment/{advertiserId}/{crmDataId} response for targeting or conversion:
{
"ReferenceId": "551a141e-5591-4080-8780-94570c1fb2a4",
"Url": "https://thetradedesk-crm-data.s3.us-east-1.amazonaws.com/data/abcd1234/drop/551a141e-5591-4080-8780-94570c1fb2a4/pii?X-Amz-Security-Token=FwoGZXIvYXdzEJf%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FwEaDNtZjtde%2BePSKjZOtiK1AZk6x%2F5iXM%2Fek%2F07E9K5UjUr7eM82CEHgUbDVSJn6oINfyHdCI0IMpk0N16IzQ32M%2Bqoptisl68b7XAe9ssX%2Bon7YZXLxcp632dBIM0y%2Fp%2FDSclqGO0negdXiaCEc0zK7ME9CThTMcQVS1SMphOi2R1uWX8fOFawjttl3lSqhmrlnll51jRkv%2FlJWVYbmXZgBpHkFXodM8Zf6CYJFy1ugaf5YcEn5BeCadTgQD7aJ2eIz47mjtYotcevggYyLd4mb0Hm6bEijGjAu46CzIY%2BBnSH6kvNNOAHhWTYu84mAdyWJWXfumM%2FGfCPEA%3D%3D&X-Amz-Algorithm=AWS4-HMAC-SHA-256&X-Amz-Date=20210312T215709Z&X-Amz-SignedHeaders=host&X-Amz-Expires=3600&X-Amz-Credential=ASIAZJW6VRZMLXSGP772%2F20210312%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Signature=2fa2feddfd7d0fd5e797214444c241edb05741d476ce8c82bf6aa017469df800"
}
IMPORTANT: Save the
UrlandReferenceIdvalues from the response for use in the steps that follow.
Send CRM data to the generated drop endpoint
To send your CRM data, make a PUT {dropUrl} request with the signed URL returned in the POST /v3/crmdata/{segmentType}/segment/{advertiserId}/{crmDataId} response (example).
TIP: For faster processing, we recommend uploading the segment in one drop, rather than splitting it into multiple drops.
Here's what you need to know about sending data:
- The
PUT {dropUrl}endpoint uses plain text as theContent-Typewith theUrlvalue from the drop endpoint response. - The drop URL is self-signed, which means that the
PUTendpoint does not require additional authentication. - The drop URL auto-expires after an hour. You can use it only once, even if it is still live.
- If your upload fails, you must generate a new drop URL to reupload the segments.
- If you have multiple segments to upload, you can send them in parallel.
- The upload file format is determined by the segment type and is not configurable in the REST API. If you need format flexibility, use the First-Party Data Uploader instead.
- Segments for targeting must use the
ValuePerLineformat: one PII value per line with no header row and no comma separator. - Segments for conversion must use the
ConversionCSVformat: a CSV with a header row and required columns. For details, see Conversion headers.
See also FAQs.
Conversion headers
The following table lists the valid headers for conversion data upload files.
| Property Header | Required? | Data Type | Description | Example |
|---|---|---|---|---|
PiiType |
Required | String | The value of a PII type for your PII property. For details, see Supported ID types. |
EmailHashedUnifiedId2 |
PII |
Required | String | The value of the PII. | customer@example.org |
TimestampUtc |
Required | DateTime | A valid timestamp in UTC, using the following ISO 8601 format:
T as the delimiter. For example, yyyy-MM-ddTHH:mm:ss is also accepted.The value must not be set to a future time. |
2024-07-09T15:30:45.123Z |
Value |
Optional | Decimal | The monetary value of this conversion as a decimal. | 19.98 |
ValueCurrency |
Optional | String | The currency of the Value field amount. |
USD |
Country |
Optional | String | The full name of the country where the conversion occurred. | United States |
Region |
Conditionally required | String | Required if the Country field is set to United States. The full name or code of the region where the conversion occurred. |
NY, New York |
NielsenDMA* |
Optional | Integer | The numerical metropolitan area geotargeting code where the conversion occurred. | 501 |
City |
Optional | String | The city where the conversion occurred. | US NYC |
PostalCode |
Optional | String | The postal or ZIP code where the conversion occurred. | 10004 |
OrderId |
Optional | String | The unique identifier for a transaction or conversion event, with a maximum length of 64 characters. | abc123XyZ |
item_brand |
Optional | String | The brand name of the item. | Cookie Brand Name |
ClientIPAddress |
Optional | String | The client's IP address associated with the conversion event. | 198.51.100.7 |
ReferrerUrl |
Optional | String | The URL of the web page associated with the conversion event. | https://www.example.com/ |
TD1-TD10 |
Optional | String(150) | Ten sequentially numbered custom dynamic properties that can be used to provide additional conversion metadata. | N/A |
privacy_type |
Conditionally required | String | Specifies the applicable privacy regulation based on the user's geographical location:
|
GDPR |
is_applicable |
Conditionally required | Boolean | Indicates if the value specified in the privacy_type property is applicable. IMPORTANT: Must always be set to true if the privacy_type property is populated. |
true or 1 |
consent_string |
Conditionally required | String | The user's consent when the privacy regulations are in effect. The format depends on the privacy_type property value:
|
N/A |
* © 2026, The Nielsen Company (US), LLC. The DMA® data is used pursuant to a license from The Nielsen Company (US), LLC. Any use and/or reproduction of these materials without the express written consent of The Nielsen Company (US), LLC, is strictly prohibited. DMA® data is valid for the period 2025 - 2026. DMA® is a registered service mark of The Nielsen Company (US), LLC and is used pursuant to license.
Request examples
Here's an example of a PUT {dropUrl} request for targeting or conversion:
curl -X PUT "https://thetradedesk-crm-data.s3.us-east-1.amazonaws.com/data/advt1234/drop/551a141e-5591-4080-8780-94570c1fb2a4/pii?X-Amz-Security-Token=FwoGZXIvYXdzEJf%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FwEaDNtZjtde%2BePSKjZOtiK1AZk6x%2F5iXM%2Fek%2F07E9K5UjUr7eM82CEHgUbDVSJn6oINfyHdCI0IMpk0N16IzQ32M%2Bqoptisl68b7XAe9ssX%2Bon7YZXLxcp632dBIM0y%2Fp%2FDSclqGO0negdXiaCEc0zK7ME9CThTMcQVS1SMphOi2R1uWX8fOFawjttl3lSqhmrlnll51jRkv%2FlJWVYbmXZgBpHkFXodM8Zf6CYJFy1ugaf5YcEn5BeCadTgQD7aJ2eIz47mjtYotcevggYyLd4mb0Hm6bEijGjAu46CzIY%2BBnSH6kvNNOAHhWTYu84mAdyWJWXfumM%2FGfCPEA%3D%3D&X-Amz-Algorithm=AWS4-HMAC-SHA-256&X-Amz-Date=20210312T215709Z&X-Amz-SignedHeaders=host&X-Amz-Expires=3600&X-Amz-Credential=ASIAZJW6VRZMLXSGP772%2F20210312%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Signature=2fa2feddfd7d0fd5e797214444c241edb05741d476ce8c82bf6aa017469df800" -T 'sample.csv'
Response
A successful response returns a 200 (OK) status code with an empty body, which indicates that your data was successfully uploaded to the AWS S3 bucket.
IMPORTANT: Always validate your CRM data upload status. A successful upload to AWS does not indicate the data has been processed. There are other factors that can result in failure, such as data format errors.
Check CRM data drop processing status
To check the processing status of the CRM data that you have sent to the drop URL, in a GET /v3/crmdata/{segmentType}/segment/{advertiserId}/{crmDataId}/{referenceId} request, include the following path parameters:
- The ID of the advertiser that owns the segment.
- The ID of the CRM data segment to create a file drop for. This ID is returned as
CrmDataIdin the POST /v3/crmdata/{segmentType}/segment response. See also CRM data and segment IDs. - The reference ID of the drop URL. This ID is returned as
ReferenceIdin the drop endpoint POST /v3/crmdata/{segmentType}/segment/{advertiserId}/{crmDataId} response.
Here's an endpoint example with the path parameter values from the preceding examples: GET /v3/crmdata/targeting/abcd1234/ab1cd3e/551a141e-5591-4080-8780-94570c1fb2a4
Response
A successful response returns a DropInfo object with the drop processing details.
Here's what you need to know about the response:
- When an
IngestedAtproperty timestamp is returned, it means the data has been verified. - You can confirm this by viewing the segment in the CRM Data tab of the Advertiser Data (One) tile in the platform UI. The data should be available within 24 hours of a successful response.
Here's an example of a GET /v3/crmdata/{segmentType}/segment/{advertiserId}/{crmDataId}/{referenceId} response with the PiiTypes array listing all PII types declared on the drop.
{
"DropInfo":{
"PiiTypes":["Email"],
"TtlInMinutes":129600,
"MergeMode":"Add",
"RetentionEnabled":true,
"RetentionRemainingInDays":90,
"State":"Created",
"CreatedAt":"2024-02-10T20:30:35.2744645+00:00",
"PiiUploadedAt":"2024-02-10T20:30:35.2744645+00:00",
"ProcessingAt":"2024-02-10T20:30:35.2744645+00:00",
"IngestedAt": "2024-02-10T20:30:35.2744645+00:00",
"SucceededAt":"2024-02-10T20:30:35.2744645+00:00",
"CancelledAt":null,
"Statistics":{},
"FailedAt":null,
"FailureMessage":null,
"ReceiptFileUrl":"https://thetradedesk-crm-data.s3.us-east-1.amazonaws.com/data/advt1234/drop/551a141e-5591-4080-8780-94570c1fb2a4/pii?X-Amz-Security-Token=FwoGZXIvYXdzEJf%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FwEaDNtZjtde%2BePSKjZOtiK1AZk6x%2F5iXM%2Fek%2F07E9K5UjUr7eM82CEHgUbDVSJn6oINfyHdCI0IMpk0N16IzQ32M%2Bqoptisl68b7XAe9ssX%2Bon7YZXLxcp632dBIM0y%2Fp%2FDSclqGO0negdXiaCEc0zK7ME9CThTMcQVS1SMphOi2R1uWX8fOFawjttl3lSqhmrlnll51jRkv%2FlJWVYbmXZgBpHkFXodM8Zf6CYJFy1ugaf5YcEn5BeCadTgQD7aJ2eIz47mjtYotcevggYyLd4mb0Hm6bEijGjAu46CzIY%2BBnSH6kvNNOAHhWTYu84mAdyWJWXfumM%2FGfCPEA%3D%3D&X-Amz-Algorithm=AWS4-HMAC-SHA-256&X-Amz-Date=20210312T215709Z&X-Amz-SignedHeaders=host&X-Amz-Expires=3600&X-Amz-Credential=ASIAZJW6VRZMLXSGP772%2F20210312%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Signature=2fa2feddfd7d0fd5e797214444c241edb05741d476ce8c82bf6aa017469df800"
}
}
TIP: If you get a value of
failedin theFailedAtproperty, or theIngestedAtvalue does not contain a timestamp, you should create a new drop URL to reupload the segment.
CRM data management tasks
After you successfully upload your CRM data, you can manage it by looking up your segments and updating them as needed. Here's what you need to know about updating segments and their data:
- Updates to a segment can include removing inactive users, adding new data on top of existing data, or replacing existing data.
- To update a segment, you must generate a unique, auto-expiring, single-use drop endpoint with the advertiser ID and CRM data ID of the segment that you want to update.
- If your update fails, you must generate a new drop endpoint.
- To replace data from a segment, update the data and be sure to set the
MergeModeproperty value toReplace.
The following table lists the relevant endpoints for each management task.
| Task | API Suite | Endpoint | Notes |
|---|---|---|---|
| Look up a data segment created for an advertiser. | Platform | GET /v3/crmdata/{segmentType}/segment/{advertiserId}/{crmDataId} | None. |
| Look up all data segments created for an advertiser. | Platform | GET /v3/crmdata/segment/{advertiserId}?paging token={pagingToken} | This enables you to retrieve a list of all segments uploaded so far and look up their names, CRM data IDs, and first-party data IDs instead of storing them. |
| Update your CRM data. | Platform and Data | POST /v3/crmdata/{segmentType}/segment/{advertiserId}/{crmDataId}PUT {dropurl} |
None. |
| Remove inactive users from a data segment. | Platform and Data | POST /v3/crmdata/{segmentType}/segment/{advertiserId}/{crmDataId}PUT {dropurl} |
None. |
| Delete a data segment. | Platform | DELETE /v3/crmdata/segment/{advertiserId}/{crmDataId} | None. |
The following sections provides examples of common querying and update tasks that you may need to perform when managing your CRM data.
Look up a data segment
To look up a CRM data segment, in a GET /v3/crmdata/{segmentType}/segment/{advertiserId}/{crmDataId} request, specify the following path parameters:
- The ID of the advertiser that owns the segment.
- The ID of the CRM data segment. This ID is returned as
CrmDataIdin the POST /v3/crmdata/{segmentType}/segment response. See also CRM data and segment IDs.
Here's an endpoint example with the path parameter values from the preceding examples: GET /v3/crmdata/targeting/advt1234/vq8rq3w
To look up the processing status of the CRM data drop, see Check CRM data drop processing status.
Response
A successful response returns the name, CRM data ID, first-party data ID, including the latest drop status, and other details for the specified CRM data segment. Here's an example of a GET /v3/crmdata/targeting/{advertiserId}/{crmDataId} response:
{
"AdvertiserId": "advt1234",
"CrmDataId": "vq8rq3w",
"SegmentName": "CRM Upload 2024-02-03",
"FirstPartyDataId": 987654,
"ActiveIds": 0,
"ReceivedIds": 0,
"LastUpdatedAt": "2024-02-25T01:31:57.5250855+00:00",
"Region": "TX",
"LatestActivatedDrop":{
"PiiType":"Email",
"TtlInMinutes":129600,
"MergeMode":"Add",
"RetentionEnabled":true,
"RetentionRemainingInDays":90,
"State":"Created",
"CreatedAt":"2024-02-10T20:30:35.2744645+00:00",
"PiiUploadedAt":"2024-02-10T20:30:35.2744645+00:00",
"ProcessingAt":"2024-02-10T20:30:35.2744645+00:00",
"IngestedAt": "2024-02-10T20:30:35.2744645+00:00",
"SucceededAt":"2024-02-10T20:30:35.2744645+00:00",
"CancelledAt":null,
"Statistics":{},
"FailedAt":null,
"FailureMessage":null,
"ReceiptFileUrl":"https://thetradedesk-crm-data.s3.us-east-1.amazonaws.com/data/advt1234/drop/551a141e-5591-4080-8780-94570c1fb2a4/pii?X-Amz-Security-Token=FwoGZXIvYXdzEJf%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FwEaDNtZjtde%2BePSKjZOtiK1AZk6x%2F5iXM%2Fek%2F07E9K5UjUr7eM82CEHgUbDVSJn6oINfyHdCI0IMpk0N16IzQ32M%2Bqoptisl68b7XAe9ssX%2Bon7YZXLxcp632dBIM0y%2Fp%2FDSclqGO0negdXiaCEc0zK7ME9CThTMcQVS1SMphOi2R1uWX8fOFawjttl3lSqhmrlnll51jRkv%2FlJWVYbmXZgBpHkFXodM8Zf6CYJFy1ugaf5YcEn5BeCadTgQD7aJ2eIz47mjtYotcevggYyLd4mb0Hm6bEijGjAu46CzIY%2BBnSH6kvNNOAHhWTYu84mAdyWJWXfumM%2FGfCPEA%3D%3D&X-Amz-Algorithm=AWS4-HMAC-SHA-256&X-Amz-Date=20210312T215709Z&X-Amz-SignedHeaders=host&X-Amz-Expires=3600&X-Amz-Credential=ASIAZJW6VRZMLXSGP772%2F20210312%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Signature=2fa2feddfd7d0fd5e797214444c241edb05741d476ce8c82bf6aa017469df800"
}
}
Look up all data segments for an advertiser
To look up multiple CRM data segments for an advertiser, in a GET /v3/crmdata/segment/{advertiserId}?paging token={pagingToken} request, specify the following:
- The ID of the advertiser that owns the segment as the path parameter.
- A
pagingTokenquery parameter for search results pagination. A paging token is a string returned in a previous call to the same endpoint. You must pass it in subsequent calls to get the next set of results.
IMPORTANT: The paging token is not required for the very first call.
Here are two endpoint examples with the path parameter value from the preceding examples:
GET /v3/crmdata/segment/advt1234(the very first call with no paging token)GET /v3/crmdata/segment/advt1234?pagingToken=YWs0OGZqdw(a subsequent call with the required paging token)
To look up a specific CRM data segment, see Look up a data segment.
Response
A successful response returns a list of segments with the name, CRM data ID, first-party data ID, and the data region for each CRM data segment as well as the paging token for the next set of results. For each ID usage and description, see CRM data and segment IDs.
Here's an example of a GET /v3/crmdata/segment/{advertiserId}?paging token={pagingToken} response:
{
"Segments": [
{
"CrmDataId": "vq8rq3w",
"SegmentName": "CRM Upload 2024-02-03",
"Region": "TX",
"FirstPartyDataId": 987654,
}
],
"PagingToken": "YWs0OGZqdw"
}
Update CRM data in a segment
To update your segments, complete the following steps:
- Generate a unique, auto-expiring, single-use drop endpoint with the advertiser ID and CRM data ID of the segment that you want to update.
- Upload the list of current users in the segment, along with any additional users you want to add, to the generated drop endpoint.
NOTE: Data segments for conversion do not support the
Replacevalue inMergeMode. You can only useAddwhich is set by default.
Request
Here's an example of a POST /v3/crmdata/targeting/segment/{advertiserId}/{crmDataId} request where the existing data is replaced with new data:
{
"PiiType": "PhoneHashedUnifiedId2",
"Region": "TX",
"MergeMode": "Replace",
"TtlInMinutes": 129600
}
Remove inactive users from a segment
To remove inactive users from your data segment, complete the following steps:
- Generate a unique, auto-expiring, single-use drop endpoint with the advertiser ID and CRM data ID of the segment that you want to update and set the
TtlInMinutesvalue to0to expire inactive users. - Upload a list of inactive users to be removed from the segment to the generated drop endpoint.
NOTE: You cannot remove users from conversion segments because those users contribute to measurement.
Request
Here's an example of a POST /v3/crmdata/targeting/segment/{advertiserId}/{crmDataId} request with the TTL set to 0:
{
"PiiType": "Email",
"Region": "TX",
"MergeMode": "Add",
"TtlInMinutes": 0
}
Delete a data segment
To delete a CRM data segment, in a DELETE /v3/crmdata/segment/{advertiserId}/{crmDataId} request, specify the following path parameters:
- The ID of the advertiser that owns the segment.
- The ID of the CRM data segment you want to delete. This ID is returned as
CrmDataIdin the POST /v3/crmdata/{segmentType}/segment response. See also CRM data and segment IDs.
For example, a request with the path parameter values from the preceding examples would be DELETE /v3/crmdata/segment/advt1234/vq8rq3w.
FAQs
The following are most commonly asked questions about managing CRM data.
How soon does the drop URL expire?
Drop URLs expire within one hour after the link is generated, regardless of whether the operation was a success or failure. If you attempt to re-upload data using the same URL, the upload attempt will be logged but the data will be ignored.
How many times can I use the same URL to upload email addresses, if the URL is still live?
Only once. The URL points to a particular drop (or file path in S3), which is processed only once. If you re-upload and overwrite your previously uploaded file while the URL is valid, the data will not be processed.
What's the recommended rate of generating drop URLs for the same segment?
There are no restrictions. However, if you have multiple segments to upload, you can send them in parallel.
How many concurrent uploads can I do? If I have 60 drop URLs, can I use all 60 at the same time?
There are no restrictions. However, the ingestion time depends on the number of drops, rather than drop size. If you split the segment into many drops, the ingestion might take much longer.
What is the maximum payload size for uploading data?
There is no strict drop size limit. However, we strongly recommend larger uploads rather than splitting your data into many small drops.
Here's what you need to know and do:
- Processing time depends on the number of drops, not the drop size.
- For best performance, upload the segment in as few drops as possible—ideally one large drop. For example, a single 50-million‑record file is preferred over 10 files of 5 million each or 100 files of 500,000 each.
- Submitting many small drops can significantly slow ingestion and may result in HTTP 429 (Too Many Requests) errors.
TIP: To ensure fast, reliable ingestion (typically under an hour), upload a segment in one drop containing up to 500 million records.
Can I create a single data segment for both audience targeting and conversion measurement?
No. You cannot create a single data segment that does both conversion measurement and audience targeting.
What's the difference between the First-Party Uploader and legacy CRM API?
The First-Party Data Uploader is the newer, expanded solution. It supports all ID types, uses GraphQL, and can ingest anonymous IDs without requiring a signed UID agreement.
The CRM Data API is a legacy REST-based method primarily designed for uploading directly identifiable data (such as email addresses and phone numbers). It supports TDIDs only in certain cases and typically requires a signed UID agreement for sending them.
In short, the First-Party Data Uploader is more flexible and is the recommended option for new integrations.