p202 campaign create

Create a new campaign

Writessupports --staged
All commands

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> --json

02What 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
$ 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
Real output · p202 1.9.77 · demo dataexit 0
p202 campaign create --aff-campaign-name Test
$ 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.
Real output · p202 1.9.77 · demo dataexit 1

Missing required flags.

03Build your command

Pick values and the command line writes itself, quoted and ready to paste.

p202 campaign create

Set flags below; the command updates as you type.

04Flags

17 flags, plus the global flags every command takes.

FlagWhat it does
--aff-campaign-cloakingstringEnable cloaking (1) or not (0): 0, 1
01
--aff-campaign-currencystringCurrency code (e.g. USD)
--aff-campaign-foreign-payoutstringForeign currency payout
--aff-campaign-namestringrequiredCampaign name (required)
--aff-campaign-payoutstringrequiredDefault payout (required)
--aff-campaign-rotatestringEnable rotation (1) or not (0): 0, 1
01
--aff-campaign-urlstringrequiredPrimary offer URL (required)
--aff-campaign-url-2stringOffer URL 2 (used with --aff-campaign-rotate 1)
--aff-campaign-url-3stringOffer URL 3
--aff-campaign-url-4stringOffer URL 4
--aff-campaign-url-5stringOffer URL 5
--aff-network-idstringrequiredCategory (affiliate network) id, from p202 aff-network list (required)
--app-registration-idstringThe 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-idstringThe attribution model this campaign's conversions are credited with, overriding the account default (p202 attribution model list; 0 returns it to the default)
--idempotency-keystringRetry-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-signalsstringLink this campaign's clicks into multi-touch journeys (1, default) or not (0): 0, 1
01
--payout-modestringHow conversions set a click's value, replace (latest payout, default) or accumulate (sum): replace, accumulate
replaceaccumulate

05For agents

Running this from an agent

  • Read the same facts as JSON: p202 commands campaign create --json.
  • With AI_AGENT, CLAUDECODE or another agent variable set, output is compact JSON and errors arrive on stderr as a JSON envelope with a hint.
  • Exit codes: 0 ok, 1 bad input, 2 auth, 3 network, 4 server error, 5 partial failure.
  • This command writes. Add --staged to record it as a proposal a person applies with p202 change apply.
p202 commands campaign create --json
{
  "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
    }
  ]
}