> ## 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 Get Batch

> Get a batch. Context.dev Contextdev Get Batch reference includes SDK V2 and CLI requests, input constraints, response fields, and Deepline cost.

Get a batch.

<Info>
  Tool ID: `contextdev_get_batch`
</Info>

## Run this action

Use the TypeScript SDK for a single call. Put `ctx.tools.execute(...)` inside a Play when the call should be durable, scheduled, or run across a CSV.

```ts theme={null}
import { Deepline } from 'deepline';

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

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

### CLI

```bash theme={null}
deepline tools execute contextdev_get_batch --input '{
  "batch_id": "batch_123"
}' --json
```

## Example response

The SDK exposes this shape at `result.toolResponse.raw`. Values below are representative.

```json theme={null}
{
  "data": {
    "id": "id_123",
    "status": "queued",
    "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",
      "completed_at": "2026-01-15T12:00:00Z"
    },
    "page_errors": [
      {
        "code": "example",
        "count": 123
      }
    ],
    "failure": {
      "code": "example",
      "message": "Example message"
    },
    "results": {
      "expires_at": "2026-01-15T12:00:00Z",
      "files": [
        {
          "url": "https://example.com",
          "items": 123,
          "bytes": 123
        }
      ]
    },
    "invalid_urls": [
      {
        "url": "https://example.com",
        "reason": "example"
      }
    ]
  }
}
```

Use `deepline tools get contextdev_get_batch --json` for the latest machine-readable contract.

## Input reference

Check progress, and get download links once the batch finishes.

| 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={null}
  {
    "type": "object",
    "description": "Check progress, and get download links once the batch finishes.",
    "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`                    | `"queued" \| "running" \| "cancelling" \| "completed" \| "cancelled" \| "failed"` | Yes      | —       | Allowed: `queued`, `running`, `cancelling`, `completed`, `cancelled`, `failed`. |
| `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.timing.completed_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.failure`                   | `object \| null`                                                                  | Yes      | —       | —                                                                               |
| `result.data.failure.code`              | `string`                                                                          | Yes      | —       | —                                                                               |
| `result.data.failure.message`           | `string`                                                                          | Yes      | —       | —                                                                               |
| `result.data.results`                   | `object \| null`                                                                  | Yes      | —       | —                                                                               |
| `result.data.results.expires_at`        | `string`                                                                          | Yes      | —       | —                                                                               |
| `result.data.results.files`             | `array`                                                                           | Yes      | —       | —                                                                               |
| `result.data.results.files[].url`       | `string`                                                                          | Yes      | —       | —                                                                               |
| `result.data.results.files[].items`     | `integer`                                                                         | Yes      | —       | —                                                                               |
| `result.data.results.files[].bytes`     | `integer`                                                                         | Yes      | —       | —                                                                               |
| `result.data.key_metadata`              | `object`                                                                          | No       | —       | —                                                                               |
| `result.data.invalid_urls`              | `array`                                                                           | Yes      | —       | —                                                                               |
| `result.data.invalid_urls[].url`        | `string`                                                                          | Yes      | —       | —                                                                               |
| `result.data.invalid_urls[].reason`     | `string`                                                                          | Yes      | —       | —                                                                               |
| `result.meta`                           | `object`                                                                          | No       | —       | —                                                                               |

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

  ### Output JSON Schema

  ```json theme={null}
  {
    "type": "object",
    "properties": {
      "data": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "queued",
              "running",
              "cancelling",
              "completed",
              "cancelled",
              "failed"
            ]
          },
          "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"
                ]
              },
              "completed_at": {
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "required": [
              "created_at",
              "started_at",
              "completed_at"
            ],
            "additionalProperties": false
          },
          "page_errors": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "code": {
                  "type": "string"
                },
                "count": {
                  "type": "integer"
                }
              },
              "required": [
                "code",
                "count"
              ],
              "additionalProperties": false
            }
          },
          "failure": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              }
            },
            "required": [
              "code",
              "message"
            ],
            "additionalProperties": false
          },
          "results": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "expires_at": {
                "type": "string"
              },
              "files": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "url": {
                      "type": "string"
                    },
                    "items": {
                      "type": "integer"
                    },
                    "bytes": {
                      "type": "integer"
                    }
                  },
                  "required": [
                    "url",
                    "items",
                    "bytes"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "required": [
              "expires_at",
              "files"
            ],
            "additionalProperties": false
          },
          "key_metadata": {
            "type": "object",
            "properties": {},
            "required": [],
            "additionalProperties": false
          },
          "invalid_urls": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "url": {
                  "type": "string"
                },
                "reason": {
                  "type": "string"
                }
              },
              "required": [
                "url",
                "reason"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "id",
          "status",
          "mode",
          "format",
          "tags",
          "crawl",
          "input",
          "progress",
          "timing",
          "page_errors",
          "failure",
          "results",
          "invalid_urls"
        ],
        "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](/docs/providers/contextdev/guide)
* [SDK V2 quickstart](/docs/sdk-v2/quickstart)
* [SDK reference](/docs/sdk-v2/sdk-reference)
* [Run tools across a CSV](/docs/sdk-v2/batch-csv)
