{
  "$id": "https://matchi.com/schemas/json/BookingParticipantJoinedV1.json",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "BookingParticipantJoinedV1",
  "description": "A message that is sent when a player with a MATCHi account comes onto an existing court booking at a venue in your subscription: they accept an invite to the booking, or they take a part of a split booking while invited and pay it. Not every player is covered: the Players joining and leaving bookings page lists when it is and is not sent. Delivery is best-effort: an event can be lost, can arrive more than once, and can arrive before BookingCreatedV2 for the same booking. 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": "JoinedParticipant",
      "description": "The player who joined: their MATCHi user ID and the email of their MATCHi account. A partner may store the two as a link to its own member record.",
      "type": "object",
      "required": [
        "userId",
        "email"
      ],
      "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."
        },
        "email": {
          "type": "string",
          "format": "email",
          "title": "Email",
          "description": "The verified email of the player's MATCHi account."
        }
      },
      "additionalProperties": false,
      "examples": [
        {
          "userId": "1b4e28ba-2fa1-11d2-883f-0016d3cca427",
          "email": "player@example.com"
        }
      ]
    }
  },
  "additionalProperties": false
}