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

Archive Campaign

Archive an ended campaign. End active, paused, ready or draft campaigns first with POST /v1/mail/campaigns/{id}/end. Archiving cancels remaining unsent mail and scheduled sends, releases reserved funds, and excludes the campaign from mail-attention reminders and the default campaign list. Mailing history is preserved. Mail already submitted to the printer may still ship.
Archiving is permanent. It does not delete recipients or previously mailed pieces. View archived campaigns with GET /v1/mail/campaigns?status=archived, or retrieve one by ID. Repeating the archive request safely finishes any interrupted cleanup.
Permission: The API key's owner needs permission to manage mail.
path idstringrequired
Campaign ID
Request example
curl -X POST https://api.v2.dealmachine.com/v1/mail/campaigns/a1b2c3d4/archive \ -H "Authorization: Bearer dm_sk_live_xxx"

Response

data contains the campaign with status: "archived". stopped_mail_count counts unsent pieces targeted by this request; already_printed_count counts pieces already sent to the printer or carrier. Repeated requests can return zero stopped pieces.

Errors

StatusCodeWhen
403permission_deniedThe API key owner cannot manage mail
404campaign_not_foundThe campaign does not exist in this workspace
409CAMPAIGN_NOT_ENDEDEnd the campaign before archiving; no mail or funds were changed

CLI and MCP

Use dm mail campaigns archive <id> --yes after confirming the cancellation. AI assistants can call dealmachine_mail_campaign_archive with campaign_id and confirmed: true after the user approves.