---
title: "Attach an advertiser"
method: POST
path: "/context/brands/{slug}/advertisers"
tags: ["Brands"]
---

# Attach an advertiser

`POST /context/brands/{slug}/advertisers`

## Request

- Base URL: `https://api.adcrunch.dev`
- URL: `https://api.adcrunch.dev/context/brands/{slug}/advertisers`
- Auth: HTTP bearer

Attaches an advertiser to a Brand. An agent that works on that advertiser can then find this brand context. Send the same call again for the same result: the pair is the key, so a second attach writes nothing and still answers `201`. AdCrunch reads the provider from the advertiser. It does not take the provider from you. A Brand takes several advertisers, and an advertiser takes several Brands.

## Path parameters

- `slug` string, required

## Request body

- object
  - `advertiser_id` string, required

## Response `201`

Attached. Idempotent: attaching an account that is already attached answers the same way. `provider` is what AdCrunch resolved from the advertiser, never what you sent.

- object
  - `advertiserId` string, required
  - `provider` string, required: Resolved from the ad account, never taken from the caller. That resolution is also the ownership check.

## Other responses

- `400`: The request does not match the schema of this operation: a field is missing or has the wrong type, or the body is not valid JSON. `error` is `invalid_request`, and `issues` names each field. Nothing was changed.
- `401`: No API key, or one that does not resolve. See the security scheme. `error` is `unauthorized`.
- `402`: The organization has no active subscription. An owner subscribes at `paywallUrl`. `error` is `organization_unentitled`.
- `403`: The caller does not hold `brand:write`. `error` is `forbidden`.
- `404`: No Brand with that slug. `error` is `not_found`.
- `422`: That advertiser is not connected to this organization. `error` is `advertiser_not_owned`. Ownership is checked against the integration database at write time, because there is no foreign key across databases.

---

[API](https://skmtc.dev/adcrunch/apis/adcrunch-api.md) · [All operations](https://skmtc.dev/adcrunch/apis/adcrunch-api/llms.txt) · [OpenAPI document](https://skmtc.dev/adcrunch/apis/adcrunch-api/revisions/a420ba80914f?raw)
