Create Table

Create a new custom table with fields

POST/tables
Requires Bearer authentication

Create a new custom table with the specified fields.

Body Parameters

namestringrequired

Display name for the table.

descriptionstring

Optional description of the table's purpose.

iconstring

Icon identifier (e.g., IconUsers, IconFolder).

fieldsarrayrequired

Array of field definitions.

namestringrequired

Display name for the field.

field_typestringrequired

Type of field (text, email, number, etc.).

is_requiredboolean

Whether the field is required. Defaults to false.

optionsobject

Type-specific options (e.g., select values).

POST/tables
curl -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"]
      }
    }
  ]
}'
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
    }
  ]
}
}