p202 conversion reset-subids

Clear every conversion of a category or one of its campaigns (the UI's Reset Campaign Subids)

Web UIUpdate › Reset Campaign SubidsNew in 1.9.77Writescannot be staged
All commands

01Jobs it does

Each one is a real command line. Copy it, or open it in the builder below to change it.

Reset Campaign Subids

p202 conversion reset-subids --aff-network-id <aff_network_id>
Web UIUpdate › Reset Campaign Subids

02What you get

Pick the shape you need. People get a table. Add --json, --csv or --ndjson for scripts, or -q for ids only. An AI agent gets compact JSON without asking. All output formats

03Build your command

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

p202 conversion reset-subids

Set flags below; the command updates as you type.

04Flags

4 flags, plus the global flags every command takes.

FlagWhat it does
--aff-campaign-idstringOnly this campaign of the category (id from p202 campaign list; default: every campaign in it)
--aff-network-idstringrequiredThe category whose subids to reset (id from p202 aff-network list; required)
--dry-runboolCount the clicks and write nothing
--force, -fboolReset without asking

05How it works

Clears every conversion of the category (--aff-network-id), or of one campaign in it (--aff-campaign-id), so a report uploaded by mistake can be uploaded again: each converted click is cleared through the ledger and the data engine rebuilds the hours. Clicks stay.

It counts the clicks first (--dry-run stops there) and asks (--force skips). Running it again is safe: it clears what is left.

Needs a role with access_to_update_section and a key with conversions:write. Cannot be staged.

06For agents

Running this from an agent

  • Read the same facts as JSON: p202 commands conversion reset-subids --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 and cannot be staged: --staged is refused before anything is sent. Have a person run it, or give the agent a key without write scope.
p202 commands conversion reset-subids --json
{
  "path": "p202 conversion reset-subids",
  "use": "reset-subids",
  "short": "Clear every conversion of a category or one of its campaigns (the UI's Reset Campaign Subids)",
  "long": "Clears every conversion of the category (--aff-network-id), or of one campaign in it\n(--aff-campaign-id), so a report uploaded by mistake can be uploaded again: each converted\nclick is cleared through the ledger and the data engine rebuilds the hours. Clicks stay.\n\nIt counts the clicks first (--dry-run stops there) and asks (--force skips). Running it\nagain is safe: it clears what is left.\n\nNeeds a role with access_to_update_section and a key with conversions:write. Cannot be staged.",
  "runnable": true,
  "example": "p202 conversion reset-subids --aff-network-id 3 --dry-run\n  p202 conversion reset-subids --aff-network-id 3 --aff-campaign-id 12 --force",
  "tasks": [
    {
      "run": "p202 conversion reset-subids",
      "ui_pages": [
        "Update › Reset Campaign Subids"
      ]
    }
  ],
  "flags": [
    {
      "name": "aff-campaign-id",
      "type": "string",
      "default": "",
      "usage": "Only this campaign of the category (id from `p202 campaign list`; default: every campaign in it)",
      "required": false
    },
    {
      "name": "aff-network-id",
      "type": "string",
      "default": "",
      "usage": "The category whose subids to reset (id from `p202 aff-network list`; required)",
      "required": false
    },
    {
      "name": "dry-run",
      "type": "bool",
      "default": "false",
      "usage": "Count the clicks and write nothing",
      "required": false
    },
    {
      "name": "force",
      "shorthand": "f",
      "type": "bool",
      "default": "false",
      "usage": "Reset without asking",
      "required": false
    }
  ]
}