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.documents.list();
console.log(documents.limit);curl https://api.morphik.ai/documents \
-H 'Content-Type: application/json' \
-H "Authorization: Bearer $MORPHIK_API_KEY" \
-d '{}'{
"skip": 123,
"limit": 123,
"returned_count": 123,
"documents": [
"<unknown>"
],
"total_count": 123,
"has_more": false,
"next_skip": 123,
"status_counts": {},
"folder_counts": [
{
"folder": "<string>",
"count": 123
}
]
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}List Docs
Flexible document listing with aggregates, projections, and advanced pagination.
Alias: /documents and /documents/list_docs share this handler.
Supported operators: $and, $or, $nor, $not, $eq, $ne, $gt, $gte, $lt, $lte,
$in, $nin, $exists, $type, $regex, $contains.
Implicit equality (backwards compatible, JSONB containment):
{"status": "active"}
Explicit operators (typed comparisons for number, decimal, datetime, date):
{"priority": {"$gte": 40}, "end_date": {"$lt": "2025-01-01"}}
Use document_filters with a filename key to filter the filename column:
{"filename": {"$regex": {"pattern": "^report_.*\.pdf$", "flags": "i"}}}
Use folder_name and end_user_id query parameters to scope system metadata.
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.documents.list();
console.log(documents.limit);curl https://api.morphik.ai/documents \
-H 'Content-Type: application/json' \
-H "Authorization: Bearer $MORPHIK_API_KEY" \
-d '{}'{
"skip": 123,
"limit": 123,
"returned_count": 123,
"documents": [
"<unknown>"
],
"total_count": 123,
"has_more": false,
"next_skip": 123,
"status_counts": {},
"folder_counts": [
{
"folder": "<string>",
"count": 123
}
]
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Query Parameters
Body
Flexible request model for listing documents with projection and aggregates.
Metadata filters with operator support: $and, $or, $nor, $not, $eq, $ne, $gt, $gte, $lt, $lte, $in, $nin, $exists, $type, $regex, $contains. Implicit equality uses JSONB containment; explicit operators support typed comparisons. Reserved key: 'filename' filters the filename column.
Response
Successful Response
Flexible response for listing documents with aggregates.
Was this page helpful?

