Skip to main content
DELETE
/
job
/
{jobId}
Cancel Job
curl --request DELETE \
  --url https://dev.api.runpulse.com/job/{jobId} \
  --header 'x-api-key: <api-key>'
{
  "job_id": "<string>",
  "message": "<string>"
}

Overview

Cancel an asynchronous job that is currently pending or processing. Jobs that have already completed, failed, or been canceled will remain unchanged.

Response

A successful cancellation returns a confirmation message:
{
  "job_id": "abc123-def456-ghi789",
  "message": "Job cancelled successfully"
}

Response Fields

FieldTypeDescription
job_idstringIdentifier of the job that was cancelled.
messagestringHuman-readable confirmation message.

When to Cancel Jobs

Cancel jobs when:
  • The extraction is no longer needed
  • You submitted a job with incorrect parameters
  • You want to stop processing to conserve page usage
Cancellation is best-effort. If a job is already mid-processing, it may complete before the cancellation takes effect. Pages used before cancellation are still counted toward your usage.

Example Usage

# Cancel a pending or processing job
curl -X DELETE https://api.runpulse.com/job/abc123-def456 \
  -H "x-api-key: YOUR_API_KEY"
import requests

def cancel_job(job_id: str, api_key: str):
    response = requests.delete(
        f"https://api.runpulse.com/job/{job_id}",
        headers={"x-api-key": api_key}
    )
    
    if response.status_code == 200:
        print(f"Job {job_id} cancelled successfully")
    elif response.status_code == 404:
        print(f"Job {job_id} not found")
    else:
        print(f"Failed to cancel: {response.text}")

Error Responses

StatusDescription
401Invalid or missing API key.
403You don’t have access to this job.
404Job not found.
500Job could not be cancelled or internal server error.

Authorizations

x-api-key
string
header
required

API key for authentication

Path Parameters

jobId
string
required

Identifier returned from an async job submission (e.g., /extract_async).

Response

Job cancellation accepted

Confirmation payload returned after successfully canceling a job.

job_id
string
required

Identifier of the job that was cancelled.

message
string
required

Human-readable confirmation message.