- Create:
POST /v1/tables, orPOST /v1/tables/importfrom a CSV or Excel file. - Rows:
GETandPOSTon/v1/tables/{table_id}/rows,POST /v1/tables/{table_id}/rows/bulk, andPATCHandDELETEon/v1/tables/{table_id}/rows/{row_id}.DELETE /v1/tables/{table_id}/rowsclears every row. - Query:
POST /v1/tables/query. - Export:
GET /v1/tables/{table_id}/export.
table_id, row_id and your_api_key. SQL refers to a table by its identifier (sql_name), which the create response includes.
Create a table
Column
type is one of string, number, boolean, datetime, file or
reference. A reference column also takes references (the linked table’s
id) and on_delete: restrict (the default), cascade or set_null.
Every table also gets an id primary key: uuid (default) or
autoincrement, set with id_type. It can’t be changed later.Insert rows in bulk
Each call inserts up to 1,000 rows. Rows are objects keyed by column name.
For larger loads, send batches, or import a file instead.
Import a CSV or Excel file
Creates a new table from a
.csv or .xlsx file of up to 25 MB and 500,000
rows. Send the file and a JSON spec as multipart form fields. In columns,
index is the column’s position in the file. Imports are all-or-nothing.
In Python, use client.tables.import_csv. Over REST, don’t set
Content-Type yourself; let your HTTP client set the multipart boundary.Query with SQL
Runs one read-only
SELECT across the workspace’s tables, including
platform tables. Results are capped at
10,000 rows and queries time out after 10 seconds, so add LIMIT and
ORDER BY. See SQL Queries for what’s allowed.Page through rows
Returns up to 500 rows per page, with
limit and offset. The response also
carries total, the number of matching rows. search matches text in any
column except id. The SDK’s iter_rows() pages for you.Update and delete a row
Target a row by its
id. An update changes only the columns you send and
returns the updated row. Deleting a row can’t be undone.Export to CSV
Downloads every row as a UTF-8 CSV, with column identifiers in the header and
id first.Async / await with the SDK
Use the
a-prefixed coroutines (acreate, aget, ainsert_rows, aquery,
aiter_rows, aupdate_row, adelete_row, aexport_csv) from async code so
the event loop stays responsive.