Limai Docs
API ReferenceDeployments

Examples

Manage extraction examples for a deployment

List Examples

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

Returns all files in the example pool for a deployment. Examples are used to improve extraction accuracy through few-shot learning.

Parameters

NameTypeInRequiredDescription
deploymentIdstringpathYesThe deployment ID
pinnedstringqueryNoFilter by pinned status: true or false

Request

const res = await fetch(
"https://app.limai.io/api/v1/deployments/dep_abc123/examples?pinned=true",
{
  headers: {
    Authorization: "Bearer YOUR_API_TOKEN",
  },
}
);
const { data, summary } = await res.json();

Response

Response200
{
  "data": [
    {
      "id": "file_001",
      "name": "sample_invoice.pdf",
      "isPinned": true,
      "description": "Standard invoice with line items",
      "isConfirmed": true
    }
  ],
  "summary": {
    "total": 5,
    "pinnedCount": 2,
    "withDescriptionCount": 3
  }
}

Update Example Description

PATCH/api/v1/deployments/{deploymentId}/examples/{fileId}/description

Update or clear the description of an example file. Descriptions help the extraction model understand what kind of document the example represents.

Parameters

NameTypeInRequiredDescription
deploymentIdstringpathYesThe deployment ID
fileIdstringpathYesThe example file ID
descriptionstring | nullbodyYesDescription text (max 500 chars) or null to clear

Request

const res = await fetch(
"https://app.limai.io/api/v1/deployments/dep_abc123/examples/file_001/description",
{
  method: "PATCH",
  headers: {
    Authorization: "Bearer YOUR_API_TOKEN",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    description: "Standard invoice with line items and tax breakdown",
  }),
}
);

Response

Response200
{
  "success": true,
  "description": "Standard invoice with line items and tax breakdown"
}

Toggle Example Pin

PATCH/api/v1/deployments/{deploymentId}/examples/{fileId}/pin

Pin or unpin an example file. Pinned examples are always included in extraction prompts.

Parameters

NameTypeInRequiredDescription
deploymentIdstringpathYesThe deployment ID
fileIdstringpathYesThe example file ID
pinnedbooleanbodyNoSet pin state. Omit to toggle.

Request

const res = await fetch(
"https://app.limai.io/api/v1/deployments/dep_abc123/examples/file_001/pin",
{
  method: "PATCH",
  headers: {
    Authorization: "Bearer YOUR_API_TOKEN",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({ pinned: true }),
}
);

Response

Response200
{
  "success": true,
  "isPinned": true
}