Back to API Overview

Base & Tables API

Manage bases, tables, fields, and records. This router provides full CRUD operations for your database infrastructure.

40 endpoints

Endpoints

POST
/api/v1/tables/createDatabase

Create a new database (base). Returns the created database with its ID.

Parameters

namestringrequired

Name for the new database/base

descriptionstring

Optional description of the database

iconstring

Icon name (e.g., "database", "folder")

colorstring

Hex color code (e.g., "#3B82F6")

Example Request

curl -X POST https://app.serenitiesai.com/api/v1/tables/createDatabase \
  -H "Authorization: Bearer mk_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "example",
  "description": "example",
  "icon": "example"
}'
POST
/api/v1/tables/listDatabases

List all databases (bases) for the current user. Returns array with id, name, description, tables[]. Use this first to get database IDs.

Example Request

curl -X POST https://app.serenitiesai.com/api/v1/tables/listDatabases \
  -H "Authorization: Bearer mk_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{}'
POST
/api/v1/tables/getDatabaseById

Get a specific database with its tables

Parameters

idstringrequired

Database ID from listDatabases

Example Request

curl -X POST https://app.serenitiesai.com/api/v1/tables/getDatabaseById \
  -H "Authorization: Bearer mk_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
  "id": "example"
}'
POST
/api/v1/tables/updateDatabase

Update database properties. Only provided fields are updated.

Parameters

idstringrequired

Database ID from listDatabases

namestring

New name for the database

descriptionstring

New description

iconstring

New icon name

colorstring

New hex color code

Example Request

curl -X POST https://app.serenitiesai.com/api/v1/tables/updateDatabase \
  -H "Authorization: Bearer mk_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
  "id": "example",
  "name": "example",
  "description": "example"
}'
POST
/api/v1/tables/deleteDatabase

Permanently delete a database and all its contents

Parameters

idstringrequired

Database ID to delete. WARNING: This permanently deletes all tables and data.

Example Request

curl -X POST https://app.serenitiesai.com/api/v1/tables/deleteDatabase \
  -H "Authorization: Bearer mk_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
  "id": "example"
}'
POST
/api/v1/tables/createTable

Create a new table in a database. Returns the created table.

Parameters

databaseIdstringrequired

Database ID from listDatabases where the table will be created

namestringrequired

Name for the new table

descriptionstring

Optional description of the table

iconstring

Icon name (e.g., "table", "users")

colorstring

Hex color code (e.g., "#10B981")

Example Request

curl -X POST https://app.serenitiesai.com/api/v1/tables/createTable \
  -H "Authorization: Bearer mk_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
  "databaseId": "example",
  "name": "example",
  "description": "example"
}'
POST
/api/v1/tables/listTables

List all tables across all databases. Returns array with id, name, databaseId. Use getTableById for full details.

Example Request

curl -X POST https://app.serenitiesai.com/api/v1/tables/listTables \
  -H "Authorization: Bearer mk_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{}'
POST
/api/v1/tables/getViewsByTableId

Get all views for a table

Parameters

tableIdstringrequired

Table ID from listTables

Example Request

curl -X POST https://app.serenitiesai.com/api/v1/tables/getViewsByTableId \
  -H "Authorization: Bearer mk_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
  "tableId": "example"
}'
POST
/api/v1/tables/getFieldsByTableId

Get all fields/columns for a table. Returns field IDs needed for createRow data keys.

Parameters

tableIdstringrequired

Table ID from listTables

Example Request

curl -X POST https://app.serenitiesai.com/api/v1/tables/getFieldsByTableId \
  -H "Authorization: Bearer mk_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
  "tableId": "example"
}'
POST
/api/v1/tables/getTableById

Get table with fields and views. Returns field IDs needed for row data.

Parameters

idstringrequired

Table ID from listTables

Example Request

curl -X POST https://app.serenitiesai.com/api/v1/tables/getTableById \
  -H "Authorization: Bearer mk_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
  "id": "example"
}'
POST
/api/v1/tables/updateTable

