Limai Docs
API ReferenceDeployments

Tables

List and create tables for a deployment

List Tables

GET/api/v1/deployments/{deploymentId}/tables

Returns all tables and their columns for a deployment.

Parameters

NameTypeInRequiredDescription
deploymentIdstringpathYesThe 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}/tables

Creates 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

NameTypeInRequiredDescription
deploymentIdstringpathYesThe deployment ID
namestringbodyYesTable name
instructionsstringbodyNoExtraction instructions for this table
parentTableIdstringbodyNoID of the primary table (required for child tables)
columnsarraybodyNoArray of column definitions

Each column object in the columns array supports:

NameTypeInRequiredDescription
namestringbodyYesColumn name
typestringbodyNoColumn type: TEXT, NUMBER, DATE, BOOLEAN, LABEL, MEASUREMENT(default: TEXT)
descriptionstringbodyNoColumn description for the extraction model
isKeybooleanbodyNoWhether this column is a key column(default: false)
isListbooleanbodyNoWhether 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": []
    }
  ]
}