Skip to content

POST /v1/answer

Answer a question over the pinned release, with citations.

POST /v1/answer

The retrieval closure for one question, as of one date: the units that matched, the article each sits in, the definitions in force on that date, whatever amends or disapplies them, and the obligation atoms written into them. Every block carries an eId or an atom id together with the release tag, so any sentence in the answer can be followed back to the canonical text it came from. Naming an entity profile has applicability decided as well; it never removes content from the answer.

The response is a function of the release and the request alone — no timestamp, no duration, no request id — so two instances started from one release answer one question with identical bytes. as_of is the single exception a caller controls: omitting it means today, which is the one thing about an answer that is not reproducible tomorrow, and the response echoes the date that was resolved.

The same closure is the Model Context Protocol tool search_regulation, answered by the same implementation over the same release.

Accepted: bearerAuth (http bearer), or no credentials.

Parameter
X-Request-IdA correlation id to answer under. A value the server cannot log safely — too long, or carrying anything outside its id alphabet — is discarded and a fresh id minted, because a log line is read by a human and must not be forgeable by a header. (in header)

A JSON object, at most 65536 bytes. Unknown properties are refused rather than ignored.

application/json, required — AnswerRequest

{
"as_of": "2025-06-01",
"entity_profile": "operator",
"query": "do operators have to keep a register of critical services"
}

The closure, every block carrying a citation.

application/json — AnswerResponse

Response header
X-Request-IdThe correlation id this request was answered under. It is on every response, in the server’s log record for the request, and inside the error object of every refusal.

invalid_request — the body is not JSON, is not an object, or states a field this route does not take — an unknown field is refused rather than ignored, because a caller who misspells as_of and is silently answered for today has been given a wrong answer with no way to tell; release_mismatch — the request names a release this instance does not serve; a response echoes the release it answered from, and an echo that lied would be worse than a refusal; unknown_profile — no entity profile of that id is in the release

application/json — Error

Response header
X-Request-IdThe correlation id this request was answered under. It is on every response, in the server’s log record for the request, and inside the error object of every refusal.

unauthorized — no bearer token was presented, or the one presented is not a credential this deployment accepts. A request with no token is answered only where the deployment configuration says anonymous access is allowed

application/json — Error

Response header
WWW-AuthenticateThe challenge, naming the one scheme this server accepts.
X-Request-IdThe correlation id this request was answered under. It is on every response, in the server’s log record for the request, and inside the error object of every refusal.

payload_too_large — the body is larger than this server reads

application/json — Error

Response header
X-Request-IdThe correlation id this request was answered under. It is on every response, in the server’s log record for the request, and inside the error object of every refusal.

rate_limited — the caller is over its per-minute allowance; Retry-After says when the rolling window will admit it again. A refused request does not consume budget, so retrying cannot make the throttling worse

application/json — Error

Response header
Retry-AfterSeconds until the rolling window admits this caller again.
X-Request-IdThe correlation id this request was answered under. It is on every response, in the server’s log record for the request, and inside the error object of every refusal.

not_ready — no verified release is loaded yet, or the process has begun draining. The socket binds before the release is verified, so a listener that is not ready answers the probes and serves no regulation at all

application/json — Error

Response header
X-Request-IdThe correlation id this request was answered under. It is on every response, in the server’s log record for the request, and inside the error object of every refusal.

Rendered from openregs/openregs@f3a2d10:docs/reference/openapi.json