Create Table
Create a new custom table with fields
POST
/tablesRequires
Bearer authenticationCreate a new custom table with the specified fields.
Body 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).
POST
/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'] } } ] }) } );
201Created
{ "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 } ] } }