Docs / REST API

POST /v1/answer_pack

Everything an answer needs — fragments, mandatory citations, deterministic outcome. No generation.

We do NOT write the answer: your model writes it, on your key, under your editorial responsibility. We return what you cannot compute yourself — the norms found verbatim, the citations the answer MUST rest on, and the OUTCOME, decided against the corpus denominator: · supported — norms found; build the answer on must_cite; · not_in_corpus — nothing relevant AND the jurisdiction's denominator is not closed: honest 'we do not know'; · no_requirement_found — nothing relevant AND the denominator IS closed: 'there is no such requirement'. This third outcome is a privilege, not a convenience: a single caveat about completeness disqualifies it (see `denominator`). Relevance is gated deterministically, not by cosine distance: a fragment is `strong` only on LEXICAL confirmation — the question's own word stems occur in the norm (overlap ≥ 0.34) or the dictionary channel (FTS) found it. Vector-only hits are returned as `weak` and never enter must_cite: a nearest neighbour always exists, including when the corpus holds nothing on the topic. Agreement between our two vector channels (article and chunk) is NOT counted as evidence — it is one embedding model applied twice. Repealed norms stay in `fragments` (a lawyer must SEE that the article on the topic was repealed) but are excluded from must_cite via eligible_for_citation=false. Body: {question, jur (required), k (default 6, cap 20), as_of, lang}. Then run the finished answer through POST /v1/citecheck before showing it to a user: that keeps the 'no invented article' guarantee closed on the corpus.

Endpoint

POST https://api.lexatlas.creatora.app/v1/answer_pack

Parameters

None.

Request body

JSON object.

FieldTypeDescription
questionstring
jurstring
kinteger
as_ofstring
langstring

Example

curl -X POST -H "X-API-Key: lxa_YOUR_KEY" -H "Content-Type: application/json" \
  -d '{"cites": ["ru:gk_rf_1:196"]}' \
  "https://api.lexatlas.creatora.app/v1/answer_pack"

Responses and error codes

StatusMeaningSchema
200{outcome, outcome_basis, must_cite[], fragments[] with verbatim text + licence + status + relevance grade, answer_contract, denominator, knowledge}. A fragment may carry relevance.citation_blocked — the corpus WITHDRAWS its own support for that norm: show it, do not rely on it. Closed enumeration, listed below; an unknown value must be read as a refusal, never as 'nothing blocked'. Values: `confirmation_scattered` — the words that confirmed the norm stand farther apart than the span threshold: in a long act a chance co-occurrence of words does not mean the norm is on pointobject
400bad request — see error_code (missing_parameter, invalid_parameter, invalid_body, invalid_cursor, empty_batch, batch_too_large, unsupported)Error
401missing/invalid API key (when auth is enabled) — error_code=unauthorizedError
413body too large — error_code=payload_too_largeError
429rate limit exceeded (per-key, per-minute window) — error_code=rate_limitedError

Errors use one envelope everywhere: error, error_code, hint, http_status. The full list of codes is served by GET /v1/errors.