Agent-readable docs index: /llms.txt. Full docs in one file: /llms-full.txt. Download /docs.zip to grep all markdown files locally.

End Campaign

End a ready, active, or paused campaign. Ending is permanent:
  • Unsent mail is stopped. Mail already printed or with the carrier is still delivered.
  • The campaign's status becomes ended.
  • Properties can no longer be added, and the campaign cannot be paused, resumed, or made active again.
To reuse an ended campaign's steps, create a new campaign with the same steps.
A draft has not started, so it cannot be ended and returns 409 campaign_is_draft. Cancel the draft with Cancel Campaign or leave it unsent.
Cancel Campaign (DELETE /v1/mail/campaigns/{id}) ends a started campaign the same way and returns the same response. Unlike End, it also cancels drafts and returns an already ended campaign with 200 instead of 409.
Permission: The API key's owner needs permission to manage mail. Without it the request returns 403.
path idstringrequired
Campaign ID (UUID)
Request example
curl -X POST https://api.v2.dealmachine.com/v1/mail/campaigns/a1b2c3d4/end \ -H "Authorization: Bearer dm_sk_live_xxx"

Response

data is the campaign, with status set to ended. Two counts describe the mail:
FieldDescription
stopped_mail_countPieces that were stopped and will not be sent
already_printed_countPieces already printed or with the carrier, which will still be delivered

Errors

StatusCodeWhen
403permission_deniedThe API key's owner does not have permission to manage mail
404campaign_not_foundNo campaign with this ID in your workspace
409campaign_endedThe campaign has already ended
409campaign_is_draftThe campaign is a draft and has not started
Response example
{ "data": { "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "organization_id": 42, "name": "Spring Seller Campaign", "status": "ended", "type": "one_off", "is_accepting_properties": true, "can_add_properties": false, "total_recipients": 150, "total_sent": 120, "total_delivered": 115, "created_at": "2026-03-01T14:23:45Z", "launched_at": "2026-03-02T10:00:00Z" }, "stopped_mail_count": 12, "already_printed_count": 3 }