API Documentation
Endpoints
Authentication
The AdServerX API uses Bearer token authentication. Include your API key in the Authorization header of every request.
Authorization: Bearer YOUR_API_KEY
Generate API keys in your account settings. Each key can be scoped to specific permissions.
GET/api/v1/campaigns
Returns a list of all campaigns for the authenticated account.
Query Parameters
| Parameter | Type | Description |
|---|---|---|
status | string | Filter by status: active, paused, draft, completed |
limit | integer | Results per page (default: 25, max: 100) |
offset | integer | Pagination offset |
Example Response
{
"success": true,
"data": [
{
"id": 1,
"uuid": "a1b2c3d4-...",
"name": "Summer Sale 2026",
"status": "active",
"pricing_model": "cpc",
"budget_type": "total",
"total_budget": 12000.00,
"spent_amount": 4873.45,
"impressions": 982340,
"clicks": 14830,
"ctr": 1.51
}
],
"total": 10,
"limit": 25,
"offset": 0
}
POST/api/v1/campaigns
Create a new campaign.
Request Body
{
"name": "My Campaign",
"pricing_model": "cpc",
"budget_type": "total",
"total_budget": 5000.00,
"start_date": "2026-04-01",
"end_date": "2026-06-30"
}