Skip to main content
POST
Cancel Batch Job

Overview

Cancels a batch job permanently. Behavior depends on job status:
  • Scheduled: Cancels Redis scheduled job + updates database
  • Pending/Running: Marks remaining contacts as cancelled
  • Completed/Failed/Cancelled: Returns error (cannot cancel)
Running calls complete normally; only pending/queued contacts are cancelled.

Request

Path Parameters

Response

Response Fields

Examples

Example 1: Cancel Scheduled Job

Response:

Example 2: Cancel Running Job

Response:

Example 3: Cancel Already Completed Job (Error)

Response:

Behavior by Status

Contact Statuses Affected

When cancelling a running job, only contacts in non-terminal statuses are cancelled: Cancelled Statuses:
  • pending — Not yet called
  • queued — Waiting for retry
  • no_answer — Will be retried
  • busy — Will be retried
  • timeout — Will be retried
Not Affected (Terminal Statuses):
  • completed — Already successful
  • failed — Final failure
  • blocked — Permanently blocked
  • invalid_number — Invalid phone number
  • carrier_error — Carrier error (final)
  • cancelled — Already cancelled

Error Handling

404 Not Found

400 Bad Request

500 Internal Server Error

Use Cases

Cancel Due to Error in Campaign

If you discover an error in your campaign (wrong message, wrong numbers):

Cancel Scheduled Job Before Start Time

Authorizations

Authorization
string
header
required

Your TalkifAI API key. Get it from Studio → Settings → API Keys.

Path Parameters

batch_job_id
string
required

Response

Batch job cancelled

success
boolean
Example:

true

message
string
Example:

"Scheduled job cancelled successfully"

batchJobId
string
redisJobCancelled
boolean
contactsCancelled
integer