Auto-save the draft
Access: an API key (or an org-wide key naming the workspace) with manage on campaigns.
Optimistic concurrency: send the revision you loaded as expectedRevision. saveKey makes a retried request idempotent. conflict and not_draft are answers (status 200), not errors: reload and merge, or stop editing.
apiKeyx-api-key<token>Workspace API key (nrk_…), shown once when created
campaignId*string^[0-9a-f]{24}$application/json- body
expectedRevision*integer0 <= value <= 9007199254740991saveKey*string8 <= length <= 100patch*Default Response
application/json- response
status*"saved""saved"revision*integer0 <= value <= 9007199254740991savedAt*string^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$date-timecurl -X PATCH 'https://api.tryzen.co/v1/campaigns/string/draft' \ -H 'Content-Type: application/json' \ -d '{ "expectedRevision": 0, "saveKey": "stringst", "patch": {}}'{ "status": "saved", "revision": 0, "savedAt": "2019-08-24T14:15:22Z"}Delete a campaign DELETE
**Access:** an API key (or an org-wide key naming the workspace) with manage on `campaigns`. Drafts and finished, canceled or failed campaigns. A scheduled, starting, running or paused campaign is 409 `campaign_not_deletable`: cancel it first. Right after a cancel, while its leads are still being stopped, 409 `campaign_still_stopping`: try again in a minute. The campaign and its sequence versions are deleted; its leads' history (actions, stats, lead rows) stays, so exclusion rules still see who it reached and workspace totals stay true. Webhooks filtered on it lose it from their filter; one filtered on it alone is deactivated rather than widened to all campaigns (`webhooks` counts both).
Would this draft launch now? Every problem, without launching POST
**Access:** an API key (or an org-wide key naming the workspace) with view on `campaigns`. Runs exactly the launch's checks (lead list exists and is ready, senders connected, schedule, the sequence with the list's custom fields as variables) and changes nothing. `ok` with warnings only, or not ok with every issue, in the shapes `launch` rejects with: `issues` and `sequenceIssues`. `wouldBecome` is `starting`, or `scheduled` for a future start date. A campaign that isn't a draft answers `ok: false` with `not_draft`.