Update table properties. Only provided fields are updated.

Parameters

idstringrequired

Table ID from listTables

namestring

New name for the table

descriptionstring

New description

iconstring

New icon name

colorstring

New hex color code

Example Request

curl -X POST https://app.serenitiesai.com/api/v1/tables/updateTable \
  -H "Authorization: Bearer mk_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
  "id": "example",
  "name": "example",
  "description": "example"
}'
POST
/api/v1/tables/deleteTable

Permanently delete a table and all its data

Parameters

idstringrequired

Table ID to delete. WARNING: This permanently deletes all rows and fields.

Example Request

curl -X POST https://app.serenitiesai.com/api/v1/tables/deleteTable \
  -H "Authorization: Bearer mk_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
  "id": "example"
}'
POST
/api/v1/tables/createField

Create a new field/column in a table

Parameters

tableIdstringrequired

Table ID from listTables

namestringrequired

Name for the new field/column

fieldTypestringrequired

Field type: "text", "number", "select", "multiselect", "date", "datetime", "checkbox", "url", "email", "phone", "file", "formula", "rating", "currency", "percent", "duration", "status", "button", "link", "lookup", "rollup"

descriptionstring

Optional description of the field

requiredboolean

Must be false or omitted. Required fields are not supported - UI creates blank rows first.

uniqueboolean

Whether values must be unique (default: false)

defaultValueany

Default value for new rows

optionsarray

For select/multiselect: [{value: "opt1", label: "Option 1", color: "#3b82f6"}]

statusLabelsarray

For status: [{value: "todo", label: "To Do", color: "#6b7280"}]

formulaConfigobject

For formula: {formula: "field1 + field2", resultType: "number"}

buttonConfigobject

For button: {actionType: "flow", flowId: "xxx"}

numberFormatConfigobject

For number: {decimalPlaces: 2, useThousandSeparator: true}

currencyFormatConfigobject

For currency: {currencySymbol: "$", symbolPosition: "before"}

percentFormatConfigobject

For percent: {decimalPlaces: 1}

lookupConfigobject

For lookup: {relationshipFieldId: "xxx", sourceFieldId: "xxx"}

rollupConfigobject

For rollup: {relationshipFieldId: "xxx", sourceFieldId: "xxx", aggregationType: "SUM"}

linkedTableIdstring

For link field: target table ID

linkTypestring

Link relationship type

displayOrderstring

Fractional order string (e.g., "a0", "b0")

Example Request

curl -X POST https://app.serenitiesai.com/api/v1/tables/createField \
  -H "Authorization: Bearer mk_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
  "tableId": "example",
  "name": "example",
  "fieldType": "example"
}'
POST
/api/v1/tables/updateField

Update field properties. Only provided fields are updated.

Parameters

idstringrequired

Field ID from getFieldsByTableId

namestring

New name for the field

fieldTypestring

Field type

descriptionstring

New description

requiredboolean

Must be false or omitted. Required fields are not supported - UI creates blank rows first.

uniqueboolean

Whether values must be unique

defaultValueany

Default value for new rows

optionsarray

For select/multiselect: [{value: "opt1", label: "Option 1", color: "#3b82f6"}]

statusLabelsarray

For status: [{value: "todo", label: "To Do", color: "#6b7280"}]

formulaConfigobject

For formula: {formula: "field1 + field2", resultType: "number"}

linkedTableIdstring

For link field: target table ID

linkTypestring

Link relationship type

linkDisplayModestring

How to display linked records

linkDisplayFieldIdstring

Which field to show from linked records

allowMultipleLinksboolean

Whether multiple links are allowed

buttonConfigobject

For button: {actionType: "flow", flowId: "xxx"}

numberFormatConfigobject

For number: {decimalPlaces: 2, useThousandSeparator: true}

currencyFormatConfigobject

For currency: {currencySymbol: "$", symbolPosition: "before"}

percentFormatConfigobject

For percent: {decimalPlaces: 1}

lookupConfigobject

