API Documentation
Access your ClipROI data programmatically. Requires an Agency plan and an API key.
Authentication
All API requests require a Bearer token in the Authorization header:
Authorization: Bearer cr_your_api_key_here
Generate API keys in Account Settings.
Rate Limits
60 requests per minute per API key. Exceeding the limit returns 429 Too Many Requests.
Endpoints
GET /api/v1/campaigns
List all your campaigns (including team campaigns).
curl -H "Authorization: Bearer cr_..." http://localhost:3000/api/v1/campaigns
POST /api/v1/campaigns
Create a new campaign.
curl -X POST -H "Authorization: Bearer cr_..." \
-H "Content-Type: application/json" \
-d '{"name":"Summer Sale","brandName":"Acme","destinationUrl":"https://example.com","trackingSlug":"summer-sale-2025"}' \
http://localhost:3000/api/v1/campaignsGET /api/v1/campaigns/:id
Get campaign details with a click summary (device, browser, country, UTM source breakdown).
curl -H "Authorization: Bearer cr_..." http://localhost:3000/api/v1/campaigns/CAMPAIGN_ID
GET /api/v1/campaigns/:id/clicks
Get raw click data (paginated, max 1000 per page).
curl -H "Authorization: Bearer cr_..." "http://localhost:3000/api/v1/campaigns/CAMPAIGN_ID/clicks?page=1&limit=100"
Query params: page (default: 1), limit (default: 100, max: 1000).
Error Responses
| Status | Meaning |
|---|---|
| 401 | Invalid or missing API key |
| 403 | Agency plan required |
| 404 | Resource not found |
| 409 | Conflict (e.g. duplicate slug) |
| 429 | Rate limit exceeded |