---
title: "Execute batch SQL query on workspace tables"
method: POST
path: "/workspaces/{workspace_id}/tables/query/batch"
tags: ["tables"]
---

# Execute batch SQL query on workspace tables

`POST /workspaces/{workspace_id}/tables/query/batch`

Executes a SQL query with multiple parameter sets for bulk operations. Useful for bulk INSERT, UPDATE, or DELETE operations with different parameter sets. Supports MessagePack responses (Accept: application/msgpack) for efficient binary data transfer.

## Path parameters

- `workspace_id` string, required

## Request body

- GithubComActiveloopaiDeeplakeApiInternalTablesExecuteBatchQueryRequest
  - `params_batch` array[]
    - unknown[]
      - unknown
  - `query` string

## Response `200`

Batch query executed successfully

- GithubComActiveloopaiDeeplakeApiInternalTablesBatchQueryResult
  - `affected_rows` integer
  - `execution_time_ms` number

## Other responses

- `400` — Invalid request (bad workspace ID, invalid body, empty query/batch, or invalid query)
- `401` — Unauthorized - missing or invalid authentication
- `403` — Access denied - user does not have access to this workspace
- `500` — Internal server error - batch query execution failed

---

[API](https://skmtc.net/deeplake/apis/deeplake-api.md) · [All operations](https://skmtc.net/deeplake/apis/deeplake-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/deeplake/deeplake-api/revisions/e16ed11d991c/schema)
