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

Get all tables in your organization.

GET /tables

Query Parameters:

ParameterTypeDescription
pageintegerPage number (default: 1)
limitintegerItems 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

TypeDescriptionOptions
textSingle-line text-
long_textMulti-line text-
numberNumeric valueprecision, min, max
currencyMoney valuecurrency_code
dateDate onlyformat
datetimeDate and timeformat, timezone
checkboxBoolean-
selectSingle selectionvalues, colors
multi_selectMultiple selectionvalues, colors
emailEmail address-
urlWeb URL-
phonePhone number-
attachmentFile uploadallowed_types, max_size

List Rows

Get all rows from a table.

GET /tables/{table_id}/rows

Query Parameters:

ParameterTypeDescription
pageintegerPage number
limitintegerItems per page
sortstringField to sort by
orderstringasc or desc
filterobjectFilter 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"]
}