{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://splitclubapp.com/schemas/v1/event.json",
  "title": "Event",
  "description": "A dated instance: a night, a tournament, a show. POST /v1/experiences accepts it (and still accepts the original experience body).",
  "x-doc": "schema-event",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "title",
    "starts_at"
  ],
  "properties": {
    "external_id": {
      "type": "string",
      "minLength": 1,
      "maxLength": 128,
      "pattern": "^[^\\s]+$",
      "description": "Your system's id for this object. Sending the same external_id again updates or replays it; it never makes a second one.",
      "x-expected": "your own id for it, 1–128 characters, no spaces",
      "examples": [
        "tee-sheet-4471"
      ]
    },
    "offering_external_id": {
      "type": "string",
      "minLength": 1,
      "maxLength": 128,
      "pattern": "^[^\\s]+$",
      "description": "The offering this is an instance of, if any.",
      "x-expected": "your own id for it, 1–128 characters, no spaces",
      "examples": [
        "tee-sheet-4471"
      ]
    },
    "title": {
      "type": "string",
      "minLength": 1,
      "maxLength": 120,
      "examples": [
        "Member-guest scramble"
      ]
    },
    "description": {
      "type": "string",
      "maxLength": 4000
    },
    "category": {
      "type": "string",
      "minLength": 1,
      "maxLength": 60,
      "pattern": "^[a-z0-9_-]+$",
      "description": "A SplitClub category slug; GET /v1/me lists the ones you may use.",
      "examples": [
        "golf"
      ]
    },
    "starts_at": {
      "type": "string",
      "format": "date-time",
      "examples": [
        "2026-11-07T08:00:00-05:00"
      ]
    },
    "ends_at": {
      "type": "string",
      "format": "date-time",
      "examples": [
        "2026-11-07T14:00:00-05:00"
      ]
    },
    "capacity": {
      "type": "integer",
      "minimum": 1,
      "maximum": 5000,
      "examples": [
        72
      ]
    },
    "tiers": {
      "type": "array",
      "maxItems": 20,
      "items": {
        "$ref": "price_tier.json"
      }
    },
    "on_sale": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "starts_at": {
          "type": "string",
          "format": "date-time",
          "examples": [
            "2026-11-07T08:00:00-05:00"
          ]
        },
        "ends_at": {
          "type": "string",
          "format": "date-time",
          "examples": [
            "2026-11-07T08:00:00-05:00"
          ]
        }
      }
    },
    "media": {
      "type": "array",
      "maxItems": 10,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "url"
        ],
        "properties": {
          "url": {
            "type": "string",
            "maxLength": 2000,
            "pattern": "^https://[^\\s]{4,}$",
            "format": "uri",
            "x-expected": "an https:// URL",
            "examples": [
              "https://example.com/photo.jpg"
            ]
          },
          "type": {
            "type": "string",
            "enum": [
              "image",
              "video"
            ],
            "default": "image"
          },
          "alt": {
            "type": "string",
            "maxLength": 300
          }
        }
      }
    },
    "policy": {
      "$ref": "policy.json"
    },
    "booking_url": {
      "type": "string",
      "maxLength": 2000,
      "pattern": "^https://[^\\s]{4,}$",
      "format": "uri",
      "x-expected": "an https:// URL",
      "examples": [
        "https://example.com/photo.jpg"
      ]
    },
    "metadata": {
      "type": "object",
      "maxProperties": 20,
      "propertyNames": {
        "type": "string",
        "minLength": 1,
        "maxLength": 40,
        "pattern": "^[A-Za-z0-9_.-]+$"
      },
      "additionalProperties": {
        "type": "string",
        "maxLength": 500
      },
      "description": "Up to 20 string keys of your own, echoed back on every read and webhook.",
      "examples": [
        {
          "order_id": "A-1042"
        }
      ]
    }
  },
  "examples": [
    {
      "external_id": "scramble-2026-11-07",
      "title": "Member-guest scramble",
      "starts_at": "2026-11-07T08:00:00-05:00",
      "capacity": 72,
      "tiers": [
        {
          "label": "Per player",
          "amount": 19500,
          "currency": "usd",
          "unit": "per_person"
        }
      ]
    }
  ]
}
