# Brands API

## Create brands

A brand is a **media brand** that belongs to a media partner (typically the advertiser company).

### Create a brand

```
POST /v1/media-partners/{mediaPartnerId}/brands

```

<table id="bkmrk-parameter-in-require-2"><thead><tr><th>Parameter</th><th>In</th><th>Required</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>mediaPartnerId</code></td><td>path</td><td>Yes</td><td>integer</td><td>The media partner (company) the brand belongs to.</td></tr></tbody></table>

**Request body** — `CreateMediaBrandRequest`

<table id="bkmrk-field-type-required--1" style="width: 92.2619%; height: 121.984px;"><thead><tr style="height: 29.7969px;"><th style="width: 24.2138%; height: 29.7969px;">Field</th><th style="width: 25.9434%; height: 29.7969px;">Type</th><th style="width: 12.2642%; height: 29.7969px;">Required</th><th style="width: 37.5786%; height: 29.7969px;">Description</th></tr></thead><tbody><tr style="height: 29.7969px;"><td style="width: 24.2138%; height: 29.7969px;"><code>name</code></td><td style="width: 25.9434%; height: 29.7969px;">string</td><td style="width: 12.2642%; height: 29.7969px;">Yes</td><td style="width: 37.5786%; height: 29.7969px;">Brand name.</td></tr><tr style="height: 29.7969px;"><td style="width: 24.2138%; height: 29.7969px;"><code>externalKey</code></td><td style="width: 25.9434%; height: 29.7969px;">string</td><td style="width: 12.2642%; height: 29.7969px;">No</td><td style="width: 37.5786%; height: 29.7969px;">Your own external reference key.</td></tr><tr style="height: 32.5938px;"><td style="width: 24.2138%; height: 32.5938px;"><code>subsystemExternalIds</code></td><td style="width: 25.9434%; height: 32.5938px;">object (string → string)</td><td style="width: 12.2642%; height: 32.5938px;">No</td><td style="width: 37.5786%; height: 32.5938px;">External ids per subsystem.</td></tr></tbody></table>

```json
{
  "name": "Acme Cola",
  "externalKey": "acme-cola",
  "subsystemExternalIds": {}
}

```

**Responses**

<table id="bkmrk-status-meaning-201-m-1"><thead><tr><th>Status</th><th>Meaning</th></tr></thead><tbody><tr><td><code>201</code></td><td>Media brand created.</td></tr><tr><td><code>400</code></td><td>Invalid input.</td></tr><tr><td><code>401</code> / <code>403</code></td><td>Not authenticated / not allowed.</td></tr><tr><td><code>404</code></td><td>Media partner not found.</td></tr></tbody></table>

> As with companies, `201` will return a body including the generated `id` and all information known about the brand.

### List a company's brands

```
GET /v1/media-partners/{mediaPartnerId}/brands?limit=50&offset=0

```

<table id="bkmrk-parameter-in-require-3" style="width: 99.6429%;"><thead><tr><th style="width: 18.1818%;">Parameter</th><th style="width: 8.49478%;">In</th><th style="width: 11.6244%;">Required</th><th style="width: 10.8793%;">Type</th><th style="width: 50.8197%;">Description</th></tr></thead><tbody><tr><td style="width: 18.1818%;"><code>mediaPartnerId</code></td><td style="width: 8.49478%;">path</td><td style="width: 11.6244%;">Yes</td><td style="width: 10.8793%;">integer</td><td style="width: 50.8197%;">The media partner.</td></tr><tr><td style="width: 18.1818%;"><code>limit</code></td><td style="width: 8.49478%;">query</td><td style="width: 11.6244%;">Yes</td><td style="width: 10.8793%;">integer</td><td style="width: 50.8197%;">Max number of results.</td></tr><tr><td style="width: 18.1818%;"><code>offset</code></td><td style="width: 8.49478%;">query</td><td style="width: 11.6244%;">Yes</td><td style="width: 10.8793%;">integer</td><td style="width: 50.8197%;">Results to skip.</td></tr><tr><td style="width: 18.1818%;"><code>includeInactive</code></td><td style="width: 8.49478%;">query</td><td style="width: 11.6244%;">No</td><td style="width: 10.8793%;">boolean</td><td style="width: 50.8197%;">Include deactivated brands.</td></tr><tr><td style="width: 18.1818%;"><code>search</code></td><td style="width: 8.49478%;">query</td><td style="width: 11.6244%;">No</td><td style="width: 10.8793%;">string</td><td style="width: 50.8197%;">URL-encoded, case-insensitive match on name.</td></tr></tbody></table>

**Response** — array of `MediaBrand Schema`

```json
[
  {
    "id": 8801,
    "name": "Acme Cola",
    "externalKey": "acme-cola",
    "subsystemExternalIds": {},
    "active": true
  }
]

```

### Get a single brand

```
GET /v1/media-partners/{mediaPartnerId}/brands/{mediaBrandId}

```

Returns a single `MediaBrand Schema`.