API ReferenceDeployments
Tables
List and create tables for a deployment
List Tables
GET
/api/v1/deployments/{deploymentId}/tablesReturns all tables and their columns for a deployment.
Parameters
| Name | Type | In | Required | Description |
|---|---|---|---|---|
deploymentId | string | path | Yes | The deployment ID |
Request
const res = await fetch(
"https://app.limai.io/api/v1/deployments/dep_abc123/tables",
{
headers: {
Authorization: "Bearer YOUR_API_TOKEN",
},
}
);
const { data } = await res.json();Response
Response200
{
"data": [
{
"id": "tbl_001",
"name": "Invoices",
"instructions": "Extract invoice header fields",
"isPrimary": true,
"parentTableId": null,
"wrapColumns": false,
"columnCount": 5,
"columns": [
{
"id": "col_001",
"name": "Invoice Number",
"type": "TEXT",
"description": null,
"isKey": true,
"isList": false,
"dateFormat": "EU",
"measurementType": "LEVENSHTEIN",
"excludedFromExtraction": false,
"index": 0
}
]
}
]
}Create Table
POST
/api/v1/deployments/{deploymentId}/tablesCreates a new table in a MODEL deployment. The first table created becomes the primary table. Additional tables must specify a parentTableId pointing to the primary table.
Parameters
| Name | Type | In | Required | Description |
|---|---|---|---|---|
deploymentId | string | path | Yes | The deployment ID |
name | string | body | Yes | Table name |
instructions | string | body | No | Extraction instructions for this table |
parentTableId | string | body | No | ID of the primary table (required for child tables) |
columns | array | body | No | Array of column definitions |
Each column object in the columns array supports:
| Name | Type | In | Required | Description |
|---|---|---|---|---|
name | string | body | Yes | Column name |
type | string | body | No | Column type: TEXT, NUMBER, DATE, BOOLEAN, LABEL, MEASUREMENT(default: TEXT) |
description | string | body | No | Column description for the extraction model |
isKey | boolean | body | No | Whether this column is a key column(default: false) |
isList | boolean | body | No | Whether this column accepts list values(default: false) |
Request
const res = await fetch(
"https://app.limai.io/api/v1/deployments/dep_abc123/tables",
{
method: "POST",
headers: {
Authorization: "Bearer YOUR_API_TOKEN",
"Content-Type": "application/json",
},
body: JSON.stringify({
name: "Line Items",
parentTableId: "tbl_001",
columns: [
{ name: "Description", type: "TEXT" },
{ name: "Quantity", type: "NUMBER" },
{ name: "Unit Price", type: "NUMBER" },
],
}),
}
);Response
Response201
{
"id": "tbl_002",
"name": "Line Items",
"instructions": null,
"isPrimary": false,
"parentTableId": "tbl_001",
"columns": [
{
"id": "col_010",
"name": "Description",
"type": "TEXT",
"description": null,
"isKey": false,
"isList": false,
"index": 0,
"labels": [],
"units": []
}
]
}