For lookup: {relationshipFieldId: "xxx", sourceFieldId: "xxx"}

rollupConfigobject

For rollup: {relationshipFieldId: "xxx", sourceFieldId: "xxx", aggregationType: "SUM"}

displayOrdernumber

Display order position

isVisibleboolean

Whether field is visible

Example Request

curl -X POST https://app.serenitiesai.com/api/v1/tables/updateField \
  -H "Authorization: Bearer mk_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
  "id": "example",
  "name": "example",
  "fieldType": "example"
}'
POST
/api/v1/tables/deleteField

Permanently delete a field/column and all its data

Parameters

idstringrequired

Field ID to delete. WARNING: This permanently deletes all data in this column.

Example Request

curl -X POST https://app.serenitiesai.com/api/v1/tables/deleteField \
  -H "Authorization: Bearer mk_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
  "id": "example"
}'
POST
/api/v1/tables/createRow

Create a new row in a table. Data keys must be field IDs, not field names.

Parameters

tableIdstringrequired

Table ID from listTables

dataobjectrequired

Object where keys are FIELD IDs from getFieldsByTableId, values are cell values. Example: {"fieldId1": "text", "fieldId2": 123}

rowOrderstring

Fractional order string for positioning. Leave empty to append at end.

Example Request

curl -X POST https://app.serenitiesai.com/api/v1/tables/createRow \
  -H "Authorization: Bearer mk_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
  "tableId": "example",
  "data": {},
  "rowOrder": "example"
}'
POST
/api/v1/tables/getRowCount

Get total row count for a table. Lightweight operation.

Parameters

tableIdstringrequired

Table ID from listTables

Example Request

curl -X POST https://app.serenitiesai.com/api/v1/tables/getRowCount \
  -H "Authorization: Bearer mk_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
  "tableId": "example"
}'
POST
/api/v1/tables/getRows

Get rows from a table with pagination. Returns row data with field IDs as keys.

Parameters

tableIdstringrequired

Table ID from listTables

limitnumber

Max rows to return (default: 100)

offsetnumber

Number of rows to skip for pagination

Example Request

curl -X POST https://app.serenitiesai.com/api/v1/tables/getRows \
  -H "Authorization: Bearer mk_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
  "tableId": "example",
  "limit": 0,
  "offset": 0
}'
POST
/api/v1/tables/updateRow

Update an existing row. Merges provided data with existing data.

Parameters

idstringrequired

Row ID from getRows

dataobjectrequired

Object with field IDs as keys and new values. Only provided fields are updated.

metadataobject

Optional metadata to merge with existing

Example Request

curl -X POST https://app.serenitiesai.com/api/v1/tables/updateRow \
  -H "Authorization: Bearer mk_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
  "id": "example",
  "data": {},
  "metadata": {}
}'
POST
/api/v1/tables/deleteRow

Permanently delete a single row

Parameters

idstringrequired

Row ID to delete

Example Request

curl -X POST https://app.serenitiesai.com/api/v1/tables/deleteRow \
  -H "Authorization: Bearer mk_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
  "id": "example"
}'
POST
/api/v1/tables/bulkDeleteRows

Delete multiple rows. Params: tableId, rowIds (array of row IDs).

Parameters

tableIdstringrequired
rowIdsarrayrequired

Example Request

curl -X POST https://app.serenitiesai.com/api/v1/tables/bulkDeleteRows \
  -H "Authorization: Bearer mk_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
  "tableId": "example",
  "rowIds": {}
}'
POST
/api/v1/tables/createView

Create a new view. Params: tableId (required), name (required), viewType (required: "grid", "kanban", "calendar", "gallery", "form"), description, filterConfig, sortConfig, groupConfig, visibleFields (array of field IDs).

Parameters

tableIdstringrequired
namestringrequired
viewTypestringrequired
descriptionstring
filterConfigany
sortConfigany
groupConfigany
visibleFieldsarray
columnWidthsany
isDefaultboolean

Example Request

curl -X POST https://app.serenitiesai.com/api/v1/tables/createView \
  -H "Authorization: Bearer mk_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
  "tableId": "example",
  "name": "example",
  "viewType": "example"
}'
POST
/api/v1/tables/updateView

Update view settings. Params: id (view ID), name, filterConfig, sortConfig, groupConfig, visibleFields, etc.

Parameters

idstringrequired
namestring
descriptionstring
filterConfigany
sortConfigany
groupConfigany
visibleFieldsarray
columnWidthsany
isDefaultboolean
metadataany

Example Request

curl -X POST https://app.serenitiesai.com/api/v1/tables/updateView \
  -H "Authorization: Bearer mk_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
  "id": "example",
  "name": "example",
  "description": "example"
}'
POST
/api/v1/tables/getViews

List all views for a table. Param "tableId". Returns array with id, name, viewType, filterConfig, sortConfig.

Parameters

tableIdstringrequired

Example Request

curl -X POST https://app.serenitiesai.com/api/v1/tables/getViews \
  -H "Authorization: Bearer mk_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
  "tableId": "example"
}'
POST
/api/v1/tables/reorderView

Change view position. Params: viewId, newOrderIndex (string).

Parameters

viewIdstringrequired
newOrderIndexstringrequired

Example Request

curl -X POST https://app.serenitiesai.com/api/v1/tables/reorderView \
  -H "Authorization: Bearer mk_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
  "viewId": "example",
  "newOrderIndex": "example"
}'
POST
/api/v1/tables/duplicateView

Copy a view. Params: id (view ID to copy), name (optional, for the copy).

Parameters

idstringrequired
namestring

Example Request

curl -X POST https://app.serenitiesai.com/api/v1/tables/duplicateView \
  -H "Authorization: Bearer mk_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
  "id": "example",
  "name": "example"
}'
POST
/api/v1/tables/setDefaultView

Set which view opens by default. Params: id (view ID), tableId.

Parameters

idstringrequired
tableIdstringrequired

Example Request

curl -X POST https://app.serenitiesai.com/api/v1/tables/setDefaultView \
  -H "Authorization: Bearer mk_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
  "id": "example",
  "tableId": "example"
}'
POST
/api/v1/tables/deleteView

Delete a view. Param "id" is the view ID.

Parameters

idstringrequired

Example Request

curl -X POST https://app.serenitiesai.com/api/v1/tables/deleteView \
  -H "Authorization: Bearer mk_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
  "id": "example"
}'
POST
/api/v1/tables/updateFieldOrder

Change field position. Params: fieldId, newOrder (fractional string).

Parameters

fieldIdstringrequired
newOrderstringrequired

Example Request

curl -X POST https://app.serenitiesai.com/api/v1/tables/updateFieldOrder \
  -H "Authorization: Bearer mk_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
  "fieldId": "example",
  "newOrder": "example"
}'
POST
/api/v1/tables/updateTableOrder

Change table position in database. Params: tableId, newOrder (string like "a0", "b0" for fractional ordering).

Parameters

tableIdstringrequired
newOrderstringrequired

Example Request

curl -X POST https://app.serenitiesai.com/api/v1/tables/updateTableOrder \
  -H "Authorization: Bearer mk_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
  "tableId": "example",
  "newOrder": "example"
}'
POST
/api/v1/tables/updateFieldWidth

Set column width in pixels. Params: fieldId, width (number, e.g., 200).

Parameters

fieldIdstringrequired
widthnumberrequired

Example Request

curl -X POST https://app.serenitiesai.com/api/v1/tables/updateFieldWidth \
  -H "Authorization: Bearer mk_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
  "fieldId": "example",
  "width": 0
}'
POST
/api/v1/tables/updateRowOrder

Update row display order for row drag-and-drop

Parameters

rowIdstringrequired

Row ID to reorder

newOrderstringrequired

New fractional order string

Example Request

curl -X POST https://app.serenitiesai.com/api/v1/tables/updateRowOrder \
  -H "Authorization: Bearer mk_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
  "rowId": "example",
  "newOrder": "example"
}'
POST
/api/v1/tables/bulkUpdateRows

