Skip to main content

Ask an LLM to answer a question from the passages of a search.

POST/api/v1/passage-answersdocuments:search

Runs the search (the members of search_passages) and has the Portal's LLM answer query from the first 200 passages it finds, citing the documents it uses as <<document id.page>>: the clustering app's AI answer. This is a paid LLM call, billed as the Portal's; a retry with the same Idempotency-Key does not ask twice. Needs View Clustering Answers and View Document Text, and Search Semantic for mode meaning or Search Full Text for mode exact. The answer is written in the background: get_passage_answer is pending until it has completed. 422 when the search finds no passages.

Scopedocuments:search
AsynchronousNo
MCP toolcreate_passage_answer
Portal permissionsview_clustering_answers, view_document_text

Parameters​

NameInTypeRequiredDescription
Docwize-Versionheaderstring (date)Optional
Idempotency-KeyheaderstringOptionalmax 255

Request body​

Content typeType
application/jsonPassageAnswerCreateInput

Responses​

StatusDescriptionBody
201Success.application/json PassageAnswer or object
400invalid_version, malformed_jsonapplication/problem+json Problem
401token_expired, unauthenticatedapplication/problem+json Problem
403forbidden, insufficient_scope, token_owner_inactiveapplication/problem+json Problem
405method_not_allowedapplication/problem+json Problem
406not_acceptableapplication/problem+json Problem
409idempotency_in_progressapplication/problem+json Problem
413payload_too_largeapplication/problem+json Problem
415unsupported_media_typeapplication/problem+json Problem
421wrong_regionapplication/problem+json Problem
422idempotency_key_reused, validation_failedapplication/problem+json Problem
500internal_errorapplication/problem+json Problem
503tenant_unavailable, unavailableapplication/problem+json Problem
504timeoutapplication/problem+json Problem

Errors​

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

Schemas​

PassageAnswer​

FieldTypeRequiredDescription
answerstring or nullRequiredThe answer, with its citations as <<document id.page>>; null until completed.
citationsarray of PassageAnswerCitationRequiredThe documents the answer cites, in the order first cited.
passage_answer_idstringRequired
statusstringRequiredpending, completed or failed.

PassageAnswerCitation​

FieldTypeRequiredDescription
document_idstringRequired

PassageAnswerCreateInput​

FieldTypeRequiredDescription
filterobject or nullOptionalA tree of and, or, not and {field, op, value} leaves: the fields document_number, document_date, document_type, project, description, image_type, main_document_number, created_by, from_organisation, folder and tag, or custom_field.<custom_field_id> for a register column; ops eq, ne, in, gt, gte, lt, lte, contains, starts_with, ends_with.
modestringRequiredmeaning (the chunks nearest the query's meaning) or exact (the document texts holding the query's words).
querystringRequiredWhat to look for: a sentence for meaning, words for exact (words, "exact phrase", OR, -exclude).