/i/campaign/create
Enterprise
This endpoint is part of Countly Enterprise. To get access, contact sales or compare versions. Existing customers can reach the support portal with questions.
Endpoint
/i/campaign/create
Overview
Creates an attribution campaign from the JSON object passed in args.
Authentication
Pass api_key or auth_token as a query parameter, or send countly-token as a header. See Authentication.
Permissions
- Attribution
Createpermission for the target app.
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
api_key | String | Yes (or use auth_token) | Dashboard API key. |
auth_token | String | Yes (or use api_key) | Dashboard auth token. |
app_id | String | Yes | Target app ID. |
args | JSON String (Object) | Yes | Campaign definition. |
args supports:
_idoptional custom campaign IDnamerequired campaign namelinkoptional default target URLfingerprintoptional booleancostoptional numeric stringcosttypeoptionalclick,install, orcampaignlinksoptional per-platform link maptypeoptional campaign typetypedataoptional type-specific objectpostbacksoptional array
Example
/i/campaign/create?api_key=YOUR_API_KEY&app_id=6991c75b024cb89cdc04efd2&args={"name":"Summer 2026","link":"https://example.com/install","cost":"0.5","costtype":"click","links":{"android":"https://play.google.com/store/apps/details?id=com.example"}}
Response
Success Response
{
"result": "Success"
}
Error Responses
Status Code: 200 OK
{
"result": "Not enough args"
}
Status Code: 200 OK
{
"result": "Duplicate campaign link"
}
Behavior
- Parses
argsfrom JSON. - Generates
_idautomatically when missing. - Normalizes defaults for
cost,costtype,links,type,typedata, andpostbacks. - Initializes summary counters such as
aclk,clk,ins,rev, andses. - If
costtype=campaign, initializestotalCostwith the campaign cost.
Implementation details
Database Collections
| Collection | Used for | Data touched by this endpoint |
|---|---|---|
countly.campaigns | Campaign storage | Inserts a new campaign document. |