Authenticate to The Trade Desk Platform API at api.thetradedesk.com/v3 by exchanging partner credentials for a bearer token via the authentication endpoint
POST to the /data/segment endpoint to create a new first-party data segment, specifying the partner ID, segment name, description, TTL (time-to-live in days), and optional CPM data rate
Receive the segment ID from the response and use it to construct the pixel-based or server-to-server (S2S) URL that fires when a user qualifies for the segment
For server-to-server population, batch-upload user identifiers (UID2 tokens, hashed emails, or TDID cookies) to the bulk upload endpoint using the segment ID, encoding the payload per the TTD data format specification
Verify segment population by querying the /data/segment/{segmentId} endpoint and checking the estimated user count after a 24-hour propagation window
Target the segment in a campaign by referencing the segment ID in the FirstPartyData targeting block of an AdGroup via the /adgroup endpoint
Known gotchas
The Trade Desk is migrating identity infrastructure to UID2; segments populated with raw TDID cookies will have lower match rates as cookie deprecation progresses, whereas UID2-based uploads are preferred
Segment TTL is set at creation and cannot be updated retroactively; user records expire silently after the TTL passes, causing audience shrinkage that looks like delivery issues
Bulk upload files must be gzip-compressed and adhere strictly to the pipe-delimited or protobuf format specification; malformed rows are silently dropped rather than raising an error
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp