Manage Tabi Tables¶
This page covers table lifecycle operations using the REST API.
Base URL and auth¶
Use your environment hostname (for example eu1.polyapi.io, na1.polyapi.io) and send your bearer token.
curl -H "Authorization: Bearer $YOUR_BEARER_TOKEN" \
https://eu1.polyapi.io/tables
Table endpoints¶
GET /tableslist tablesPOST /tablescreate tableGET /tables/{id}get one tablePATCH /tables/{id}update table metadata or schemaDELETE /tables/{id}delete table
Create a table¶
Note: Tabi automatically provides these columns on every table:
id(UUID primary key)created_atupdated_at
So there’s no need to include those in your column definitions when creating a table!
curl -X POST https://eu1.polyapi.io/tables \
-H "content-type: application/json" \
-H "Authorization: Bearer $YOUR_BEARER_TOKEN" \
-d '{
"name": "MyTable",
"context": "customer.data",
"description": "Structured records for customer sync",
"visibility": "ENVIRONMENT",
"columns": [
{
"name": "data_type",
"type": "text",
"required": true,
"unique": false,
"primary": false,
"schema": { "type": "string", "enum": ["building", "company", "user"] }
},
{
"name": "external_id",
"type": "text",
"required": true,
"unique": true,
"primary": false,
"schema": { "type": "string" }
},
{
"name": "json_data",
"type": "jsonb",
"required": true,
"unique": false,
"primary": false,
"schema": { "type": "object" }
}
]
}'
Notes:
nameandcolumnsare required.visibilityvalues areENVIRONMENTorTENANT.Column
schemais used for generated SDK type hints and documentation, not runtime enforcement.
Supported column data types¶
Tabi accepts the following column type names and aliases:
string,text,varchar-> stored astextchar-> stored ascharuuid-> stored asuuidnumber,numeric,decimal-> stored asnumericfloat,double,float8-> stored asdouble precisionint,integer,int4-> stored asintegerbigint,int8-> stored asbigintserial-> stored asserialbigserial-> stored asbigserialboolean,bool-> stored asbooleandate-> stored asdatetime,timesec-> stored astimetimestamp,timestamptz-> stored astimestamptzjson,jsonb,object-> stored asjsonb
Update a table¶
Use PATCH /tables/{id} to update name/context/description/visibility and apply supported schema changes.
curl -X PATCH https://eu1.polyapi.io/tables/$YOUR_TABLE_ID \
-H "content-type: application/json" \
-H "Authorization: Bearer $YOUR_BEARER_TOKEN" \
-d '{
"description": "Updated table description",
"columns": [
{
"name": "new_status",
"type": "text",
"required": false,
"unique": false,
"primary": false,
"schema": { "type": "string" }
}
]
}'
Warning
Schema changes currently support adding or dropping columns only.
Delete a table¶
curl -X DELETE https://eu1.polyapi.io/tables/$YOUR_TABLE_ID \
-H "Authorization: Bearer $YOUR_BEARER_TOKEN"