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 organization | This endpoint |
|---|---|
OWNER | Allowed |
ADMIN | Allowed |
MEMBER | Refused — 403 |
Path parameters
| Parameter | Type | Description |
|---|---|---|
campaignId | string | Unique 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 todraft.401 Unauthorized— missing or invalid key, or its owner left the organization.403 Forbidden— the key's owner is amemberof the organization, not anadmin.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
| Field | Type | Description |
|---|---|---|
success | boolean | Indicates if the operation was successful |
data.campaignId | string | The campaign that was unscheduled |
data.status | string | Always 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 answers409and the send goes on. - To move a departure rather than cancel it, call Schedule a campaign again — no need to unschedule first.