{
  "openapi": "3.1.0",
  "info": {
    "title": "Cleartix organizer API",
    "version": "1.4.0",
    "description": "REST API for organizers on the **Pro** tier. Authenticate with an API key created under *Settings → API keys*:\n\n```\nAuthorization: Bearer ctk_live_…\n```\n\nEvery key carries **scopes**; each operation lists the scope it needs. Requests are rate-limited to **100 per minute per key** and every response carries `X-RateLimit-Remaining`.\n\nSuccessful responses wrap their payload in `{ \"data\": … }`; lists add `meta` with pagination. Errors are `{ \"error\": CODE, \"message\": … }`.\n\nEvents, orders, attendees and stats are read-only. Widgets can be created and managed, which makes the API a foundation for website integrations such as a WordPress plugin.",
    "contact": {
      "name": "Cleartix",
      "url": "https://cleartix.eu"
    }
  },
  "servers": [
    {
      "url": "https://cleartix.io/api/v1"
    }
  ],
  "tags": [
    {
      "name": "Events",
      "description": "Your events, their dates and ticket types."
    },
    {
      "name": "Orders",
      "description": "Sold orders and their tickets."
    },
    {
      "name": "Attendees",
      "description": "Ticket holders per event."
    },
    {
      "name": "Stats",
      "description": "Aggregated sales figures without attendee data."
    },
    {
      "name": "Widgets",
      "description": "Embeddable widgets and embed snippets for your own website."
    },
    {
      "name": "Meta"
    }
  ],
  "security": [
    {
      "ApiKey": []
    }
  ],
  "paths": {
    "/openapi.json": {
      "get": {
        "operationId": "getOpenApi",
        "summary": "This document",
        "tags": [
          "Meta"
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "OpenAPI 3.1 document.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        },
        "description": "Public — no authentication."
      }
    },
    "/events": {
      "get": {
        "operationId": "listEvents",
        "summary": "List events",
        "tags": [
          "Events"
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "x-required-scope": "events:read",
        "description": "Events of the authenticated organization, newest start date first. Every event lists the languages it is sold in (`locales`, primary first); pass `?locale=` to receive `title` as a plain string in one language.\n\n**Required scope:** `events:read`. Requires the Pro tier.",
        "parameters": [
          {
            "$ref": "#/components/parameters/page"
          },
          {
            "$ref": "#/components/parameters/perPage"
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/EventStatus"
            },
            "description": "Filter on status; unknown values are ignored."
          },
          {
            "name": "locale",
            "in": "query",
            "description": "Resolve translatable fields to plain strings in this language. Falls back to the event's primary language when the event is not offered in it. Omit to receive the stored `{ nl, fr, en }` objects.",
            "schema": {
              "$ref": "#/components/schemas/Locale"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/EventSummary"
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/PaginationMeta"
                    }
                  },
                  "required": [
                    "data",
                    "meta"
                  ]
                }
              }
            },
            "headers": {
              "X-RateLimit-Remaining": {
                "schema": {
                  "type": "integer"
                },
                "description": "Rate-limit quota left for this key in the current minute."
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/events/{id}": {
      "get": {
        "operationId": "getEvent",
        "summary": "Get an event",
        "tags": [
          "Events"
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "x-required-scope": "events:read",
        "description": "One event with its dates and visible ticket types. `locales` lists the languages it is sold in (primary first); pass `?locale=` to receive title, description, ticket type names and date labels as plain strings in one language.\n\n**Required scope:** `events:read`. Requires the Pro tier.",
        "parameters": [
          {
            "$ref": "#/components/parameters/id"
          },
          {
            "name": "locale",
            "in": "query",
            "description": "Resolve translatable fields to plain strings in this language. Falls back to the event's primary language when the event is not offered in it. Omit to receive the stored `{ nl, fr, en }` objects.",
            "schema": {
              "$ref": "#/components/schemas/Locale"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/EventDetail"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            },
            "headers": {
              "X-RateLimit-Remaining": {
                "schema": {
                  "type": "integer"
                },
                "description": "Rate-limit quota left for this key in the current minute."
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/events/{id}/orders": {
      "get": {
        "operationId": "listEventOrders",
        "summary": "List orders of an event",
        "tags": [
          "Orders"
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "x-required-scope": "orders:read",
        "description": "Sold orders only (`paid`, `partially_refunded`, `invoice_paid`), newest first.\n\n**Required scope:** `orders:read`. Requires the Pro tier.",
        "parameters": [
          {
            "$ref": "#/components/parameters/id"
          },
          {
            "$ref": "#/components/parameters/page"
          },
          {
            "$ref": "#/components/parameters/perPage"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/OrderSummary"
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/PaginationMeta"
                    }
                  },
                  "required": [
                    "data",
                    "meta"
                  ]
                }
              }
            },
            "headers": {
              "X-RateLimit-Remaining": {
                "schema": {
                  "type": "integer"
                },
                "description": "Rate-limit quota left for this key in the current minute."
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/events/{id}/attendees": {
      "get": {
        "operationId": "listEventAttendees",
        "summary": "List attendees of an event",
        "tags": [
          "Attendees"
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "x-required-scope": "attendees:read",
        "description": "One row per valid ticket on a sold order. Holder details come from the ticket's form data, falling back to the buyer.\n\n**Required scope:** `attendees:read`. Requires the Pro tier.",
        "parameters": [
          {
            "$ref": "#/components/parameters/id"
          },
          {
            "$ref": "#/components/parameters/page"
          },
          {
            "$ref": "#/components/parameters/perPage"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Attendee"
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/PaginationMeta"
                    }
                  },
                  "required": [
                    "data",
                    "meta"
                  ]
                }
              }
            },
            "headers": {
              "X-RateLimit-Remaining": {
                "schema": {
                  "type": "integer"
                },
                "description": "Rate-limit quota left for this key in the current minute."
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/events/{id}/stats": {
      "get": {
        "operationId": "getEventStats",
        "summary": "Sales stats of an event",
        "tags": [
          "Stats"
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "x-required-scope": "stats:read",
        "description": "Aggregated tickets sold, check-ins, orders and revenue, broken down per ticket type. Contains no attendee data.\n\n**Required scope:** `stats:read`. Requires the Pro tier.",
        "parameters": [
          {
            "$ref": "#/components/parameters/id"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/EventSalesStats"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            },
            "headers": {
              "X-RateLimit-Remaining": {
                "schema": {
                  "type": "integer"
                },
                "description": "Rate-limit quota left for this key in the current minute."
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/events/{id}/embed": {
      "get": {
        "operationId": "getEventEmbed",
        "summary": "Embed snippet for an event",
        "tags": [
          "Widgets"
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "x-required-scope": "events:read",
        "description": "Loader-script URL, iframe URL, copy-paste snippet and script attributes for the single-event hosted checkout. Counterpart of the `embed` block on widgets.\n\n**Required scope:** `events:read`. Requires the Pro tier.",
        "parameters": [
          {
            "$ref": "#/components/parameters/id"
          },
          {
            "name": "locale",
            "in": "query",
            "description": "Language of the embedded checkout (default `nl`).",
            "schema": {
              "$ref": "#/components/schemas/Locale"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/EventEmbed"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            },
            "headers": {
              "X-RateLimit-Remaining": {
                "schema": {
                  "type": "integer"
                },
                "description": "Rate-limit quota left for this key in the current minute."
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/orders/{id}": {
      "get": {
        "operationId": "getOrder",
        "summary": "Get an order",
        "tags": [
          "Orders"
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "x-required-scope": "orders:read",
        "description": "Full order with buyer, invoicing status, booked timeslot and tickets.\n\n**Required scope:** `orders:read`. Requires the Pro tier.",
        "parameters": [
          {
            "$ref": "#/components/parameters/id"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/OrderDetail"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            },
            "headers": {
              "X-RateLimit-Remaining": {
                "schema": {
                  "type": "integer"
                },
                "description": "Rate-limit quota left for this key in the current minute."
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/widgets": {
      "get": {
        "operationId": "listWidgets",
        "summary": "List widgets",
        "tags": [
          "Widgets"
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "x-required-scope": "widgets:read",
        "description": "Embeddable multi-event widgets of the organization, newest first. Each carries an `embed` block with everything needed to place it on a website.\n\n**Required scope:** `widgets:read`. Requires the Pro tier.",
        "parameters": [
          {
            "$ref": "#/components/parameters/page"
          },
          {
            "$ref": "#/components/parameters/perPage"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Widget"
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/PaginationMeta"
                    }
                  },
                  "required": [
                    "data",
                    "meta"
                  ]
                }
              }
            },
            "headers": {
              "X-RateLimit-Remaining": {
                "schema": {
                  "type": "integer"
                },
                "description": "Rate-limit quota left for this key in the current minute."
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "post": {
        "operationId": "createWidget",
        "summary": "Create a widget",
        "tags": [
          "Widgets"
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "x-required-scope": "widgets:write",
        "description": "Same fields as the dashboard form. `eventTemplateIds`, `eventIds` and `locationIds` are only consulted for their matching `selectionMode`.\n\n**Required scope:** `widgets:write`. Requires the Pro tier.",
        "requestBody": {
          "required": true,
          "description": "Widget configuration.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WidgetInput"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Widget"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            },
            "headers": {
              "X-RateLimit-Remaining": {
                "schema": {
                  "type": "integer"
                },
                "description": "Rate-limit quota left for this key in the current minute."
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/ValidationError"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/widgets/options": {
      "get": {
        "operationId": "getWidgetOptions",
        "summary": "Choices for configuring a widget",
        "tags": [
          "Widgets"
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "x-required-scope": "widgets:read",
        "description": "Templates, upcoming published events, locations and branding of the organization, plus the allowed enum values — everything a configuration screen needs.\n\n**Required scope:** `widgets:read`. Requires the Pro tier.",
        "parameters": [
          {
            "name": "locale",
            "in": "query",
            "description": "Language of template/event labels (default `nl`).",
            "schema": {
              "$ref": "#/components/schemas/Locale"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/WidgetOptions"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            },
            "headers": {
              "X-RateLimit-Remaining": {
                "schema": {
                  "type": "integer"
                },
                "description": "Rate-limit quota left for this key in the current minute."
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/widgets/preview": {
      "post": {
        "operationId": "previewWidgetEvents",
        "summary": "Preview events for a draft selection",
        "tags": [
          "Widgets"
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "x-required-scope": "widgets:read",
        "description": "Resolves which events a (possibly unsaved) selection would show. Nothing is persisted.\n\n**Required scope:** `widgets:read`. Requires the Pro tier.",
        "requestBody": {
          "required": true,
          "description": "Draft selection to resolve.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WidgetPreviewInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Resolved events with the locale and currency they are rendered in.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/WidgetEvent"
                      }
                    },
                    "meta": {
                      "type": "object",
                      "properties": {
                        "locale": {
                          "$ref": "#/components/schemas/Locale"
                        },
                        "currency": {
                          "type": "string"
                        },
                        "total": {
                          "type": "integer"
                        }
                      },
                      "required": [
                        "locale",
                        "currency",
                        "total"
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "meta"
                  ]
                }
              }
            },
            "headers": {
              "X-RateLimit-Remaining": {
                "schema": {
                  "type": "integer"
                },
                "description": "Rate-limit quota left for this key in the current minute."
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/ValidationError"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/widgets/{id}": {
      "get": {
        "operationId": "getWidget",
        "summary": "Get a widget",
        "tags": [
          "Widgets"
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "x-required-scope": "widgets:read",
        "parameters": [
          {
            "$ref": "#/components/parameters/id"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Widget"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            },
            "headers": {
              "X-RateLimit-Remaining": {
                "schema": {
                  "type": "integer"
                },
                "description": "Rate-limit quota left for this key in the current minute."
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "description": "**Required scope:** `widgets:read`. Requires the Pro tier."
      },
      "patch": {
        "operationId": "updateWidget",
        "summary": "Update a widget",
        "tags": [
          "Widgets"
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "x-required-scope": "widgets:write",
        "description": "Partial update; omitted fields are left untouched. Send `\"theme\": null` to clear the theme.\n\n**Required scope:** `widgets:write`. Requires the Pro tier.",
        "parameters": [
          {
            "$ref": "#/components/parameters/id"
          }
        ],
        "requestBody": {
          "required": true,
          "description": "Fields to change.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WidgetUpdateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Widget"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            },
            "headers": {
              "X-RateLimit-Remaining": {
                "schema": {
                  "type": "integer"
                },
                "description": "Rate-limit quota left for this key in the current minute."
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/ValidationError"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "delete": {
        "operationId": "deleteWidget",
        "summary": "Delete a widget",
        "tags": [
          "Widgets"
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "x-required-scope": "widgets:write",
        "description": "Embeds referencing the widget stop rendering.\n\n**Required scope:** `widgets:write`. Requires the Pro tier.",
        "parameters": [
          {
            "$ref": "#/components/parameters/id"
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted",
            "headers": {
              "X-RateLimit-Remaining": {
                "schema": {
                  "type": "integer"
                },
                "description": "Rate-limit quota left for this key in the current minute."
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/widgets/{id}/events": {
      "get": {
        "operationId": "listWidgetEvents",
        "summary": "Events a widget shows",
        "tags": [
          "Widgets"
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "x-required-scope": "widgets:read",
        "description": "The same resolution the iframe uses: published, upcoming events narrowed by the widget's selection and date range, in start order.\n\n**Required scope:** `widgets:read`. Requires the Pro tier.",
        "parameters": [
          {
            "$ref": "#/components/parameters/id"
          },
          {
            "name": "locale",
            "in": "query",
            "description": "Defaults to the widget's `defaultLocale`.",
            "schema": {
              "$ref": "#/components/schemas/Locale"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Resolved events with the locale and currency they are rendered in.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/WidgetEvent"
                      }
                    },
                    "meta": {
                      "type": "object",
                      "properties": {
                        "locale": {
                          "$ref": "#/components/schemas/Locale"
                        },
                        "currency": {
                          "type": "string"
                        },
                        "total": {
                          "type": "integer"
                        }
                      },
                      "required": [
                        "locale",
                        "currency",
                        "total"
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "meta"
                  ]
                }
              }
            },
            "headers": {
              "X-RateLimit-Remaining": {
                "schema": {
                  "type": "integer"
                },
                "description": "Rate-limit quota left for this key in the current minute."
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "ApiKey": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "ctk_live_<32 hex chars>",
        "description": "Scopes: `events:read`, `orders:read`, `attendees:read`, `stats:read`, `widgets:read`, `widgets:write`."
      }
    },
    "parameters": {
      "page": {
        "name": "page",
        "in": "query",
        "description": "Page number, starting at 1.",
        "schema": {
          "type": "integer",
          "minimum": 1,
          "default": 1
        }
      },
      "perPage": {
        "name": "perPage",
        "in": "query",
        "description": "Items per page (max 50).",
        "schema": {
          "type": "integer",
          "minimum": 1,
          "maximum": 50,
          "default": 50
        }
      },
      "locale": {
        "name": "locale",
        "in": "query",
        "description": "Language for resolved labels and links. Invalid values fall back to the default.",
        "schema": {
          "$ref": "#/components/schemas/Locale"
        }
      },
      "id": {
        "name": "id",
        "in": "path",
        "required": true,
        "description": "Resource id.",
        "schema": {
          "type": "string"
        }
      }
    },
    "responses": {
      "Unauthorized": {
        "description": "Missing or invalid API key (`UNAUTHORIZED`).",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "Forbidden": {
        "description": "Organization is not on the Pro tier, or the key lacks the required scope (`FORBIDDEN`).",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "NotFound": {
        "description": "The resource does not exist or belongs to another organization (`NOT_FOUND`).",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "RateLimited": {
        "description": "More than 100 requests in the current minute for this key (`RATE_LIMIT_EXCEEDED`).",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "ValidationError": {
        "description": "Malformed JSON (`INVALID_JSON`) or a body that fails validation (`VALIDATION_ERROR`, see `details`).",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      }
    },
    "schemas": {
      "Locale": {
        "type": "string",
        "enum": [
          "nl",
          "fr",
          "en"
        ]
      },
      "Translatable": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": "string"
            }
          }
        ],
        "description": "Locale-aware text. Without `?locale=` this is the stored object keyed by language (`{ nl, fr, en }`; only the languages the event offers are present, and an empty string counts as missing). With `?locale=` it is a plain string resolved for that language, falling back to the event's primary language (`locales[0]`) when the requested one is not offered or not filled in."
      },
      "PaginationMeta": {
        "type": "object",
        "properties": {
          "page": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "perPage": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "total": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          }
        },
        "required": [
          "page",
          "perPage",
          "total"
        ],
        "additionalProperties": false
      },
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string",
            "description": "Stable machine-readable code, e.g. `NOT_FOUND`."
          },
          "message": {
            "type": "string"
          },
          "details": {
            "description": "Present on `VALIDATION_ERROR` only: Zod `flatten()` output (`formErrors`, `fieldErrors`).",
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {}
          }
        },
        "required": [
          "error",
          "message"
        ],
        "additionalProperties": false
      },
      "EventStatus": {
        "type": "string",
        "enum": [
          "draft",
          "published",
          "cancelled",
          "past"
        ]
      },
      "OrderStatus": {
        "type": "string",
        "enum": [
          "pending",
          "paid",
          "partially_refunded",
          "refunded",
          "cancelled",
          "expired",
          "pending_invoice",
          "invoice_paid"
        ]
      },
      "TicketStatus": {
        "type": "string",
        "enum": [
          "valid",
          "cancelled",
          "transferred"
        ]
      },
      "CheckInStatus": {
        "type": "string",
        "enum": [
          "not_checked_in",
          "checked_in"
        ]
      },
      "EventSummary": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "title": {
            "$ref": "#/components/schemas/Translatable"
          },
          "locales": {
            "minItems": 1,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Locale"
            },
            "description": "Languages the event is sold in, primary language first. Translatable fields only carry these languages."
          },
          "startAt": {
            "type": "string",
            "format": "date-time"
          },
          "endAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "status": {
            "$ref": "#/components/schemas/EventStatus"
          },
          "slug": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "id",
          "title",
          "locales",
          "startAt",
          "endAt",
          "status",
          "slug"
        ],
        "additionalProperties": false
      },
      "EventDate": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "startAt": {
            "type": "string",
            "format": "date-time"
          },
          "endAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "label": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Translatable"
              },
              {
                "type": "null"
              }
            ]
          },
          "capacity": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          },
          "availableCapacity": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "startAt",
          "endAt",
          "label",
          "capacity",
          "availableCapacity"
        ],
        "additionalProperties": false
      },
      "TicketType": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "$ref": "#/components/schemas/Translatable"
          },
          "description": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Translatable"
              },
              {
                "type": "null"
              }
            ]
          },
          "basePrice": {
            "type": "number",
            "description": "Major currency units (e.g. 12.5 = €12.50)."
          },
          "capacity": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          },
          "availableCapacity": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          },
          "salesStartAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "salesEndAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "sortOrder": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          }
        },
        "required": [
          "id",
          "name",
          "description",
          "basePrice",
          "capacity",
          "availableCapacity",
          "salesStartAt",
          "salesEndAt",
          "sortOrder"
        ],
        "additionalProperties": false
      },
      "EventDetail": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "title": {
            "$ref": "#/components/schemas/Translatable"
          },
          "description": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Translatable"
              },
              {
                "type": "null"
              }
            ]
          },
          "locales": {
            "minItems": 1,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Locale"
            },
            "description": "Languages the event is sold in, primary language first. Translatable fields only carry these languages."
          },
          "startAt": {
            "type": "string",
            "format": "date-time"
          },
          "endAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "timezone": {
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/EventStatus"
          },
          "slug": {
            "type": [
              "string",
              "null"
            ]
          },
          "capacity": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ],
            "description": "Configured event-wide seat cap; null when unlimited."
          },
          "eventCapacity": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ],
            "description": "Seats still available at event level (the cap minus live orders and waitlist holds); null when unlimited."
          },
          "timeslotBookingEnabled": {
            "type": "boolean"
          },
          "timeslotCapacityUnit": {
            "type": "string",
            "enum": [
              "bookings",
              "tickets"
            ],
            "description": "How each timeslot's capacity is counted: per order (bookings) or per ticket."
          },
          "eventDates": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EventDate"
            }
          },
          "ticketTypes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TicketType"
            },
            "description": "Visible ticket types only."
          }
        },
        "required": [
          "id",
          "title",
          "description",
          "locales",
          "startAt",
          "endAt",
          "timezone",
          "status",
          "slug",
          "capacity",
          "eventCapacity",
          "timeslotBookingEnabled",
          "timeslotCapacityUnit",
          "eventDates",
          "ticketTypes"
        ],
        "additionalProperties": false
      },
      "EventEmbed": {
        "type": "object",
        "properties": {
          "eventId": {
            "type": "string"
          },
          "eventSlug": {
            "type": [
              "string",
              "null"
            ]
          },
          "status": {
            "$ref": "#/components/schemas/EventStatus"
          },
          "orgSlug": {
            "type": "string"
          },
          "publicUrl": {
            "type": "string",
            "description": "Public event page (custom domain when verified)."
          },
          "scriptUrl": {
            "type": "string",
            "description": "Loader script; include once per page."
          },
          "url": {
            "type": "string",
            "description": "Iframe page the loader renders; usable directly as `<iframe src>`."
          },
          "snippet": {
            "type": "string",
            "description": "Copy-paste HTML (container div + script tag)."
          },
          "attributes": {
            "type": "object",
            "properties": {
              "data-event": {
                "type": "string"
              },
              "data-org": {
                "type": "string"
              },
              "data-locale": {
                "$ref": "#/components/schemas/Locale"
              }
            },
            "required": [
              "data-event",
              "data-org",
              "data-locale"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "eventId",
          "eventSlug",
          "status",
          "orgSlug",
          "publicUrl",
          "scriptUrl",
          "url",
          "snippet",
          "attributes"
        ],
        "additionalProperties": false
      },
      "Person": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string"
          },
          "firstName": {
            "type": [
              "string",
              "null"
            ]
          },
          "lastName": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "email",
          "firstName",
          "lastName"
        ],
        "additionalProperties": false
      },
      "Timeslot": {
        "type": "object",
        "properties": {
          "eventDateId": {
            "type": "string"
          },
          "startAt": {
            "type": "string",
            "format": "date-time"
          },
          "endAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "label": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Translatable"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "eventDateId",
          "startAt",
          "endAt",
          "label"
        ],
        "additionalProperties": false
      },
      "OrderSummary": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "total": {
            "type": "number",
            "description": "Major currency units, incl. VAT."
          },
          "currency": {
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/OrderStatus"
          },
          "attendee": {
            "$ref": "#/components/schemas/Person"
          }
        },
        "required": [
          "id",
          "createdAt",
          "total",
          "currency",
          "status",
          "attendee"
        ],
        "additionalProperties": false
      },
      "OrderDetail": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "paidAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "status": {
            "$ref": "#/components/schemas/OrderStatus"
          },
          "total": {
            "type": "number",
            "description": "Major currency units (e.g. 12.5 = €12.50)."
          },
          "subtotal": {
            "type": "number",
            "description": "Major currency units (e.g. 12.5 = €12.50)."
          },
          "discount": {
            "type": "number",
            "description": "Major currency units (e.g. 12.5 = €12.50)."
          },
          "vat": {
            "type": "number",
            "description": "Major currency units (e.g. 12.5 = €12.50)."
          },
          "vatRate": {
            "type": "number"
          },
          "currency": {
            "type": "string"
          },
          "paymentProvider": {
            "type": "string",
            "enum": [
              "stripe",
              "mollie",
              "none"
            ]
          },
          "paymentMethod": {
            "type": [
              "string",
              "null"
            ]
          },
          "locale": {
            "$ref": "#/components/schemas/Locale"
          },
          "vatScheme": {
            "type": "string",
            "enum": [
              "standard",
              "reverse_charge",
              "zero_rated"
            ]
          },
          "buyer": {
            "type": "object",
            "properties": {
              "email": {
                "type": "string"
              },
              "firstName": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "lastName": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "type": {
                "type": "string",
                "enum": [
                  "personal",
                  "business"
                ]
              },
              "companyName": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "vatNumber": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "billingAddress": {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "street": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "postalCode": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "city": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "country": {
                        "type": [
                          "string",
                          "null"
                        ]
                      }
                    },
                    "required": [
                      "street",
                      "postalCode",
                      "city",
                      "country"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "email",
              "firstName",
              "lastName",
              "type",
              "companyName",
              "vatNumber",
              "billingAddress"
            ],
            "additionalProperties": false
          },
          "invoicing": {
            "type": "object",
            "properties": {
              "required": {
                "type": "boolean",
                "description": "True when the organizer still has to issue an invoice for this order."
              },
              "invoicedAt": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "date-time"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "reference": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "provider": {
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "required": [
              "required",
              "invoicedAt",
              "reference",
              "provider"
            ],
            "additionalProperties": false
          },
          "event": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "title": {
                    "$ref": "#/components/schemas/Translatable"
                  },
                  "slug": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                },
                "required": [
                  "id",
                  "title",
                  "slug"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "timeslot": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Timeslot"
              },
              {
                "type": "null"
              }
            ]
          },
          "tickets": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "status": {
                  "$ref": "#/components/schemas/TicketStatus"
                },
                "checkInStatus": {
                  "$ref": "#/components/schemas/CheckInStatus"
                },
                "checkedInAt": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "date-time"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "ticketType": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "$ref": "#/components/schemas/Translatable"
                    },
                    "basePrice": {
                      "type": "number",
                      "description": "Major currency units (e.g. 12.5 = €12.50)."
                    }
                  },
                  "required": [
                    "id",
                    "name",
                    "basePrice"
                  ],
                  "additionalProperties": false
                }
              },
              "required": [
                "id",
                "status",
                "checkInStatus",
                "checkedInAt",
                "ticketType"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "id",
          "createdAt",
          "paidAt",
          "status",
          "total",
          "subtotal",
          "discount",
          "vat",
          "vatRate",
          "currency",
          "paymentProvider",
          "paymentMethod",
          "locale",
          "vatScheme",
          "buyer",
          "invoicing",
          "event",
          "timeslot",
          "tickets"
        ],
        "additionalProperties": false
      },
      "Attendee": {
        "type": "object",
        "properties": {
          "ticketId": {
            "type": "string"
          },
          "ticketStatus": {
            "$ref": "#/components/schemas/TicketStatus"
          },
          "ticketTypeName": {
            "$ref": "#/components/schemas/Translatable"
          },
          "orderStatus": {
            "$ref": "#/components/schemas/OrderStatus"
          },
          "checkedIn": {
            "type": "boolean"
          },
          "checkedInAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "timeslot": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Timeslot"
              },
              {
                "type": "null"
              }
            ]
          },
          "holder": {
            "$ref": "#/components/schemas/Person"
          }
        },
        "required": [
          "ticketId",
          "ticketStatus",
          "ticketTypeName",
          "orderStatus",
          "checkedIn",
          "checkedInAt",
          "timeslot",
          "holder"
        ],
        "additionalProperties": false
      },
      "TicketTypeSalesRow": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "$ref": "#/components/schemas/Translatable"
          },
          "basePrice": {
            "type": "number",
            "description": "Major currency units (e.g. 12.5 = €12.50)."
          },
          "capacity": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          },
          "availableCapacity": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          },
          "isVisible": {
            "type": "boolean"
          },
          "sortOrder": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "sold": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          }
        },
        "required": [
          "id",
          "name",
          "basePrice",
          "capacity",
          "availableCapacity",
          "isVisible",
          "sortOrder",
          "sold"
        ],
        "additionalProperties": false
      },
      "EventSalesStats": {
        "type": "object",
        "properties": {
          "event": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "title": {
                "$ref": "#/components/schemas/Translatable"
              },
              "startAt": {
                "type": "string",
                "format": "date-time"
              },
              "endAt": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "date-time"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "status": {
                "$ref": "#/components/schemas/EventStatus"
              },
              "slug": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "capacity": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "Configured event-wide seat cap; null when unlimited."
              },
              "eventCapacity": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "Seats still available at event level (the cap minus live orders and waitlist holds); null when unlimited."
              }
            },
            "required": [
              "id",
              "title",
              "startAt",
              "endAt",
              "status",
              "slug",
              "capacity",
              "eventCapacity"
            ],
            "additionalProperties": false
          },
          "currency": {
            "type": "string"
          },
          "totals": {
            "type": "object",
            "properties": {
              "ticketsSold": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              "checkedIn": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              "orders": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              "revenue": {
                "type": "number",
                "description": "Gross ticket revenue in major units, incl. VAT, excl. add-ons."
              }
            },
            "required": [
              "ticketsSold",
              "checkedIn",
              "orders",
              "revenue"
            ],
            "additionalProperties": false
          },
          "ticketTypes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TicketTypeSalesRow"
            },
            "description": "Includes hidden ticket types."
          }
        },
        "required": [
          "event",
          "currency",
          "totals",
          "ticketTypes"
        ],
        "additionalProperties": false
      },
      "WidgetView": {
        "type": "string",
        "enum": [
          "list",
          "calendar"
        ]
      },
      "WidgetSelectionMode": {
        "type": "string",
        "enum": [
          "all_upcoming",
          "templates",
          "manual",
          "location"
        ]
      },
      "WidgetTheme": {
        "type": "object",
        "properties": {
          "primaryColor": {
            "type": "string",
            "pattern": "^#[0-9a-fA-F]{6}$"
          },
          "backgroundColor": {
            "type": "string",
            "pattern": "^#[0-9a-fA-F]{6}$"
          },
          "cardColor": {
            "type": "string",
            "pattern": "^#[0-9a-fA-F]{6}$"
          },
          "textColor": {
            "type": "string",
            "pattern": "^#[0-9a-fA-F]{6}$"
          },
          "borderRadius": {
            "type": "string",
            "enum": [
              "none",
              "sm",
              "md",
              "lg",
              "xl"
            ]
          }
        },
        "additionalProperties": false,
        "description": "Unset colors inherit the organization branding."
      },
      "WidgetEmbed": {
        "type": "object",
        "properties": {
          "scriptUrl": {
            "type": "string",
            "description": "Loader script; include once per page for any number of widgets."
          },
          "url": {
            "type": "string",
            "description": "Iframe page the loader renders; usable directly as `<iframe src>`. Append `?locale=` to override the language."
          },
          "snippet": {
            "type": "string",
            "description": "Copy-paste HTML using the widget's default locale."
          },
          "attributes": {
            "type": "object",
            "properties": {
              "data-widget": {
                "type": "string"
              },
              "data-org": {
                "type": "string"
              },
              "data-locale": {
                "$ref": "#/components/schemas/Locale"
              }
            },
            "required": [
              "data-widget",
              "data-org",
              "data-locale"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "scriptUrl",
          "url",
          "snippet",
          "attributes"
        ],
        "additionalProperties": false
      },
      "Widget": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "view": {
            "$ref": "#/components/schemas/WidgetView"
          },
          "selectionMode": {
            "$ref": "#/components/schemas/WidgetSelectionMode"
          },
          "eventTemplateIds": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "eventIds": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "locationIds": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "dateFrom": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "dateTo": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "theme": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/WidgetTheme"
              },
              {
                "type": "null"
              }
            ]
          },
          "customCss": {
            "type": [
              "string",
              "null"
            ]
          },
          "defaultLocale": {
            "$ref": "#/components/schemas/Locale"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "embed": {
            "$ref": "#/components/schemas/WidgetEmbed"
          }
        },
        "required": [
          "id",
          "name",
          "view",
          "selectionMode",
          "eventTemplateIds",
          "eventIds",
          "locationIds",
          "dateFrom",
          "dateTo",
          "theme",
          "customCss",
          "defaultLocale",
          "createdAt",
          "updatedAt",
          "embed"
        ],
        "additionalProperties": false
      },
      "WidgetEvent": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "title": {
            "type": "string",
            "description": "Already resolved to the requested locale."
          },
          "startAtISO": {
            "type": "string",
            "format": "date-time"
          },
          "endAtISO": {
            "type": "string",
            "format": "date-time"
          },
          "timezone": {
            "type": "string"
          },
          "imageUrl": {
            "anyOf": [
              {
                "type": "string",
                "description": "Absolute URL."
              },
              {
                "type": "null"
              }
            ]
          },
          "locationName": {
            "type": [
              "string",
              "null"
            ]
          },
          "priceFrom": {
            "anyOf": [
              {
                "type": "number",
                "description": "Major currency units (e.g. 12.5 = €12.50)."
              },
              {
                "type": "null"
              }
            ],
            "description": "Lowest visible ticket price in major units; 0 = free; null = no visible ticket types."
          },
          "soldOut": {
            "type": "boolean"
          },
          "checkoutUrl": {
            "type": "string",
            "description": "Hosted embedded checkout for this event (what the widget links to)."
          },
          "publicUrl": {
            "type": "string",
            "description": "Public event page (custom domain when verified)."
          }
        },
        "required": [
          "id",
          "slug",
          "title",
          "startAtISO",
          "endAtISO",
          "timezone",
          "imageUrl",
          "locationName",
          "priceFrom",
          "soldOut",
          "checkoutUrl",
          "publicUrl"
        ],
        "additionalProperties": false
      },
      "WidgetOption": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "meta": {
            "description": "Secondary label, e.g. the event date.",
            "type": "string"
          }
        },
        "required": [
          "id",
          "label"
        ],
        "additionalProperties": false
      },
      "WidgetOptions": {
        "type": "object",
        "properties": {
          "orgSlug": {
            "type": "string"
          },
          "branding": {
            "type": "object",
            "properties": {
              "primaryColor": {
                "type": "string"
              },
              "secondaryColor": {
                "type": "string"
              }
            },
            "required": [
              "primaryColor",
              "secondaryColor"
            ],
            "additionalProperties": false
          },
          "scriptUrl": {
            "type": "string",
            "description": "Absolute URL."
          },
          "templates": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WidgetOption"
            }
          },
          "events": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WidgetOption"
            },
            "description": "Published, upcoming events."
          },
          "locations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WidgetOption"
            }
          },
          "views": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WidgetView"
            }
          },
          "selectionModes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WidgetSelectionMode"
            }
          },
          "locales": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Locale"
            }
          },
          "borderRadii": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "none",
                "sm",
                "md",
                "lg",
                "xl"
              ]
            }
          }
        },
        "required": [
          "orgSlug",
          "branding",
          "scriptUrl",
          "templates",
          "events",
          "locations",
          "views",
          "selectionModes",
          "locales",
          "borderRadii"
        ],
        "additionalProperties": false
      },
      "WidgetInput": {
        "type": "object",
        "properties": {
          "selectionMode": {
            "type": "string",
            "enum": [
              "all_upcoming",
              "templates",
              "manual",
              "location"
            ]
          },
          "eventTemplateIds": {
            "default": [],
            "maxItems": 100,
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "eventIds": {
            "default": [],
            "maxItems": 500,
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "locationIds": {
            "default": [],
            "maxItems": 100,
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "dateFrom": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "dateTo": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "view": {
            "type": "string",
            "enum": [
              "list",
              "calendar"
            ]
          },
          "theme": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "primaryColor": {
                    "type": "string",
                    "pattern": "^#[0-9a-fA-F]{6}$"
                  },
                  "backgroundColor": {
                    "type": "string",
                    "pattern": "^#[0-9a-fA-F]{6}$"
                  },
                  "cardColor": {
                    "type": "string",
                    "pattern": "^#[0-9a-fA-F]{6}$"
                  },
                  "textColor": {
                    "type": "string",
                    "pattern": "^#[0-9a-fA-F]{6}$"
                  },
                  "borderRadius": {
                    "type": "string",
                    "enum": [
                      "none",
                      "sm",
                      "md",
                      "lg",
                      "xl"
                    ]
                  }
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "customCss": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 20000
              },
              {
                "type": "null"
              }
            ]
          },
          "defaultLocale": {
            "type": "string",
            "enum": [
              "nl",
              "fr",
              "en"
            ]
          }
        },
        "required": [
          "selectionMode",
          "name",
          "view",
          "defaultLocale"
        ]
      },
      "WidgetUpdateInput": {
        "type": "object",
        "properties": {
          "selectionMode": {
            "type": "string",
            "enum": [
              "all_upcoming",
              "templates",
              "manual",
              "location"
            ]
          },
          "eventTemplateIds": {
            "default": [],
            "maxItems": 100,
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "eventIds": {
            "default": [],
            "maxItems": 500,
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "locationIds": {
            "default": [],
            "maxItems": 100,
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "dateFrom": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "dateTo": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "view": {
            "type": "string",
            "enum": [
              "list",
              "calendar"
            ]
          },
          "theme": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "primaryColor": {
                    "type": "string",
                    "pattern": "^#[0-9a-fA-F]{6}$"
                  },
                  "backgroundColor": {
                    "type": "string",
                    "pattern": "^#[0-9a-fA-F]{6}$"
                  },
                  "cardColor": {
                    "type": "string",
                    "pattern": "^#[0-9a-fA-F]{6}$"
                  },
                  "textColor": {
                    "type": "string",
                    "pattern": "^#[0-9a-fA-F]{6}$"
                  },
                  "borderRadius": {
                    "type": "string",
                    "enum": [
                      "none",
                      "sm",
                      "md",
                      "lg",
                      "xl"
                    ]
                  }
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "customCss": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 20000
              },
              {
                "type": "null"
              }
            ]
          },
          "defaultLocale": {
            "type": "string",
            "enum": [
              "nl",
              "fr",
              "en"
            ]
          }
        }
      },
      "WidgetPreviewInput": {
        "type": "object",
        "properties": {
          "selectionMode": {
            "type": "string",
            "enum": [
              "all_upcoming",
              "templates",
              "manual",
              "location"
            ]
          },
          "eventTemplateIds": {
            "default": [],
            "maxItems": 100,
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "eventIds": {
            "default": [],
            "maxItems": 500,
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "locationIds": {
            "default": [],
            "maxItems": 100,
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "dateFrom": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "dateTo": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "locale": {
            "default": "nl",
            "type": "string",
            "enum": [
              "nl",
              "fr",
              "en"
            ]
          }
        },
        "required": [
          "selectionMode"
        ]
      }
    }
  }
}