Skip to main content
POST
/
retrieve
/
chunks
JavaScript
import Morphik from 'morphik';

const client = new Morphik({
  apiKey: 'My API Key',
});

const chunkResults = await client.retrieve.chunks.create({ query: 'x' });

console.log(chunkResults);
[
  {
    "content": "<string>",
    "score": 123,
    "document_id": "<string>",
    "chunk_number": 123,
    "metadata": {},
    "content_type": "<string>",
    "filename": "<string>",
    "download_url": "<string>",
    "is_padding": false
  }
]

Headers

authorization
string

Body

application/json

Base retrieve request model

query
string
required
Minimum length: 1
filters
object | null
k
integer
default:4
Required range: x > 0
min_score
number
default:0
use_reranking
boolean | null
use_colpali
boolean | null
padding
integer
default:0

Number of additional chunks/pages to retrieve before and after matched chunks (ColPali only)

Required range: x >= 0
graph_name
string | null

Name of the graph to use for knowledge graph-enhanced retrieval

hop_depth
integer | null
default:1

Number of relationship hops to traverse in the graph

Required range: 1 <= x <= 3
include_paths
boolean | null
default:false

Whether to include relationship paths in the response

folder_name

Optional folder scope for the operation. Accepts a single folder name or a list of folder names.

end_user_id
string | null

Optional end-user scope for the operation

Response

Successful Response

content
string
required
score
number
required
document_id
string
required
chunk_number
integer
required
metadata
object
required
content_type
string
required
filename
string | null
download_url
string | null
is_padding
boolean
default:false

Whether this chunk was added as padding

I