Update multiple rows at once

Parameters

tableIdstringrequired

Table ID from listTables

updatesarrayrequired

Array of row updates

Example Request

curl -X POST https://app.serenitiesai.com/api/v1/tables/bulkUpdateRows \
  -H "Authorization: Bearer mk_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
  "tableId": "example",
  "updates": {}
}'
POST
/api/v1/tables/exportTable

Export all table data for download

Parameters

tableIdstringrequired

Table ID to export

Example Request

curl -X POST https://app.serenitiesai.com/api/v1/tables/exportTable \
  -H "Authorization: Bearer mk_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
  "tableId": "example"
}'
POST
/api/v1/tables/importRows

Bulk import rows. Use matchFieldsByName=true (default) to use field names as keys.

Parameters

tableIdstringrequired

Table ID from listTables

rowsarrayrequired

Array of row data. When matchFieldsByName=true, use field NAMES as keys. When false, use field IDs.

matchFieldsByNameboolean

If true, match columns by field name. If false, use field IDs as keys (default: true)

fieldDefinitionsarray

Optional field definitions to create new fields during import

Example Request

curl -X POST https://app.serenitiesai.com/api/v1/tables/importRows \
  -H "Authorization: Bearer mk_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
  "tableId": "example",
  "rows": {},
  "matchFieldsByName": true
}'
POST
/api/v1/tables/searchRows

Full-text search across all text fields in a table. Returns matching rows with optional readable format.

Parameters

tableIdstringrequired

Table ID to search in

querystringrequired

Search query string

limitnumber

Max results (default: 50)

offsetnumber

Skip results for pagination

includeReadableboolean

Include human-readable field names in output

Example Request

curl -X POST https://app.serenitiesai.com/api/v1/tables/searchRows \
  -H "Authorization: Bearer mk_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
  "tableId": "example",
  "query": "example",
  "limit": 0
}'
POST
/api/v1/tables/upsertRow

Create a row if no match found, or update existing row if match exists. Useful for sync operations.

Parameters

tableIdstringrequired

Table ID

matchFieldIdstringrequired

Field ID to match on (must be unique or will update first match)

matchValueany

Value to match against

dataobjectrequired

Row data with field IDs as keys

includeReadableboolean

Include human-readable output

Example Request

curl -X POST https://app.serenitiesai.com/api/v1/tables/upsertRow \
  -H "Authorization: Bearer mk_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
  "tableId": "example",
  "matchFieldId": "example",
  "matchValue": {}
}'
POST
/api/v1/tables/getTableSchema

Get table structure/schema. Useful for understanding table layout before creating/updating rows.

Parameters

tableIdstringrequired

Table ID

formatstring

Output format: json (full), array (simple), markdown (documentation)

Example Request

curl -X POST https://app.serenitiesai.com/api/v1/tables/getTableSchema \
  -H "Authorization: Bearer mk_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
  "tableId": "example",
  "format": "example"
}'
POST
/api/v1/tables/duplicateTable

Clone a table with its structure (fields) and optionally data (rows) and views.

Parameters

tableIdstringrequired

Source table ID to duplicate

newNamestringrequired

Name for the new table

targetDatabaseIdstring

Target database ID (defaults to same database)

includeRowsboolean

Copy all rows from source table

includeViewsboolean

Copy views configuration

Example Request

curl -X POST https://app.serenitiesai.com/api/v1/tables/duplicateTable \
  -H "Authorization: Bearer mk_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
  "tableId": "example",
  "newName": "example",
  "targetDatabaseId": "example"
}'
POST
/api/v1/tables/getHelp

Get help for Tables API. Call with topic to get focused guidance.

Parameters

topicstring

Topic: "overview", "fields", "rows", "views", "linked"

Example Request

curl -X POST https://app.serenitiesai.com/api/v1/tables/getHelp \
  -H "Authorization: Bearer mk_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
  "topic": "example"
}'
Base & Tables API - Serenities