{
  "$id": "https://matchi.com/schemas/json/BookingParticipantLeftV1.json",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "BookingParticipantLeftV1",
  "description": "A message that is sent when a player who came onto a court booking at a venue in your subscription goes off it: they leave, the booker removes them, they decline, or they remove their own paid part of a split booking. It carries the player's user ID and no email. The Players joining and leaving bookings page lists when it is and is not sent. Not sent when the booking is cancelled (BookingCancelledV2 covers it). Delivery is best-effort: an event can be lost, can arrive more than once, and can arrive before the BookingParticipantJoinedV1 it ends. This is the data part of the message; please read the event section for more information on the metadata envelope.",
  "type": "object",
  "required": [
    "booking",
    "facility",
    "participant"
  ],
  "properties": {
    "booking": {
      "title": "ParticipantBooking",
      "description": "The court booking a player joined or left.",
      "type": "object",
      "required": [
        "bookingId",
        "courtId",
        "courtName",
        "startTime",
        "endTime"
      ],
      "properties": {
        "bookingId": {
          "type": "string",
          "title": "Booking ID",
          "description": "A unique identifier for the booking, the same ID BookingCreatedV2 carries."
        },
        "courtId": {
          "type": "string",
          "title": "Court ID",
          "description": "A unique identifier for the court."
        },
        "courtName": {
          "type": "string",
          "title": "Court Name",
          "description": "The name of the court."
        },
        "startTime": {
          "type": "string",
          "format": "date-time",
          "title": "Start Time",
          "description": "The start time of the booking, in ISO 8601 format. The time is the facility's local time, with its UTC offset included."
        },
        "endTime": {
          "type": "string",
          "format": "date-time",
          "title": "End Time",
          "description": "The end time of the booking, in ISO 8601 format. The time is the facility's local time, with its UTC offset included."
        }
      },
      "additionalProperties": false,
      "examples": [
        {
          "bookingId": "48213377",
          "courtId": "1201",
          "courtName": "Court 3",
          "startTime": "2026-11-25T18:00:00+01:00",
          "endTime": "2026-11-25T19:00:00+01:00"
        }
      ]
    },
    "facility": {
      "title": "Facility",
      "description": "Facility information",
      "type": "object",
      "required": [
        "facilityId",
        "facilityName"
      ],
      "properties": {
        "facilityId": {
          "type": "string",
          "title": "Facility ID",
          "description": "A unique identifier for the facility."
        },
        "facilityName": {
          "type": "string",
          "title": "Facility Name",
          "description": "The name of the facility."
        }
      },
      "examples": [
        {
          "facilityId": "2344123",
          "facilityName": "Matchi Tennis Club"
        }
      ]
    },
    "participant": {
      "title": "LeftParticipant",
      "description": "The player who left: their MATCHi user ID only. Match it against the user ID received in BookingParticipantJoinedV1.",
      "type": "object",
      "required": [
        "userId"
      ],
      "properties": {
        "userId": {
          "type": "string",
          "format": "uuid",
          "title": "User ID",
          "description": "The player's MATCHi user ID, the same kind of ID the booking events use for MATCHi users."
        }
      },
      "additionalProperties": false,
      "examples": [
        {
          "userId": "1b4e28ba-2fa1-11d2-883f-0016d3cca427"
        }
      ]
    }
  },
  "additionalProperties": false
}