Limai Docs
API ReferenceProjects

Deployments

List and create the models within a project

List Deployments

GET/api/v1/projects/{projectId}/deployments

Returns every model in a project, with optional status filtering. A deployment — the named pointer that routes traffic to a model — is created and managed in the dashboard, and addressed by its ID everywhere the API takes a deploymentId.

Parameters

NameTypeInRequiredDescription
projectIdstringpathYesThe project ID
statusstringqueryNoFilter by status: ACTIVE or PAUSED

Request

const res = await fetch(
"https://app.limai.io/api/v1/projects/proj_abc123/deployments?status=ACTIVE",
{
  headers: {
    Authorization: "Bearer YOUR_API_TOKEN",
  },
}
);
const { data } = await res.json();

Response

Response200
{
  "data": [
    {
      "id": "dep_001",
      "name": "Invoice Extractor v2",
      "status": "ACTIVE",
      "type": "MODEL",
      "extractionSchemaId": "es_001",
      "fileCount": 150,
      "tableCount": 2,
      "createdAt": "2025-01-01T00:00:00.000Z",
      "updatedAt": "2025-01-15T00:00:00.000Z"
    }
  ]
}

extractionSchemaId is null until the model has been configured. Results are ordered by updatedAt, newest first.


Create Deployment

POST/api/v1/projects/{projectId}/deployments

Creates a model in a project. You can optionally provide table and column definitions; if you provide none, a single primary table named Primary Table is created.

Parameters

NameTypeInRequiredDescription
projectIdstringpathYesThe project ID
namestringbodyYesModel name
tablesarraybodyNoArray of table definitions with columns, each optionally carrying an instructions string of up to 10,000 characters

type is accepted and ignored, and is scheduled for removal. Sending it changes nothing about what is created.

Each table object accepts an optional instructions string — the guidance the model reads when extracting that table. It is capped at 10,000 characters; a longer value is rejected with a 400 and the message Table instructions must be 10000 characters or fewer.

Each column object accepts the same fields as Create Column, including units and autoGenerateUnits. A NUMBER_WITH_UNIT column needs at least one unit or autoGenerateUnits: true; otherwise the request is rejected with a 400.

Request

const res = await fetch(
"https://app.limai.io/api/v1/projects/proj_abc123/deployments",
{
  method: "POST",
  headers: {
    Authorization: "Bearer YOUR_API_TOKEN",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    name: "Invoice Extractor",
    tables: [
      {
        name: "Invoices",
        columns: [
          { name: "Invoice Number", type: "TEXT", isKey: true },
          { name: "Date", type: "DATE" },
          { name: "Total", type: "NUMBER" },
        ],
      },
    ],
  }),
}
);

Response

Response201
{
  "id": "dep_new",
  "name": "Invoice Extractor",
  "status": "ACTIVE",
  "type": "MODEL",
  "extractionSchemaId": "es_new",
  "createdAt": "2025-01-15T10:30:00.000Z",
  "tables": [
    {
      "id": "tbl_001",
      "name": "Invoices",
      "isPrimary": true,
      "columns": [
        {
          "id": "col_001",
          "name": "Invoice Number",
          "type": "TEXT",
          "description": null
        }
      ]
    }
  ]
}

On this page