> For the complete documentation index, see [llms.txt](https://docs.exoclick.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.exoclick.com/api/exoclick-public-api/api-manual-postman-examples.md).

# Postman Examples

## Overview

This guide provides step-by-step instructions for authenticating and creating campaigns via the ExoClick API using Postman. All examples specify the required request type, headers, and body format for each endpoint.

## Authentication (Login)

You can authenticate using your account credentials or a permanent API Token. Both return a temporary Bearer Token used for all subsequent requests.

{% tabs %}
{% tab title="Login with Username & Password" %}
**Request Type:** `POST`\
**URL:** `https://api.exoclick.com/v2/login`

**Headers:**

```
Content-Type: application/json
```

**Body (raw JSON):**

```json
{
  "username": "YOUR_USERNAME",
  "password": "YOUR_PASSWORD"
}
```

{% endtab %}

{% tab title="Login with API Token" %}
Use this if you generated a token in your ExoClick Dashboard (Profile > API Tokens).

**Request Type:** `POST`\
**URL:** `https://api.exoclick.com/v2/login`

**Headers:**

```
Content-Type: application/json
```

**Body (raw JSON):**

```json
{
  "api_token": "YOUR_API_TOKEN"
}
```

{% endtab %}
{% endtabs %}

## 300x250 Banner Campaign Creation Flow

Follow these steps in exact order. Note the transition from JSON to Form-Data in the final steps.

{% stepper %}
{% step %}

### Create Landing Page URL (Library)

Registers your destination URL. Standard banners require an `id_library_url`.

**Request Type:** `POST`\
**URL:** `https://api.exoclick.com/v2/library/url`

**Headers:**

```
Authorization: Bearer YOUR_TOKEN
Content-Type: application/json
```

**Body (raw JSON):**

```json
{
  "url": "https://your-landing-page.com"
}
```

**Result:** Save the returned `"id"` (e.g., `6512406`).
{% endstep %}

{% step %}

### Upload Image (Library)

Registers your creative asset. The image must be exactly 300x250.

**Request Type:** `POST`\
**URL:** `https://api.exoclick.com/v2/library/file`

**Headers:**

```
Authorization: Bearer YOUR_TOKEN
```

**Body (form-data):**

| Key    | Type | Value                            |
| ------ | ---- | -------------------------------- |
| `file` | File | Select your image file (300x250) |
| `type` | Text | `image`                          |

**Result:** Save the returned `"id"` (e.g., `6884966`).
{% endstep %}

{% step %}

### Create Campaign Shell

Sets targeting, budget, and the `img_banner` template.

**Request Type:** `POST`\
**URL:** `https://api.exoclick.com/v2/campaigns`

**Headers:**

```
Authorization: Bearer YOUR_TOKEN
Content-Type: application/json
```

**Body (raw JSON):**

```json
{
  "name": "Banner 300x250 Production",
  "status": 0,
  "advertiser_ad_type": 0,
  "media_storage_template": "img_banner",
  "size": "300x250",
  "categories": {
    "type": "targeted",
    "elements": [97, 98, 99]
  },
  "countries": {
    "type": "targeted",
    "elements": [
      {
        "country": "USA",
        "regions": [0]
      }
    ]
  },
  "pricing": {
    "model": 4,
    "price": 300
  },
  "start_date": "2026-03-02",
  "daily_limit_type": 1,
  "max_daily_budget": 2000,
  "budget_delivery_mode": 1,
  "run_on_responsive_zones": 1
}
```

**Result:** Save the returned `"id"` (e.g., `8140060`).
{% endstep %}

{% step %}

### Add the Variation

Links the URL (Step 1) and Image (Step 2) to the Campaign (Step 3).

**Request Type:** `POST`\
**URL:** `https://api.exoclick.com/v2/campaigns/8140060/variation`\
\&#xNAN;*(Replace `8140060` with your actual campaign ID from Step 3)*

**Headers:**

```
Authorization: Bearer YOUR_TOKEN
```

**Body (form-data):**

| Key               | Type | Value                     |
| ----------------- | ---- | ------------------------- |
| `id_library_url`  | Text | `6512406` *(from Step 1)* |
| `id_library_file` | Text | `6884966` *(from Step 2)* |
| `active`          | Text | `1`                       |

All IDs returned at each step must be saved and used in subsequent requests. Remember to replace `YOUR_TOKEN`, file paths, and IDs with your actual values.
{% endstep %}
{% endstepper %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.exoclick.com/api/exoclick-public-api/api-manual-postman-examples.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
