### Bulk Create Campaigns API Source: https://context7.com/context7/ttd-workflows_apidocumentation_reference/llms.txt Creates multiple campaigns in a single asynchronous job, streamlining bulk campaign setup. ```APIDOC ## POST /workflows/standardjob/campaign/bulk ### Description Creates multiple campaigns in a single asynchronous job. ### Method POST ### Endpoint `https://ext-api.sb.thetradedesk.com/workflows/standardjob/campaign/bulk` ### Parameters #### Request Body - **advertiserId** (string) - Required - The ID of the advertiser. - **campaigns** (array) - Required - A list of campaign objects to create. - **primaryInput** (object) - Required - The primary input for each campaign. - **name** (string) - Required - The name of the campaign. - **budget** (object) - Required - The budget for the campaign. - **allocationType** (string) - Required - The budget allocation type. - **budgetInAdvertiserCurrency** (number) - Required - The budget amount. - **startDate** (string) - Required - The start date of the campaign. - **endDate** (string) - Required - The end date of the campaign. ``` -------------------------------- ### Get Campaign Version History using cURL Source: https://context7.com/context7/ttd-workflows_apidocumentation_reference/llms.txt Retrieves the version history for a specific campaign, showing changes made over time. This GET request requires the campaign ID. The response lists each version with its timestamp, modifier, and a summary of changes. ```bash curl -X GET https://ext-api.sb.thetradedesk.com/workflows/campaign/cmp-q4-launch-2024/version \ -H "TTD-Auth: YOUR_AUTH_TOKEN" # Response { "campaignId": "cmp-q4-launch-2024", "versions": [ { "version": 1, "timestamp": "2024-10-01T12:00:00Z", "modifiedBy": "user@example.com", "changes": ["Created campaign"] }, { "version": 2, "timestamp": "2024-10-11T14:30:00Z", "modifiedBy": "user@example.com", "changes": ["Updated budget", "Extended end date"] } ] } ``` -------------------------------- ### Execute Generic REST Request using cURL Source: https://context7.com/context7/ttd-workflows_apidocumentation_reference/llms.txt Proxies a generic REST API request through the workflows service. This allows you to make various HTTP requests (e.g., GET, POST) to different endpoints, specifying the method, endpoint path, and query parameters. ```bash curl -X POST https://ext-api.sb.thetradedesk.com/workflows/restrequest \ -H "TTD-Auth: YOUR_AUTH_TOKEN" \ -H "Content-Type: application/json" \ -d '{ \ "method": "GET", \ "endpoint": "/v3/advertiser", \ "queryParameters": { \ "PageSize": "100", \ "PageStartIndex": "0" \ } \ }' # Response { "statusCode": 200, "data": { "advertisers": [ { "advertiserId": "adv-001", "name": "Acme Corporation", "status": "Active" } ], "totalRecords": 1 } } ``` -------------------------------- ### Get Campaign Version History API Source: https://context7.com/context7/ttd-workflows_apidocumentation_reference/llms.txt Retrieves the version history for a specific campaign, tracking changes over time. ```APIDOC ## GET /workflows/campaign/{campaignId}/version ### Description Retrieves version history for a campaign to track changes over time. ### Method GET ### Endpoint `https://ext-api.sb.thetradedesk.com/workflows/campaign/{campaignId}/version` ### Parameters #### Path Parameters - **campaignId** (string) - Required - The ID of the campaign whose version history is to be retrieved. ``` -------------------------------- ### Get GraphQL Bulk Job Status Source: https://context7.com/context7/ttd-workflows_apidocumentation_reference/llms.txt Checks the status of a GraphQL bulk query job. ```APIDOC ## GET /workflows/graphqlbulkjob/{jobId} ### Description Checks the status of a GraphQL bulk query job. ### Method GET ### Endpoint `https://ext-api.sb.thetradedesk.com/workflows/graphqlbulkjob/job-graphql-bulk-xyz123` ### Parameters #### Path Parameters - **jobId** (string) - Required - The ID of the GraphQL bulk job. ### Request Example ```bash curl -X GET https://ext-api.sb.thetradedesk.com/workflows/graphqlbulkjob/job-graphql-bulk-xyz123 \ -H "TTD-Auth: YOUR_AUTH_TOKEN" ``` ### Response #### Success Response (200) - **jobId** (string) - The ID of the job. - **status** (string) - The current status of the job (e.g., "Completed", "Processing", "Failed"). - **queriesExecuted** (integer) - The number of GraphQL queries executed. - **queriesFailed** (integer) - The number of GraphQL queries that failed. - **resultUrl** (string) - A URL to the results of the GraphQL bulk job. - **expiresAt** (string) - The expiration timestamp for the result URL. #### Response Example ```json { "jobId": "job-graphql-bulk-xyz123", "status": "Completed", "queriesExecuted": 3, "queriesFailed": 0, "resultUrl": "https://ttd-results.s3.amazonaws.com/job-graphql-bulk-xyz123.json", "expiresAt": "2024-10-18T15:20:00Z" } ``` ``` -------------------------------- ### Get GraphQL Bulk Job Status - Bash Source: https://context7.com/context7/ttd-workflows_apidocumentation_reference/llms.txt Retrieves the status of a GraphQL bulk query job. Authentication is required via a TTD-Auth token. The response details the job ID, status, query counts, result URL, and expiration time. ```bash curl -X GET https://ext-api.sb.thetradedesk.com/workflows/graphqlbulkjob/job-graphql-bulk-xyz123 \ -H "TTD-Auth: YOUR_AUTH_TOKEN" # Response { "jobId": "job-graphql-bulk-xyz123", "status": "Completed", "queriesExecuted": 3, "queriesFailed": 0, "resultUrl": "https://ttd-results.s3.amazonaws.com/job-graphql-bulk-xyz123.json", "expiresAt": "2024-10-18T15:20:00Z" } ``` -------------------------------- ### Get Standard Job Status - Bash Source: https://context7.com/context7/ttd-workflows_apidocumentation_reference/llms.txt Checks the status of a standard workflow job, such as bulk operations or data uploads. Requires a TTD-Auth token for authentication. The response includes job details, status, timing, and item counts with any errors. ```bash curl -X GET https://ext-api.sb.thetradedesk.com/workflows/standardjob/job-bulk-adgroup-xyz789/status \ -H "TTD-Auth: YOUR_AUTH_TOKEN" # Response { "jobId": "job-bulk-adgroup-xyz789", "status": "Completed", "startTime": "2024-10-11T14:00:00Z", "completionTime": "2024-10-11T14:15:23Z", "totalItems": 150, "successfulItems": 148, "failedItems": 2, "errors": [ { "itemIndex": 47, "errorMessage": "Invalid creative ID: crv-missing-001" }, { "itemIndex": 103, "errorMessage": "Budget exceeds campaign limit" } ] } ``` -------------------------------- ### Validate Requests Without Execution - Bash Source: https://context7.com/context7/ttd-workflows_apidocumentation_reference/llms.txt Illustrates using the `validateInputOnly: true` flag to validate API requests without executing them, which is useful for error checking. The example shows a request to create an ad group with an invalid budget, resulting in validation errors. ```bash curl -X POST https://ext-api.sb.thetradedesk.com/workflows/adgroup \ -H "TTD-Auth: YOUR_AUTH_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "campaignId": "cmp-test-001", "primaryInput": { "name": "Test Ad Group", "budget": { "allocationType": "Minimum", "budgetInAdvertiserCurrency": -1000 } }, "validateInputOnly": true }' # Response { "status": "ValidationFailed", "validationErrors": [ { "field": "primaryInput.budget.budgetInAdvertiserCurrency", "message": "Budget must be a positive value" } ] } ``` -------------------------------- ### Java SDK Request for TTD Workflows Source: https://ttd-workflows.apidocumentation.com/reference/index Demonstrates how to make an API request using the Java SDK for TTD workflows. This involves setting up the request with specific parameters and handling the response. The code snippet appears to be related to cookie and header retrieval. ```java // Placeholder for actual Java SDK code // The provided text only indicates 'Java (SDK) Response AllCookiesHeadersBody' // Actual implementation would involve SDK client instantiation, request building, and execution. ``` -------------------------------- ### Create Campaign API Source: https://context7.com/context7/ttd-workflows_apidocumentation_reference/llms.txt Creates a new advertising campaign with specified budget, flight dates, and targeting configuration. ```APIDOC ## POST /workflows/campaign ### Description Creates a new advertising campaign with budget, flight dates, and targeting configuration. ### Method POST ### Endpoint `https://ext-api.sb.thetradedesk.com/workflows/campaign` ### Parameters #### Request Body - **advertiserId** (string) - Required - The ID of the advertiser. - **primaryInput** (object) - Required - The primary input for campaign creation. - **name** (string) - Required - The name of the campaign. - **description** (string) - Optional - A description for the campaign. - **budget** (object) - Required - The budget for the campaign. - **allocationType** (string) - Required - The budget allocation type (e.g., "Total"). - **budgetInAdvertiserCurrency** (number) - Required - The total budget in the advertiser's currency. - **startDate** (string) - Required - The start date of the campaign in ISO 8601 format. - **endDate** (string) - Required - The end date of the campaign in ISO 8601 format. - **campaignGoal** (string) - Required - The primary goal of the campaign (e.g., "Conversions"). - **flights** (array) - Optional - A list of flight configurations. - **name** (string) - Required - The name of the flight. - **startDate** (string) - Required - The start date of the flight. - **endDate** (string) - Required - The end date of the flight. - **budgetInAdvertiserCurrency** (number) - Required - The budget for this flight. - **validateInputOnly** (boolean) - Optional - If true, only validates the input without creating the campaign. ``` -------------------------------- ### Get Standard Job Status Source: https://context7.com/context7/ttd-workflows_apidocumentation_reference/llms.txt Checks the status of a standard workflow job, such as bulk operations and data uploads. ```APIDOC ## GET /workflows/standardjob/{jobId}/status ### Description Checks the status of a standard workflow job (bulk operations, data uploads). ### Method GET ### Endpoint `https://ext-api.sb.thetradedesk.com/workflows/standardjob/job-bulk-adgroup-xyz789/status` ### Parameters #### Path Parameters - **jobId** (string) - Required - The ID of the job to check. ### Request Example ```bash curl -X GET https://ext-api.sb.thetradedesk.com/workflows/standardjob/job-bulk-adgroup-xyz789/status \ -H "TTD-Auth: YOUR_AUTH_TOKEN" ``` ### Response #### Success Response (200) - **jobId** (string) - The ID of the job. - **status** (string) - The current status of the job (e.g., "Completed", "Processing", "Failed"). - **startTime** (string) - The timestamp when the job started. - **completionTime** (string) - The timestamp when the job completed. - **totalItems** (integer) - The total number of items processed. - **successfulItems** (integer) - The number of items processed successfully. - **failedItems** (integer) - The number of items that failed processing. - **errors** (array) - A list of errors encountered during job execution. - **itemIndex** (integer) - The index of the item that failed. - **errorMessage** (string) - The error message for the failed item. #### Response Example ```json { "jobId": "job-bulk-adgroup-xyz789", "status": "Completed", "startTime": "2024-10-11T14:00:00Z", "completionTime": "2024-10-11T14:15:23Z", "totalItems": 150, "successfulItems": 148, "failedItems": 2, "errors": [ { "itemIndex": 47, "errorMessage": "Invalid creative ID: crv-missing-001" }, { "itemIndex": 103, "errorMessage": "Budget exceeds campaign limit" } ] } ``` ``` -------------------------------- ### POST /workflows/graphqlbulkqueryjob Source: https://context7.com/context7/ttd-workflows_apidocumentation_reference/llms.txt Submits multiple GraphQL queries in a bulk job for asynchronous processing. Results are typically retrieved via a callback URL. ```APIDOC ## POST /workflows/graphqlbulkqueryjob ### Description Submits multiple GraphQL queries in a bulk job for asynchronous processing. Results are typically retrieved via a callback URL. ### Method POST ### Endpoint /workflows/graphqlbulkqueryjob ### Parameters #### Request Body - **queries** (array) - Required - A list of GraphQL queries to execute. - **queryId** (string) - Required - An identifier for the query. - **query** (string) - Required - The GraphQL query string. - **outputFormat** (string) - Required - The desired format for the output (e.g., "JSON"). - **callbackUrl** (string) - Optional - The URL to send results to upon completion. ### Request Example ```json { "queries": [ { "queryId": "q1", "query": "query { advertiser(id: \"adv-001\") { name totalSpend } }" }, { "queryId": "q2", "query": "query { campaigns(advertiserId: \"adv-001\") { id name status } }" }, { "queryId": "q3", "query": "query { adGroups(campaignId: \"cmp-001\") { id name isEnabled } }" } ], "outputFormat": "JSON", "callbackUrl": "https://your-server.com/webhook/graphql-results" } ``` ### Response #### Success Response (200) - **jobId** (string) - The ID of the asynchronous job. - **status** (string) - The status of the job (e.g., "Processing"). - **queriesCount** (integer) - The total number of queries submitted. - **estimatedCompletionTime** (string) - The estimated time for completion. #### Response Example ```json { "jobId": "job-graphql-bulk-xyz123", "status": "Processing", "queriesCount": 3, "estimatedCompletionTime": "2024-10-11T15:20:00Z" } ``` ``` -------------------------------- ### Create Campaign using cURL Source: https://context7.com/context7/ttd-workflows_apidocumentation_reference/llms.txt Creates a new advertising campaign with specified budget, flight dates, and targeting. This POST request requires authentication and a detailed JSON payload. The response includes the new campaign ID and status. ```bash curl -X POST https://ext-api.sb.thetradedesk.com/workflows/campaign \ -H "TTD-Auth: YOUR_AUTH_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "advertiserId": "adv-enterprise-001", "primaryInput": { "name": "Q4 2024 Product Launch", "description": "Holiday season product launch campaign", "budget": { "allocationType": "Total", "budgetInAdvertiserCurrency": 500000.00 }, "startDate": "2024-11-01T00:00:00Z", "endDate": "2024-12-31T23:59:59Z", "campaignGoal": "Conversions", "flights": [ { "name": "Phase 1 - Awareness", "startDate": "2024-11-01T00:00:00Z", "endDate": "2024-11-30T23:59:59Z", "budgetInAdvertiserCurrency": 200000.00 }, { "name": "Phase 2 - Conversion", "startDate": "2024-12-01T00:00:00Z", "endDate": "2024-12-31T23:59:59Z", "budgetInAdvertiserCurrency": 300000.00 } ] }, "validateInputOnly": false }' # Response { "campaignId": "cmp-q4-launch-2024", "status": "Success", "flightIds": ["flt-001", "flt-002"] } ``` -------------------------------- ### POST /workflows/adgroup Source: https://context7.com/context7/ttd-workflows_apidocumentation_reference/llms.txt Creates a new ad group with full configuration including budget, targeting, ROI goals, and creative assignments. ```APIDOC ## POST /workflows/adgroup ### Description Creates a new ad group with full configuration including budget, targeting, ROI goals, and creative assignments. ### Method POST ### Endpoint https://ext-api.sb.thetradedesk.com/workflows/adgroup ### Parameters #### Headers - **TTD-Auth** (string) - Required - Your authentication token. - **Content-Type** (string) - Required - application/json #### Request Body - **campaignId** (string) - Required - The ID of the campaign to associate the ad group with. - **primaryInput** (object) - Required - Core configuration for the ad group. - **name** (string) - Required - The name of the ad group. - **isEnabled** (boolean) - Required - Whether the ad group is currently enabled. - **description** (string) - Optional - A description for the ad group. - **channel** (string) - Required - The advertising channel (e.g., "Display"). - **funnelLocation** (string) - Optional - The funnel stage this ad group targets. - **budget** (object) - Required - Budget details for the ad group. - **allocationType** (string) - Required - How the budget is allocated (e.g., "Minimum"). - **budgetInAdvertiserCurrency** (number) - Required - The total budget amount in the advertiser's currency. - **dailyTargetInAdvertiserCurrency** (number) - Optional - The daily budget target in the advertiser's currency. - **baseBidCPMInAdvertiserCurrency** (number) - Required - The base bid CPM in the advertiser's currency. - **maxBidCPMInAdvertiserCurrency** (number) - Optional - The maximum bid CPM in the advertiser's currency. - **audienceTargeting** (object) - Optional - Audience targeting configurations. - **audienceId** (string) - Required - The ID of the audience. - **audienceBoosterEnabled** (boolean) - Optional - Whether audience booster is enabled. - **targetTrackableUsersEnabled** (boolean) - Optional - Whether to target trackable users. - **recencyExclusionWindowInMinutes** (number) - Optional - Recency exclusion window in minutes. - **roiGoal** (object) - Optional - ROI goal configuration. - **cpaInAdvertiserCurrency** (number) - Optional - Target CPA in advertiser's currency. - **returnOnAdSpendPercent** (number) - Optional - Target ROAS percentage. - **creativeIds** (array of strings) - Optional - List of creative IDs to associate with the ad group. - **associatedBidLists** (array of objects) - Optional - Associated bid lists. - **bidListId** (string) - Required - The ID of the bid list. - **isEnabled** (boolean) - Required - Whether the bid list is enabled. - **isDefaultForDimension** (boolean) - Optional - Whether this is the default bid list for dimensions. - **advancedInput** (object) - Optional - Advanced configuration settings. - **koaOptimizationSettings** (object) - Optional - KOA optimization settings. - **areFutureKoaFeaturesEnabled** (boolean) - Optional - Whether future KOA features are enabled. - **predictiveClearingEnabled** (boolean) - Optional - Whether predictive clearing is enabled. - **newFrequencyConfigs** (array of objects) - Optional - New frequency capping configurations. - **counterName** (string) - Required - Name of the counter (e.g., "impression-cap"). - **frequencyCap** (number) - Required - The maximum number of times the ad can be shown. - **resetIntervalInMinutes** (number) - Required - The interval in minutes for resetting the cap. - **validateInputOnly** (boolean) - Optional - If true, only validates the input without creating the ad group. ### Request Example ```json { "campaignId": "abc123xyz", "primaryInput": { "name": "Q4 Holiday Campaign Ad Group", "isEnabled": true, "description": "Targeting high-value holiday shoppers", "channel": "Display", "funnelLocation": "Awareness", "budget": { "allocationType": "Minimum", "budgetInAdvertiserCurrency": 50000.00, "dailyTargetInAdvertiserCurrency": 2500.00 }, "baseBidCPMInAdvertiserCurrency": 3.50, "maxBidCPMInAdvertiserCurrency": 8.00, "audienceTargeting": { "audienceId": "aud-holiday-shoppers-2024", "audienceBoosterEnabled": true, "targetTrackableUsersEnabled": true, "recencyExclusionWindowInMinutes": 1440 }, "roiGoal": { "cpaInAdvertiserCurrency": 25.00, "returnOnAdSpendPercent": 300 }, "creativeIds": ["crv-banner-001", "crv-banner-002"], "associatedBidLists": [ { "bidListId": "bidlist-premium-sites", "isEnabled": true, "isDefaultForDimension": true } ] }, "advancedInput": { "koaOptimizationSettings": { "areFutureKoaFeaturesEnabled": true, "predictiveClearingEnabled": true }, "newFrequencyConfigs": [ { "counterName": "impression-cap", "frequencyCap": 5, "resetIntervalInMinutes": 10080 } ] }, "validateInputOnly": false } ``` ### Response #### Success Response (200) - **adGroupId** (string) - The ID of the newly created ad group. - **status** (string) - The status of the operation (e.g., "Success"). - **validationErrors** (array) - A list of any validation errors encountered. #### Response Example ```json { "adGroupId": "ag-new-group-xyz789", "status": "Success", "validationErrors": [] } ``` ``` -------------------------------- ### POST /workflows/standardjob/adgroup/bulk Source: https://context7.com/context7/ttd-workflows_apidocumentation_reference/llms.txt Creates multiple ad groups in a single asynchronous job. ```APIDOC ## POST /workflows/standardjob/adgroup/bulk ### Description Creates multiple ad groups in a single asynchronous job. ### Method POST ### Endpoint https://ext-api.sb.thetradedesk.com/workflows/standardjob/adgroup/bulk ### Parameters #### Headers - **TTD-Auth** (string) - Required - Your authentication token. - **Content-Type** (string) - Required - application/json #### Request Body - **campaignId** (string) - Required - The ID of the campaign to associate the ad groups with. - **adGroups** (array of objects) - Required - A list of ad group configurations to create. - **primaryInput** (object) - Required - Core configuration for the ad group. - **name** (string) - Required - The name of the ad group. - **channel** (string) - Required - The advertising channel (e.g., "Display"). - **budget** (object) - Required - Budget details for the ad group. - **allocationType** (string) - Required - How the budget is allocated (e.g., "Minimum"). - **budgetInAdvertiserCurrency** (number) - Required - The total budget amount in the advertiser's currency. - **baseBidCPMInAdvertiserCurrency** (number) - Required - The base bid CPM in the advertiser's currency. - **creativeIds** (array of strings) - Optional - List of creative IDs to associate with the ad group. ### Request Example ```json { "campaignId": "cmp-parent-001", "adGroups": [ { "primaryInput": { "name": "AdGroup A - Demographics 18-24", "channel": "Display", "budget": { "allocationType": "Minimum", "budgetInAdvertiserCurrency": 10000 }, "baseBidCPMInAdvertiserCurrency": 2.50, "creativeIds": ["crv-demo-18-24"] } }, { "primaryInput": { "name": "AdGroup B - Demographics 25-34", "channel": "Display", "budget": { "allocationType": "Minimum", "budgetInAdvertiserCurrency": 15000 }, "baseBidCPMInAdvertiserCurrency": 3.00, "creativeIds": ["crv-demo-25-34"] } } ] } ``` ### Response #### Success Response (200) - The response for this endpoint typically indicates the initiation of a job, and further details would be retrieved via a job status endpoint (not detailed in the provided text). #### Response Example (No specific example provided for bulk job creation success response in the input text. Typically, it would return a job ID.) ``` -------------------------------- ### POST /workflows/standardjob/firstpartydata Source: https://context7.com/context7/ttd-workflows_apidocumentation_reference/llms.txt Submits a job to upload first-party audience data for targeting. Supports hashed email data uploads. ```APIDOC ## POST /workflows/standardjob/firstpartydata ### Description Submits a job to upload first-party audience data for targeting. Supports hashed email data uploads. ### Method POST ### Endpoint /workflows/standardjob/firstpartydata ### Parameters #### Request Body - **advertiserId** (string) - Required - The ID of the advertiser. - **dataProviderId** (string) - Required - The ID of the data provider. - **segmentName** (string) - Required - The name of the audience segment. - **membershipDurationDays** (integer) - Required - The duration in days for segment membership. - **dataFormat** (string) - Required - The format of the data (e.g., "HashedEmail"). - **members** (array) - Required - A list of members to upload. - **hashedEmail** (string) - Required - The hashed email address of the member. - **replaceExisting** (boolean) - Required - Whether to replace existing data. ### Request Example ```json { "advertiserId": "adv-enterprise-001", "dataProviderId": "dp-first-party-001", "segmentName": "High-Value Customers Q4 2024", "membershipDurationDays": 90, "dataFormat": "HashedEmail", "members": [ { "hashedEmail": "5e884898da28047151d0e56f8dc6292773603d0d6aabbdd62a11ef721d1542d8" }, { "hashedEmail": "6ca13d52ca70c883e0f0bb101e425a89e8624de51db2d2392593af6a84118090" }, { "hashedEmail": "8d969eef6ecad3c29a3a629280e686cf0c3f5d5a86aff3ca12020c923adc6c92" } ], "replaceExisting": false } ``` ### Response #### Success Response (200) - **jobId** (string) - The ID of the asynchronous job. - **segmentId** (string) - The ID of the created segment. - **status** (string) - The status of the job (e.g., "Processing"). - **estimatedProcessingTime** (string) - The estimated time for processing the job. #### Response Example ```json { "jobId": "job-fpd-upload-xyz789", "segmentId": "seg-high-value-q4", "status": "Processing", "estimatedProcessingTime": "2024-10-11T15:45:00Z" } ``` ``` -------------------------------- ### Bulk Create Campaigns using cURL Source: https://context7.com/context7/ttd-workflows_apidocumentation_reference/llms.txt Creates multiple campaigns in a single asynchronous job. This POST request uses a JSON payload that includes the advertiser ID and an array of campaign objects to be created. The response returns a job ID and status. ```bash curl -X POST https://ext-api.sb.thetradedesk.com/workflows/standardjob/campaign/bulk \ -H "TTD-Auth: YOUR_AUTH_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "advertiserId": "adv-enterprise-001", "campaigns": [ { "primaryInput": { "name": "Regional Campaign - West", "budget": { "allocationType": "Total", "budgetInAdvertiserCurrency": 100000 }, "startDate": "2024-11-01T00:00:00Z", "endDate": "2024-12-31T23:59:59Z" } }, { "primaryInput": { "name": "Regional Campaign - East", "budget": { "allocationType": "Total", "budgetInAdvertiserCurrency": 150000 }, "startDate": "2024-11-01T00:00:00Z", "endDate": "2024-12-31T23:59:59Z" } } ] }' # Response { "jobId": "job-bulk-campaign-xyz123", "status": "Queued" } ``` -------------------------------- ### Upload First-Party Data using cURL Source: https://context7.com/context7/ttd-workflows_apidocumentation_reference/llms.txt Initiates a job to upload first-party audience data for targeting purposes. This requires advertiser and data provider IDs, segment details, membership duration, data format (e.g., HashedEmail), and the list of members. ```bash curl -X POST https://ext-api.sb.thetradedesk.com/workflows/standardjob/firstpartydata \ -H "TTD-Auth: YOUR_AUTH_TOKEN" \ -H "Content-Type: application/json" \ -d '{ \ "advertiserId": "adv-enterprise-001", \ "dataProviderId": "dp-first-party-001", \ "segmentName": "High-Value Customers Q4 2024", \ "membershipDurationDays": 90, \ "dataFormat": "HashedEmail", \ "members": [ \ { \ "hashedEmail": "5e884898da28047151d0e56f8dc6292773603d0d6aabbdd62a11ef721d1542d8" \ }, \ { \ "hashedEmail": "6ca13d52ca70c883e0f0bb101e425a89e8624de51db2d2392593af6a84118090" \ }, \ { \ "hashedEmail": "8d969eef6ecad3c29a3a629280e686cf0c3f5d5a86aff3ca12020c923adc6c92" \ } \ ], \ "replaceExisting": false \ }' # Response { "jobId": "job-fpd-upload-xyz789", "segmentId": "seg-high-value-q4", "status": "Processing", "estimatedProcessingTime": "2024-10-11T15:45:00Z" } ``` -------------------------------- ### POST /workflows/graphqlrequest Source: https://context7.com/context7/ttd-workflows_apidocumentation_reference/llms.txt Executes a single GraphQL query against The Trade Desk's GraphQL API. Returns results directly. ```APIDOC ## POST /workflows/graphqlrequest ### Description Executes a single GraphQL query against The Trade Desk's GraphQL API. Returns results directly. ### Method POST ### Endpoint /workflows/graphqlrequest ### Parameters #### Request Body - **query** (string) - Required - The GraphQL query string. - **variables** (object) - Optional - A JSON object containing variables for the query. ### Request Example ```json { "query": "query GetCampaignPerformance($campaignId: ID!) { campaign(id: $campaignId) { id name impressions clicks conversions spend { amount currency } } }", "variables": { "campaignId": "cmp-q4-launch-2024" } } ``` ### Response #### Success Response (200) - **data** (object) - The data returned by the GraphQL query. #### Response Example ```json { "data": { "campaign": { "id": "cmp-q4-launch-2024", "name": "Q4 2024 Product Launch", "impressions": 5234567, "clicks": 78901, "conversions": 2345, "spend": { "amount": 345678.90, "currency": "USD" } } } } ``` ``` -------------------------------- ### TTD Workflows API - Primary and Advanced Input Source: https://ttd-workflows.apidocumentation.com/reference/index This section details the structure for primary and advanced input parameters for TTD workflows, covering campaign settings, targeting, bidding, and reporting. ```APIDOC ## POST /workflows ### Description This endpoint allows for the creation and configuration of TTD workflows, enabling users to set up campaigns with detailed targeting, bidding strategies, and advanced features. ### Method POST ### Endpoint /workflows ### Parameters #### Request Body - **primaryInput** (object) - Required - Contains the primary settings for the workflow. - **isEnabled** (boolean) - Optional - Indicates if the primary input is enabled. - **description** (string) - Optional - A description for the primary input. - **budget** (object) - Optional - Budget allocation details. - **allocationType** (string) - Required - Type of budget allocation (e.g., "Minimum"). - **budgetInAdvertiserCurrency** (number) - Optional - Budget amount in advertiser's currency. - **budgetInImpressions** (number) - Optional - Budget in impressions. - **dailyTargetInAdvertiserCurrency** (number) - Optional - Daily budget target in advertiser's currency. - **dailyTargetInImpressions** (number) - Optional - Daily budget target in impressions. - **baseBidCPMInAdvertiserCurrency** (number) - Optional - Base bid CPM in advertiser's currency. - **maxBidCPMInAdvertiserCurrency** (number) - Optional - Maximum bid CPM in advertiser's currency. - **audienceTargeting** (object) - Optional - Audience targeting configuration. - **audienceId** (string) - Optional - The ID of the audience to target. - **audienceAcceleratorExclusionsEnabled** (boolean) - Optional - Enables audience accelerator exclusions. - **audienceBoosterEnabled** (boolean) - Optional - Enables audience booster. - **audienceExcluderEnabled** (boolean) - Optional - Enables audience excluder. - **audiencePredictorEnabled** (boolean) - Optional - Enables audience predictor. - **crossDeviceVendorListForAudience** (array) - Optional - List of cross-device vendor IDs for audience. - **recencyExclusionWindowInMinutes** (number) - Optional - Recency exclusion window in minutes. - **targetTrackableUsersEnabled** (boolean) - Optional - Enables targeting trackable users. - **useMcIdAsPrimary** (boolean) - Optional - Use MC ID as primary identifier. - **roiGoal** (object) - Optional - Return on Investment goals. - **maximizeReach** (boolean) - Optional - Maximize reach. - **maximizeLtvIncrementalReach** (boolean) - Optional - Maximize LTV incremental reach. - **cpcInAdvertiserCurrency** (number) - Optional - Cost per click in advertiser's currency. - **ctrInPercent** (number) - Optional - Click-through rate in percent. - **nielsenOTPInPercent** (number) - Optional - Nielsen optimized targeting in percent. - **cpaInAdvertiserCurrency** (number) - Optional - Cost per acquisition in advertiser's currency. - **returnOnAdSpendPercent** (number) - Optional - Return on ad spend in percent. - **vcrInPercent** (number) - Optional - Video completion rate in percent. - **viewabilityInPercent** (number) - Optional - Viewability in percent. - **vcpmInAdvertiserCurrency** (number) - Optional - Viewable cost per mille in advertiser's currency. - **cpcvInAdvertiserCurrency** (number) - Optional - Cost per viewable click in advertiser's currency. - **miaozhenOTPInPercent** (number) - Optional - Miaozhen optimized targeting in percent. - **creativeIds** (array) - Optional - List of creative IDs to associate with the workflow. - **associatedBidLists** (array) - Optional - List of associated bid lists. - **bidListId** (string) - Required - ID of the bid list. - **isEnabled** (boolean) - Optional - Indicates if the bid list is enabled. - **isDefaultForDimension** (boolean) - Optional - Indicates if it's the default for dimensions. - **name** (string) - Optional - Name of the workflow. - **channel** (string) - Optional - Channel for the workflow (e.g., "Other"). - **funnelLocation** (string) - Optional - Funnel location (e.g., "None"). - **programmaticGuaranteedPrivateContractId** (string) - Optional - ID for programmatic guaranteed private contracts. - **campaignId** (string) - Optional - The ID of the campaign to which this workflow belongs. - **advancedInput** (object) - Optional - Contains advanced settings for the workflow. - **koaOptimizationSettings** (object) - Optional - Settings for KOA optimization. - **areFutureKoaFeaturesEnabled** (boolean) - Optional - Enables future KOA features. - **predictiveClearingEnabled** (boolean) - Optional - Enables predictive clearing. - **comscoreSettings** (object) - Optional - Comscore integration settings. - **isEnabled** (boolean) - Required - Enables Comscore tracking. - **populationId** (number) - Optional - Comscore population ID. - **demographicMemberIds** (array) - Optional - List of demographic member IDs for Comscore. - **mobileDemographicMemberIds** (array) - Optional - List of mobile demographic member IDs for Comscore. - **contractTargeting** (object) - Optional - Settings for contract targeting. - **allowOpenMarketBiddingWhenTargetingContracts** (boolean) - Optional - Allows open market bidding when targeting contracts. - **dimensionalBiddingAutoOptimizationSettings** (array) - Optional - Auto-optimization settings for dimensional bidding. - **isUseClicksAsConversionsEnabled** (boolean) - Optional - Enables using clicks as conversions. - **isUseSecondaryConversionsEnabled** (boolean) - Optional - Enables using secondary conversions. - **nielsenTrackingAttributes** (object) - Optional - Nielsen tracking attributes. - **enhancedReportingOption** (string) - Optional - Nielsen enhanced reporting option (e.g., "None"). - **gender** (string) - Optional - Gender for Nielsen tracking (e.g., "Male"). - **startAge** (string) - Optional - Start age for Nielsen tracking (e.g., "Two"). - **endAge** (string) - Optional - End age for Nielsen tracking (e.g., "Seventeen"). - **countries** (array) - Optional - List of countries for Nielsen tracking. - **newFrequencyConfigs** (array) - Optional - New frequency capping configurations. - **counterName** (string) - Optional - Name of the frequency counter. - **frequencyCap** (number) - Optional - The frequency cap value. - **frequencyGoal** (number) - Optional - The frequency goal value. - **resetIntervalInMinutes** (number) - Required - Interval in minutes for resetting the frequency cap. - **flights** (array) - Optional - Flight details for the campaign. - **allocationType** (string) - Required - Type of budget allocation for the flight. - **budgetInAdvertiserCurrency** (number) - Optional - Budget amount in advertiser's currency for the flight. - **budgetInImpressions** (number) - Optional - Budget in impressions for the flight. - **dailyTargetInAdvertiserCurrency** (number) - Optional - Daily budget target in advertiser's currency for the flight. - **dailyTargetInImpressions** (number) - Optional - Daily budget target in impressions for the flight. - **campaignFlightId** (number) - Required - ID of the campaign flight. - **validateInputOnly** (boolean) - Optional - If true, only validates the input without creating the workflow. ### Request Example ```json { "primaryInput": { "isEnabled": true, "description": "Example workflow description", "budget": { "allocationType": "Minimum", "budgetInAdvertiserCurrency": 10000, "dailyTargetInAdvertiserCurrency": 500 }, "baseBidCPMInAdvertiserCurrency": 5.0, "maxBidCPMInAdvertiserCurrency": 10.0, "audienceTargeting": { "audienceId": "12345", "audienceAcceleratorExclusionsEnabled": true }, "roiGoal": { "maximizeReach": true, "cpaInAdvertiserCurrency": 2.5 }, "creativeIds": ["creative_abc"], "associatedBidLists": [ { "bidListId": "bidlist_xyz", "isEnabled": true, "isDefaultForDimension": false } ], "name": "Example Campaign Workflow", "channel": "Display", "funnelLocation": "Awareness" }, "campaignId": "campaign_789", "advancedInput": { "comscoreSettings": { "isEnabled": true, "populationId": 101, "demographicMemberIds": [1, 2], "mobileDemographicMemberIds": [3, 4] }, "nielsenTrackingAttributes": { "enhancedReportingOption": "Standard", "gender": "Female", "startAge": "Eighteen", "endAge": "ThirtyFive", "countries": ["US", "CA"] }, "newFrequencyConfigs": [ { "counterName": "Video Views", "frequencyCap": 3, "frequencyGoal": 2, "resetIntervalInMinutes": 60 } ], "flights": [ { "allocationType": "Maximum", "budgetInAdvertiserCurrency": 5000, "campaignFlightId": 1001 } ] }, "validateInputOnly": false } ``` ### Response #### Success Response (200) - **workflowId** (string) - The ID of the created workflow. - **status** (string) - The status of the workflow creation. #### Response Example ```json { "workflowId": "wf_abc123", "status": "Created" } ``` ```