> ## Documentation Index
> Fetch the complete documentation index at: https://docs.getclean.ai/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> getclean's own MCP server is at https://mcp.getclean.ai/mcp. The /mcp path of this docs site is Mintlify's search over these pages, not getclean.
> Every answer of the API opens with outcome. A page that could not be read is a record whose outcome says why, never an HTTP error; read outcome before anything else.
> The API's contract is the OpenAPI 3.1 file at https://docs.getclean.ai/openapi.yaml; the SDKs are generated from it.
> The product's name is written getclean, in lower case.

# Answers from official pages only

> Build an assistant for residents that searches only the sites you name, returns the passage of the official page that answers, and shows its date. A forum post cannot enter an answer, because only the sites you name are searched.

A city builds an assistant that tells residents how to renew a residence permit. On an open web search the page ranked first is a forum thread from 2019 with a fee that changed twice since. A resident who follows it comes to the office with the wrong papers. An assistant of a public body has to answer from the body's own pages and show which page it used. This page builds that assistant.

## The run in 4 steps

### Name the sites that count

`allowed_domains` is a hard filter: only results on these sites are in the list. An entry can be a domain, every domain with one ending such as `.gov`, or the start of an address. `source_kinds` narrows the list further to sites that a public body publishes.

The policy of a key can set the allowed sites for every call. An assistant that runs under such a key cannot search another site, whatever its prompt says.

### Get the passages in one call

Send the resident's question in several wordings and in each official language. `contents` fetches the first 3 results in the same call and finds the passages for the question in each.

```json Request body of search theme={"theme":"css-variables"}
{
  "query": "renew residence permit required documents",
  "alternate_queries": [
    "residence permit extension application deadline",
    "Aufenthaltstitel verlängern erforderliche Unterlagen",
    "Verlängerung Aufenthaltserlaubnis Antrag Frist"
  ],
  "allowed_domains": ["CITY_DOMAIN", "MINISTRY_DOMAIN"],
  "source_kinds": ["state"],
  "languages": ["de", "en"],
  "contents": {
    "top": 3,
    "max_characters": 0,
    "highlights": [
      "Which documents are needed to renew a residence permit?",
      "How long before the permit expires must the application be made?",
      "What does the renewal cost?"
    ]
  }
}
```

Replace `CITY_DOMAIN` and `MINISTRY_DOMAIN` with the domains of the official sites.

### Show the passage with its date

Each of the 3 pages comes back as a record with the passages that bear on each question, and with the facts of the page. This part of one record is cut to the fields that an answer shows.

```json Part of the response theme={"theme":"css-variables"}
{
  "source": {
    "title": "Aufenthaltstitel verlängern",
    "published_date": "2026-09-01",
    "published_date_basis": "structured_data",
    "language": "de",
    "language_versions": [{ "language": "en", "url": "ENGLISH_VERSION_URL" }]
  },
  "highlights": [
    {
      "query_index": 1,
      "basis": "judged",
      "text": "Der Antrag ist spätestens acht Wochen vor Ablauf des Aufenthaltstitels zu stellen."
    }
  ]
}
```

Your assistant writes its answer from the passage and shows the passage under it, in the page's own words, with the title of the page and its date. The resident can open the page and find the sentence.

The page has an English version of its own. For a resident who writes in English, fetch that version and quote from it. Nothing is translated for you, so a quote is the page's own text.

### Know when a page changed

Fetch the pages that your answers rest on each night, with the fingerprint of each one's last record. A page whose text changed comes back in full, and your assistant stops quoting the old sentence that day.

## What the city can check

| The city asks | What the assistant has |
| - | - |
| Which page is this answer from? | The page, its date, and the passage in the page's words. |
| Could a private site get into an answer? | No, because only the sites on your list are searched. |
| Is the page still the same? | The fingerprint of the record that the answer used. |
| What did the assistant search? | The receipt of each search: every wording, and what was not searched. |

## Know the limits

A model picks the passage that bears on a question, and your own model writes the answer. The passage is the page's text, word for word. The answer is not.

A page that declares no date has none. An answer then shows the day the page was read.

Which version of a page binds is stated only where the page itself declares it.

For the calls, see [Search and get the evidence in one call](https://docs.getclean.ai/find/search-and-read.md) and [Get one ranked list from the web and from specialist datasources](https://docs.getclean.ai/find/where-you-can-search.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.