[Tenjin API Reference](https://api-docs.tenjin.com/llms.txt) › [Campaign Management API](https://api-docs.tenjin.com/campaign-management-api.md) › List campaigns

- Campaign Management API OpenAPI spec: https://api-docs.tenjin.com/openapi/campaign-management-api.json

# List campaigns

- **Method:** `GET`
- **Path:** `/v2/campaigns`
- **Operation ID:** `get_campaigns`
- **Tags:** Campaigns

## Effective servers

- `https://api.tenjin.com`

## Authentication

- **Bearer**: HTTP bearer (`JWT`)

  Generate an access token on the [Access Tokens](https://dashboard.tenjin.com/dashboard/access_tokens) page of the Tenjin dashboard and send it as `Authorization: Bearer <access token>`. [API access tokens](https://tenjin.com/docs/api-access-tokens/) explains them.

## Query parameters

- **`channel_id`**: `integer`

  Keep only campaigns of this channel
- **`app_id`**: `string`, format: `uuid`, maxLength: `36`

  Keep only campaigns of this app
- **`platform`**: `string`, possible values: `"amazon", "android", "android_other", "ios", "windows", "unspecified"`

  Keep only campaigns of apps on this platform
- **`query`**: `string`

  Search campaigns by name, short_id or remote_campaign_id
- **`page`**: `integer`, default: `1`

  Page of results to fetch.
- **`per_page`**: `integer`, default: `25`, minimum: `0`, maximum: `1000`

  Number of results to return per page.

## Responses

### 200 Campaigns

**Headers:**

- **`Link`**

  URLs of the first, previous, next and last pages (RFC 8288); sent only when the list has more than one page

  `string`
- **`Total`**

  Number of items on all pages

  `integer`
- **`Per-Page`**

  Number of items per page

  `integer`

**Content type:** `application/json`

schema: `CampaignListDocument`

- **`data` (required)**: `array`

  **Items:**

  schema: `CampaignResource`
  - **`attributes` (required)**: `object`
    - **`ad_account_id` (required)**: `string | null`, format: `uuid`

      Id of the campaign's ad account
    - **`app_id` (required)**: `string | null`, format: `uuid`

      Id of the app the campaign promotes
    - **`attribution_window` (required)**: `integer | null`

      Click attribution window in seconds. Null uses the ad account's window. Attribution does not use it: it uses the app's attribution windows and the integration's attribution settings
    - **`channel_id` (required)**: `integer`

      Id of the campaign's channel
    - **`click_tracking_url` (required)**: `string | null`

      Click tracking URL of the campaign, with the ad network's macros left as is
    - **`created_at` (required)**: `string | null`, format: `date-time`

      When the campaign was created
    - **`hidden` (required)**: `boolean`

      Whether the campaign is deleted
    - **`impression_tracking_url` (required)**: `string | null`

      Impression tracking URL of the campaign, with the ad network's macros left as is
    - **`name` (required)**: `string | null`

      Name of the campaign in Tenjin
    - **`remote_campaign_id` (required)**: `string | null`

      Id of the campaign on the ad network
    - **`short_id` (required)**: `string | null`

      URL-safe id of the campaign in Tenjin
  - **`id` (required)**: `string`, format: `uuid`
  - **`type` (required)**: `string`, possible values: `"campaign"`
- **`links` (required)**: `object`, schema: `Links`
  - **`self` (required)**: `string`, format: `uri`

    URL of this request
  - **`first`**: `string`, format: `uri`

    URL of the first page of a list
  - **`last`**: `string`, format: `uri`

    URL of the last page of a list
  - **`next`**: `string`, format: `uri`

    URL of the next page of a list
  - **`prev`**: `string`, format: `uri`

    URL of the previous page of a list
- **`meta` (required)**: `object`, schema: `PageMeta`
  - **`count` (required)**: `integer`

    Number of items on all pages
  - **`per_page` (required)**: `integer`

    Number of items per page

**Example: Campaigns**

```json
{
  "data": [
    {
      "id": "41149a48-9766-4c23-7744-56cb4836a603",
      "type": "campaign",
      "attributes": {
        "channel_id": 3,
        "app_id": "17ef8c1a-5729-456e-98db-ccc104bdf860",
        "ad_account_id": "6e3fbfa6-27cc-45f2-af3f-5c9ead45280e",
        "name": "Facebook Campaign",
        "short_id": "zzzk0TXwNXu7Y5Maf2aRkL",
        "remote_campaign_id": "48249a48-9766-4c23-8c13-56cb4836d903",
        "click_tracking_url": "https://track.tenjin.com/v0/click/zzzk0TXwNXu7Y5Maf2aRkL",
        "impression_tracking_url": null,
        "attribution_window": null,
        "created_at": "2019-08-20T21:56:12.336Z",
        "hidden": false
      }
    },
    {
      "id": "3ba367d2-62a7-4791-941c-a2a53d2832e3",
      "type": "campaign",
      "attributes": {
        "channel_id": 1,
        "app_id": "5fce6a93-877c-44f7-9c56-3bfe4acbbfd5",
        "ad_account_id": "333c57b6-c022-496a-bd27-5d8d7caa8cae",
        "name": "Dog Watcher -- Video - Offerwall/Featured (iOS) - AU,DE - eCPI Goal of $1.50",
        "short_id": "bYHn2BhR5O9zgGJ6Cp1E37",
        "remote_campaign_id": "ee8244a0-075b-406e-a4c7-0755cc844920",
        "click_tracking_url": "https://track.tenjin.com/v0/tapjoy/cZarDzkYbGtUYM7pPM2ZCH?bundle_id=com.this.DogWatcher&platform=ios&advertising_id=TAPJOY_ADVERTISING_ID&campaign_id=TAPJOY_OFFER_ID&site_id=TAPJOY_GENERIC_SOURCE&click_id=TAPJOY_TJCID&ip_address=[ip_address]&creative_name=TAPJOY_CREATIVE_NAME",
        "impression_tracking_url": null,
        "attribution_window": 604800,
        "created_at": "2019-08-12T02:08:51.252Z",
        "hidden": false
      }
    }
  ],
  "links": {
    "self": "https://api.tenjin.com/v2/campaigns"
  },
  "meta": {
    "count": 2,
    "per_page": 25
  }
}
```

### 400, 401, 403, 498

- `400` A param is missing or invalid, a record is not found, or the request cannot be served
- `401` Missing or invalid credentials, or no access to the requested data
- `403` Invalid token, or the user's role does not allow the request
- `498` Expired token, or a token with an invalid signature

**Content type:** `application/json`

schema: `Error`

- **`error` (required)**: `string`

  What went wrong

**Example:**

```json
{
  "error": ""
}
```

## Schemas

- `Error` — shown above.
- `CampaignListDocument` — shown above.
- `Links` — shown above.
- `PageMeta` — shown above.
- `CampaignResource` — shown above.
