01Run it
Straight from the command's own help.
p202 campaign create --aff-campaign-name <campaign_name> --aff-campaign-url <campaign_url> --aff-campaign-payout <campaign_payout> --aff-network-id <id from p202 aff-network list> --json02What you get
Captured from the real binary, run against a demo store with 30 days of traffic. Switch tabs to see the same run as JSON, the shape scripts and agents parse.
$ p202 campaign create --aff-campaign-name "Spring Collection / US" --aff-campaign-url https://example.com/shop/spring-collection --aff-campaign-payout 86 --aff-network-id 1 aff_campaign_cloaking: 0 aff_campaign_currency: USD aff_campaign_foreign_payout: 0 aff_campaign_id: 8 aff_campaign_id_public: 685 aff_campaign_name: Spring Collection / US aff_campaign_payout: 86 aff_campaign_rotate: 0 aff_campaign_url: https://example.com/shop/spring-collection aff_campaign_url_2: aff_campaign_url_3: aff_campaign_url_4: aff_campaign_url_5: aff_network_id: 1 app_registration_id: attribution_model_id: etag: "c41ee7087e1d69e5ab91967a25c7a5627d14e053" identity_signals: 1 payout_mode: replace user_id: 1 version: c41ee7087e1d69e5ab91967a25c7a5627d14e053
$ p202 campaign create --aff-campaign-name Test Error [validation]: required flags --aff-campaign-url, --aff-campaign-payout, --aff-network-id are missing Hint: --aff-network-id takes an id from `p202 aff-network list`. `p202 campaign create --help` shows an example with every required flag.
$ AI_AGENT=1 p202 campaign create --aff-campaign-name Test {"error":{"category":"validation","command":"p202 campaign create","exit_code":1,"hint":"--aff-network-id takes an id from `p202 aff-network list`. `p202 campaign create --help` shows an example with every required flag.","message":"required flags --aff-campaign-url, --aff-campaign-payout, --aff-network-id are missing"}}
Missing required flags.
03Build your command
Pick values and the command line writes itself, quoted and ready to paste.
p202 campaign createSet flags below; the command updates as you type.
04Flags
17 flags, plus the global flags every command takes.
| Flag | What it does |
|---|---|
| --aff-campaign-cloakingstring | Enable cloaking (1) or not (0): 0, 101 |
| --aff-campaign-currencystring | Currency code (e.g. USD) |
| --aff-campaign-foreign-payoutstring | Foreign currency payout |
| --aff-campaign-namestringrequired | Campaign name (required) |
| --aff-campaign-payoutstringrequired | Default payout (required) |
| --aff-campaign-rotatestring | Enable rotation (1) or not (0): 0, 101 |
| --aff-campaign-urlstringrequired | Primary offer URL (required) |
| --aff-campaign-url-2string | Offer URL 2 (used with --aff-campaign-rotate 1) |
| --aff-campaign-url-3string | Offer URL 3 |
| --aff-campaign-url-4string | Offer URL 4 |
| --aff-campaign-url-5string | Offer URL 5 |
| --aff-network-idstringrequired | Category (affiliate network) id, from p202 aff-network list (required) |
| --app-registration-idstring | The Android app registration this campaign's store links install (p202 app list --platform android; 0 unlinks). An install of another app on its click is foreign_click |
| --attribution-model-idstring | The attribution model this campaign's conversions are credited with, overriding the account default (p202 attribution model list; 0 returns it to the default) |
| --idempotency-keystring | Retry-safe create: the server records the response under this key and replays it on a retry with the same key and payload instead of creating a duplicate |
| --identity-signalsstring | Link this campaign's clicks into multi-touch journeys (1, default) or not (0): 0, 101 |
| --payout-modestring | How conversions set a click's value, replace (latest payout, default) or accumulate (sum): replace, accumulatereplaceaccumulate |
05For agents
Running this from an agent
- Read the same facts as JSON:
p202 commands campaign create --json. - With
AI_AGENT,CLAUDECODEor another agent variable set, output is compact JSON and errors arrive on stderr as a JSON envelope with ahint. - Exit codes: 0 ok, 1 bad input, 2 auth, 3 network, 4 server error, 5 partial failure.
- This command writes. Add
--stagedto record it as a proposal a person applies withp202 change apply.
{
"path": "p202 campaign create",
"use": "create",
"short": "Create a new campaign",
"runnable": true,
"example": "p202 campaign create --aff-campaign-name <campaign_name> --aff-campaign-url <campaign_url> --aff-campaign-payout <campaign_payout> --aff-network-id <id from p202 aff-network list> --json",
"flags": [
{
"name": "aff-campaign-cloaking",
"type": "string",
"default": "",
"usage": "Enable cloaking (1) or not (0): 0, 1",
"allowed_values": [
"0",
"1"
],
"required": false
},
{
"name": "aff-campaign-currency",
"type": "string",
"default": "",
"usage": "Currency code (e.g. USD)",
"required": false
},
{
"name": "aff-campaign-foreign-payout",
"type": "string",
"default": "",
"usage": "Foreign currency payout",
"required": false
},
{
"name": "aff-campaign-name",
"type": "string",
"default": "",
"usage": "Campaign name (required)",
"required": true
},
{
"name": "aff-campaign-payout",
"type": "string",
"default": "",
"usage": "Default payout (required)",
"required": true
},
{
"name": "aff-campaign-rotate",
"type": "string",
"default": "",
"usage": "Enable rotation (1) or not (0): 0, 1",
"allowed_values": [
"0",
"1"
],
"required": false
},
{
"name": "aff-campaign-url",
"type": "string",
"default": "",
"usage": "Primary offer URL (required)",
"required": true
},
{
"name": "aff-campaign-url-2",
"type": "string",
"default": "",
"usage": "Offer URL 2 (used with --aff-campaign-rotate 1)",
"required": false
},
{
"name": "aff-campaign-url-3",
"type": "string",
"default": "",
"usage": "Offer URL 3",
"required": false
},
{
"name": "aff-campaign-url-4",
"type": "string",
"default": "",
"usage": "Offer URL 4",
"required": false
},
{
"name": "aff-campaign-url-5",
"type": "string",
"default": "",
"usage": "Offer URL 5",
"required": false
},
{
"name": "aff-network-id",
"type": "string",
"default": "",
"usage": "Category (affiliate network) id, from `p202 aff-network list` (required)",
"required": true
},
{
"name": "app-registration-id",
"type": "string",
"default": "",
"usage": "The Android app registration this campaign's store links install (`p202 app list --platform android`; 0 unlinks). An install of another app on its click is foreign_click",
"required": false
},
{
"name": "attribution-model-id",
"type": "string",
"default": "",
"usage": "The attribution model this campaign's conversions are credited with, overriding the account default (`p202 attribution model list`; 0 returns it to the default)",
"required": false
},
{
"name": "idempotency-key",
"type": "string",
"default": "",
"usage": "Retry-safe create: the server records the response under this key and replays it on a retry with the same key and payload instead of creating a duplicate",
"required": false
},
{
"name": "identity-signals",
"type": "string",
"default": "",
"usage": "Link this campaign's clicks into multi-touch journeys (1, default) or not (0): 0, 1",
"allowed_values": [
"0",
"1"
],
"required": false
},
{
"name": "payout-mode",
"type": "string",
"default": "",
"usage": "How conversions set a click's value, replace (latest payout, default) or accumulate (sum): replace, accumulate",
"allowed_values": [
"replace",
"accumulate"
],
"required": false
}
]
}