> ## Documentation Index
> Fetch the complete documentation index at: https://docs.narrative.io/llms.txt
> Use this file to discover all available pages before exploring further.

# The Trade Desk Connector API

> Deliver audiences to The Trade Desk and manage your taxonomy over the API, and set up what every Trade Desk API guide needs

The Trade Desk Connector API lets an unattended integration deliver audiences to The Trade Desk (TTD) and manage the taxonomy third-party audiences are sold from. A person signs in once to create an API key, and the integration uses that key from then on.

Complete the [prerequisites](#prerequisites) and [set up API access](#set-up-api-access) on this page before you follow any of the guides.

## Choose a guide

<CardGroup cols={3}>
  <Card title="First-party delivery" icon="user" href="/guides/connector-apis/the-trade-desk/first-party-delivery-api">
    Deliver an audience into one advertiser's own seat. No taxonomy, no review by TTD.
  </Card>

  <Card title="Third-party delivery" icon="store" href="/guides/connector-apis/the-trade-desk/third-party-delivery-api">
    Deliver an audience to TTD's marketplace, where the buyers you choose can purchase it.
  </Card>

  <Card title="Taxonomy management" icon="sitemap" href="/guides/connector-apis/the-trade-desk/managing-taxonomy-api">
    Build, price, and maintain the taxonomy third-party audiences are sold from.
  </Card>
</CardGroup>

[First-party and third-party delivery](/reference/connectors/the-trade-desk#overview) compares the two delivery models.

## Prerequisites

What you need depends on the guide you follow:

| Prerequisite | First-party | Third-party | Taxonomy |
| - | :-: | :-: | :-: |
| [API key](#api-key) | ✓ | ✓ | ✓ |
| [TTD Brand ID on your connector profile](#brand-id) | ✓ | ✓ | ✓ |
| [Sub-Provider ID](#sub-provider-id), where TTD requires one | | ✓ | ✓ |
| [Taxonomy element for the audience](#taxonomy-element) | | ✓ | |
| [Advertiser ID and secret key](#advertiser-id-and-secret-key) | ✓ | | |

### API key

Create the key under **Settings → API Keys** with read and write on `datasets`, `uploads`, `connections`, `jobs`, `mappings`, `attributes`, and `installations`. See [API Keys](/account-settings/api-keys) for the procedure and the [Permissions Reference](/reference/security/permissions) for what each resource covers.

Create it from a shared team account rather than a personal login, so the integration keeps working when someone changes roles. Keys expire in at most 365 days, so plan on rotating yours once a year.

### Brand ID

Narrative is the registered data provider at The Trade Desk, and your Brand ID is a brand under Narrative's provider account. TTD issues it, so you cannot create one yourself. Ask your Narrative relationship manager or your TTD account representative.

The Brand ID is stored on your connector profile. To find the profile, see [Find your connector profile](/guides/connector-apis/the-trade-desk/third-party-delivery-api#6-find-your-connector-profile). Taxonomy synchronization is refused for a profile with no Brand ID.

### Sub-Provider ID

Where TTD requires one, the connector sends the Sub-Provider ID when it creates each taxonomy element in TTD. It cannot be added to an element afterward, so have it on your profile before your first synchronization. Your Narrative relationship manager sets it up.

### Taxonomy element

Every third-party audience is a buyable element in your taxonomy, and the element carries the price and who can buy it. Your first taxonomy needs TTD's approval before anything sells, so start it early with [Taxonomy management](/guides/connector-apis/the-trade-desk/managing-taxonomy-api).

### Advertiser ID and secret key

First-party delivery goes into one advertiser's seat, so you need that advertiser's TTD Advertiser ID and secret key from whoever owns the seat.

## Set up API access

The guides talk to two hosts, and both accept the same credential, `Authorization: Bearer <your API key>`:

| Host | Base URL | Handles |
| - | - | - |
| Narrative API | `https://api.narrative.io` | Datasets, uploads, mappings, profiles, connections |
| Trade Desk connector | `https://thetradedesk.narrativeconnectors.com` | Taxonomy elements, synchronization, advertiser registration, delivery statistics |

Confirm that both answer before you build anything:

```bash theme={null}
curl -s https://api.narrative.io/company-info/whoami \
  -H "Authorization: Bearer $NIO_API_TOKEN"
# → {"id": 1234}

curl -s https://thetradedesk.narrativeconnectors.com/whoami \
  -H "Authorization: Bearer $NIO_API_TOKEN"
# → 1234
```

Both must return your company ID. A `403` from the first call means the key was not created under **Settings → API Keys**. Application credentials do not work with these guides.

<Tip>
  API keys contain characters that shells mangle. Read the key from a file or an environment variable rather than pasting it inline.
</Tip>

***

## Related content

<CardGroup cols={2}>
  <Card title="The Trade Desk Connector" icon="bullhorn" href="/reference/connectors/the-trade-desk">
    Full settings reference, identifiers, and status vocabularies
  </Card>

  <Card title="Connector Interfaces" icon="plug" href="/concepts/data-activation/connector-interfaces">
    Why a dataset connects to an interface rather than a connector
  </Card>
</CardGroup>
