API reference/bulk

Cancel a bulk job

POST/api/v1/email/bulk/{jobId}/cancel

authentication
Secret API key as a bearer token
billing
Free.

Asks a queued or running job to stop. A queued job is cancelled on the spot; a running one stops at its next checkpoint and keeps the rows already written downloadable through the results endpoint. Rows already verified stay billed. The completion webhook fires with status cancelled just as it does for completed and failed. A job that already reached a terminal status answers 409 JOB_ALREADY_FINISHED.

Parameters

name in type description
jobIdrequiredpathintegerThe id returned at creation.

Example request

curl -X POST https://spaw.co/api/v1/email/bulk/512/cancel \
  -H "Authorization: Bearer sk_live_…"
const response = await fetch('https://spaw.co/api/v1/email/bulk/512/cancel', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer sk_live_…',
  },
});
const result = await response.json();
import requests

response = requests.post(
    'https://spaw.co/api/v1/email/bulk/512/cancel',
    headers={'Authorization': 'Bearer sk_live_…'},
)
result = response.json()
$ch = curl_init('https://spaw.co/api/v1/email/bulk/512/cancel');
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_HTTPHEADER => ['Authorization: Bearer sk_live_…'],
]);
$result = json_decode(curl_exec($ch), true);

Responses

200The job, with `cancel_requested` set.

{
    "success": true,
    "data": {
        "job": {
            "id": 512,
            "status": "processing",
            "total": 2000,
            "duplicate_count": 12,
            "processed": 900,
            "deliverable": 610,
            "risky": 140,
            "undeliverable": 150,
            "credits_used": 750,
            "stopped_reason": null,
            "cancel_requested": true,
            "webhook_status": null,
            "created_at": "2026-09-03T10:12:44+00:00",
            "finished_at": null
        }
    }
}

401The key is missing, malformed, or revoked.

{
    "success": false,
    "error": {
        "code": "UNAUTHENTICATED",
        "message": "Provide a valid API key as a bearer token.",
        "request_id": "req_01m1kgdm4xngzmbmff68g94w0c"
    }
}

404No such record on this account.

{
    "message": "Not Found"
}

409The job already finished.

{
    "success": false,
    "error": {
        "code": "JOB_ALREADY_FINISHED",
        "message": "The job has already finished and cannot be cancelled.",
        "request_id": "req_01m1kgdm4xngzmbmff68g94w0c"
    }
}

429Over 5 requests per second for the key. Retry after the limit resets.

{
    "success": false,
    "error": {
        "code": "RATE_LIMITED",
        "message": "Too many requests. Retry after the limit resets.",
        "request_id": "req_01m1kgdm4xngzmbmff68g94w0c"
    }
}

Error codes

Failures answer { success: false, error: { code, message, request_id } }. Each code has its own page.

markdown version·openapi.json