> For the complete documentation index, see [llms.txt](https://docs.n8n.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.n8n.io/connect/n8n-api/data-table.md).

# Data Table

Operations about data tables and their rows

## List all data tables

> Retrieve a list of all data tables with optional filtering, sorting, and pagination.

```json
{"openapi":"3.0.0","info":{"title":"n8n Public API","version":"1.1.1"},"tags":[{"name":"DataTable","description":"Operations about data tables and their rows"}],"servers":[{"url":"/api/v1"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-N8N-API-KEY"}},"parameters":{"limit":{"name":"limit","in":"query","description":"The maximum number of items to return.","required":false,"schema":{"type":"number","default":100,"maximum":250}},"cursor":{"name":"cursor","in":"query","description":"Paginate by setting the cursor parameter to the nextCursor attribute returned by the previous request's response. Default value fetches the first \"page\" of the collection. See pagination for more detail.","required":false,"style":"form","schema":{"type":"string"}}},"schemas":{"dataTableList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/dataTable"}},"nextCursor":{"type":"string","description":"Paginate through data tables by setting the cursor parameter to a nextCursor attribute returned by a previous request. Default value fetches the first \"page\" of the collection.","nullable":true}}},"dataTable":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the data table"},"name":{"type":"string","description":"Name of the data table"},"columns":{"type":"array","description":"Column definitions","items":{"type":"object","properties":{"id":{"type":"string","description":"Column ID"},"name":{"type":"string","description":"Column name"},"type":{"type":"string","enum":["string","number","boolean","date"],"description":"Column data type"},"index":{"type":"integer","description":"Column position"}}}},"projectId":{"type":"string","description":"ID of the project this table belongs to"},"createdAt":{"type":"string","format":"date-time","description":"Timestamp when the table was created"},"updatedAt":{"type":"string","format":"date-time","description":"Timestamp when the table was last updated"}},"required":["id","name","columns","projectId","createdAt","updatedAt"]}},"responses":{"badRequest":{"description":"The request is invalid or provides malformed data."},"unauthorized":{"description":"Unauthorized"}}},"paths":{"/data-tables":{"get":{"tags":["DataTable"],"summary":"List all data tables","description":"Retrieve a list of all data tables with optional filtering, sorting, and pagination.","operationId":"list-data-tables","parameters":[{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/cursor"},{"name":"filter","in":"query","description":"JSON string of filter conditions","schema":{"type":"string","format":"jsonString"}},{"name":"sortBy","in":"query","description":"Sort format: field:asc or field:desc","schema":{"type":"string"}}],"responses":{"200":{"description":"Successfully retrieved data tables","content":{"application/json":{"schema":{"$ref":"#/components/schemas/dataTableList"}}}},"400":{"$ref":"#/components/responses/badRequest"},"401":{"$ref":"#/components/responses/unauthorized"}}}}}}
```

## Create a new data table

> Create a new data table in your personal project or a team project you have access to.

```json
{"openapi":"3.0.0","info":{"title":"n8n Public API","version":"1.1.1"},"tags":[{"name":"DataTable","description":"Operations about data tables and their rows"}],"servers":[{"url":"/api/v1"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-N8N-API-KEY"}},"schemas":{"createDataTableRequest":{"type":"object","properties":{"name":{"type":"string","description":"Name of the data table","minLength":1,"maxLength":128},"columns":{"type":"array","description":"Column definitions for the table","items":{"type":"object","properties":{"name":{"type":"string","description":"Column name","minLength":1},"type":{"type":"string","enum":["string","number","boolean","date","json"],"description":"Column data type"}},"required":["name","type"]}},"projectId":{"type":"string","description":"ID of the project to create the table in. When omitted, the table is created in the user's personal project.\n"}},"required":["name","columns"]},"dataTable":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the data table"},"name":{"type":"string","description":"Name of the data table"},"columns":{"type":"array","description":"Column definitions","items":{"type":"object","properties":{"id":{"type":"string","description":"Column ID"},"name":{"type":"string","description":"Column name"},"type":{"type":"string","enum":["string","number","boolean","date"],"description":"Column data type"},"index":{"type":"integer","description":"Column position"}}}},"projectId":{"type":"string","description":"ID of the project this table belongs to"},"createdAt":{"type":"string","format":"date-time","description":"Timestamp when the table was created"},"updatedAt":{"type":"string","format":"date-time","description":"Timestamp when the table was last updated"}},"required":["id","name","columns","projectId","createdAt","updatedAt"]}},"responses":{"badRequest":{"description":"The request is invalid or provides malformed data."},"unauthorized":{"description":"Unauthorized"},"forbidden":{"description":"Forbidden"},"conflict":{"description":"Conflict"}}},"paths":{"/data-tables":{"post":{"tags":["DataTable"],"summary":"Create a new data table","description":"Create a new data table in your personal project or a team project you have access to.","operationId":"create-data-table","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/createDataTableRequest"}}}},"responses":{"201":{"description":"Data table created successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/dataTable"}}}},"400":{"$ref":"#/components/responses/badRequest"},"401":{"$ref":"#/components/responses/unauthorized"},"403":{"$ref":"#/components/responses/forbidden"},"409":{"$ref":"#/components/responses/conflict"}}}}}}
```

## Get a data table

> Retrieve a specific data table by ID.

```json
{"openapi":"3.0.0","info":{"title":"n8n Public API","version":"1.1.1"},"tags":[{"name":"DataTable","description":"Operations about data tables and their rows"}],"servers":[{"url":"/api/v1"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-N8N-API-KEY"}},"parameters":{"dataTableId":{"name":"dataTableId","in":"path","description":"The ID of the data table","required":true,"schema":{"type":"string","format":"nanoid"}}},"schemas":{"dataTable":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the data table"},"name":{"type":"string","description":"Name of the data table"},"columns":{"type":"array","description":"Column definitions","items":{"type":"object","properties":{"id":{"type":"string","description":"Column ID"},"name":{"type":"string","description":"Column name"},"type":{"type":"string","enum":["string","number","boolean","date"],"description":"Column data type"},"index":{"type":"integer","description":"Column position"}}}},"projectId":{"type":"string","description":"ID of the project this table belongs to"},"createdAt":{"type":"string","format":"date-time","description":"Timestamp when the table was created"},"updatedAt":{"type":"string","format":"date-time","description":"Timestamp when the table was last updated"}},"required":["id","name","columns","projectId","createdAt","updatedAt"]}},"responses":{"unauthorized":{"description":"Unauthorized"},"notFound":{"description":"The specified resource was not found."}}},"paths":{"/data-tables/{dataTableId}":{"get":{"tags":["DataTable"],"summary":"Get a data table","description":"Retrieve a specific data table by ID.","operationId":"get-data-table","parameters":[{"$ref":"#/components/parameters/dataTableId"}],"responses":{"200":{"description":"Successfully retrieved data table","content":{"application/json":{"schema":{"$ref":"#/components/schemas/dataTable"}}}},"401":{"$ref":"#/components/responses/unauthorized"},"404":{"$ref":"#/components/responses/notFound"}}}}}}
```

## Delete a data table

> Delete a data table. This will also delete all rows in the table.

```json
{"openapi":"3.0.0","info":{"title":"n8n Public API","version":"1.1.1"},"tags":[{"name":"DataTable","description":"Operations about data tables and their rows"}],"servers":[{"url":"/api/v1"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-N8N-API-KEY"}},"parameters":{"dataTableId":{"name":"dataTableId","in":"path","description":"The ID of the data table","required":true,"schema":{"type":"string","format":"nanoid"}}},"responses":{"unauthorized":{"description":"Unauthorized"},"notFound":{"description":"The specified resource was not found."}}},"paths":{"/data-tables/{dataTableId}":{"delete":{"tags":["DataTable"],"summary":"Delete a data table","description":"Delete a data table. This will also delete all rows in the table.","operationId":"delete-data-table","parameters":[{"$ref":"#/components/parameters/dataTableId"}],"responses":{"204":{"description":"Data table deleted successfully"},"401":{"$ref":"#/components/responses/unauthorized"},"404":{"$ref":"#/components/responses/notFound"}}}}}}
```

## Update a data table

> Update a data table's name.

```json
{"openapi":"3.0.0","info":{"title":"n8n Public API","version":"1.1.1"},"tags":[{"name":"DataTable","description":"Operations about data tables and their rows"}],"servers":[{"url":"/api/v1"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-N8N-API-KEY"}},"parameters":{"dataTableId":{"name":"dataTableId","in":"path","description":"The ID of the data table","required":true,"schema":{"type":"string","format":"nanoid"}}},"schemas":{"updateDataTableRequest":{"type":"object","properties":{"name":{"type":"string","description":"New name for the data table","minLength":1,"maxLength":128}},"required":["name"]},"dataTable":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the data table"},"name":{"type":"string","description":"Name of the data table"},"columns":{"type":"array","description":"Column definitions","items":{"type":"object","properties":{"id":{"type":"string","description":"Column ID"},"name":{"type":"string","description":"Column name"},"type":{"type":"string","enum":["string","number","boolean","date"],"description":"Column data type"},"index":{"type":"integer","description":"Column position"}}}},"projectId":{"type":"string","description":"ID of the project this table belongs to"},"createdAt":{"type":"string","format":"date-time","description":"Timestamp when the table was created"},"updatedAt":{"type":"string","format":"date-time","description":"Timestamp when the table was last updated"}},"required":["id","name","columns","projectId","createdAt","updatedAt"]}},"responses":{"badRequest":{"description":"The request is invalid or provides malformed data."},"unauthorized":{"description":"Unauthorized"},"notFound":{"description":"The specified resource was not found."},"conflict":{"description":"Conflict"}}},"paths":{"/data-tables/{dataTableId}":{"patch":{"tags":["DataTable"],"summary":"Update a data table","description":"Update a data table's name.","operationId":"update-data-table","parameters":[{"$ref":"#/components/parameters/dataTableId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/updateDataTableRequest"}}}},"responses":{"200":{"description":"Data table updated successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/dataTable"}}}},"400":{"$ref":"#/components/responses/badRequest"},"401":{"$ref":"#/components/responses/unauthorized"},"404":{"$ref":"#/components/responses/notFound"},"409":{"$ref":"#/components/responses/conflict"}}}}}}
```

## Retrieve rows from a data table

> Query and retrieve rows from a data table with optional filtering, sorting, and pagination.

```json
{"openapi":"3.0.0","info":{"title":"n8n Public API","version":"1.1.1"},"tags":[{"name":"DataTable","description":"Operations about data tables and their rows"}],"servers":[{"url":"/api/v1"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-N8N-API-KEY"}},"parameters":{"dataTableId":{"name":"dataTableId","in":"path","description":"The ID of the data table","required":true,"schema":{"type":"string","format":"nanoid"}},"limit":{"name":"limit","in":"query","description":"The maximum number of items to return.","required":false,"schema":{"type":"number","default":100,"maximum":250}},"cursor":{"name":"cursor","in":"query","description":"Paginate by setting the cursor parameter to the nextCursor attribute returned by the previous request's response. Default value fetches the first \"page\" of the collection. See pagination for more detail.","required":false,"style":"form","schema":{"type":"string"}}},"schemas":{"dataTableRowList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/dataTableRow"}},"nextCursor":{"type":"string","description":"Paginate through rows by setting the cursor parameter to a nextCursor attribute returned by a previous request. Default value fetches the first \"page\" of the collection.","nullable":true}}},"dataTableRow":{"type":"object","properties":{"id":{"type":"integer","description":"The row ID (auto-generated)"},"createdAt":{"type":"string","format":"date-time","description":"The date and time the row was created"},"updatedAt":{"type":"string","format":"date-time","description":"The date and time the row was last updated"}},"additionalProperties":true,"description":"A data table row with system columns (id, createdAt, updatedAt) and user-defined columns"}},"responses":{"badRequest":{"description":"The request is invalid or provides malformed data."},"unauthorized":{"description":"Unauthorized"},"notFound":{"description":"The specified resource was not found."}}},"paths":{"/data-tables/{dataTableId}/rows":{"get":{"tags":["DataTable"],"summary":"Retrieve rows from a data table","description":"Query and retrieve rows from a data table with optional filtering, sorting, and pagination.","operationId":"get-data-table-rows","parameters":[{"$ref":"#/components/parameters/dataTableId"},{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/cursor"},{"name":"filter","in":"query","description":"JSON string of filter conditions","schema":{"type":"string","format":"jsonString"}},{"name":"sortBy","in":"query","description":"Sort format: columnName:asc or columnName:desc","schema":{"type":"string"}},{"name":"search","in":"query","description":"Search text across all string columns","schema":{"type":"string"}}],"responses":{"200":{"description":"Successfully retrieved rows","content":{"application/json":{"schema":{"$ref":"#/components/schemas/dataTableRowList"}}}},"400":{"$ref":"#/components/responses/badRequest"},"401":{"$ref":"#/components/responses/unauthorized"},"404":{"$ref":"#/components/responses/notFound"}}}}}}
```

## Insert rows into a data table

> Insert one or more rows into a data table.

```json
{"openapi":"3.0.0","info":{"title":"n8n Public API","version":"1.1.1"},"tags":[{"name":"DataTable","description":"Operations about data tables and their rows"}],"servers":[{"url":"/api/v1"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-N8N-API-KEY"}},"parameters":{"dataTableId":{"name":"dataTableId","in":"path","description":"The ID of the data table","required":true,"schema":{"type":"string","format":"nanoid"}}},"schemas":{"insertRowsRequest":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","additionalProperties":true},"description":"Array of rows to insert. Each row is an object with column names as keys.","minItems":1},"returnType":{"type":"string","enum":["count","id","all"],"default":"count","description":"- count: Return only the number of rows inserted\n- id: Return an array of inserted row IDs\n- all: Return the full row data for all inserted rows\n"}},"required":["data"]},"dataTableRow":{"type":"object","properties":{"id":{"type":"integer","description":"The row ID (auto-generated)"},"createdAt":{"type":"string","format":"date-time","description":"The date and time the row was created"},"updatedAt":{"type":"string","format":"date-time","description":"The date and time the row was last updated"}},"additionalProperties":true,"description":"A data table row with system columns (id, createdAt, updatedAt) and user-defined columns"}},"responses":{"badRequest":{"description":"The request is invalid or provides malformed data."},"unauthorized":{"description":"Unauthorized"},"notFound":{"description":"The specified resource was not found."}}},"paths":{"/data-tables/{dataTableId}/rows":{"post":{"tags":["DataTable"],"summary":"Insert rows into a data table","description":"Insert one or more rows into a data table.","operationId":"insert-data-table-rows","parameters":[{"$ref":"#/components/parameters/dataTableId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/insertRowsRequest"}}}},"responses":{"200":{"description":"Rows inserted successfully","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"count":{"type":"integer"}},"description":"Number of rows inserted (when returnType is 'count')"},{"type":"array","items":{"type":"integer"},"description":"Array of inserted row IDs (when returnType is 'id')"},{"type":"array","items":{"$ref":"#/components/schemas/dataTableRow"},"description":"Array of inserted rows (when returnType is 'all')"}]}}}},"400":{"$ref":"#/components/responses/badRequest"},"401":{"$ref":"#/components/responses/unauthorized"},"404":{"$ref":"#/components/responses/notFound"}}}}}}
```

## Update rows in a data table

> Update rows matching filter conditions in a data table.

```json
{"openapi":"3.0.0","info":{"title":"n8n Public API","version":"1.1.1"},"tags":[{"name":"DataTable","description":"Operations about data tables and their rows"}],"servers":[{"url":"/api/v1"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-N8N-API-KEY"}},"parameters":{"dataTableId":{"name":"dataTableId","in":"path","description":"The ID of the data table","required":true,"schema":{"type":"string","format":"nanoid"}}},"schemas":{"updateRowsRequest":{"type":"object","properties":{"filter":{"type":"object","properties":{"type":{"type":"string","enum":["and","or"],"default":"and"},"filters":{"type":"array","minItems":1,"items":{"type":"object","properties":{"columnName":{"type":"string"},"condition":{"type":"string","enum":["eq","neq","like","ilike","gt","gte","lt","lte"]},"value":{}},"required":["columnName","condition","value"]}}},"required":["filters"],"description":"Filter conditions to match rows for update"},"data":{"type":"object","additionalProperties":true,"description":"Column values to update"},"returnData":{"type":"boolean","default":false,"description":"If true, return the updated rows; if false, return true on success"},"dryRun":{"type":"boolean","default":false,"description":"If true, preview changes without persisting them"}},"required":["filter","data"]},"dataTableRow":{"type":"object","properties":{"id":{"type":"integer","description":"The row ID (auto-generated)"},"createdAt":{"type":"string","format":"date-time","description":"The date and time the row was created"},"updatedAt":{"type":"string","format":"date-time","description":"The date and time the row was last updated"}},"additionalProperties":true,"description":"A data table row with system columns (id, createdAt, updatedAt) and user-defined columns"}},"responses":{"badRequest":{"description":"The request is invalid or provides malformed data."},"unauthorized":{"description":"Unauthorized"},"notFound":{"description":"The specified resource was not found."}}},"paths":{"/data-tables/{dataTableId}/rows/update":{"patch":{"tags":["DataTable"],"summary":"Update rows in a data table","description":"Update rows matching filter conditions in a data table.","operationId":"update-data-table-rows","parameters":[{"$ref":"#/components/parameters/dataTableId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/updateRowsRequest"}}}},"responses":{"200":{"description":"Rows updated successfully","content":{"application/json":{"schema":{"oneOf":[{"type":"boolean","description":"True when returnData is false"},{"type":"array","items":{"$ref":"#/components/schemas/dataTableRow"},"description":"Updated rows when returnData is true"}]}}}},"400":{"$ref":"#/components/responses/badRequest"},"401":{"$ref":"#/components/responses/unauthorized"},"404":{"$ref":"#/components/responses/notFound"}}}}}}
```

## Upsert a row in a data table

> Update an existing row or insert a new one if no row matches the filter conditions.

```json
{"openapi":"3.0.0","info":{"title":"n8n Public API","version":"1.1.1"},"tags":[{"name":"DataTable","description":"Operations about data tables and their rows"}],"servers":[{"url":"/api/v1"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-N8N-API-KEY"}},"parameters":{"dataTableId":{"name":"dataTableId","in":"path","description":"The ID of the data table","required":true,"schema":{"type":"string","format":"nanoid"}}},"schemas":{"upsertRowRequest":{"type":"object","properties":{"filter":{"type":"object","properties":{"type":{"type":"string","enum":["and","or"],"default":"and"},"filters":{"type":"array","minItems":1,"items":{"type":"object","properties":{"columnName":{"type":"string"},"condition":{"type":"string","enum":["eq","neq","like","ilike","gt","gte","lt","lte"]},"value":{}},"required":["columnName","condition","value"]}}},"required":["filters"],"description":"Filter conditions to match existing row. If no row matches, a new row is inserted."},"data":{"type":"object","additionalProperties":true,"description":"Column values for the row"},"returnData":{"type":"boolean","default":false,"description":"If true, return the upserted row; if false, return true on success"},"dryRun":{"type":"boolean","default":false,"description":"If true, preview changes without persisting them"}},"required":["filter","data"]},"dataTableRow":{"type":"object","properties":{"id":{"type":"integer","description":"The row ID (auto-generated)"},"createdAt":{"type":"string","format":"date-time","description":"The date and time the row was created"},"updatedAt":{"type":"string","format":"date-time","description":"The date and time the row was last updated"}},"additionalProperties":true,"description":"A data table row with system columns (id, createdAt, updatedAt) and user-defined columns"}},"responses":{"badRequest":{"description":"The request is invalid or provides malformed data."},"unauthorized":{"description":"Unauthorized"},"notFound":{"description":"The specified resource was not found."}}},"paths":{"/data-tables/{dataTableId}/rows/upsert":{"post":{"tags":["DataTable"],"summary":"Upsert a row in a data table","description":"Update an existing row or insert a new one if no row matches the filter conditions.","operationId":"upsert-data-table-row","parameters":[{"$ref":"#/components/parameters/dataTableId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/upsertRowRequest"}}}},"responses":{"200":{"description":"Row upserted successfully","content":{"application/json":{"schema":{"oneOf":[{"type":"boolean","description":"True when returnData is false"},{"allOf":[{"$ref":"#/components/schemas/dataTableRow"}],"description":"Upserted row when returnData is true"}]}}}},"400":{"$ref":"#/components/responses/badRequest"},"401":{"$ref":"#/components/responses/unauthorized"},"404":{"$ref":"#/components/responses/notFound"}}}}}}
```

## Delete rows from a data table

> Delete rows matching filter conditions from a data table. Filter is required to prevent accidental deletion of all data.

```json
{"openapi":"3.0.0","info":{"title":"n8n Public API","version":"1.1.1"},"tags":[{"name":"DataTable","description":"Operations about data tables and their rows"}],"servers":[{"url":"/api/v1"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-N8N-API-KEY"}},"parameters":{"dataTableId":{"name":"dataTableId","in":"path","description":"The ID of the data table","required":true,"schema":{"type":"string","format":"nanoid"}}},"schemas":{"dataTableRow":{"type":"object","properties":{"id":{"type":"integer","description":"The row ID (auto-generated)"},"createdAt":{"type":"string","format":"date-time","description":"The date and time the row was created"},"updatedAt":{"type":"string","format":"date-time","description":"The date and time the row was last updated"}},"additionalProperties":true,"description":"A data table row with system columns (id, createdAt, updatedAt) and user-defined columns"}},"responses":{"badRequest":{"description":"The request is invalid or provides malformed data."},"unauthorized":{"description":"Unauthorized"},"notFound":{"description":"The specified resource was not found."}}},"paths":{"/data-tables/{dataTableId}/rows/delete":{"delete":{"tags":["DataTable"],"summary":"Delete rows from a data table","description":"Delete rows matching filter conditions from a data table. Filter is required to prevent accidental deletion of all data.","operationId":"delete-data-table-rows","parameters":[{"$ref":"#/components/parameters/dataTableId"},{"name":"filter","in":"query","required":true,"description":"JSON string of filter conditions. Required to prevent accidental deletion of all data.","schema":{"type":"string","format":"jsonString"}},{"name":"returnData","in":"query","description":"If true, return the deleted rows; if false, return true on success","schema":{"type":"boolean","default":false}},{"name":"dryRun","in":"query","description":"If true, preview which rows would be deleted without actually deleting them","schema":{"type":"boolean","default":false}}],"responses":{"200":{"description":"Rows deleted successfully","content":{"application/json":{"schema":{"oneOf":[{"type":"boolean","description":"True when returnData is false"},{"type":"array","items":{"$ref":"#/components/schemas/dataTableRow"},"description":"Deleted rows when returnData is true"}]}}}},"400":{"$ref":"#/components/responses/badRequest"},"401":{"$ref":"#/components/responses/unauthorized"},"404":{"$ref":"#/components/responses/notFound"}}}}}}
```

## List columns of a data table

> Retrieve all columns for a specific data table.

```json
{"openapi":"3.0.0","info":{"title":"n8n Public API","version":"1.1.1"},"tags":[{"name":"DataTable","description":"Operations about data tables and their rows"}],"servers":[{"url":"/api/v1"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-N8N-API-KEY"}},"parameters":{"dataTableId":{"name":"dataTableId","in":"path","description":"The ID of the data table","required":true,"schema":{"type":"string","format":"nanoid"}}},"schemas":{"dataTableColumn":{"type":"object","properties":{"id":{"type":"string","description":"Column ID"},"name":{"type":"string","description":"Column name"},"dataTableId":{"type":"string","description":"ID of the data table this column belongs to"},"type":{"type":"string","enum":["string","number","boolean","date"],"description":"Column data type"},"index":{"type":"integer","description":"Column position"}},"required":["id","name","dataTableId","type","index"]}},"responses":{"unauthorized":{"description":"Unauthorized"},"notFound":{"description":"The specified resource was not found."}}},"paths":{"/data-tables/{dataTableId}/columns":{"get":{"tags":["DataTable"],"summary":"List columns of a data table","description":"Retrieve all columns for a specific data table.","operationId":"list-data-table-columns","parameters":[{"$ref":"#/components/parameters/dataTableId"}],"responses":{"200":{"description":"Successfully retrieved columns","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/dataTableColumn"}}}}},"401":{"$ref":"#/components/responses/unauthorized"},"404":{"$ref":"#/components/responses/notFound"}}}}}}
```

## Add a column to a data table

> Add a new column to an existing data table.

```json
{"openapi":"3.0.0","info":{"title":"n8n Public API","version":"1.1.1"},"tags":[{"name":"DataTable","description":"Operations about data tables and their rows"}],"servers":[{"url":"/api/v1"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-N8N-API-KEY"}},"parameters":{"dataTableId":{"name":"dataTableId","in":"path","description":"The ID of the data table","required":true,"schema":{"type":"string","format":"nanoid"}}},"schemas":{"createColumnRequest":{"type":"object","properties":{"name":{"$ref":"#/components/schemas/dataTableColumnName"},"type":{"type":"string","enum":["string","number","boolean","date"],"description":"Column data type"},"index":{"type":"integer","minimum":0,"description":"Column position (optional, appended to end if omitted)"}},"required":["name","type"]},"dataTableColumnName":{"type":"string","description":"Column name. Must start with a letter; only letters, digits, and underscores after that; maximum 63 characters.","minLength":1,"maxLength":63,"pattern":"^[a-zA-Z][a-zA-Z0-9_]*$"},"dataTableColumn":{"type":"object","properties":{"id":{"type":"string","description":"Column ID"},"name":{"type":"string","description":"Column name"},"dataTableId":{"type":"string","description":"ID of the data table this column belongs to"},"type":{"type":"string","enum":["string","number","boolean","date"],"description":"Column data type"},"index":{"type":"integer","description":"Column position"}},"required":["id","name","dataTableId","type","index"]}},"responses":{"badRequest":{"description":"The request is invalid or provides malformed data."},"unauthorized":{"description":"Unauthorized"},"notFound":{"description":"The specified resource was not found."},"conflict":{"description":"Conflict"}}},"paths":{"/data-tables/{dataTableId}/columns":{"post":{"tags":["DataTable"],"summary":"Add a column to a data table","description":"Add a new column to an existing data table.","operationId":"create-data-table-column","parameters":[{"$ref":"#/components/parameters/dataTableId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/createColumnRequest"}}}},"responses":{"201":{"description":"Column created successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/dataTableColumn"}}}},"400":{"$ref":"#/components/responses/badRequest"},"401":{"$ref":"#/components/responses/unauthorized"},"404":{"$ref":"#/components/responses/notFound"},"409":{"$ref":"#/components/responses/conflict"}}}}}}
```

## Delete a column

> Remove a column from a data table. This will also delete all data in the column.

```json
{"openapi":"3.0.0","info":{"title":"n8n Public API","version":"1.1.1"},"tags":[{"name":"DataTable","description":"Operations about data tables and their rows"}],"servers":[{"url":"/api/v1"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-N8N-API-KEY"}},"parameters":{"dataTableId":{"name":"dataTableId","in":"path","description":"The ID of the data table","required":true,"schema":{"type":"string","format":"nanoid"}},"columnId":{"name":"columnId","in":"path","description":"The ID of the column","required":true,"schema":{"type":"string","format":"nanoid"}}},"responses":{"unauthorized":{"description":"Unauthorized"},"notFound":{"description":"The specified resource was not found."}}},"paths":{"/data-tables/{dataTableId}/columns/{columnId}":{"delete":{"tags":["DataTable"],"summary":"Delete a column","description":"Remove a column from a data table. This will also delete all data in the column.","operationId":"delete-data-table-column","parameters":[{"$ref":"#/components/parameters/dataTableId"},{"$ref":"#/components/parameters/columnId"}],"responses":{"204":{"description":"Column deleted successfully"},"401":{"$ref":"#/components/responses/unauthorized"},"404":{"$ref":"#/components/responses/notFound"}}}}}}
```

## Update a column

> Rename and/or reorder a column in a data table.

```json
{"openapi":"3.0.0","info":{"title":"n8n Public API","version":"1.1.1"},"tags":[{"name":"DataTable","description":"Operations about data tables and their rows"}],"servers":[{"url":"/api/v1"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-N8N-API-KEY"}},"parameters":{"dataTableId":{"name":"dataTableId","in":"path","description":"The ID of the data table","required":true,"schema":{"type":"string","format":"nanoid"}},"columnId":{"name":"columnId","in":"path","description":"The ID of the column","required":true,"schema":{"type":"string","format":"nanoid"}}},"schemas":{"updateColumnRequest":{"type":"object","properties":{"name":{"$ref":"#/components/schemas/dataTableColumnName"},"index":{"type":"integer","minimum":0,"description":"New zero-based position for the column"}},"additionalProperties":false,"anyOf":[{"required":["name"]},{"required":["index"]}]},"dataTableColumnName":{"type":"string","description":"Column name. Must start with a letter; only letters, digits, and underscores after that; maximum 63 characters.","minLength":1,"maxLength":63,"pattern":"^[a-zA-Z][a-zA-Z0-9_]*$"},"dataTableColumn":{"type":"object","properties":{"id":{"type":"string","description":"Column ID"},"name":{"type":"string","description":"Column name"},"dataTableId":{"type":"string","description":"ID of the data table this column belongs to"},"type":{"type":"string","enum":["string","number","boolean","date"],"description":"Column data type"},"index":{"type":"integer","description":"Column position"}},"required":["id","name","dataTableId","type","index"]}},"responses":{"badRequest":{"description":"The request is invalid or provides malformed data."},"unauthorized":{"description":"Unauthorized"},"notFound":{"description":"The specified resource was not found."},"conflict":{"description":"Conflict"}}},"paths":{"/data-tables/{dataTableId}/columns/{columnId}":{"patch":{"tags":["DataTable"],"summary":"Update a column","description":"Rename and/or reorder a column in a data table.","operationId":"update-data-table-column","parameters":[{"$ref":"#/components/parameters/dataTableId"},{"$ref":"#/components/parameters/columnId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/updateColumnRequest"}}}},"responses":{"200":{"description":"Column updated successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/dataTableColumn"}}}},"400":{"$ref":"#/components/responses/badRequest"},"401":{"$ref":"#/components/responses/unauthorized"},"404":{"$ref":"#/components/responses/notFound"},"409":{"$ref":"#/components/responses/conflict"}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.n8n.io/connect/n8n-api/data-table.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
