{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/joinways-app/json-schema/joinways-app-event-schema.json",
  "title": "Event",
  "description": "The stored event, as returned by `POST /events`, `PATCH /events/{id}` and the conversion of a lead. Every column of the event is returned except the internal search fields, the embedding and the public tokens; the main ones are listed. Amounts are `null` without `reports.view` or `quotes.manage`.",
  "x-generated": "2026-11-13",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/joinways-app-openapi.yml#/components/schemas/Event",
  "type": "object",
  "additionalProperties": true,
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid"
    },
    "account_id": {
      "type": "string",
      "format": "uuid"
    },
    "event_number": {
      "type": [
        "integer",
        "null"
      ]
    },
    "internal_reference": {
      "type": [
        "string",
        "null"
      ]
    },
    "title": {
      "type": "string"
    },
    "description": {
      "type": [
        "string",
        "null"
      ]
    },
    "type": {
      "type": [
        "string",
        "null"
      ]
    },
    "category": {
      "type": [
        "string",
        "null"
      ]
    },
    "status": {
      "$ref": "#/$defs/EventStatus"
    },
    "status_changed_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "stage_id": {
      "type": [
        "string",
        "null"
      ],
      "format": "uuid"
    },
    "stage_changed_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "pax": {
      "type": [
        "integer",
        "null"
      ]
    },
    "start_date": {
      "type": "string",
      "format": "date-time"
    },
    "end_date": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "selected_dates": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": "string",
        "format": "date"
      }
    },
    "day_hours": {
      "$ref": "#/$defs/DayHours"
    },
    "timezone": {
      "type": [
        "string",
        "null"
      ]
    },
    "is_virtual": {
      "type": [
        "boolean",
        "null"
      ]
    },
    "flexible": {
      "type": [
        "boolean",
        "null"
      ]
    },
    "language": {
      "type": [
        "string",
        "null"
      ]
    },
    "venue_id": {
      "type": [
        "string",
        "null"
      ],
      "format": "uuid",
      "description": "The venue (internally `location_id`)."
    },
    "location": {
      "type": [
        "string",
        "null"
      ],
      "description": "Free-text place (legacy), not the venue."
    },
    "address": {
      "type": [
        "string",
        "null"
      ]
    },
    "city": {
      "type": [
        "string",
        "null"
      ]
    },
    "postal_code": {
      "type": [
        "string",
        "null"
      ]
    },
    "country": {
      "type": [
        "string",
        "null"
      ]
    },
    "source": {
      "type": [
        "string",
        "null"
      ]
    },
    "source_lead_id": {
      "type": [
        "string",
        "null"
      ],
      "format": "uuid",
      "description": "Primary request (lead) of the event."
    },
    "budget": {
      "type": [
        "number",
        "null"
      ]
    },
    "expected_revenue": {
      "type": [
        "number",
        "null"
      ]
    },
    "currency": {
      "type": [
        "string",
        "null"
      ]
    },
    "confirmed_amount": {
      "type": [
        "number",
        "null"
      ]
    },
    "confirmed_amount_excl_tax": {
      "type": [
        "number",
        "null"
      ]
    },
    "cancellation_fee_excl_tax": {
      "type": [
        "number",
        "null"
      ]
    },
    "confirmed_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "loss_reason": {
      "type": [
        "string",
        "null"
      ]
    },
    "loss_reason_detail": {
      "type": [
        "string",
        "null"
      ]
    },
    "cancellation_reason": {
      "type": [
        "string",
        "null"
      ]
    },
    "cancellation_reason_detail": {
      "type": [
        "string",
        "null"
      ]
    },
    "tags": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": "string"
      }
    },
    "notes": {
      "type": [
        "string",
        "null"
      ]
    },
    "company_id": {
      "type": [
        "string",
        "null"
      ],
      "format": "uuid"
    },
    "contact_person_id": {
      "type": [
        "string",
        "null"
      ],
      "format": "uuid"
    },
    "assigned_to_account_id": {
      "type": [
        "string",
        "null"
      ],
      "format": "uuid"
    },
    "created_by": {
      "type": [
        "string",
        "null"
      ],
      "format": "uuid"
    },
    "billing_company_id": {
      "type": [
        "string",
        "null"
      ],
      "format": "uuid",
      "description": "Third-party company the quotes are billed to (instead of the client)."
    },
    "quote_to_platform": {
      "type": [
        "boolean",
        "null"
      ],
      "description": "The quotes are billed to the booking platform of `source`."
    },
    "is_replaceable": {
      "type": "boolean",
      "description": "Replaceable booking: a confirmed event that may give up its slot to another request. It keeps its date; the website form and chat show it per their settings, the inbox shows how to free the date. Nothing moves without the team."
    },
    "replaceable_changes": {
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "space",
          "date",
          "time"
        ]
      },
      "description": "What may change for a replaceable booking (`[]` when it is not)."
    },
    "event_group_id": {
      "type": [
        "string",
        "null"
      ],
      "format": "uuid"
    },
    "external_link": {
      "type": [
        "string",
        "null"
      ]
    },
    "setup_type": {
      "type": [
        "string",
        "null"
      ]
    },
    "setup_notes": {
      "type": [
        "string",
        "null"
      ]
    },
    "catering_notes": {
      "type": [
        "string",
        "null"
      ]
    },
    "dietary_notes": {
      "type": [
        "string",
        "null"
      ],
      "description": "Diets and allergies (« Contraintes alimentaires »), for the whole event."
    },
    "technical_notes": {
      "type": [
        "string",
        "null"
      ]
    },
    "service_notes": {
      "type": [
        "string",
        "null"
      ]
    },
    "beo_context": {
      "type": [
        "string",
        "null"
      ]
    },
    "beo_remarks": {
      "type": [
        "string",
        "null"
      ]
    },
    "schedule": {
      "type": [
        "array",
        "null"
      ],
      "description": "BEO program lines (see `BeoUpdate.schedule`).",
      "items": {
        "type": "object",
        "additionalProperties": true
      }
    },
    "technical_needs": {
      "type": [
        "string",
        "null"
      ],
      "description": "Technical needs, free text."
    },
    "service_needs": {
      "type": [
        "string",
        "null"
      ],
      "description": "Service needs, free text."
    },
    "event_schedule": {
      "type": [
        "string",
        "null"
      ],
      "description": "Schedule as free text; the BEO program is `schedule`."
    },
    "beo_public_url": {
      "type": [
        "string",
        "null"
      ],
      "format": "uri",
      "description": "Shareable, no-login URL of the public BEO page."
    },
    "archived_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "archived_by": {
      "type": [
        "string",
        "null"
      ],
      "format": "uuid"
    },
    "created_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "updated_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    }
  },
  "$defs": {
    "DayHours": {
      "type": [
        "array",
        "null"
      ],
      "description": "Per-day hours of a multi-day event, by date: one entry per day when the days have different hours, `null` when every day has the same hours (the time of `start_date` to the time of `end_date`) or for a one-day event.",
      "items": {
        "$ref": "#/$defs/DayHoursEntry"
      }
    },
    "DayHoursEntry": {
      "type": "object",
      "required": [
        "date",
        "start",
        "end"
      ],
      "description": "The hours of one day, wall-clock in the event's `timezone`. An `end` at or before `start` ends the next morning (overnight), at 06:00 at the latest.",
      "properties": {
        "date": {
          "type": "string",
          "format": "date"
        },
        "start": {
          "type": "string",
          "pattern": "^([01]\\d|2[0-3]):[0-5]\\d$"
        },
        "end": {
          "type": "string",
          "pattern": "^([01]\\d|2[0-3]):[0-5]\\d$"
        }
      }
    },
    "EventStatus": {
      "type": "string",
      "enum": [
        "option",
        "confirmed",
        "lost",
        "cancelled"
      ],
      "description": "`option` = pending / tentative, `confirmed` = booked, `lost` = did not convert, `cancelled` = cancelled after booking."
    }
  }
}