{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/zluri/refs/heads/main/json-schema/snapshot-data-upload.json",
  "title": "Zluri Snapshot Data Upload",
  "description": "Payload for uploading snapshot entity data within an active sync session. Snapshot data represents the current state of entities.",
  "type": "object",
  "required": ["entity", "page", "data"],
  "properties": {
    "entity": {
      "type": "string",
      "description": "The type of snapshot entity being uploaded. Dependencies: users must be synced before groups, group_users, and activities.",
      "enum": [
        "users",
        "applications",
        "contracts",
        "transactions",
        "groups",
        "group_users",
        "roles",
        "activities"
      ]
    },
    "page": {
      "type": "integer",
      "description": "Page number for this batch of data. Re-uploading the same page number overwrites previous data for that page.",
      "minimum": 1
    },
    "data": {
      "type": "array",
      "description": "Array of entity records. Maximum 1000 records per page.",
      "maxItems": 1000,
      "items": {
        "type": "object"
      }
    }
  }
}
