Skip to main content

Find documents similar to a document.

GET/api/v1/documents/{document_id}/similar-documentsdocuments:read

The documents whose text (match_type textual, with the matching snippet) or pages (match_type visual, with the page) look like the seed's, as the Explorer's Find similar shows them, best score first (score 0 to 1). text_limit (1 to 100, default 20) and visual_limit (1 to 50, default 10) cap each kind before the list is paged. Every match is read through the caller's document access. Needs Find Similar Documents, View Document Metadata, View Document Text and View Document Content. Needs the organisation's document embeddings: without them the list is empty. match_type narrows the list to one kind.

Scopedocuments:read
AsynchronousNo
MCP toollist_document_similar_documents
Portal permissionsfind_similar_documents, view_document_metadata, view_document_text, view_document_content
Pagingsnapshot
Default order-score, document_id
Sort fieldsscore, document_id
Filtersmatch_type

Parameters​

NameInTypeRequiredDescription
document_idpathstringRequired
text_limitqueryinteger or nullOptionalHow many textual matches to read, 1 to 100; 20 when left out.
visual_limitqueryinteger or nullOptionalHow many visual matches to read, 1 to 50; 10 when left out.
limitqueryintegerOptionalDefault: 50; ≥ 1
cursorquerystringOptional
sortquerystringOptionalComma-separated sort fields, - for descending.
match_typequeryarray of stringOptional
Docwize-Versionheaderstring (date)Optional
If-None-MatchheaderstringOptionalAnswers 304 when the representation is unchanged (resources that publish an ETag).

Responses​

StatusDescriptionBody
200Success.application/json object
304Not modified (If-None-Match matched the ETag).
400invalid_versionapplication/problem+json Problem
401token_expired, unauthenticatedapplication/problem+json Problem
403forbidden, insufficient_scope, token_owner_inactiveapplication/problem+json Problem
404not_foundapplication/problem+json Problem
405method_not_allowedapplication/problem+json Problem
406not_acceptableapplication/problem+json Problem
410cursor_expiredapplication/problem+json Problem
421wrong_regionapplication/problem+json Problem
422invalid_cursor, validation_failedapplication/problem+json Problem
500internal_errorapplication/problem+json Problem
503tenant_unavailable, unavailableapplication/problem+json Problem
504timeoutapplication/problem+json Problem

200 body​

FieldTypeRequiredDescription
itemsarray of SimilarDocumentRequired
next_cursorstring or nullRequired
warningsarray of objectRequired

Errors​

The problem codes this operation can answer with. Each code links to its page.

Schemas​

SimilarDocument​

FieldTypeRequiredDescription
descriptionstring or nullRequired
document_idstringRequired
image_typestring or nullRequiredThe file type the Portal stored for the document.
match_typestringRequiredtextual or visual.
pageinteger or nullRequiredFor a visual match: the page that matched.
reference_numberstring or nullRequired
scorenumberRequired0 to 1, higher is more alike.
snippetstring or nullRequiredFor a textual match: the passage that matched.