TryzenAPI
Campaigns

Replace a campaign's schedule, also after launch

PUT
/v1/campaigns/{campaignId}/schedule

Access: an API key (or an org-wide key naming the workspace) with manage on campaigns.

The whole schedule (time zone, days, hours, start and end date). Drafts, scheduled, starting, running and paused campaigns; canceled and failed ones, and finished ones whose end date is still ahead, are 422 campaign_closed (sending a finished campaign's current schedule back unchanged is a no-op). A finished campaign whose end date has passed may extend its end date, and change nothing else: a later end date than today in the campaign's time zone (422 end_date_not_later otherwise, also for no end date), every other field as it is (422 only_end_date_editable, each changed field in error.problems as field_locked). It stays finished: resume it, or add leads with resumeFinished. The start date is locked once the campaign started (422 start_date_locked: send it back unchanged). An invalid schedule is 422 schedule_invalid with every issue in error.problems; warnings come back in warnings. A running campaign's senders get the new window within seconds; a scheduled one starts on the new date. A concurrent settings write is 409 conflict.

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
schedule*

Response Body

Default Response

application/json
  1. response
schedule*
status*string
Value in"draft""scheduled""starting""in_progress""paused""finished""canceled""failed"
changed*boolean
warnings*array<>
Example Request
curl -X PUT 'https://api.tryzen.co/v1/campaigns/string/schedule' \  -H 'Content-Type: application/json' \  -d '{  "schedule": {    "tz": "string",    "days": [      "mon"    ],    "from": "string",    "to": "string",    "startDate": "string",    "endDate": "string"  }}'
Example Response
{  "schedule": {    "tz": "string",    "days": [      "mon"    ],    "from": "string",    "to": "string",    "startDate": "string",    "endDate": "string"  },  "status": "draft",  "changed": true,  "warnings": [    {      "code": "not_draft",      "severity": "error",      "field": "status",      "message": "string"    }  ]}