> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ensads.tech/llms.txt
> Use this file to discover all available pages before exploring further.

# POST /api/v1/campaigns/click — Track User Clicks

> Record a user click on a campaign ad. Send campaignId, placement, location, and device in the request body. Only fire for genuine user-initiated interactions.

Call this endpoint when a user clicks or otherwise interacts with a displayed campaign. A click event signals genuine user engagement to the ENS Ads platform and is used by advertisers to measure campaign performance. You should fire this request in response to a real user action — for example, after intercepting the click on a campaign element before navigating the user to the `destinationUrl`.

<Note>
  This endpoint must be called from your server. Your API key must never appear in client-side or user-facing code. Forward click events through your backend to keep your credentials secure.
</Note>

## Endpoint

```
POST https://ads.enslive.live/api/v1/campaigns/click
```

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

## Request example

```bash theme={null}
curl -X POST "https://ads.enslive.live/api/v1/campaigns/click" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "campaignId": 1,
    "placement": "header_banner",
    "location": "US",
    "device": "mobile"
  }'
```

## Body parameters

<ParamField body="campaignId" type="integer" required>
  The unique ID of the campaign that was clicked. Use the `id` field returned by the [Fetch Campaigns](/api/fetch-campaigns) endpoint.
</ParamField>

<ParamField body="placement" type="string" required>
  The placement ID where the campaign was rendered when the user clicked (e.g., `header_banner`, `article_inline`). This must match the placement used when fetching and displaying the campaign.
</ParamField>

<ParamField body="location" type="string">
  The ISO 3166-1 alpha-2 country code of the user's geographic location (e.g., `US`, `GB`, `FR`). Including this improves reporting accuracy for advertisers.
</ParamField>

<ParamField body="device" type="string">
  The device type of the user who clicked the campaign. Accepted values: `mobile`, `desktop`, `tablet`.
</ParamField>

## Response

### 200 — Success

```json theme={null}
{
  "status": "success",
  "message": "Click tracked successfully"
}
```

### 400 — Bad Request

Returned when a required field is missing from the request body.

```json theme={null}
{
  "status": "error",
  "message": "campaignId is required"
}
```

### 401 — Unauthorized

Returned when the `Authorization` header is missing or the API key is invalid.

```json theme={null}
{
  "status": "error",
  "message": "unauthorized"
}
```

<Tip>
  Only track clicks that result from genuine user-initiated interactions. Do not fire this endpoint programmatically, on page load, or in response to automated events. Tracking fraudulent clicks violates advertiser trust and platform terms, and may result in your API key being suspended.
</Tip>
