Fetch provisions
Read provisions by unit_id, from a source record or a search hit: at most 20 per call. A unit_id names a provision, not a version, so it keeps working after the law is amended.
as_of picks the version in force that day, today in UTC without it; each record echoes the date it used. text is cut to 20,000 characters. An id that was not found, or that this API does not serve (us, an add-on corpus, a country whose ids are not yet stable), is in not_found and free.
Charged per provision returned; a call that returns none is not charged. X-Jurisdiction is checked as for a search and narrows nothing.
bearerAuthAuthorizationBearer <token>Idempotency-Key?stringMakes a retry safe. A repeat of the same request answers with the stored result and Idempotent-Replayed: true, and is never charged again; the same key on a different request is idempotency_key_reused. Without it, a retry is a new, charged request.
^[ -~]+$1 <= length <= 255X-Jurisdiction?stringThe countries whose law is read, comma-separated, in any case and spacing; hu without it. Allowed: at, be, ch, cz, de, dk, es, fi, fr, gb, ge, hr, hu, ie, it, li, lu, mc, nl, no, pl, pt, ro, rs, se, si, sk. Any other code, us, oecd and ifrs included, is unsupported_jurisdiction.
application/json- body
POST /v1/provisions/fetch: unit_ids, and the day whose versions to read (today in
UTC when absent).
as_of?|The day whose version is read, YYYY-MM-DD; today in UTC when absent.
nullids*array<string>The unit_ids to read, from a source record or a search hit.
1 <= items <= 20The provisions found, and the ids that were not.
application/json- response
The answer to POST /v1/provisions/fetch.
data*array<>not_found*array<string>The requested ids that were not read, in request order. They cost nothing.
object*stringusage*What a provision lookup cost.
curl -X POST 'https://api.azta.ai/v1/provisions/fetch' \ -H 'Content-Type: application/json' \ -d '{ "ids": [ "string" ]}'{ "data": [ { "act": { "identifier": "string", "short_title": "string", "title": "string" }, "as_of": "2019-08-24", "country": "string", "excerpt": "string", "kind": "provision", "section": "string", "text": "string", "title": "string", "truncated": true, "unit_id": "string", "url": "http://example.com", "url_kind": "official", "version": { "effective_from": "2019-08-24", "effective_to": "2019-08-24", "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "is_current": true } } ], "not_found": [ "string" ], "object": "list", "usage": { "cost": { "amount": "string", "currency": "EUR" } }}Create a response POST
Ask a question and get an answer from the law, with its sources. Set exactly one of `stream` and `background` to `true`. `stream` answers `200` with server-sent events; `background` answers `202` with the response at `status: queued`, which you poll with `getResponse` and which sends a webhook when it ends. This API is stateless: `input` is a string, or the whole conversation as items whose last item has the role `user`. `conversation` and `previous_response_id` are refused. Unknown fields are accepted and ignored. A response is charged to the organisation's credit balance (see `usage.cost`); a request the ledger refuses starts nothing.
Retrieve a response GET
A response this key created, whatever its state. A failure is in the object (`status`, `error`), never in the HTTP status. `output` is empty and `sources` is `[]` until the response is `completed`; there is no partial text. `usage` appears once it has ended.