# Campaigns

The EmailBison campaign roster and its tags, read only.

Source: https://docs.leadarc.io/reference-campaigns.html

- [GET /v1/workspaces/{ws}/campaigns](#get-v1-workspaces-ws-campaigns)
- [GET /v1/workspaces/{ws}/campaign_tags](#get-v1-workspaces-ws-campaign-tags)

## GET /v1/workspaces/{ws}/campaigns

`campaigns:read` · upstream bucket · returns list of campaign

The EmailBison campaign roster

```bash
curl -sS https://api.leadarc.io/v1/workspaces/airpay/campaigns?limit=25 \
  -H "Authorization: Bearer $LEADARC_API_KEY"
```

**Query parameters.** Anything else is [`400 unsupported_filter`](errors.html#status-400).

`cursor` `limit`

**Errors from this endpoint**, on top of the [common ones](errors.html): [`invalid_request`](errors.html#status-400), [`upstream_error`](errors.html#status-502).

```json
{
  "object": "list",
  "data": [{
    "object": "campaign",
    "id": "cmp_HWO-6oxZflAfh5iwoKTzqjgycG_C8wMff6Galz",
    "workspace": "airpay",
    "name": "Senior Living / Ops Directors / v3",
    "status": "active",
    "tags": [{ "id": "ctg_7yHIVjtbLY11QWHJ5fpU3NpBjDkdBmTjy4q10v", "name": "senior-living" }]
  }],
  "has_more": false,
  "next_cursor": null
}
```
Proxied live from EmailBison at `https://send.leadarc.io` (the `EB_BASE_URL` default), using the per-workspace token from `clients.eb_token`. **That token never appears in a response, an error message, or a log line.** It is stored in plain text in the database, which is exactly why the serializer is a hand-written field-by-field mapper and never spreads a `clients` row.

Pagination over a proxied upstream is emulated. The full roster is fetched (it is tens of campaigns, not thousands) and paged in memory, and cached in-process for 60 seconds per workspace. [`next_cursor`](pagination.html#cursors) here is not a database cursor, and these pages say so.

## GET /v1/workspaces/{ws}/campaign_tags

`campaigns:read` · upstream bucket · returns list of campaign_tag

Campaign tags, the match key for rules and notes

```bash
curl -sS https://api.leadarc.io/v1/workspaces/airpay/campaign_tags?limit=25 \
  -H "Authorization: Bearer $LEADARC_API_KEY"
```

**Query parameters.** Anything else is `400 unsupported_filter`.

`cursor` `limit`

**Errors from this endpoint**, on top of the [common ones](errors.html): `invalid_request`, `upstream_error`.

```json
{ "object": "campaign_tag", "id": "ctg_7yHIVjtbLY11QWHJ5fpU3NpBjDkdBmTjy4q10v", "workspace": "airpay",
  "name": "senior-living", "campaign_count": 4 }
```
These ids are the match key for `assignment_rules.tag_ids` and `sdr_note_sets.tag_ids`, both matched by Postgres array overlap (`&&`).

---

---

Base URL `https://api.leadarc.io/v1`. Generated from the API source.
