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.

GET/tables
Requires Bearer authentication

Query Parameters

pageinteger

Page number for pagination. Defaults to 1.

limitinteger

Number of items per page. Defaults to 50, max 100.

GET/tables
curl -X GET "https://api.vastal.agency/v1/tables?page=1&limit=50" \
-H "Authorization: Bearer YOUR_API_KEY"
200Success
{
"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.

GET/tables/{table_id}
Requires Bearer authentication

Path Parameters

table_idstringrequired

The unique identifier of the table.

GET/tables/{table_id}
curl -X GET "https://api.vastal.agency/v1/tables/tbl_abc123" \
-H "Authorization: Bearer YOUR_API_KEY"
200Success
{
"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.

POST/tables
Requires Bearer authentication

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
    }
  ]
}
}

List Rows

Retrieve all rows from a table with optional filtering and sorting.

GET/tables/{table_id}/rows
Requires Bearer authentication

Path Parameters

table_idstringrequired

The unique identifier of the table.

Query Parameters

pageinteger

Page number for pagination.

limitinteger

Number of items per page (max 100).

sortstring

Field slug to sort by.

orderstring

Sort order: 'asc' or 'desc'.

filterobject

JSON object with filter conditions.

GET/tables/{table_id}/rows
curl -X GET "https://api.vastal.agency/v1/tables/tbl_abc123/rows?limit=50&sort=created_at&order=desc" \
-H "Authorization: Bearer YOUR_API_KEY"
200Success
{
"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
Requires Bearer authentication

Path Parameters

table_idstringrequired

The unique identifier of the table.

Body Parameters

dataobjectrequired

Object containing field values keyed by field slug.

POST/tables/{table_id}/rows
curl -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"
  }
}'
201Created
{
"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.

PATCH/tables/{table_id}/rows/{row_id}
Requires Bearer authentication

Path Parameters

table_idstringrequired

The unique identifier of the table.

row_idstringrequired

The unique identifier of the row.

Body Parameters

dataobjectrequired

Object containing field values to update.

PATCH/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"
  }
}'
200Success
{
"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.

DELETE/tables/{table_id}/rows/{row_id}
Requires Bearer authentication

Path Parameters

table_idstringrequired

The unique identifier of the table.

row_idstringrequired

The unique identifier of the row to delete.

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"
200Success
{
"success": true,
"message": "Row deleted successfully"
}

Field Types

TypeDescription
textSingle-line text input
long_textMulti-line text area
numberNumeric values with optional precision
currencyMoney values with currency code
dateDate picker
datetimeDate and time picker
checkboxBoolean true/false
selectSingle selection dropdown
multi_selectMultiple selection
emailEmail address with validation
urlWeb URL with validation
phonePhone number
attachmentFile uploads