01Run it
Replace the <placeholders> with your own values, or use the builder below.
p202 attribution model create --model-name <model_name> --model-type <model_type>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 formats03Build your command
Pick values and the command line writes itself, quoted and ready to paste.
p202 attribution model createSet flags below; the command updates as you type.
04Flags
7 flags, plus the global flags every command takes.
| Flag | What it does |
|---|---|
| --defaultbool | Make this the account default model |
| --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 |
| --lookback-daysint ยท default 30 | Days before a conversion whose clicks can earn credit, 1-365 |
| --model-namestringrequired | Model name (required) |
| --model-typestringrequired | Type (required): last_touch, first_touch, linear, time_decay, position_basedlast_touchfirst_touchlineartime_decayposition_based |
| --statusstring | Status: active, inactiveactiveinactive |
| --weighting-configstring | Weighting config JSON object: time_decay {"half_life_hours":48}, position_based {"first_weight":0.4,"last_weight":0.4} |
05For agents
Running this from an agent
- Read the same facts as JSON:
p202 commands attribution model 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 attribution model create",
"use": "create",
"short": "Create an attribution model; its credits are computed for existing conversions by the next worker run",
"runnable": true,
"flags": [
{
"name": "default",
"type": "bool",
"default": "false",
"usage": "Make this the account default model",
"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": "lookback-days",
"type": "int",
"default": "30",
"usage": "Days before a conversion whose clicks can earn credit, 1-365",
"required": false
},
{
"name": "model-name",
"type": "string",
"default": "",
"usage": "Model name (required)",
"required": true
},
{
"name": "model-type",
"type": "string",
"default": "",
"usage": "Type (required): last_touch, first_touch, linear, time_decay, position_based",
"allowed_values": [
"last_touch",
"first_touch",
"linear",
"time_decay",
"position_based"
],
"required": true
},
{
"name": "status",
"type": "string",
"default": "",
"usage": "Status: active, inactive",
"allowed_values": [
"active",
"inactive"
],
"required": false
},
{
"name": "weighting-config",
"type": "string",
"default": "",
"usage": "Weighting config JSON object: time_decay {\"half_life_hours\":48}, position_based {\"first_weight\":0.4,\"last_weight\":0.4}",
"required": false
}
]
}