{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/enterprise-wikimedia-com/json-schema/enterprise-wikimedia-com-batch-schema.json",
  "title": "batch",
  "description": "Hourly batch file of article updates for a project namespace, served by the Realtime Batch endpoints",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/enterprise-wikimedia-com-openapi.yml#/components/schemas/batch",
  "type": "object",
  "properties": {
    "identifier": {
      "type": "string",
      "description": "Identifier of the batch, combining the project identifier and namespace, e.g. `enwiki_namespace_0`. The Wikidata batches are `wikidata_items` and `wikidata_properties`; the Wikidata batch endpoints take `items` or `properties` as their `{identifier}` path parameter, not this value"
    },
    "version": {
      "type": "string",
      "description": "Content hash of the batch file. Changes whenever the batch contents change"
    },
    "date_modified": {
      "type": "string",
      "format": "date-time",
      "description": "Timestamp of when the batch file was last updated"
    },
    "in_language": {
      "$ref": "#/$defs/language",
      "description": "Language of the project the batch belongs to"
    },
    "is_part_of": {
      "$ref": "#/$defs/project",
      "description": "Project the batch belongs to"
    },
    "namespace": {
      "$ref": "#/$defs/article_namespace",
      "description": "Namespace of the articles in the batch"
    },
    "size": {
      "$ref": "#/$defs/size",
      "description": "Size of the batch file in decimal megabytes (`unit_text` is `MB`)."
    },
    "record_count": {
      "type": "integer",
      "description": "Number of records in the batch file"
    }
  },
  "$defs": {
    "article_namespace": {
      "type": "object",
      "description": "Namespace the page belongs to",
      "properties": {
        "identifier": {
          "type": "number",
          "description": "Numeric identifier of the namespace. Names and descriptions are available from the Namespaces metadata endpoints"
        }
      }
    },
    "language": {
      "type": "object",
      "description": "Language of a Wikimedia project or article",
      "properties": {
        "identifier": {
          "type": "string",
          "description": "Wikimedia [language code](https://www.wikidata.org/wiki/Help:Wikimedia_language_codes/lists/all) of the language"
        },
        "name": {
          "type": "string",
          "description": "Full name of the language"
        },
        "alternate_name": {
          "type": "string",
          "description": "Alternate name of the language"
        },
        "direction": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "ltr",
            "rtl",
            null
          ],
          "description": "Direction the language is written in, `ltr` (left-to-right) or `rtl` (right-to-left)"
        }
      }
    },
    "project": {
      "type": "object",
      "description": "Wikimedia project a resource belongs to",
      "properties": {
        "identifier": {
          "type": "string",
          "description": "Unique identifier of the project, combining language and project code, e.g. `enwiki` for English Wikipedia"
        },
        "code": {
          "type": "string",
          "description": "Code of the project type, e.g. `wiki` for Wikipedia projects"
        },
        "name": {
          "type": "string",
          "description": "Name of the project"
        },
        "url": {
          "type": "string",
          "format": "uri",
          "description": "URL of the project"
        },
        "in_language": {
          "$ref": "#/$defs/language",
          "description": "Primary language of the project"
        }
      }
    },
    "size": {
      "type": "object",
      "description": "Size of a resource, in the unit given by `unit_text`.",
      "properties": {
        "unit_text": {
          "type": "string",
          "description": "`MB` on snapshots, chunks and batches: decimal megabytes, bytes divided by 1,000,000, to three decimals. `B` on article versions: bytes of wikitext."
        },
        "value": {
          "type": "number",
          "description": "Size in the unit given by `unit_text`. For the exact byte count of a download, use the `Content-Length` header from a HEAD request on its download endpoint."
        }
      }
    }
  }
}