---
title: "Run a query and get generated text with retrieved passages"
method: POST
path: "/v1/run"
---

# Run a query and get generated text with retrieved passages

`POST /v1/run`

## Request body

- object
  - `query` string, required — The query string
  - `result_column` string — The result column name

## Response `200`

Successful response

- union
  - object
    - `type` 'generated_text' | 'retrieved_passage', required — When the type is "generated_text", only "generated_text" is returned. The other fields are None. When the type is "retrieved_passage", only "retrieved_passage" and "passage_index" are returned. The other fields are None.
    - `generated_text` string, nullable, required — The generated text, only present when "type" is "generated_text".
    - `retrieved_passage` object, nullable
      - `content` string
      - `doc_id` string
      - `filepath` string, nullable
      - `file_page` integer, nullable
      - `start_idx` integer, nullable
      - `end_idx` integer, nullable
    - `passage_index` integer, nullable — The index of the retrieved passage, only present when "type" is "retrieved_passage".
  - object
    - `type` 'generated_text' | 'retrieved_passage', required — When the type is "generated_text", only "generated_text" is returned. The other fields are None. When the type is "retrieved_passage", only "retrieved_passage" and "passage_index" are returned. The other fields are None.
    - `generated_text` string, nullable — The generated text, only present when "type" is "generated_text".
    - `retrieved_passage` object, nullable, required
      - `content` string
      - `doc_id` string
      - `filepath` string, nullable
      - `file_page` integer, nullable
      - `start_idx` integer, nullable
      - `end_idx` integer, nullable
    - `passage_index` integer, nullable, required — The index of the retrieved passage, only present when "type" is "retrieved_passage".

## Changes

- **2024-10-27** `9039aed58e02` — 3 breaking, 1 warning, 9 info
  - added `subschema #1, subschema #2` to the response body `oneOf` list for the response status `200`
  - the response property `retrieved_passage` became nullable for the status `200`
  - the `retrieved_passage` response's property type changed from `array` to `object` for status `200`
  - removed the optional property `result` from the response with the `200` status
  - …9 more
- **2024-10-08** `d3e705544181` — 2 breaking, 8 warning, 2 info
  - the `retrieved_passage` response's property type changed from `object` to `array` for status `200`
  - removed the required property `type` from the response with the `200` status
  - removed the optional property `generated_text` from the response with the `200` status
  - removed the optional property `passage_index` from the response with the `200` status
  - …8 more

[Change history](https://skmtc.dev/marker-inc-korea/apis/example-api/changes/v1/run/post.md)

---

[API](https://skmtc.dev/marker-inc-korea/apis/example-api.md) · [All operations](https://skmtc.dev/marker-inc-korea/apis/example-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/marker-inc-korea/example-api/revisions/19765fce26c8/schema)
