Limai Docs
API ReferenceTables & Rows

Columns

List, create, get, and update columns

List Columns

GET/api/v1/tables/{tableId}/columns

Returns all columns for a table, ordered by index.

Parameters

NameTypeInRequiredDescription
tableIdstringpathYesThe table ID

Request

const res = await fetch(
"https://app.limai.io/api/v1/tables/tbl_abc123/columns",
{
  headers: {
    Authorization: "Bearer YOUR_API_TOKEN",
  },
}
);
const { data } = await res.json();

Response

Response200
{
  "data": [
    {
      "id": "col_001",
      "name": "Invoice Number",
      "type": "TEXT",
      "description": null,
      "isKey": true,
      "isList": false,
      "dateFormat": "EU",
      "measurementType": "LEVENSHTEIN",
      "excludedFromExtraction": false,
      "defaultValue": null,
      "defaultValueEnabled": false,
      "autoGenerateLabels": false,
      "autoGenerateUnits": false,
      "index": 0,
      "labels": [],
      "units": []
    }
  ]
}

Create Column

POST/api/v1/tables/{tableId}/columns

Creates one or more columns in a table. Supports both single column and bulk creation (wrap in a columns array).

Parameters

NameTypeInRequiredDescription
tableIdstringpathYesThe table ID
namestringbodyYesColumn name
typestringbodyNoColumn type: TEXT, NUMBER, DATE, BOOLEAN, LABEL, MEASUREMENT(default: TEXT)
descriptionstringbodyNoColumn description for the model
isKeybooleanbodyNoWhether this is a key column(default: false)
isListbooleanbodyNoWhether this column accepts list values(default: false)
labelsarraybodyNoArray of {name, color} for LABEL columns
unitsarraybodyNoArray of {name} for MEASUREMENT columns

Request

const res = await fetch(
"https://app.limai.io/api/v1/tables/tbl_abc123/columns",
{
  method: "POST",
  headers: {
    Authorization: "Bearer YOUR_API_TOKEN",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    name: "Total Amount",
    type: "NUMBER",
    description: "The total invoice amount including tax",
  }),
}
);

Response

Response201
{
  "id": "col_new",
  "name": "Total Amount",
  "type": "NUMBER",
  "description": "Total invoice amount including tax",
  "isKey": false,
  "isList": false,
  "dateFormat": "EU",
  "measurementType": "LEVENSHTEIN",
  "excludedFromExtraction": false,
  "index": 3,
  "labels": [],
  "units": [],
  "createdAt": "2025-01-15T10:30:00.000Z"
}

Get Column

GET/api/v1/columns/{columnId}

Returns details of a specific column.

Parameters

NameTypeInRequiredDescription
columnIdstringpathYesThe column ID

Request

const res = await fetch(
"https://app.limai.io/api/v1/columns/col_abc123",
{
  headers: {
    Authorization: "Bearer YOUR_API_TOKEN",
  },
}
);
const column = await res.json();

Response

Response200
{
  "id": "col_abc123",
  "name": "Invoice Number",
  "type": "TEXT",
  "description": null,
  "isList": false,
  "dateFormat": "EU",
  "tableId": "tbl_001",
  "excludedFromExtraction": false,
  "createdAt": "2025-01-01T00:00:00.000Z",
  "updatedAt": "2025-01-15T00:00:00.000Z"
}

Update Column

PATCH/api/v1/columns/{columnId}

Update a column's properties.

Parameters

NameTypeInRequiredDescription
columnIdstringpathYesThe column ID
namestringbodyNoNew column name
descriptionstringbodyNoNew description
typestringbodyNoNew column type
isListbooleanbodyNoWhether this column accepts list values
dateFormatstringbodyNoDate format: EU or US
excludedFromExtractionbooleanbodyNoWhether to exclude from extraction

Request

const res = await fetch(
"https://app.limai.io/api/v1/columns/col_abc123",
{
  method: "PATCH",
  headers: {
    Authorization: "Bearer YOUR_API_TOKEN",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    description: "Unique invoice identifier",
    isKey: true,
  }),
}
);

Response

Response200
{
  "id": "col_abc123",
  "name": "Invoice Number",
  "description": "Unique invoice identifier",
  "type": "TEXT",
  "isList": false,
  "dateFormat": "EU",
  "excludedFromExtraction": false,
  "updatedAt": "2025-01-15T12:00:00.000Z"
}