Get Chunks By Condition
This API returns the complete list of chunks that satisfy the given condition in the request body.Query Parameters
Request Parameters
Example filter:
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
| Field | Value |
|---|---|
| Method | POST |
| Endpoint | <host_url>/api/public/bot/:botId/chunk/list |
| Content-Type | application/json |
| Authorization | auth: <JWT Token> |
| API Scope | Chunk Management |
| Parameter | Description | Mandatory |
|---|---|---|
| Bot ID | Provide your application ID here. | Yes |
| Parameter | Description | Mandatory |
|---|---|---|
filters | Used to set filters for selecting chunks. filters contains: Conditions — an array of conditions where each condition is a set of operands applied on the conditions; and Operand — the operand applied on all conditions in the array. For example, a logical OR on sourceName, another OR on recordTitle, and an AND combining both results. See the example below. | No. If no filters are provided, all chunks are returned. |
enableFilters | Set to true to apply the filter field to chunks in the response. | No |
nextCursor | Used for cursor-based pagination. Omit on first request; use the cursor value from the previous response to fetch the next set of results. | No |
prevCursor | Used for cursor-based pagination. Use the cursor value from the previous request. | No |
{
"conditions": [
{
"operand": "or",
"conditions": [
{ "key": "sourceName", "op": "equals", "value": "https://www.blogs.domain.com/" },
{ "key": "sourceName", "op": "equals", "value": "www.domain.com" }
]
},
{
"operand": "or",
"conditions": [
{ "key": "recordTitle", "op": "equals", "value": "FAQs" },
{ "key": "recordTitle", "op": "equals", "value": "Frequently Asked Questions" }
]
}
],
"operand": "and"
}
{
"count": 888,
"chunks": [
{
"_id": "chk-fffb8f28-29c2-4afe-8d2c-9379dad4446c",
"chunkTitle": "",
"chunkText": "191 agreement of trial balance...",
"sourceType": "file",
"sourceName": "Default Directory",
"extractionMethod": "text",
"chunkType": "Text",
"chunkContent": "chunkText : 191 agreement of trial balance...",
"chunkId": "chk-fffb8f28-29c2-4afe-8d2c-9379dad4446c",
"sourceUrl": "https://domain/api/getMediaStream/findly/f-e7e04183-c53a-5013-9f93-f77f438aa7f9.pdf?n=4272962592&s=IkFHSDh1L3MxejB0OHU0MFg0MEVPV3AwSXRQZy9rbUhOOHh3RGdKaVpCSVk9Ig$$",
"pageNumber": 191,
"recordTitle": "accounts.pdf",
"recordUrl": "https://domain/api/getMediaStream/findly/f-e7e04183-c53a-5013-9f93-f77f438aa7f9.pdf?n=4272962592&s=IkFHSDh1L3MxejB0OHU0MFg0MEVPV3AwSXRQZy9rbUhOOHh3RGdKaVpCSVk9Ig$$#page=191",
"docId": "fc-4de878cb-01a6-5557-a7a7-78992b743b77",
"searchIndexId": "sidx-f9413800-94f8-51e0-b3d6-7d1b8187d6f6",
"sourceId": "fs-4181a831-ef7b-5bb6-8adb-937be72ce275",
"createdOn": "2024-11-19T13:45:45.914Z",
"extractionStrategy": "Default Strategy",
"fileType": "pdf",
"chunkMeta": {}
}
],
"hasMore": true,
"inOffsetPagination": true,
"nextCursor": "eyJzZWFyY2hBZnRlciI6ImNoay1jMTFjZGMwZi05MmUwLTQzYTgtODc5OS1kZjAwZjA0MzExNDUiLCJza2lwIjoxMCwibGltaXQiOjEwLCJwcmV2Q3Vyc29yIjoiIn0=",
"prevCursor": null
}
| Field | Value |
|---|---|
| Method | POST |
| Endpoint | <host_url>/api/public/bot/:botId/chunk/:chunkId |
| Content-Type | application/json |
| Authorization | auth: <JWT Token> |
| API Scope | Chunk Management |
| Parameter | Description | Mandatory |
|---|---|---|
| Bot ID | Provide your application ID here. | Yes |
| ChunkID | Unique ID of the chunk to be updated. | Yes |
{
"chunkText": "text",
"chunkTitle": "title1",
"pageNumber": "1",
"recordTitle": "recordTitle",
"recordUrl": "recordUrl",
"sourceUrl": "sourceUrl",
"chunkMeta": {}
}
{
"indexPipelineId": "fip-8e8d41c7-e1c3-5f73-b764-09327de66de7_vector",
"status_code": 200,
"status_msg": "Documents updated successfully",
"updated_documents": 1
}
| Field | Value |
|---|---|
| Method | POST |
| URL | /api/public/bot/{AppId}/search/deleteChunksById |
| Content-Type | application/json |
| Authentication | auth: <JWT Token> |
| API Scope | Chunk Management |
| Parameter | Type | Required | Description |
|---|---|---|---|
AppId | string | Yes | Your application ID. To view it, go to Dev Tools under App Settings and check the API scopes. |
| Field | Type | Required | Description |
|---|---|---|---|
chunkId | string[] | No | An array of chunk IDs to delete. |
curl --location 'https://<HOST>/api/public/bot/<BOT_ID>/search/deleteChunksById' \
--header 'auth: <JWT_TOKEN>' \
--header 'Content-Type: application/json' \
--data '{
"chunkId": ["chk-xxxx1", "chk-xxxx2"]
}'
| Field | Description |
|---|---|
status | Status of the chunk deletion job. |
totalRequested | Number of chunks requested for deletion. |
totalDeleted | Number of chunks successfully deleted. |
totalNotFound | Number of chunks that were not found. |
notFoundChunkIds | Array of chunk Ids that were not found |
{
"Status": "success",
"Data": {
"totalRequested": 4,
"totalDeleted": 4,
"totalNotFound": 0,
"notFoundChunkIds": []
}
}
| Error Code | Message | When It Occurs | Recommended Action |
|---|---|---|---|
| 400 | One or more chunkIds don’t exist. | chunkId is not provided in the request body. | Provide exactly one of the required fields. |
| 401 | Unauthorized | Missing, invalid, or expired JWT token. | Verify the auth header and regenerate the token. |
| 404 | Resource not found | Invalid AppId or resource doesn’t exist. | Verify the AppID. |
| 500 | Internal server error | Unexpected server-side failure. | Retry the request or contact support if the issue persists. |
Was this page helpful?