Skip to content

POST /v1/unit

One unit’s text and metadata, by eId, as of a date.

POST /v1/unit

The version of a provision in force on as_of, its citation, every version of it the release holds, and the obligation atoms anchored to it. An eId that names units of more than one act on that date is refused rather than resolved by picking: pass work_iri to say which act is meant.

This is the REST twin of the get_unit MCP tool, and not a second implementation of it — one service builds the payload and the two protocols carry it, so the documents cannot drift apart.

The same closure is the Model Context Protocol tool get_unit, 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 — UnitRequest

{
"as_of": "2025-06-01",
"eid": "art_5__para_2"
}

The unit as it read on the date, and what is anchored to it.

application/json — UnitResponse

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

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.

not_found — no unit, atom or route of that name

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.

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