Skip to main content

Export Table as CSV

POST/workspace/{workspaceId}/tooljet-db/tables/{tableName}/export

Fetches rows from a ToolJet Database table and returns them as a downloadable CSV file. Supports column selection, multi-condition filtering, multi-column sorting, and offset-based pagination. Maximum 1,000 rows per request.

Path Parameters
workspaceIdUUIDrequired
The unique identifier of the workspace that owns the table. Must be a valid UUID.
tableNamestringrequired
Exact name of the ToolJet Database table to export. Case-sensitive.
Request Body
filtersFilterCondition[]optional
Array of filter conditions. All conditions are combined with AND logic.
sortSortCondition[]optional
Array of sort conditions applied in order.
selectstring[]optional
Column names to include in the CSV output, in the order listed. Defaults to all columns.
limitintegeroptional
Maximum rows to return. Must be between 1 and 1,000 inclusive. Defaults to 1,000.
offsetintegeroptional
Number of rows to skip before returning results. Must be ≥ 0. Defaults to 0. Use with limit to paginate.
FilterCondition
columnstringrequired
Column name to filter on.
operatorstringrequired
Filter operator. One of: equals, not equal, greater than, greater than or equal, less than, less than or equal, like, ilike, match, imatch, in, is.
valuestring | number | boolean | arrayrequired
Filter value. The in operator requires a non-empty array. The is operator accepts null, true, false, or "notNull". All other operators accept a string, number, or boolean.
SortCondition
columnstringrequired
Column name to sort on.
directionstringrequired
Sort direction. Must be "Ascending" or "Descending" (case-sensitive).
Error Responses
200
CSV file returned. The first row is the header. An empty result set (no matching rows) returns the header row only — not an error.
400
workspaceId is not a valid UUID.
400
limit is not a positive integer, or exceeds 1,000.
400
offset is negative or not an integer.
400
operator is not a recognised value.
400
in operator — value is empty or not an array.
400
is operator — value is not null, true, false, or "notNull".
400
Other operators — value is not a string, number, or boolean.
400
direction is not "Ascending" or "Descending".
401
Missing or invalid Authorization: Basic <token> header.
403
ENABLE_EXTERNAL_API is not set to true, or workspace does not have an active EXTERNAL_API license.
404
Table not found in the workspace, or endpoint not available on Community Edition.
Request
curl -X POST "https://{your-domain}/api/ext/workspace/{workspaceId}/tooljet-db/tables/orders/export" \
  -H "Authorization: Basic <access_token>" \
  -H "Content-Type: application/json" \
  -d '{
    "select": ["id", "customer_name", "status", "total"],
    "filters": [
      {
        "column": "status",
        "operator": "equals",
        "value": "shipped"
      },
      {
        "column": "total",
        "operator": "greater than",
        "value": 100
      }
    ],
    "sort": [
      {
        "column": "total",
        "direction": "Descending"
      }
    ],
    "limit": 500,
    "offset": 0
  }' \
  --output orders.csv

Response: 200

Content-Type: text/csv
Content-Disposition: attachment; filename="orders.csv"
id,customer_name,status,total
42,Jane Smith,shipped,320.00
17,John Doe,shipped,210.50