Examples
Manage a model's extraction examples
List Examples
/api/v1/deployments/{deploymentId}/examplesReturns the files in a model's example pool. Examples are used to improve extraction accuracy through few-shot learning.
Which files come back depends on how you addressed the pool. Address the model and you get its whole pool. Address a deployment and you get the shared examples plus the ones scoped to that deployment — an isolated deployment's examples are hidden from its siblings, not from the model.
Parameters
| Name | Type | In | Required | Description |
|---|---|---|---|---|
deploymentId | string | path | Yes | The model or deployment ID |
pinned | string | query | No | Filter 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
{
"data": [
{
"id": "file_001",
"name": "sample_invoice.pdf",
"isPinned": true,
"description": "Standard invoice with line items",
"isConfirmed": true,
"scope": "SHARED",
"scopeDeploymentId": null
}
],
"summary": {
"total": 5,
"pinnedCount": 2,
"withDescriptionCount": 3
},
"modelId": "dep_abc123",
"viaDeploymentId": "dpl_prod01"
}| Field | Type | Description |
|---|---|---|
data[].name | string | The file's alias when it has one, otherwise its uploaded name. |
data[].scope | SHARED | PRIVATE | SHARED for an example in the model's pool, PRIVATE for one scoped to a single deployment. |
data[].scopeDeploymentId | string | null | The deployment that owns a PRIVATE example; null for a SHARED one. |
summary counts the whole addressed pool. The pinned filter narrows data only, so total can exceed the number of entries returned.
Update Example Description
/api/v1/deployments/{deploymentId}/examples/{fileId}/descriptionUpdate or clear the description of an example file. Descriptions help the extraction model understand what kind of document the example represents.
Parameters
| Name | Type | In | Required | Description |
|---|---|---|---|---|
deploymentId | string | path | Yes | The model or deployment ID |
fileId | string | path | Yes | The example file ID |
description | string | null | body | Yes | Description 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
{
"success": true,
"description": "Standard invoice with line items and tax breakdown",
"modelId": "dep_abc123",
"viaDeploymentId": "dpl_prod01"
}Toggle Example Pin
/api/v1/deployments/{deploymentId}/examples/{fileId}/pinPin or unpin an example file. Pinned examples are always included in extraction prompts.
Parameters
| Name | Type | In | Required | Description |
|---|---|---|---|---|
deploymentId | string | path | Yes | The model or deployment ID |
fileId | string | path | Yes | The example file ID |
pinned | boolean | body | No | Set 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
{
"success": true,
"isPinned": true,
"modelId": "dep_abc123",
"viaDeploymentId": "dpl_prod01"
}