> ## Documentation Index
> Fetch the complete documentation index at: https://deepline.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Context.dev: Contextdev Cancel Batch

> Stop a Context.dev scraping batch from starting any more pages, by batch ID. Includes SDK V2 examples, input constraints, response fields, and Deepline cost.

Stop a Context.dev scraping batch from starting any more pages, by batch ID.

> [!NOTE]
>
> Tool ID: `contextdev_cancel_batch`

## Run this action

Use the TypeScript SDK for one call. Use `ctx.tools.execute(...)` inside a Play for durable calls, scheduled calls, or CSV processing.

```ts theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
import { Deepline } from 'deepline';

const deepline = await Deepline.connect();
const result = await deepline.tools.execute(
  'contextdev_cancel_batch',
  {
    "batch_id": "batch_123"
  },
);

console.log(result.toolResponse.raw);
```

### CLI

```bash theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
deepline tools execute contextdev_cancel_batch --input '{
  "batch_id": "batch_123"
}' --json
```

## Example response

The SDK returns this shape at `result.toolResponse.raw`. The example values illustrate the response.

```json theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
{
  "data": {
    "id": "id_123",
    "status": "cancelling",
    "mode": "scrape",
    "format": "markdown",
    "tags": [
      "example"
    ],
    "crawl": {
      "source": {
        "type": "start_url",
        "url": "https://example.com"
      },
      "max_pages": 123,
      "max_depth": 1,
      "follow_subdomains": true,
      "url_pattern": "https://example.com"
    },
    "input": {
      "reserved": 123,
      "reserved_is_ceiling": true,
      "submitted": 1,
      "duplicates": 123,
      "invalid": 1
    },
    "progress": {
      "succeeded": 123,
      "failed": 123,
      "pending": 123
    },
    "timing": {
      "created_at": "2026-01-15T12:00:00Z",
      "started_at": "2026-01-15T12:00:00Z"
    },
    "page_errors": [
      {
        "code": "example",
        "count": 123
      }
    ]
  }
}
```

Use `deepline describe contextdev_cancel_batch --json` for the latest machine-readable contract.

## Input reference

Stop a batch from starting new pages.

| Name | Type | Required | Default | Details |
| - | - | - | - | - |
| `payload.batch_id` | `string` | Yes | — | ID of the batch to retrieve or cancel. |

<details>
  <summary>Show raw input schema</summary>

  ### Input JSON Schema

  ```json theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
  {
    "type": "object",
    "description": "Stop a batch from starting new pages.",
    "properties": {
      "batch_id": {
        "type": "string",
        "description": "ID of the batch to retrieve or cancel."
      }
    },
    "required": [
      "batch_id"
    ],
    "additionalProperties": false
  }
  ```
</details>

## Output reference

| Name | Type | Required | Default | Details |
| - | - | - | - | - |
| `result.data` | `object` | Yes | — | — |
| `result.data.id` | `string` | Yes | — | — |
| `result.data.status` | `"cancelling"` | Yes | — | Allowed: `cancelling`. |
| `result.data.mode` | `"scrape" \| "crawl"` | Yes | — | Allowed: `scrape`, `crawl`. |
| `result.data.format` | `"markdown" \| "html"` | Yes | — | Allowed: `markdown`, `html`. |
| `result.data.tags` | `array` | Yes | — | — |
| `result.data.crawl` | `object \| null` | Yes | — | — |
| `result.data.crawl.source` | `object` | Yes | — | — |
| `result.data.crawl.source.type` | `"start_url"` | Yes | — | — |
| `result.data.crawl.source.url` | `string` | Yes | — | — |
| `result.data.crawl.source.domain` | `string` | Yes | — | — |
| `result.data.crawl.max_pages` | `integer` | Yes | — | — |
| `result.data.crawl.max_depth` | `integer \| null` | Yes | — | — |
| `result.data.crawl.follow_subdomains` | `boolean` | Yes | — | — |
| `result.data.crawl.url_pattern` | `string \| null` | Yes | — | — |
| `result.data.input` | `object` | Yes | — | — |
| `result.data.input.reserved` | `integer` | Yes | — | — |
| `result.data.input.reserved_is_ceiling` | `boolean` | Yes | — | — |
| `result.data.input.submitted` | `integer \| null` | Yes | — | — |
| `result.data.input.duplicates` | `integer` | Yes | — | — |
| `result.data.input.invalid` | `integer \| null` | Yes | — | — |
| `result.data.progress` | `object` | Yes | — | — |
| `result.data.progress.succeeded` | `integer` | Yes | — | — |
| `result.data.progress.failed` | `integer` | Yes | — | — |
| `result.data.progress.pending` | `integer` | Yes | — | — |
| `result.data.timing` | `object` | Yes | — | — |
| `result.data.timing.created_at` | `string` | Yes | — | — |
| `result.data.timing.started_at` | `string \| null` | Yes | — | — |
| `result.data.page_errors` | `array` | Yes | — | — |
| `result.data.page_errors[].code` | `string` | Yes | — | — |
| `result.data.page_errors[].count` | `integer` | Yes | — | — |
| `result.data.key_metadata` | `object` | No | — | — |
| `result.meta` | `object` | No | — | — |

