{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "meta": {
      "type": "object",
      "properties": {
        "created_at": {
          "type": "string",
          "format": "date-time",
          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
        },
        "updated_at": {
          "type": "string",
          "format": "date-time",
          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
        },
        "deleted_at": {
          "type": "string",
          "format": "date-time",
          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
        },
        "legacy_ref": {
          "type": "object",
          "properties": {
            "table": {
              "type": "string"
            },
            "key": {
              "type": ["string", "number"]
            },
            "row": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            }
          },
          "required": ["table", "key", "row"],
          "additionalProperties": false
        },
        "dataset": {
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "source": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
        },
        "kind": {
          "type": "string"
        },
        "class": {
          "type": "string",
          "enum": ["public", "private_shared", "private"]
        },
        "url": {
          "type": "string",
          "format": "uri"
        },
        "title": {
          "type": "string"
        },
        "author": {
          "type": "string"
        }
      },
      "required": ["id", "kind", "class"],
      "additionalProperties": false
    },
    "via": {
      "type": "string"
    },
    "note": {
      "type": "string"
    },
    "status": {
      "type": "string",
      "enum": ["pending", "parsed", "needs_input", "failed"]
    },
    "reason_code": {
      "type": "string"
    },
    "question": {
      "type": "string"
    },
    "progress": {
      "$ref": "#/$defs/__schema0"
    },
    "results": {
      "maxItems": 100,
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_.:-]{1,64}$"
          },
          "record": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "kind": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "visible": {
            "type": "boolean"
          },
          "open_url": {
            "type": "string",
            "format": "uri"
          },
          "too_large": {
            "type": "boolean"
          }
        },
        "required": ["id", "record", "kind", "title", "visible"],
        "additionalProperties": false
      },
      "partType": "result"
    },
    "feedback": {
      "readOnly": true,
      "description": "Pigeon admin feedback resolution.",
      "$ref": "#/$defs/__schema0"
    }
  },
  "required": ["source", "via", "status", "results"],
  "additionalProperties": false,
  "$defs": {
    "__schema0": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "number"
        },
        {
          "type": "boolean"
        },
        {
          "type": "null"
        },
        {
          "type": "array",
          "items": {
            "$ref": "#/$defs/__schema0"
          }
        },
        {
          "type": "object",
          "propertyNames": {
            "type": "string"
          },
          "additionalProperties": {
            "$ref": "#/$defs/__schema0"
          }
        }
      ]
    }
  },
  "$id": "https://sendtopigeon.com/schemas/send@1.schema.json",
  "title": "Pigeon Open Data: send@1",
  "$comment": "Apache-2.0. Structural schema; use Zod/parseRecord for semantic invariants. This published schema URL is immutable.",
  "examples": [
    {
      "source": {
        "id": "0194ab00-0000-7000-8000-000000000001",
        "kind": "demo",
        "class": "public"
      },
      "via": "demo",
      "status": "pending",
      "results": []
    }
  ]
}
