TryzenAPI
Campaigns

Auto-save the draft

PATCH
/v1/campaigns/{campaignId}/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.

Authorization

apiKey
headerx-api-key<token>

Workspace API key (nrk_…), shown once when created

Path Parameters

campaignId*string
Match^[0-9a-f]{24}$

Request Body

application/json
  1. body
expectedRevision*integer
Range0 <= value <= 9007199254740991
saveKey*string
Length8 <= length <= 100
patch*

Response Body

Default Response

application/json
  1. response
status*"saved"
Value in"saved"
revision*integer
Range0 <= value <= 9007199254740991
savedAt*string
Match^(?:(?:\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)))$
Formatdate-time
Example Request
curl -X PATCH 'https://api.tryzen.co/v1/campaigns/string/draft' \  -H 'Content-Type: application/json' \  -d '{  "expectedRevision": 0,  "saveKey": "stringst",  "patch": {}}'
Example Response
{  "status": "saved",  "revision": 0,  "savedAt": "2019-08-24T14:15:22Z"}