<details>
  <summary>Show raw output schema</summary>

  ### Output JSON Schema

  ```json theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
  {
    "type": "object",
    "properties": {
      "data": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "cancelling"
            ]
          },
          "mode": {
            "type": "string",
            "enum": [
              "scrape",
              "crawl"
            ]
          },
          "format": {
            "type": "string",
            "enum": [
              "markdown",
              "html"
            ]
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "crawl": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "source": {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string",
                        "enum": [
                          "start_url"
                        ]
                      },
                      "url": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "type",
                      "url"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string",
                        "enum": [
                          "sitemap"
                        ]
                      },
                      "domain": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "type",
                      "domain"
                    ],
                    "additionalProperties": false
                  }
                ]
              },
              "max_pages": {
                "type": "integer"
              },
              "max_depth": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "follow_subdomains": {
                "type": "boolean"
              },
              "url_pattern": {
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "required": [
              "source",
              "max_pages",
              "max_depth",
              "follow_subdomains",
              "url_pattern"
            ],
            "additionalProperties": false
          },
          "input": {
            "type": "object",
            "properties": {
              "reserved": {
                "type": "integer"
              },
              "reserved_is_ceiling": {
                "type": "boolean"
              },
              "submitted": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "duplicates": {
                "type": "integer"
              },
              "invalid": {
                "type": [
                  "integer",
                  "null"
                ]
              }
            },
            "required": [
              "reserved",
              "reserved_is_ceiling",
              "submitted",
              "duplicates",
              "invalid"
            ],
            "additionalProperties": false
          },
          "progress": {
            "type": "object",
            "properties": {
              "succeeded": {
                "type": "integer"
              },
              "failed": {
                "type": "integer"
              },
              "pending": {
                "type": "integer"
              }
            },
            "required": [
              "succeeded",
              "failed",
              "pending"
            ],
            "additionalProperties": false
          },
          "timing": {
            "type": "object",
            "properties": {
              "created_at": {
                "type": "string"
              },
              "started_at": {
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "required": [
              "created_at",
              "started_at"
            ],
            "additionalProperties": false
          },
          "page_errors": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "code": {
                  "type": "string"
                },
                "count": {
                  "type": "integer"
                }
              },
              "required": [
                "code",
                "count"
              ],
              "additionalProperties": false
            }
          },
          "key_metadata": {
            "type": "object",
            "properties": {},
            "required": [],
            "additionalProperties": false
          }
        },
        "required": [
          "id",
          "status",
          "mode",
          "format",
          "tags",
          "crawl",
          "input",
          "progress",
          "timing",
          "page_errors"
        ],
        "additionalProperties": false
      },
      "meta": {
        "type": "object",
        "additionalProperties": true
      }
    },
    "required": [
      "data"
    ],
    "additionalProperties": false
  }
  ```
</details>

## Deepline cost

* Pricing model: `fixed` (per call).
* Estimated Deepline credits: `0` per pricing unit.
* Provider-native pricing may still exist outside Deepline credit billing.

## Related documentation

* [Context.dev provider guide](https://deepline.com/docs/providers/contextdev/guide.md)
* [SDK V2 quickstart](https://deepline.com/docs/sdk-v2/quickstart.md)
* [SDK reference](https://deepline.com/docs/sdk-v2/sdk-reference.md)
* [Run tools across a CSV](https://deepline.com/docs/sdk-v2/batch-csv.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.