The Tables API allows you to create custom data tables and perform CRUD operations on records.
List Tables
Get all tables in your organization.
GET /tables
Query Parameters:
| Parameter | Type | Description |
|---|---|---|
page | integer | Page number (default: 1) |
limit | integer | Items per page (default: 50) |
Response:
{
"success": true,
"data": [
{
"id": "tbl_abc123",
"name": "Contacts",
"slug": "contacts",
"description": "Customer contact information",
"icon": "IconUsers",
"row_count": 150,
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-20T14:15:00Z"
}
],
"pagination": {
"page": 1,
"limit": 50,
"total": 5
}
}
Get Table
Get details of a specific table including its fields.
GET /tables/{table_id}
Response:
{
"success": true,
"data": {
"id": "tbl_abc123",
"name": "Contacts",
"slug": "contacts",
"fields": [
{
"id": "fld_001",
"name": "Name",
"slug": "name",
"field_type": "text",
"is_required": true
},
{
"id": "fld_002",
"name": "Email",
"slug": "email",
"field_type": "email",
"is_required": true
},
{
"id": "fld_003",
"name": "Company",
"slug": "company",
"field_type": "text",
"is_required": false
}
]
}
}
Create Table
Create a new custom table.
POST /tables
Request Body:
{
"name": "Projects",
"description": "Project management table",
"icon": "IconFolder",
"fields": [
{
"name": "Project Name",
"field_type": "text",
"is_required": true
},
{
"name": "Status",
"field_type": "select",
"options": {
"values": ["Planning", "In Progress", "Completed"]
}
},
{
"name": "Due Date",
"field_type": "date"
}
]
}
Response:
{
"success": true,
"data": {
"id": "tbl_xyz789",
"name": "Projects",
"slug": "projects",
"fields": [...]
}
}
Field Types
| Type | Description | Options |
|---|---|---|
text | Single-line text | - |
long_text | Multi-line text | - |
number | Numeric value | precision, min, max |
currency | Money value | currency_code |
date | Date only | format |
datetime | Date and time | format, timezone |
checkbox | Boolean | - |
select | Single selection | values, colors |
multi_select | Multiple selection | values, colors |
email | Email address | - |
url | Web URL | - |
phone | Phone number | - |
attachment | File upload | allowed_types, max_size |
List Rows
Get all rows from a table.
GET /tables/{table_id}/rows
Query Parameters:
| Parameter | Type | Description |
|---|---|---|
page | integer | Page number |
limit | integer | Items per page |
sort | string | Field to sort by |
order | string | asc or desc |
filter | object | Filter conditions (JSON) |
Example with Filters:
GET /tables/contacts/rows?filter={"email":{"contains":"@acme.com"}}
Response:
{
"success": true,
"data": [
{
"id": "row_001",
"data": {
"name": "John Doe",
"email": "john@acme.com",
"company": "Acme Inc"
},
"created_at": "2024-01-15T10:30:00Z"
}
],
"pagination": {
"page": 1,
"limit": 50,
"total": 150
}
}
Create Row
Add a new row to a table.
POST /tables/{table_id}/rows
Request Body:
{
"data": {
"name": "Jane Smith",
"email": "jane@example.com",
"company": "Tech Corp"
}
}
Update Row
Update an existing row.
PATCH /tables/{table_id}/rows/{row_id}
Request Body:
{
"data": {
"company": "New Company Name"
}
}
Delete Row
Remove a row from a table.
DELETE /tables/{table_id}/rows/{row_id}
Bulk Operations
Bulk Create
Create multiple rows in a single request.
POST /tables/{table_id}/rows/bulk
Request Body:
{
"rows": [
{ "data": { "name": "Alice", "email": "alice@example.com" } },
{ "data": { "name": "Bob", "email": "bob@example.com" } }
]
}
Bulk Delete
Delete multiple rows.
DELETE /tables/{table_id}/rows/bulk
Request Body:
{
"row_ids": ["row_001", "row_002", "row_003"]
}