---
title: "Submit async batch DuckDB job"
method: POST
path: "/v4/query/jobs/batch"
tags: ["v4", "Query Jobs"]
---

# Submit async batch DuckDB job

`POST /v4/query/jobs/batch`

## Request body

- SubmitDuckDBBatchJobRequest
  - `queries` BatchQueryItem[], required — Ordered list of queries to run on the container
    - `sql` string, required — SQL query to execute
    - `queryType` 'json' | 'arrow' | 'exec' — Query type for this item: 'arrow', 'json', or 'exec'
  - `mode` 'serial' | 'parallel'
  - `resources` ComputeResourceRequest — Compute resource request shared by the DuckDB cluster and E2B sandbox paths. Defaults are sized for the DuckDB cluster. Non-DuckDB callers must check `model_fields_set` before reading `cpu`/`memory`, otherwise the DuckDB defaults will be used for other engines — see `defapi.config.e2b.select_e2b_sandbox_tier` for an example.
    - `cpu` string — CPU cores in Kubernetes format (e.g., '4', '2.5', '500m')
    - `memory` string — Memory in Kubernetes format (e.g., '16Gi', '512Mi', '1G')
    - `timeoutSeconds` integer — Job timeout in seconds (60-604800, default 3600)
  - `integrationId` union — Optional integration ID. If not provided, uses team's default Ducklake integration.
    - string, uuid
    - string
  - `blockId` union — Optional block ID associated with the job
    - string, uuid
    - string

## Response `202`

Success

- SuccessResponseDuckDBJobResponse
  - `success` true, required — Flag for it request was successful
  - `data` DuckDBJobResponse, required
    - `jobId` string, required — Unique job identifier (e.g., 'duckdb-job-abc123')
    - `status` 'pending' | 'running' | 'succeeded' | 'failed' | 'unknown', required — Status of an async DuckDB K8s job.
    - `teamId` union — Team that submitted the job
      - string, uuid
      - string
    - `userId` union — User that submitted the job
      - string, uuid
      - string
    - `integrationId` union — Integration used
      - string, uuid
      - string
    - `blockId` union — Associated block ID
      - string, uuid
      - string
    - `queryType` 'json' | 'arrow' | 'exec' | 'batch'
    - `cpu` string, nullable — CPU resources requested
    - `memory` string, nullable — Memory requested
    - `timeoutSeconds` integer, nullable — Job timeout
    - `createdAt` string, date-time, nullable — Job submission time
  - `meta` ResponseMeta
    - `requestId` string — Unique request identifier for tracing
    - `timestamp` string, date-time — Response timestamp (UTC)
    - `durationMs` integer, nullable — Request processing time in milliseconds

## Other responses

- `401` — Auth Invalid Token
- `403` — Forbidden Insufficient Permissions
- `404` — Resource Not Found
- `422` — Validation Failed
- `426` — Business Quota Exceeded
- `500` — Internal Error

---

[API](https://skmtc.dev/definite/apis/defapi.md) · [All operations](https://skmtc.dev/definite/apis/defapi/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/definite/defapi/revisions/3943d8deb3be/schema)
