{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/aard-ai/json-schema/aard-ai-build-url-request-schema.json",
  "title": "BuildUrlRequest",
  "description": "Request body for POST /v1/build_url: one flat JSON object of tool arguments. Unknown names are rejected with 400 invalid_request, and the `detail` then lists every accepted name.",
  "x-generated": "2026-10-31",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/aard-ai-openapi.json#/components/schemas/BuildUrlRequest",
  "type": "object",
  "properties": {
    "agency_id": {
      "type": "string",
      "minLength": 1,
      "pattern": "\\S",
      "description": "SDMX agency code, e.g. \"ABS\", \"ESTAT\", \"OECD\". Dataflow identifiers are agency-scoped, so both are required."
    },
    "dataflow_id": {
      "type": "string",
      "minLength": 1,
      "pattern": "\\S",
      "description": "SDMX dataflow identifier, e.g. \"DF_CLD_XCHL_SEX_AGE_NB\"."
    },
    "selections": {
      "oneOf": [
        {
          "type": "object",
          "additionalProperties": true
        },
        {
          "type": "string"
        }
      ],
      "description": "`{dimension_id: code or name, ...}` anchoring the request — a JSON object, or that object JSON-encoded as a string. Names resolve within the dimension's available codes; a value with no available data is rejected with alternatives, never silently passed."
    },
    "time_range": {
      "type": "string",
      "minLength": 1,
      "pattern": "\\S",
      "description": "Time filter, e.g. \"2020-2024\", \"since 2015\", \"2024\"."
    },
    "precision": {
      "type": "string",
      "minLength": 1,
      "pattern": "\\S",
      "description": "URL breadth: \"point\" (one observation), \"series\" (headline series defaults) or \"cube\" (the full cube).",
      "default": "series",
      "enum": [
        "point",
        "series",
        "cube"
      ]
    },
    "availability": {
      "type": "string",
      "minLength": 1,
      "pattern": "\\S",
      "description": "\"confirmed\" accepts direct Actual or observed-key evidence; \"best_effort\" also accepts direct Allowed codes, labelled unconfirmed. Neither executes structural codelist values.",
      "default": "confirmed",
      "enum": [
        "confirmed",
        "best_effort"
      ]
    },
    "verify": {
      "type": "boolean",
      "description": "true fetches one observation from the built URL to confirm the selected codes co-occur in observed data (a small live request); false disables the probe. Omitted defers to the origin's configured default, currently off. The URL is never changed, only annotated."
    },
    "labels": {
      "type": "boolean",
      "description": "Request the publisher's labelled CSV where supported — each coded column gains a human-readable name column beside it. Increases source bytes.",
      "default": false
    }
  },
  "additionalProperties": false,
  "required": [
    "agency_id",
    "dataflow_id"
  ]
}