{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/apidirect-io/json-schema/apidirect-io-batch-response-schema.json",
  "title": "BatchResponse",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/apidirect-io-batch-api-openapi.yml#/components/schemas/BatchResponse",
  "type": "object",
  "properties": {
    "results": {
      "type": "array",
      "description": "One result per request item, in input order.",
      "items": {
        "$ref": "#/$defs/BatchResult"
      }
    },
    "summary": {
      "type": "object",
      "properties": {
        "total": {
          "type": "integer",
          "description": "Number of items in the batch."
        },
        "succeeded": {
          "type": "integer",
          "description": "Items that returned 2xx."
        },
        "failed": {
          "type": "integer",
          "description": "Items that did not succeed."
        },
        "duration_ms": {
          "type": "integer",
          "description": "Total batch execution time."
        }
      }
    }
  },
  "$defs": {
    "BatchResult": {
      "type": "object",
      "properties": {
        "index": {
          "type": "integer",
          "description": "Position of the item in `requests`."
        },
        "endpoint": {
          "type": "string",
          "description": "The endpoint the item called."
        },
        "tag": {
          "type": [
            "string",
            "null"
          ],
          "description": "The item's tag, when one was sent."
        },
        "status": {
          "type": "integer",
          "description": "The item's HTTP status: 2xx on success, the endpoint's normal 4xx/5xx on error, or 0 when the item was not attempted (never billed)."
        },
        "body": {
          "type": "object",
          "description": "Exactly what the endpoint returns when called directly, or its error body."
        }
      }
    }
  }
}