JavaScript
import Morphik from 'morphik';
const client = new Morphik({
apiKey: process.env['MORPHIK_API_KEY'], // This is the default and can be omitted
});
const chunkResults = await client.batch.retrieveChunks();
console.log(chunkResults);curl https://api.morphik.ai/batch/chunks \
-H 'Content-Type: application/json' \
-H "Authorization: Bearer $MORPHIK_API_KEY" \
-d '{}'[
{
"content": "<string>",
"score": 123,
"document_id": "<string>",
"chunk_number": 123,
"metadata": {},
"content_type": "<string>",
"filename": "<string>",
"download_url": "<string>",
"is_padding": false
}
]{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}API Reference
Batch Get Chunks
Retrieve specific chunks by their document ID and chunk number in a single batch operation.
POST
/
batch
/
chunks
JavaScript
import Morphik from 'morphik';
const client = new Morphik({
apiKey: process.env['MORPHIK_API_KEY'], // This is the default and can be omitted
});
const chunkResults = await client.batch.retrieveChunks();
console.log(chunkResults);curl https://api.morphik.ai/batch/chunks \
-H 'Content-Type: application/json' \
-H "Authorization: Bearer $MORPHIK_API_KEY" \
-d '{}'[
{
"content": "<string>",
"score": 123,
"document_id": "<string>",
"chunk_number": 123,
"metadata": {},
"content_type": "<string>",
"filename": "<string>",
"download_url": "<string>",
"is_padding": false
}
]{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Headers
Body
application/json
Request model for batch chunk retrieval.
List of chunk sources to retrieve
Show child attributes
Show child attributes
Optional folder scope. Accepts a folder PATH (e.g., '/Company/Reports') or list of paths.
Optional end-user scope for the operation
Whether to use ColPali embeddings for retrieval
How to return image chunks: base64 (default), url, or text (markdown format)
Available options:
base64, url, text Response
Successful Response
Was this page helpful?

