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.
| Scope | documents:search |
| Asynchronous | No |
| MCP tool | create_passage_answer |
| Portal permissions | view_clustering_answers, view_document_text |
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
Docwize-Version | header | string (date) | Optional | |
Idempotency-Key | header | string | Optional | max 255 |
Request body
| Content type | Type |
|---|---|
application/json | PassageAnswerCreateInput |
Responses
| Status | Description | Body |
|---|---|---|
201 | Success. | application/json PassageAnswer or object |
400 | invalid_version, malformed_json | application/problem+json Problem |
401 | token_expired, unauthenticated | application/problem+json Problem |
403 | forbidden, insufficient_scope, token_owner_inactive | application/problem+json Problem |
405 | method_not_allowed | application/problem+json Problem |
406 | not_acceptable | application/problem+json Problem |
409 | idempotency_in_progress | application/problem+json Problem |
413 | payload_too_large | application/problem+json Problem |
415 | unsupported_media_type | application/problem+json Problem |
421 | wrong_region | application/problem+json Problem |
422 | idempotency_key_reused, validation_failed | application/problem+json Problem |
500 | internal_error | application/problem+json Problem |
503 | tenant_unavailable, unavailable | application/problem+json Problem |
504 | timeout | application/problem+json Problem |
Errors
The problem codes this operation can answer with. Each code links to its page.
Schemas
PassageAnswer
| Field | Type | Required | Description |
|---|---|---|---|
answer | string or null | Required | The answer, with its citations as <<document id.page>>; null until completed. |
citations | array of PassageAnswerCitation | Required | The documents the answer cites, in the order first cited. |
passage_answer_id | string | Required | |
status | string | Required | pending, completed or failed. |
PassageAnswerCitation
| Field | Type | Required | Description |
|---|---|---|---|
document_id | string | Required |
PassageAnswerCreateInput
| Field | Type | Required | Description |
|---|---|---|---|
filter | object or null | Optional | A 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. |
mode | string | Required | meaning (the chunks nearest the query's meaning) or exact (the document texts holding the query's words). |
query | string | Required | What to look for: a sentence for meaning, words for exact (words, "exact phrase", OR, -exclude). |