Documents

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.

post/documents

Request

  • Base URL
    https://api.morphik.ai (the document declares no server; this is the origin it was published from)
  • URL
    https://api.morphik.ai/documents
  • Auth
    none declared

Query parameters

string
OR
string[]
folder_depthinteger nullable

Folder scope depth: 0/None = exact, -1 = all descendants, n > 0 = include descendants up to n levels.

end_user_idstring nullable

Headers

authorizationstring nullable

Request body

document_filtersobject nullable

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.

skipinteger

Number of documents to skip

limitinteger

Maximum number of documents to return

return_documentsboolean

When false, only aggregates are returned

include_total_countboolean

Include total number of matching documents when true

include_status_countsboolean

Include document counts grouped by processing status when true

include_folder_countsboolean

Include document counts grouped by folder when true

completed_onlyboolean

When true, only documents with completed processing status are returned and counted

sort_by'created_at' | 'updated_at' | 'filename' | 'external_id' nullable

Field to sort the results by

sort_direction'asc' | 'desc'

Sort direction for the results

fieldsstring[] nullable

Optional list of fields to project for each document (dot notation supported). Derived fields such as 'page_count' are also supported.

Response

Successful Response

skipinteger required
limitinteger required
returned_countinteger required
total_countinteger nullable
has_moreboolean
next_skipinteger nullable
status_countsobject nullable

Changes

    • breaking

      the response's body type changed from array to object for status

    • warning

      the request property's min was set to 0.00

    • info

      api operation id list_documents_documents_post removed and replaced with list_docs_documents_post

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      header request parameter authorization list-of-types was widened by adding types null

    • info

      for the header request parameter authorization, the type was generalized from string to no type

    • info

      the request property default value changed from 1000 to 100

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the required property to the response with the status

    • info

      added the required property to the response with the status

    • info

      added the required property to the response with the status

    • warning

      removed the optional property / from the response with the status

    • info

      added the optional property / to the response with the status

    • info

      added the optional property / to the response with the status

    • info

      added the optional property / to the response with the status

    • info

      added the optional property / to the response with the status

    • info

      added the optional property / to the response with the status