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

# Setup

> What Targeter needs from a publisher before it can call your API

## What Targeter needs from you

Share the following with Targeter integration support before go-live. Targeter stores these as the connection for your platform.

| Item                | Description                                                                              |
| ------------------- | ---------------------------------------------------------------------------------------- |
| Base URL            | API host, including version prefix (for example `https://ads.publisher.no/v1`)           |
| Access token        | Bearer token Targeter sends on every request                                             |
| Token lifetime      | How long the token is valid, and how Targeter should refresh it                          |
| Supported functions | Which of the [ideal functions](/integrations/introduction) you implement                 |
| Platform ids        | Stable ids returned by [`GET /publisher-platforms`](/integrations/platforms/get)         |
| Office matching     | Whether offices are unique by `name`, and whether Targeter should create missing offices |

<Tip>
  Tokens are for server-to-server calls only. Issue a dedicated credential for Targeter; do not reuse a personal or dashboard login.
</Tip>

## Conventions

* **JSON** request and response bodies, `Content-Type: application/json`
* **snake\_case** field names (`office_id`, `target_url`, `publisher_platforms`)
* **Insight windows** as `YYYY-MM-DD` (inclusive)
* **Timestamps** as UTC ISO 8601 date-times (`2026-08-20T00:00:00Z`), including `start_date` and `end_date`
* **IDs** as opaque strings generated by you (`office_id`, `ad_id`)
* **Ids Targeter sends** as opaque strings you store and return unchanged (`campaign_id`)

## Office mapping

Ads are attributed to an office (brokerage or advertiser account) in your system.

1. Targeter looks up the office with [`GET /offices`](/integrations/offices/get) using the name from the Targeter account.
2. If nothing matches, Targeter calls [`POST /offices`](/integrations/offices/create). You generate `office_id`.
3. Targeter sends that `office_id` on every [`POST /ads`](/integrations/ads/create).

Treat `name` as unique. If Targeter creates an office that already exists, return **200** with the existing `office_id` instead of a duplicate.

## Ad lifecycle

Targeter drives delivery with these status transitions:

```
pending_review → scheduled → active ⇄ paused → completed
                      ↘ rejected
                      ↘ error
```

* **Pause** and **resume** must not delete the ad or drop historical insights.
* **Delete** is permanent. Targeter uses it when the campaign should not remain in your system.
* **Get ad status** is how Targeter syncs `scheduled`, `active`, `paused`, `completed`, `rejected`, and `error`.

## Creatives

`material.target_url` is always required. Provide at least one of `images`, `videos`, or `html5` as publicly reachable URLs. Targeter will only request formats listed for each platform in [`GET /publisher-platforms`](/integrations/platforms/get).

## Going live

1. Stand up the endpoints against a sandbox host.
2. Send Targeter the sandbox base URL and token.
3. Targeter runs the [typical flow](/integrations/introduction#typical-flow): platforms → office → create ad → status → insights → pause/resume.
4. Switch the stored base URL and token to production.
