# Manage ads

Connect a Trade Desk partner with an API token, then sync and manage its advertisers' campaigns and ad groups.

Connect a Trade Desk partner with an API token to sync and manage its advertisers' campaigns and ad groups from Zernio. Sending conversions to a tracking tag is a separate connection: see [Connect](/platforms/the-trade-desk/connect).

## How it works

The Trade Desk has no OAuth sign-in. Your Trade Desk account manager enables API access for your Trade Desk user.

That user creates a long-lived API token in the Partner Portal under **Manage API Tokens**. You send the token and your Partner ID:

```bash
curl -X POST 'https://zernio.com/api/v1/connect/tradedesk-ads/partner' \
  -H "Authorization: Bearer $ZERNIO_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{ "profileId": "YOUR_PROFILE_ID", "partnerId": "ptn1234", "apiToken": "YOUR_TTD_API_TOKEN" }'
```

We list the partner's advertisers with the token before saving anything, and store the token encrypted.

Each advertiser becomes an ad account (`GET /v1/ads/accounts`), and `adAccountIds` keeps only some of them. The connection's platform is `tradedeskdsp` and its ads carry `platform: "tradedesk"`.

## What syncs

- Campaigns, ad groups and the creatives each ad group serves. Each creative in an ad group is one ad.
- An ad group is active when it is enabled in The Trade Desk. A campaign is active while one of its ad groups is.
- Once a campaign is archived, it and everything under it read as cancelled.
- Spend and other metrics are not synced yet.

## What you can change

| Action | How |
|--------|-----|
| Create a campaign | `POST /v1/ads/campaigns` with goal `awareness` or `video_views` (maximize reach) and an optional lifetime budget. It is created with no ad group, so it spends nothing until you add and enable one in The Trade Desk. |
| Pause or resume an ad group | Ad set status update |
| Pause a campaign | Switches off every enabled ad group in it. Resume the ad groups you want to run. |
| Budgets | Lifetime budget of the campaign's running flight, or of its next flight before it starts (422 when it has neither); daily or lifetime budget of an ad group |
| Bid | The ad group's base CPM bid (`bidAmount`) |
| Delete | Archives the campaign or ad group, which cannot be undone. Deleting an ad takes its creative off the ad group. |

Not available yet: creating ad groups, uploading creatives, and geo, device or inventory targeting.