Skip to main content
POST

Clear campaign

Ends every active contact list of the campaign and, optionally, removes its calls — the same as Clear campaign in the dashboard. The campaign itself, its settings and its call history stay.

Endpoint

Path parameters

string
required
Campaign UUID.

Request headers

string
required
Bearer token. Format: Bearer talq_your_environment_token_here

Request body

boolean
default:"true"
When the campaign has SFTP export configured, export the results before removing the calls.
boolean
default:"false"
Remove the calls whose status is in delete_statuses. Without it, unfinished calls are only stopped.
string[]
default:"[]"
Statuses to remove when delete_calls is true: pending, queued, processing, awaiting_report, completed, failed, canceled, paused, terminated.
An empty delete_statuses removes nothing. To remove the calls of every status, send every status in the list.

What clearing does

  • Every unfinished call (pending, paused, processing) is stopped, so nothing in the old lists is dialed again. Finished calls are kept.
  • With delete_calls, calls in the chosen statuses leave the campaign. They are hidden, not destroyed: recordings, transcripts and billing stay.
  • Removed numbers can be imported again right away. This also drops their cooldown: a number that completed a call can be called again by the next list.
  • The response comes back when the lists are ended. Only the SFTP export, when configured, runs afterwards.

Examples

Response

Error responses

500 — Partially cleared

At least one list could not be ended (files_failed > 0) and is still active. Do not upload the next list yet: send the clear again — it only touches the lists that are still active.

404 — Campaign not found

The campaign does not exist or belongs to another environment.

Daily cycle

To replace a campaign’s mailing every day by script:
  1. Clear: POST /campaigns/{campaign_id}/clear. On 500, retry until it returns 200.
  2. Upload: POST /campaigns/{campaign_id}/files with the new CSV. On 422, fix the file — nothing was imported.
  3. Follow: GET /campaigns/{campaign_id}/files/{file_data_id}/progress every few seconds until completed or failed.
For mailings delivered as files, SFTP import does the same without an HTTP upload.