import Morphik from 'morphik';
const client = new Morphik({
apiKey: process.env['MORPHIK_API_KEY'], // This is the default and can be omitted
});
const documents = await client.search.documents({ query: 'x' });
console.log(documents);curl https://api.morphik.ai/search/documents \
-H 'Content-Type: application/json' \
-H "Authorization: Bearer $MORPHIK_API_KEY" \
-d '{
"query": "x"
}'[
{
"content_type": "<string>",
"external_id": "<string>",
"filename": "<string>",
"metadata": {},
"metadata_types": {},
"storage_info": {},
"system_metadata": {},
"additional_metadata": {},
"chunk_ids": [
"<string>"
],
"summary_storage_key": "<string>",
"summary_version": 123,
"summary_bucket": "<string>",
"summary_updated_at": "<string>",
"folder_name": "<string>",
"end_user_id": "<string>",
"app_id": "<string>",
"folder_path": "<string>",
"folder_id": "<string>"
}
]{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Search Documents By Name
Search documents by filename using full-text search.
request.filters accepts the same operator set as /retrieve/chunks: $eq, $ne, $gt, $gte, $lt,
$lte, $in, $nin, $exists, $type, $regex (with optional i flag), $contains, and the logical
operators $and, $or, $nor, $not. Comparison clauses honor typed metadata (number, decimal,
datetime, date).
import Morphik from 'morphik';
const client = new Morphik({
apiKey: process.env['MORPHIK_API_KEY'], // This is the default and can be omitted
});
const documents = await client.search.documents({ query: 'x' });
console.log(documents);curl https://api.morphik.ai/search/documents \
-H 'Content-Type: application/json' \
-H "Authorization: Bearer $MORPHIK_API_KEY" \
-d '{
"query": "x"
}'[
{
"content_type": "<string>",
"external_id": "<string>",
"filename": "<string>",
"metadata": {},
"metadata_types": {},
"storage_info": {},
"system_metadata": {},
"additional_metadata": {},
"chunk_ids": [
"<string>"
],
"summary_storage_key": "<string>",
"summary_version": 123,
"summary_bucket": "<string>",
"summary_updated_at": "<string>",
"folder_name": "<string>",
"end_user_id": "<string>",
"app_id": "<string>",
"folder_path": "<string>",
"folder_id": "<string>"
}
]{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Headers
Body
Request model for searching documents by name
Search query for document names/filenames
1Number of documents to return
1 <= x <= 100Optional metadata filters for documents
Optional folder scope. Accepts a folder PATH (e.g., '/Company/Reports') or list of paths.
Folder scope depth: 0/None exact, -1 all descendants, n>0 include descendants up to n levels.
Optional end-user scope for the search
Response
Successful Response
Show child attributes
Show child attributes
Was this page helpful?

