Unschedule a campaign
const url = 'https://api.sendwing.app/api/organizations/example/campaigns/example/unschedule';const options = {method: 'POST', headers: {'x-api-key': '<x-api-key>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.sendwing.app/api/organizations/example/campaigns/example/unschedule \ --header 'x-api-key: <x-api-key>'Returns a scheduled campaign to draft, to edit it or send it another time. 409 unless it’s scheduled.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The workspace, like org_…. An OAuth access token works in the one the member picked when connecting, which GET /me returns.
Like cmp_…
Responses
Section titled “Responses”The draft
object
Like cmp_…
Internal name, never shown to contacts
draft until it’s sent or scheduled, and the only status where it can change; scheduled sends at scheduledAt; sending until every recipient is handled, then sent; canceled when stopped first
The inbox snippet shown after the subject
On one of the workspace’s verified sending domains
May use merge tags, like {{firstName}}. Lists leave out the content
The plain-text version; generated from html when null
The editor’s content html was rendered from; null for HTML written by hand
A design of the email editor (contentVersion 2)
object
object
A colour like “#4f46e5”
A colour like “#4f46e5”
A colour like “#4f46e5”
A colour like “#4f46e5”
A colour like “#4f46e5”
object
A colour like “#4f46e5”
A document of the old editor (contentVersion 1)
object
object
object
object
object
object
object
object
The template it started from, for reference; its content was copied
Who receives the campaign
object
object
Null once the mailing list is deleted
object
Null once the segment is deleted
object
Null once the tag is deleted
Why a scheduled campaign couldn’t start and went back to draft; cleared by the next send
While set, a sending campaign sends nothing; resume it once the reason is fixed
The user_… or key_… that created it
The design as markdown, with ?include=markdown or when saved from markdown; null for content that isn’t a design
Example
{ "status": "draft", "contentJson": { "styles": { "backdrop": "#f4f4f5", "background": "#ffffff", "textColor": "#1f2937", "linkColor": "#2563eb", "brandColor": "#2563eb", "fontFamily": "system", "fontSize": 16 }, "sections": [ { "kind": "content", "layout": "1", "columns": [ [ { "type": "heading", "level": 1, "content": [ { "type": "text", "marks": [ { "type": "bold" } ] } ], "align": "left" } ] ], "paddingTop": 16, "paddingBottom": 16, "paddingLeft": 0, "paddingRight": 0, "verticalAlign": "top", "stackOnMobile": true } ] }, "audience": { "type": "all" }, "paused": { "reason": "sender_setup" }}The request isn’t valid; issues lists each problem
object
What went wrong, in words you can show people
For a 400, each invalid field of the request; for a 422, what to fix first
object
The field, like events.0.name in the request or subject of what it acts on
For a 5xx: quote it when contacting support
Example generated
{ "error": "example", "issues": [ { "path": "example", "message": "example" } ], "requestId": "example"}The API key or access token is missing, invalid or expired
object
What went wrong, in words you can show people
For a 400, each invalid field of the request; for a 422, what to fix first
object
The field, like events.0.name in the request or subject of what it acts on
For a 5xx: quote it when contacting support
Example generated
{ "error": "example", "issues": [ { "path": "example", "message": "example" } ], "requestId": "example"}The API key’s permissions, or the app’s scopes and the member’s role, don’t allow this
object
What went wrong, in words you can show people
For a 400, each invalid field of the request; for a 422, what to fix first
object
The field, like events.0.name in the request or subject of what it acts on
For a 5xx: quote it when contacting support
Example generated
{ "error": "example", "issues": [ { "path": "example", "message": "example" } ], "requestId": "example"}Not found in this workspace
object
What went wrong, in words you can show people
For a 400, each invalid field of the request; for a 422, what to fix first
object
The field, like events.0.name in the request or subject of what it acts on
For a 5xx: quote it when contacting support
Example generated
{ "error": "example", "issues": [ { "path": "example", "message": "example" } ], "requestId": "example"}Conflicts with the current state; error says how
object
What went wrong, in words you can show people
For a 400, each invalid field of the request; for a 422, what to fix first
object
The field, like events.0.name in the request or subject of what it acts on
For a 5xx: quote it when contacting support
Example generated
{ "error": "example", "issues": [ { "path": "example", "message": "example" } ], "requestId": "example"}Too many requests; wait for the seconds in Retry-After
object
What went wrong, in words you can show people
For a 400, each invalid field of the request; for a 422, what to fix first
object
The field, like events.0.name in the request or subject of what it acts on
For a 5xx: quote it when contacting support
Example generated
{ "error": "example", "issues": [ { "path": "example", "message": "example" } ], "requestId": "example"}