Tables API
Create and manage custom tables and records
The Tables API allows you to create custom data tables and perform CRUD operations on records.
List Tables
Retrieve all tables in your organization.
/tablesBearer authenticationQuery Parameters
pageintegerPage number for pagination. Defaults to 1.
limitintegerNumber of items per page. Defaults to 50, max 100.
/tablescurl -X GET "https://api.vastal.agency/v1/tables?page=1&limit=50" \ -H "Authorization: Bearer YOUR_API_KEY"
const response = await fetch( 'https://api.vastal.agency/v1/tables?page=1&limit=50', { headers: { 'Authorization': 'Bearer YOUR_API_KEY' } } ); const data = await response.json();
import requests response = requests.get( 'https://api.vastal.agency/v1/tables', params={'page': 1, 'limit': 50}, headers={'Authorization': 'Bearer YOUR_API_KEY'} ) data = response.json()
{ "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
Retrieve details of a specific table including its fields.
/tables/{table_id}Bearer authenticationPath Parameters
table_idstringrequiredThe unique identifier of the table.
/tables/{table_id}curl -X GET "https://api.vastal.agency/v1/tables/tbl_abc123" \ -H "Authorization: Bearer YOUR_API_KEY"
const response = await fetch( 'https://api.vastal.agency/v1/tables/tbl_abc123', { headers: { 'Authorization': 'Bearer YOUR_API_KEY' } } ); const table = await response.json();
{ "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 } ] } }
Create Table
Create a new custom table with fields.
/tablesBearer authenticationBody Parameters
namestringrequiredDisplay name for the table.
descriptionstringOptional description of the table's purpose.
iconstringIcon identifier (e.g., IconUsers, IconFolder).
fieldsarrayrequiredArray of field definitions.
namestringrequiredDisplay name for the field.
field_typestringrequiredType of field (text, email, number, etc.).
is_requiredbooleanWhether the field is required. Defaults to false.
optionsobjectType-specific options (e.g., select values).
/tablescurl -X POST "https://api.vastal.agency/v1/tables" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "name": "Projects", "description": "Project management", "fields": [ { "name": "Project Name", "field_type": "text", "is_required": true }, { "name": "Status", "field_type": "select", "options": { "values": ["Planning", "In Progress", "Done"] } } ] }'
const response = await fetch( 'https://api.vastal.agency/v1/tables', { method: 'POST', headers: { 'Authorization': 'Bearer YOUR_API_KEY', 'Content-Type': 'application/json' }, body: JSON.stringify({ name: 'Projects', description: 'Project management', fields: [ { name: 'Project Name', field_type: 'text', is_required: true }, { name: 'Status', field_type: 'select', options: { values: ['Planning', 'In Progress', 'Done'] } } ] }) } );
{ "success": true, "data": { "id": "tbl_xyz789", "name": "Projects", "slug": "projects", "fields": [ { "id": "fld_001", "name": "Project Name", "slug": "project_name", "field_type": "text", "is_required": true } ] } }
List Rows
Retrieve all rows from a table with optional filtering and sorting.
/tables/{table_id}/rowsBearer authenticationPath Parameters
table_idstringrequiredThe unique identifier of the table.
Query Parameters
pageintegerPage number for pagination.
limitintegerNumber of items per page (max 100).
sortstringField slug to sort by.
orderstringSort order: 'asc' or 'desc'.
filterobjectJSON object with filter conditions.
/tables/{table_id}/rowscurl -X GET "https://api.vastal.agency/v1/tables/tbl_abc123/rows?limit=50&sort=created_at&order=desc" \ -H "Authorization: Bearer YOUR_API_KEY"
const response = await fetch( 'https://api.vastal.agency/v1/tables/tbl_abc123/rows?' + new URLSearchParams({ limit: '50', sort: 'created_at', order: 'desc' }), { headers: { 'Authorization': 'Bearer YOUR_API_KEY' } } );
{ "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.
/tables/{table_id}/rowsBearer authenticationPath Parameters
table_idstringrequiredThe unique identifier of the table.
Body Parameters
dataobjectrequiredObject containing field values keyed by field slug.
/tables/{table_id}/rowscurl -X POST "https://api.vastal.agency/v1/tables/tbl_abc123/rows" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "data": { "name": "Jane Smith", "email": "jane@example.com", "company": "Tech Corp" } }'
const response = await fetch( 'https://api.vastal.agency/v1/tables/tbl_abc123/rows', { method: 'POST', headers: { 'Authorization': 'Bearer YOUR_API_KEY', 'Content-Type': 'application/json' }, body: JSON.stringify({ data: { name: 'Jane Smith', email: 'jane@example.com', company: 'Tech Corp' } }) } );
{ "success": true, "data": { "id": "row_002", "data": { "name": "Jane Smith", "email": "jane@example.com", "company": "Tech Corp" }, "created_at": "2024-01-20T15:45:00Z" } }
Update Row
Update an existing row's data.
/tables/{table_id}/rows/{row_id}Bearer authenticationPath Parameters
table_idstringrequiredThe unique identifier of the table.
row_idstringrequiredThe unique identifier of the row.
Body Parameters
dataobjectrequiredObject containing field values to update.
/tables/{table_id}/rows/{row_id}curl -X PATCH "https://api.vastal.agency/v1/tables/tbl_abc123/rows/row_001" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "data": { "company": "New Company Name" } }'
{ "success": true, "data": { "id": "row_001", "data": { "name": "John Doe", "email": "john@acme.com", "company": "New Company Name" }, "updated_at": "2024-01-21T09:00:00Z" } }
Delete Row
Remove a row from a table.
/tables/{table_id}/rows/{row_id}Bearer authenticationPath Parameters
table_idstringrequiredThe unique identifier of the table.
row_idstringrequiredThe unique identifier of the row to delete.
/tables/{table_id}/rows/{row_id}curl -X DELETE "https://api.vastal.agency/v1/tables/tbl_abc123/rows/row_001" \ -H "Authorization: Bearer YOUR_API_KEY"
{ "success": true, "message": "Row deleted successfully" }
Field Types
| Type | Description |
|---|---|
text | Single-line text input |
long_text | Multi-line text area |
number | Numeric values with optional precision |
currency | Money values with currency code |
date | Date picker |
datetime | Date and time picker |
checkbox | Boolean true/false |
select | Single selection dropdown |
multi_select | Multiple selection |
email | Email address with validation |
url | Web URL with validation |
phone | Phone number |
attachment | File uploads |