Unschedule a campaign

DELETE /api/v1/campaigns/{campaignId}/schedule Cancels a booked send: a scheduled campaign — or a paused one that still has a date — goes back to draft, with no date. The booked time no longer applies, and the campaign will not leave until you send or schedule it again.

Authorization

Role in the organizationThis endpoint
OWNERAllowed
ADMINAllowed
MEMBERRefused — 403
A key carries the role its creator holds in this organization — never a role on AgentsMail itself. See API keys.

Path parameters

ParameterTypeDescription
campaignIdstringUnique identifier of a campaign

Example

bash
curl -X DELETE -H "x-api-key: $AGENTMAIL_API_KEY" \
  "https://www.agentsmail.io/api/v1/campaigns/$CAMPAIGN_ID/schedule"

Response

  • 200 OK — the campaign is back to draft.
  • 401 Unauthorized — missing or invalid key, or its owner left the organization.
  • 403 Forbidden — the key's owner is a member of the organization, not an admin.
  • 404 Not Found — no such campaign, or it belongs to another organization.
  • 409 Conflict — the campaign is not scheduled (a draft, already sending, sent…), or it changed between your read and this call. Nothing is written.
  • 429 Too Many Requests — over 120 requests in a minute for this key.

Response fields

FieldTypeDescription
successbooleanIndicates if the operation was successful
data.campaignIdstringThe campaign that was unscheduled
data.statusstringAlways draft

Example response

json
{
  "success": true,
  "data": {"campaignId": "6c6c6c6c-5555-4aaa-8bbb-999900001111", "status": "draft"}
}

Notes

  • Too late is too late: once the campaign is sending, this answers 409 and the send goes on.
  • To move a departure rather than cancel it, call Schedule a campaign again — no need to unschedule first.