Fetch provisions

POST
/v1/provisions/fetch

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.

Authorization

bearerAuth
headerAuthorizationBearer <token>

Header Parameters

Idempotency-Key?string

Makes 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.

Match^[ -~]+$
Length1 <= length <= 255
X-Jurisdiction?string

The 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.

Request Body

application/json
  1. 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.

Defaultnull
ids*array<string>

The unit_ids to read, from a source record or a search hit.

Items1 <= items <= 20

Response Body

The provisions found, and the ids that were not.

application/json
  1. 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*string
usage*

What a provision lookup cost.

Example Request
curl -X POST 'https://api.azta.ai/v1/provisions/fetch' \  -H 'Content-Type: application/json' \  -d '{  "ids": [    "string"  ]}'
Example Response
{  "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"    }  }}