Cancelling Jobs via Jobs API

Details on how to cancel a job using the Jobs REST API

This page guides you through the process of cancelling a job using the Jobs API.

❗️

Jobs execute asynchronously, so any work already in progress won't be cancelled. As a result, you may still receive data after cancellation.

Required Parameters

Before using the Jobs API, ensure you have the following:

  • Job ID: The ID of the specific job you want to query.
  • Pipeline ID: The ID of the pipeline for which you want to list jobs.
  • Component ID: The ID of the component within the pipeline.

Cancel Job

To cancel a specific job

curl --request PATCH --location 'https://api.platform.datastreamer.io/api/pipelines/:PipelineId/components/:ComponentId/jobs/:JobId/state/cancelled' \
--header 'apikey: API_KEY'

Example

Here is an example of how the curl command might look after replacing the placeholders:

curl --location 'https://api.platform.datastreamer.io/api/pipelines/12345/components/67890/jobs/job123/state/cancelled' \
--header 'apikey: abcdef123456'

The API will return a JSON response containing details of the job after cancellation.

{
    "type": "job",
    "organization_id": "11111111-1111-1111-1111-111111111111",
    "pipeline_id": "12345",
    "step_id": "67890",
    "job_id": "job123",
    "state": "cancelled",
    "job_name": "test_twitter_auto",
    "data_source": "twitter_auto",
    "job_type": "oneTime",
    "priority": "normal",
    "preferred_start_time": "2026-09-15T19:15:31.910854Z",
    "query_from": "2026-09-14T00:00:00Z",
    "query_to": "2026-09-15T00:00:00Z",
    "query": {
        "platform": "twitter",
        "query": "test",
        "prioritization": "coverage",
        "per_day_limit": null,
        "include": [ { "max_documents": null } ]
    },
    "query_start_offset": 0,
    "start_time_offset": 0,
    "max_documents": 10,
    "secondary_max_documents": 0,
    "created": "2026-09-15T19:15:28.60794Z",
    "updated": "2026-09-15T19:16:32.420828Z",
    "started": "2026-09-15T19:15:31.919687Z",
    "ended": "2026-09-15T19:16:32.420828Z",
    "schedule_time": "2026-09-15T19:15:31.919687Z",
    "document_count": 0,
    "secondary_document_count": 0,
    "elapsed_time_ms": 2899,
    "run_count": 1,
    "error": ""
}

Did this page help you?