{ "openapi": "3.1.0", "info": { "title": "Cross Events API", "version": "v2", "description": "Version 2 of the Cross Events API. Every response is JSON:\n- a single item is `{ \"data\": { … } }`;\n- a list is `{ \"data\": [ … ], \"meta\": { \"page\", \"limit\", \"total\", \"pages\" } }`, paged with `?page=` and `?limit=` (at most 100);\n- an error is `{ \"error\": { \"code\", \"message\", \"fields\"? } }` with a stable `code`.\n\nDates are ISO 8601 in UTC; amounts are in rand. Sign in through the app and send the token as `Authorization: Bearer `.\nVersion 1 (`/api/…`) keeps working while the app moves over; it will be removed in 2.0." }, "servers": [ { "url": "/api/v2" } ], "tags": [ { "name": "Events (staff)" }, { "name": "Events" }, { "name": "Admin" }, { "name": "Uploads" }, { "name": "Series" }, { "name": "Me" }, { "name": "Deals" }, { "name": "Campuses" }, { "name": "Registrations" }, { "name": "Check-in" }, { "name": "Accounts" } ], "paths": { "/events/manage": { "get": { "tags": [ "Events (staff)" ], "summary": "Every event staff can see", "description": "Hidden ones too. Upcoming by default; `past`, `inactive` and `closed` (cashed-up) widen it. Campus-scoped staff see their campuses' events and church-wide ones. Not paged — it's what the event pickers search.\n\n**Who:** Staff, supervisors and admins.", "operationId": "getEventsManage", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "past", "in": "query", "required": false, "description": "Include events that have ended", "schema": { "default": "false", "type": "string", "enum": [ "true", "false" ] } }, { "name": "inactive", "in": "query", "required": false, "description": "Include deactivated events", "schema": { "default": "false", "type": "string", "enum": [ "true", "false" ] } }, { "name": "closed", "in": "query", "required": false, "description": "Include cashed-up events (default true)", "schema": { "default": "true", "type": "string", "enum": [ "true", "false" ] } }, { "name": "campus", "in": "query", "required": false, "description": "A campus id or slug, or 'all' for church-wide events only", "schema": { "type": "string", "maxLength": 64 } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 64 }, "title": { "type": "string" }, "description": { "type": [ "string", "null" ] }, "startDate": { "type": "string", "format": "date-time", "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$" }, "endDate": { "type": "string", "format": "date-time", "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$" }, "isActive": { "type": "boolean" }, "isHidden": { "type": "boolean" }, "requiresRegistration": { "type": "boolean" }, "scheduleType": { "type": "string", "enum": [ "single", "sessions" ] }, "attendanceMode": { "type": "string", "enum": [ "whole", "pick" ] }, "cashupStatus": { "type": "string", "enum": [ "open", "closed" ] }, "campusId": { "anyOf": [ { "type": "string", "minLength": 1, "maxLength": 64 }, { "type": "null" } ] }, "seriesId": { "anyOf": [ { "type": "string", "minLength": 1, "maxLength": 64 }, { "type": "null" } ] }, "picture": { "type": [ "string", "null" ] }, "eventOptions": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 64 }, "name": { "type": "string" }, "price": { "type": "number" }, "isMainTicket": { "type": "boolean" }, "stockLimit": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 } }, "required": [ "id", "name", "price", "isMainTicket", "stockLimit" ], "additionalProperties": {} } }, "sessions": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 64 }, "label": { "type": [ "string", "null" ] }, "startsAt": { "type": "string", "format": "date-time", "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$" }, "endsAt": { "type": "string", "format": "date-time", "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$" }, "cancelled": { "type": "boolean" } }, "required": [ "id", "label", "startsAt", "endsAt", "cancelled" ], "additionalProperties": {} } } }, "required": [ "id", "title", "description", "startDate", "endDate", "isActive", "isHidden", "requiresRegistration", "scheduleType", "attendanceMode", "cashupStatus", "campusId", "seriesId", "picture" ], "additionalProperties": {} } } }, "required": [ "data" ], "additionalProperties": false } } } }, "400": { "description": "Validation failed (VALIDATION_FAILED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "401": { "description": "Not signed in (UNAUTHENTICATED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "Not allowed for this role (FORBIDDEN)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/events": { "post": { "tags": [ "Events (staff)" ], "summary": "Create an event", "description": "Gets a \"Main Ticket\" at the event price (unless registration is off). A campus-scoped supervisor must choose one of their campuses.\n\n**Who:** Supervisors and admins.", "operationId": "postEvents", "security": [ { "bearerAuth": [] } ], "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "title": { "type": "string", "minLength": 1, "maxLength": 200 }, "description": { "anyOf": [ { "type": "string", "maxLength": 20000 }, { "type": "null" } ] }, "startDate": { "type": "string", "maxLength": 40 }, "endDate": { "type": "string", "maxLength": 40 }, "price": { "anyOf": [ { "type": "number" }, { "type": "string", "maxLength": 20 } ] }, "campusId": { "anyOf": [ { "type": "string", "minLength": 1, "maxLength": 64 }, { "type": "null" } ] }, "seriesId": { "anyOf": [ { "type": "string", "minLength": 1, "maxLength": 64 }, { "type": "null" } ] }, "scheduleType": { "type": "string", "enum": [ "single", "sessions" ] }, "sessions": { "maxItems": 200, "type": "array", "items": { "type": "object", "properties": {}, "additionalProperties": {} } } }, "required": [ "title", "startDate", "endDate" ], "additionalProperties": {} } } } }, "responses": { "201": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 64 }, "title": { "type": "string" }, "description": { "type": [ "string", "null" ] }, "startDate": { "type": "string", "format": "date-time", "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$" }, "endDate": { "type": "string", "format": "date-time", "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$" }, "isActive": { "type": "boolean" }, "isHidden": { "type": "boolean" }, "requiresRegistration": { "type": "boolean" }, "scheduleType": { "type": "string", "enum": [ "single", "sessions" ] }, "attendanceMode": { "type": "string", "enum": [ "whole", "pick" ] }, "cashupStatus": { "type": "string", "enum": [ "open", "closed" ] }, "campusId": { "anyOf": [ { "type": "string", "minLength": 1, "maxLength": 64 }, { "type": "null" } ] }, "seriesId": { "anyOf": [ { "type": "string", "minLength": 1, "maxLength": 64 }, { "type": "null" } ] }, "picture": { "type": [ "string", "null" ] }, "eventOptions": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 64 }, "name": { "type": "string" }, "price": { "type": "number" }, "isMainTicket": { "type": "boolean" }, "stockLimit": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 } }, "required": [ "id", "name", "price", "isMainTicket", "stockLimit" ], "additionalProperties": {} } }, "sessions": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 64 }, "label": { "type": [ "string", "null" ] }, "startsAt": { "type": "string", "format": "date-time", "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$" }, "endsAt": { "type": "string", "format": "date-time", "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$" }, "cancelled": { "type": "boolean" } }, "required": [ "id", "label", "startsAt", "endsAt", "cancelled" ], "additionalProperties": {} } } }, "required": [ "id", "title", "description", "startDate", "endDate", "isActive", "isHidden", "requiresRegistration", "scheduleType", "attendanceMode", "cashupStatus", "campusId", "seriesId", "picture" ], "additionalProperties": {} } }, "required": [ "data" ], "additionalProperties": false } } } }, "400": { "description": "Validation failed (VALIDATION_FAILED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "401": { "description": "Not signed in (UNAUTHENTICATED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "Not allowed for this role (FORBIDDEN)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } }, "get": { "tags": [ "Events" ], "summary": "Upcoming public events", "description": "Events anyone can see (active, not hidden, live) that have not ended, soonest first.\n\n**Who:** Anyone.", "operationId": "getEvents", "parameters": [ { "name": "page", "in": "query", "required": false, "description": "Page number, from 1", "schema": { "default": 1, "type": "integer", "minimum": 1, "maximum": 9007199254740991 } }, { "name": "limit", "in": "query", "required": false, "description": "Items per page (at most 100)", "schema": { "default": 25, "type": "integer", "minimum": 1, "maximum": 100 } }, { "name": "q", "in": "query", "required": false, "description": "Search the title", "schema": { "type": "string", "maxLength": 100 } }, { "name": "campus", "in": "query", "required": false, "description": "A campus id or slug (its events plus church-wide ones), or 'all' for church-wide events only", "schema": { "type": "string", "maxLength": 64 } }, { "name": "series", "in": "query", "required": false, "description": "A series slug", "schema": { "type": "string", "maxLength": 120 } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 64 }, "title": { "type": "string" }, "startDate": { "type": "string", "format": "date-time", "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$" }, "endDate": { "type": "string", "format": "date-time", "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$" }, "location": { "type": [ "string", "null" ] }, "price": { "type": "number", "description": "The headline price in rand (0 = free)" }, "pictureUrl": { "type": [ "string", "null" ] }, "requiresRegistration": { "type": "boolean" }, "scheduleType": { "type": "string", "enum": [ "single", "sessions" ] }, "campus": { "anyOf": [ { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 64 }, "name": { "type": "string" }, "slug": { "type": "string" } }, "required": [ "id", "name", "slug" ], "additionalProperties": false }, { "type": "null" } ], "description": "null = for all campuses (or campuses are off)" }, "series": { "anyOf": [ { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 64 }, "name": { "type": "string" }, "slug": { "type": "string" } }, "required": [ "id", "name", "slug" ], "additionalProperties": false }, { "type": "null" } ] } }, "required": [ "id", "title", "startDate", "endDate", "location", "price", "pictureUrl", "requiresRegistration", "scheduleType", "campus", "series" ], "additionalProperties": false } }, "meta": { "type": "object", "properties": { "page": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, "limit": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, "total": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991, "description": "Items across all pages" }, "pages": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991, "description": "Number of pages (at least 1)" } }, "required": [ "page", "limit", "total", "pages" ], "additionalProperties": false } }, "required": [ "data", "meta" ], "additionalProperties": false } } } }, "400": { "description": "Validation failed (VALIDATION_FAILED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/events/{id}": { "patch": { "tags": [ "Events (staff)" ], "summary": "Change an event", "description": "Only the fields sent change. Sessions save with the event (a refused schedule change saves nothing). A cashed-up event can't change until an admin reopens it. The answer includes `sessionChanges` (added, moved, cancelled… counts) when sessions were sent.\n\n**Who:** Supervisors and admins.", "operationId": "patchEventsId", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "id", "in": "path", "required": true, "description": "The id", "schema": { "type": "string", "minLength": 1, "maxLength": 64 } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "title": { "type": "string", "minLength": 1, "maxLength": 200 }, "description": { "anyOf": [ { "type": "string", "maxLength": 20000 }, { "type": "null" } ] }, "startDate": { "type": "string", "maxLength": 40 }, "endDate": { "type": "string", "maxLength": 40 }, "price": { "anyOf": [ { "type": "number" }, { "type": "string", "maxLength": 20 } ] }, "campusId": { "anyOf": [ { "type": "string", "minLength": 1, "maxLength": 64 }, { "type": "null" } ] }, "seriesId": { "anyOf": [ { "type": "string", "minLength": 1, "maxLength": 64 }, { "type": "null" } ] }, "scheduleType": { "type": "string", "enum": [ "single", "sessions" ] }, "sessions": { "maxItems": 200, "type": "array", "items": { "type": "object", "properties": {}, "additionalProperties": {} } } }, "additionalProperties": {} } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 64 }, "title": { "type": "string" }, "description": { "type": [ "string", "null" ] }, "startDate": { "type": "string", "format": "date-time", "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$" }, "endDate": { "type": "string", "format": "date-time", "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$" }, "isActive": { "type": "boolean" }, "isHidden": { "type": "boolean" }, "requiresRegistration": { "type": "boolean" }, "scheduleType": { "type": "string", "enum": [ "single", "sessions" ] }, "attendanceMode": { "type": "string", "enum": [ "whole", "pick" ] }, "cashupStatus": { "type": "string", "enum": [ "open", "closed" ] }, "campusId": { "anyOf": [ { "type": "string", "minLength": 1, "maxLength": 64 }, { "type": "null" } ] }, "seriesId": { "anyOf": [ { "type": "string", "minLength": 1, "maxLength": 64 }, { "type": "null" } ] }, "picture": { "type": [ "string", "null" ] }, "eventOptions": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 64 }, "name": { "type": "string" }, "price": { "type": "number" }, "isMainTicket": { "type": "boolean" }, "stockLimit": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 } }, "required": [ "id", "name", "price", "isMainTicket", "stockLimit" ], "additionalProperties": {} } }, "sessions": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 64 }, "label": { "type": [ "string", "null" ] }, "startsAt": { "type": "string", "format": "date-time", "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$" }, "endsAt": { "type": "string", "format": "date-time", "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$" }, "cancelled": { "type": "boolean" } }, "required": [ "id", "label", "startsAt", "endsAt", "cancelled" ], "additionalProperties": {} } }, "sessionChanges": { "anyOf": [ { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "number" } }, { "type": "null" } ] } }, "required": [ "id", "title", "description", "startDate", "endDate", "isActive", "isHidden", "requiresRegistration", "scheduleType", "attendanceMode", "cashupStatus", "campusId", "seriesId", "picture", "sessionChanges" ], "additionalProperties": {} } }, "required": [ "data" ], "additionalProperties": false } } } }, "400": { "description": "Validation failed (VALIDATION_FAILED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "401": { "description": "Not signed in (UNAUTHENTICATED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "Not allowed for this role (FORBIDDEN)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Not found (NOT_FOUND)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } }, "delete": { "tags": [ "Events (staff)" ], "summary": "Deactivate an event", "description": "Admins only. The event is deactivated, not deleted: registrations, payments and tickets stay.\n\n**Who:** Admins only.", "operationId": "deleteEventsId", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "id", "in": "path", "required": true, "description": "The id", "schema": { "type": "string", "minLength": 1, "maxLength": 64 } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 64 }, "isActive": { "type": "boolean", "const": false } }, "required": [ "id", "isActive" ], "additionalProperties": false } }, "required": [ "data" ], "additionalProperties": false } } } }, "400": { "description": "Validation failed (VALIDATION_FAILED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "401": { "description": "Not signed in (UNAUTHENTICATED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "Not allowed for this role (FORBIDDEN)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Not found (NOT_FOUND)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } }, "get": { "tags": [ "Events" ], "summary": "One public event", "description": "With its ticket options (internal kids check-in and volunteer tickets left out) and sessions. Hidden events can be fetched by id (they are unlisted, not private).\n\n**Who:** Anyone.", "operationId": "getEventsId", "parameters": [ { "name": "id", "in": "path", "required": true, "description": "The id", "schema": { "type": "string", "minLength": 1, "maxLength": 64 } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 64 }, "title": { "type": "string" }, "startDate": { "type": "string", "format": "date-time", "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$" }, "endDate": { "type": "string", "format": "date-time", "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$" }, "location": { "type": [ "string", "null" ] }, "price": { "type": "number", "description": "The headline price in rand (0 = free)" }, "pictureUrl": { "type": [ "string", "null" ] }, "requiresRegistration": { "type": "boolean" }, "scheduleType": { "type": "string", "enum": [ "single", "sessions" ] }, "campus": { "anyOf": [ { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 64 }, "name": { "type": "string" }, "slug": { "type": "string" } }, "required": [ "id", "name", "slug" ], "additionalProperties": false }, { "type": "null" } ], "description": "null = for all campuses (or campuses are off)" }, "series": { "anyOf": [ { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 64 }, "name": { "type": "string" }, "slug": { "type": "string" } }, "required": [ "id", "name", "slug" ], "additionalProperties": false }, { "type": "null" } ] }, "description": { "type": [ "string", "null" ] }, "registrationDeadline": { "anyOf": [ { "type": "string", "format": "date-time", "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$" }, { "type": "null" } ] }, "ticketOptions": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 64 }, "name": { "type": "string" }, "price": { "type": "number", "description": "The normal price in rand" }, "currentPrice": { "type": "number", "description": "What it costs now (an early-bird price while one runs)" }, "isMainTicket": { "type": "boolean" }, "sessionMode": { "type": "string", "enum": [ "all", "pick" ], "description": "\"pick\" = the buyer chooses sessions" } }, "required": [ "id", "name", "price", "currentPrice", "isMainTicket", "sessionMode" ], "additionalProperties": false } }, "sessions": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 64 }, "label": { "type": [ "string", "null" ] }, "startsAt": { "type": "string", "format": "date-time", "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$" }, "endsAt": { "type": "string", "format": "date-time", "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$" }, "location": { "type": [ "string", "null" ] }, "cancelled": { "type": "boolean" } }, "required": [ "id", "label", "startsAt", "endsAt", "location", "cancelled" ], "additionalProperties": false }, "description": "Multi-day events only; empty otherwise" } }, "required": [ "id", "title", "startDate", "endDate", "location", "price", "pictureUrl", "requiresRegistration", "scheduleType", "campus", "series", "description", "registrationDeadline", "ticketOptions", "sessions" ], "additionalProperties": false } }, "required": [ "data" ], "additionalProperties": false } } } }, "400": { "description": "Validation failed (VALIDATION_FAILED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Not found (NOT_FOUND)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/events/{id}/copy-from": { "post": { "tags": [ "Events (staff)" ], "summary": "Copy set-up from another event", "description": "Allocation groups, and planned costs for admins — used right after copying an event.\n\n**Who:** Supervisors and admins.", "operationId": "postEventsIdCopy-from", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "id", "in": "path", "required": true, "description": "The id", "schema": { "type": "string", "minLength": 1, "maxLength": 64 } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "fromEventId": { "type": "string", "minLength": 1, "maxLength": 64 } }, "required": [ "fromEventId" ] } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": {}, "additionalProperties": {} } }, "required": [ "data" ], "additionalProperties": false } } } }, "400": { "description": "Validation failed (VALIDATION_FAILED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "401": { "description": "Not signed in (UNAUTHENTICATED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "Not allowed for this role (FORBIDDEN)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Not found (NOT_FOUND)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/events/{id}/notify-recipients": { "get": { "tags": [ "Events (staff)" ], "summary": "Who gets this event's emails", "description": "Registration, payment and daily-summary emails.\n\n**Who:** Supervisors and admins.", "operationId": "getEventsIdNotify-recipients", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "id", "in": "path", "required": true, "description": "The id", "schema": { "type": "string", "minLength": 1, "maxLength": 64 } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 64 }, "name": { "type": "string" }, "email": { "type": "string" }, "role": { "type": "string", "enum": [ "admin", "supervisor", "staff", "user" ] } }, "required": [ "id", "name", "email", "role" ], "additionalProperties": false } } }, "required": [ "data" ], "additionalProperties": false } } } }, "400": { "description": "Validation failed (VALIDATION_FAILED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "401": { "description": "Not signed in (UNAUTHENTICATED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "Not allowed for this role (FORBIDDEN)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Not found (NOT_FOUND)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } }, "put": { "tags": [ "Events (staff)" ], "summary": "Set who gets this event's emails", "description": "**Who:** Supervisors and admins.", "operationId": "putEventsIdNotify-recipients", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "id", "in": "path", "required": true, "description": "The id", "schema": { "type": "string", "minLength": 1, "maxLength": 64 } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "userIds": { "maxItems": 200, "type": "array", "items": { "type": "string", "minLength": 1, "maxLength": 64 } } }, "required": [ "userIds" ] } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 64 }, "name": { "type": "string" }, "email": { "type": "string" }, "role": { "type": "string", "enum": [ "admin", "supervisor", "staff", "user" ] } }, "required": [ "id", "name", "email", "role" ], "additionalProperties": false } } }, "required": [ "data" ], "additionalProperties": false } } } }, "400": { "description": "Validation failed (VALIDATION_FAILED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "401": { "description": "Not signed in (UNAUTHENTICATED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "Not allowed for this role (FORBIDDEN)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Not found (NOT_FOUND)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/events/{id}/full": { "get": { "tags": [ "Events" ], "summary": "One event in full", "description": "What the registration page and the set-up screens need: ticket options with what's left (per variant, and per session for \"pick sessions\" tickets), early-bird tiers, sessions with bookings, the attendee form, attachments, bundle deals on sale and the next event in its series.\n\nStaff (of a campus they work with) also get inactive and not-yet-live events, who created it, who gets its emails, and the kids/volunteer tickets. Everyone else gets NOT_FOUND for events that aren't public.\n\n**Who:** Anyone; signed-in staff may see more.", "operationId": "getEventsIdFull", "security": [ {}, { "bearerAuth": [] } ], "parameters": [ { "name": "id", "in": "path", "required": true, "description": "The id", "schema": { "type": "string", "minLength": 1, "maxLength": 64 } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 64 }, "title": { "type": "string" }, "description": { "type": [ "string", "null" ] }, "startDate": { "type": "string", "format": "date-time", "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$" }, "endDate": { "type": "string", "format": "date-time", "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$" }, "isActive": { "type": "boolean" }, "isHidden": { "type": "boolean" }, "requiresRegistration": { "type": "boolean" }, "scheduleType": { "type": "string", "enum": [ "single", "sessions" ] }, "attendanceMode": { "type": "string", "enum": [ "whole", "pick" ] }, "cashupStatus": { "type": "string", "enum": [ "open", "closed" ] }, "campusId": { "anyOf": [ { "type": "string", "minLength": 1, "maxLength": 64 }, { "type": "null" } ] }, "seriesId": { "anyOf": [ { "type": "string", "minLength": 1, "maxLength": 64 }, { "type": "null" } ] }, "picture": { "type": [ "string", "null" ] }, "eventOptions": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 64 }, "name": { "type": "string" }, "price": { "type": "number" }, "isMainTicket": { "type": "boolean" }, "stockLimit": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 } }, "required": [ "id", "name", "price", "isMainTicket", "stockLimit" ], "additionalProperties": {} } }, "sessions": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 64 }, "label": { "type": [ "string", "null" ] }, "startsAt": { "type": "string", "format": "date-time", "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$" }, "endsAt": { "type": "string", "format": "date-time", "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$" }, "cancelled": { "type": "boolean" } }, "required": [ "id", "label", "startsAt", "endsAt", "cancelled" ], "additionalProperties": {} } }, "form": { "anyOf": [ { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 64 }, "isRequired": { "type": "boolean" }, "fields": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 64 }, "type": { "type": "string" }, "label": { "type": "string" } }, "required": [ "id", "type", "label" ], "additionalProperties": {} } } }, "required": [ "id", "isRequired", "fields" ], "additionalProperties": {} }, { "type": "null" } ] }, "attachments": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 64 }, "originalName": { "type": "string" }, "url": { "type": [ "string", "null" ] } }, "required": [ "id", "originalName", "url" ], "additionalProperties": {} } } }, "required": [ "id", "title", "description", "startDate", "endDate", "isActive", "isHidden", "requiresRegistration", "scheduleType", "attendanceMode", "cashupStatus", "campusId", "seriesId", "picture", "form", "attachments" ], "additionalProperties": {} } }, "required": [ "data" ], "additionalProperties": false } } } }, "400": { "description": "Validation failed (VALIDATION_FAILED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Not found (NOT_FOUND)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/events/{id}/calendar.ics": { "get": { "tags": [ "Events" ], "summary": "The event as a calendar file", "description": "An .ics file (each session for a multi-day event). Same visibility as the event.\n\n**Who:** Anyone; signed-in staff may see more.", "operationId": "getEventsIdCalendar.ics", "security": [ {}, { "bearerAuth": [] } ], "parameters": [ { "name": "id", "in": "path", "required": true, "description": "The id", "schema": { "type": "string", "minLength": 1, "maxLength": 64 } } ], "responses": { "200": { "description": "The file", "content": { "text/calendar": { "schema": { "type": "string" } } } }, "400": { "description": "Validation failed (VALIDATION_FAILED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Not found (NOT_FOUND)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/events/by-alias/{alias}": { "get": { "tags": [ "Events" ], "summary": "An event by its short link", "description": "The part after the site address (`/camp2026`), any letter case. Active events only.\n\n**Who:** Anyone.", "operationId": "getEventsBy-aliasAlias", "parameters": [ { "name": "alias", "in": "path", "required": true, "description": "The short link, e.g. camp2026", "schema": { "type": "string", "minLength": 1, "maxLength": 100 } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 64 }, "title": { "type": "string" }, "description": { "type": [ "string", "null" ] }, "startDate": { "type": "string", "format": "date-time", "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$" }, "endDate": { "type": "string", "format": "date-time", "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$" }, "registrationDeadline": { "anyOf": [ { "type": "string", "format": "date-time", "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$" }, { "type": "null" } ] }, "goLiveAt": { "anyOf": [ { "type": "string", "format": "date-time", "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$" }, { "type": "null" } ] }, "price": { "type": "number" }, "picture": { "type": [ "string", "null" ] }, "redirectUrl": { "type": [ "string", "null" ] }, "isLive": { "type": "boolean", "description": "Not over yet" } }, "required": [ "id", "title", "description", "startDate", "endDate", "registrationDeadline", "goLiveAt", "price", "picture", "redirectUrl", "isLive" ], "additionalProperties": false } }, "required": [ "data" ], "additionalProperties": false } } } }, "400": { "description": "Validation failed (VALIDATION_FAILED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Not found (NOT_FOUND)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/events/{id}/ticket-options": { "post": { "tags": [ "Events (staff)" ], "summary": "Add a ticket option", "description": "**Who:** Supervisors and admins.", "operationId": "postEventsIdTicket-options", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "id", "in": "path", "required": true, "description": "The id", "schema": { "type": "string", "minLength": 1, "maxLength": 64 } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "name": { "type": "string", "minLength": 1, "maxLength": 120 }, "price": { "anyOf": [ { "type": "number" }, { "type": "string", "maxLength": 20 } ] }, "isMainTicket": { "type": "boolean" }, "stockLimit": { "description": "0 = no limit", "anyOf": [ { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, { "type": "string", "maxLength": 10 } ] }, "staffPrice": { "description": "What staff pay (empty = the normal price)", "anyOf": [ { "anyOf": [ { "type": "number" }, { "type": "string", "maxLength": 20 } ] }, { "type": "null" } ] }, "sessionMode": { "description": "\"pick\" = buyers choose sessions (multi-day events)", "type": "string", "enum": [ "all", "pick" ] } }, "required": [ "name", "price" ] } } } }, "responses": { "201": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 64 }, "eventId": { "type": "string", "minLength": 1, "maxLength": 64 }, "name": { "type": "string" }, "price": { "type": "number" }, "isMainTicket": { "type": "boolean" }, "stockLimit": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, "staffPrice": { "type": [ "number", "null" ] }, "sessionMode": { "type": "string", "enum": [ "all", "pick" ] }, "earlyBirdTiers": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 64 }, "deadline": { "type": "string", "format": "date-time", "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$" }, "price": { "type": "number" }, "stockLimit": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, "variantId": { "anyOf": [ { "type": "string", "minLength": 1, "maxLength": 64 }, { "type": "null" } ] } }, "required": [ "id", "deadline", "price", "stockLimit", "variantId" ], "additionalProperties": {} } }, "variants": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 64 }, "name": { "type": "string" }, "price": { "type": [ "number", "null" ] }, "stockLimit": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, "staffPrice": { "type": [ "number", "null" ] }, "order": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 } }, "required": [ "id", "name", "price", "stockLimit", "staffPrice", "order" ], "additionalProperties": {} } } }, "required": [ "id", "eventId", "name", "price", "isMainTicket", "stockLimit", "staffPrice", "sessionMode" ], "additionalProperties": {} } }, "required": [ "data" ], "additionalProperties": false } } } }, "400": { "description": "Validation failed (VALIDATION_FAILED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "401": { "description": "Not signed in (UNAUTHENTICATED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "Not allowed for this role (FORBIDDEN)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Not found (NOT_FOUND)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/ticket-options/{id}": { "patch": { "tags": [ "Events (staff)" ], "summary": "Change a ticket option", "description": "Only what's sent changes. `earlyBirdTiers` and `variants`, when sent, are the full lists: kept by id, added without one, and ones left out removed when nothing was bought under them.\n\n**Who:** Supervisors and admins.", "operationId": "patchTicket-optionsId", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "id", "in": "path", "required": true, "description": "The id", "schema": { "type": "string", "minLength": 1, "maxLength": 64 } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "name": { "type": "string", "minLength": 1, "maxLength": 120 }, "price": { "anyOf": [ { "type": "number" }, { "type": "string", "maxLength": 20 } ] }, "isMainTicket": { "type": "boolean" }, "stockLimit": { "description": "0 = no limit", "anyOf": [ { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, { "type": "string", "maxLength": 10 } ] }, "staffPrice": { "description": "What staff pay (empty = the normal price)", "anyOf": [ { "anyOf": [ { "type": "number" }, { "type": "string", "maxLength": 20 } ] }, { "type": "null" } ] }, "sessionMode": { "description": "\"pick\" = buyers choose sessions (multi-day events)", "type": "string", "enum": [ "all", "pick" ] }, "earlyBirdTiers": { "maxItems": 50, "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 64 }, "deadline": { "type": "string", "maxLength": 40 }, "price": { "anyOf": [ { "type": "number" }, { "type": "string", "maxLength": 20 } ] }, "stockLimit": { "type": [ "number", "string" ] }, "variantId": { "anyOf": [ { "type": "string", "minLength": 1, "maxLength": 64 }, { "type": "null" } ] } }, "required": [ "deadline", "price" ], "additionalProperties": {} } }, "variants": { "maxItems": 100, "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string", "minLength": 1, "maxLength": 120 }, "price": { "description": "Empty = the option's price", "anyOf": [ { "anyOf": [ { "type": "number" }, { "type": "string", "maxLength": 20 } ] }, { "type": "null" } ] }, "stockLimit": { "anyOf": [ { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, { "type": "string", "maxLength": 10 } ] }, "staffPrice": { "anyOf": [ { "anyOf": [ { "type": "number" }, { "type": "string", "maxLength": 20 } ] }, { "type": "null" } ] }, "order": { "anyOf": [ { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, { "type": "string", "maxLength": 10 } ] }, "id": { "type": "string", "minLength": 1, "maxLength": 64 } }, "required": [ "name" ] } } } } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 64 }, "eventId": { "type": "string", "minLength": 1, "maxLength": 64 }, "name": { "type": "string" }, "price": { "type": "number" }, "isMainTicket": { "type": "boolean" }, "stockLimit": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, "staffPrice": { "type": [ "number", "null" ] }, "sessionMode": { "type": "string", "enum": [ "all", "pick" ] }, "earlyBirdTiers": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 64 }, "deadline": { "type": "string", "format": "date-time", "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$" }, "price": { "type": "number" }, "stockLimit": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, "variantId": { "anyOf": [ { "type": "string", "minLength": 1, "maxLength": 64 }, { "type": "null" } ] } }, "required": [ "id", "deadline", "price", "stockLimit", "variantId" ], "additionalProperties": {} } }, "variants": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 64 }, "name": { "type": "string" }, "price": { "type": [ "number", "null" ] }, "stockLimit": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, "staffPrice": { "type": [ "number", "null" ] }, "order": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 } }, "required": [ "id", "name", "price", "stockLimit", "staffPrice", "order" ], "additionalProperties": {} } } }, "required": [ "id", "eventId", "name", "price", "isMainTicket", "stockLimit", "staffPrice", "sessionMode" ], "additionalProperties": {} } }, "required": [ "data" ], "additionalProperties": false } } } }, "400": { "description": "Validation failed (VALIDATION_FAILED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "401": { "description": "Not signed in (UNAUTHENTICATED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "Not allowed for this role (FORBIDDEN)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Not found (NOT_FOUND)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } }, "delete": { "tags": [ "Events (staff)" ], "summary": "Remove a ticket option", "description": "Admins only. Not one anybody has bought, and never the event's only main ticket.\n\n**Who:** Admins only.", "operationId": "deleteTicket-optionsId", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "id", "in": "path", "required": true, "description": "The id", "schema": { "type": "string", "minLength": 1, "maxLength": 64 } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 64 }, "deleted": { "type": "boolean", "const": true } }, "required": [ "id", "deleted" ], "additionalProperties": false } }, "required": [ "data" ], "additionalProperties": false } } } }, "400": { "description": "Validation failed (VALIDATION_FAILED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "401": { "description": "Not signed in (UNAUTHENTICATED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "Not allowed for this role (FORBIDDEN)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Not found (NOT_FOUND)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/ticket-options/{id}/variants": { "post": { "tags": [ "Events (staff)" ], "summary": "Add a variant (e.g. a T-shirt size)", "description": "**Who:** Supervisors and admins.", "operationId": "postTicket-optionsIdVariants", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "id", "in": "path", "required": true, "description": "The id", "schema": { "type": "string", "minLength": 1, "maxLength": 64 } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "name": { "type": "string", "minLength": 1, "maxLength": 120 }, "price": { "description": "Empty = the option's price", "anyOf": [ { "anyOf": [ { "type": "number" }, { "type": "string", "maxLength": 20 } ] }, { "type": "null" } ] }, "stockLimit": { "anyOf": [ { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, { "type": "string", "maxLength": 10 } ] }, "staffPrice": { "anyOf": [ { "anyOf": [ { "type": "number" }, { "type": "string", "maxLength": 20 } ] }, { "type": "null" } ] }, "order": { "anyOf": [ { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, { "type": "string", "maxLength": 10 } ] } }, "required": [ "name" ] } } } }, "responses": { "201": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 64 }, "name": { "type": "string" }, "price": { "type": [ "number", "null" ] }, "stockLimit": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, "staffPrice": { "type": [ "number", "null" ] }, "order": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 } }, "required": [ "id", "name", "price", "stockLimit", "staffPrice", "order" ], "additionalProperties": {} } }, "required": [ "data" ], "additionalProperties": false } } } }, "400": { "description": "Validation failed (VALIDATION_FAILED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "401": { "description": "Not signed in (UNAUTHENTICATED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "Not allowed for this role (FORBIDDEN)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Not found (NOT_FOUND)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/variants/{id}": { "patch": { "tags": [ "Events (staff)" ], "summary": "Change a variant", "description": "**Who:** Supervisors and admins.", "operationId": "patchVariantsId", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "id", "in": "path", "required": true, "description": "The id", "schema": { "type": "string", "minLength": 1, "maxLength": 64 } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "name": { "type": "string", "minLength": 1, "maxLength": 120 }, "price": { "description": "Empty = the option's price", "anyOf": [ { "anyOf": [ { "type": "number" }, { "type": "string", "maxLength": 20 } ] }, { "type": "null" } ] }, "stockLimit": { "anyOf": [ { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, { "type": "string", "maxLength": 10 } ] }, "staffPrice": { "anyOf": [ { "anyOf": [ { "type": "number" }, { "type": "string", "maxLength": 20 } ] }, { "type": "null" } ] }, "order": { "anyOf": [ { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, { "type": "string", "maxLength": 10 } ] } } } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 64 }, "name": { "type": "string" }, "price": { "type": [ "number", "null" ] }, "stockLimit": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, "staffPrice": { "type": [ "number", "null" ] }, "order": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 } }, "required": [ "id", "name", "price", "stockLimit", "staffPrice", "order" ], "additionalProperties": {} } }, "required": [ "data" ], "additionalProperties": false } } } }, "400": { "description": "Validation failed (VALIDATION_FAILED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "401": { "description": "Not signed in (UNAUTHENTICATED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "Not allowed for this role (FORBIDDEN)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Not found (NOT_FOUND)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } }, "delete": { "tags": [ "Events (staff)" ], "summary": "Remove a variant", "description": "Admins only, and not one anybody has bought.\n\n**Who:** Admins only.", "operationId": "deleteVariantsId", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "id", "in": "path", "required": true, "description": "The id", "schema": { "type": "string", "minLength": 1, "maxLength": 64 } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 64 }, "deleted": { "type": "boolean", "const": true } }, "required": [ "id", "deleted" ], "additionalProperties": false } }, "required": [ "data" ], "additionalProperties": false } } } }, "400": { "description": "Validation failed (VALIDATION_FAILED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "401": { "description": "Not signed in (UNAUTHENTICATED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "Not allowed for this role (FORBIDDEN)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Not found (NOT_FOUND)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/events/{id}/attachments": { "get": { "tags": [ "Events" ], "summary": "An event's attachments", "description": "Files for attendees (programmes, packing lists…), newest first.\n\n**Who:** Anyone.", "operationId": "getEventsIdAttachments", "parameters": [ { "name": "id", "in": "path", "required": true, "description": "The id", "schema": { "type": "string", "minLength": 1, "maxLength": 64 } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 64 }, "eventId": { "type": "string", "minLength": 1, "maxLength": 64 }, "originalName": { "type": "string" }, "filename": { "type": "string" }, "mimeType": { "type": "string" }, "size": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, "url": { "type": [ "string", "null" ] }, "createdAt": { "type": "string", "format": "date-time", "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$" } }, "required": [ "id", "eventId", "originalName", "filename", "mimeType", "size", "url", "createdAt" ], "additionalProperties": false } } }, "required": [ "data" ], "additionalProperties": false } } } }, "400": { "description": "Validation failed (VALIDATION_FAILED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Not found (NOT_FOUND)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } }, "post": { "tags": [ "Events (staff)" ], "summary": "Attach a file to an event", "description": "**Who:** Supervisors and admins.", "operationId": "postEventsIdAttachments", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "id", "in": "path", "required": true, "description": "The id", "schema": { "type": "string", "minLength": 1, "maxLength": 64 } } ], "requestBody": { "required": true, "content": { "multipart/form-data": { "schema": { "type": "object", "required": [ "file" ], "properties": { "file": { "type": "string", "format": "binary", "description": "PDF, Word, Excel, PowerPoint, text, CSV or ZIP, up to 20 MB" } } } } } }, "responses": { "201": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 64 }, "eventId": { "type": "string", "minLength": 1, "maxLength": 64 }, "originalName": { "type": "string" }, "filename": { "type": "string" }, "mimeType": { "type": "string" }, "size": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, "url": { "type": [ "string", "null" ] }, "createdAt": { "type": "string", "format": "date-time", "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$" } }, "required": [ "id", "eventId", "originalName", "filename", "mimeType", "size", "url", "createdAt" ], "additionalProperties": false } }, "required": [ "data" ], "additionalProperties": false } } } }, "400": { "description": "Validation failed (VALIDATION_FAILED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "401": { "description": "Not signed in (UNAUTHENTICATED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "Not allowed for this role (FORBIDDEN)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Not found (NOT_FOUND)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/events/{id}/attachments/{attachmentId}": { "delete": { "tags": [ "Events (staff)" ], "summary": "Remove an attachment", "description": "**Who:** Supervisors and admins.", "operationId": "deleteEventsIdAttachmentsAttachmentId", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "type": "string", "minLength": 1, "maxLength": 64 } }, { "name": "attachmentId", "in": "path", "required": true, "schema": { "type": "string", "minLength": 1, "maxLength": 64 } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 64 }, "deleted": { "type": "boolean", "const": true } }, "required": [ "id", "deleted" ], "additionalProperties": false } }, "required": [ "data" ], "additionalProperties": false } } } }, "400": { "description": "Validation failed (VALIDATION_FAILED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "401": { "description": "Not signed in (UNAUTHENTICATED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "Not allowed for this role (FORBIDDEN)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Not found (NOT_FOUND)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/attachments/status": { "get": { "tags": [ "Admin" ], "summary": "Attachments diagnostics", "description": "**Who:** Admins only.", "operationId": "getAttachmentsStatus", "security": [ { "bearerAuth": [] } ], "parameters": [], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "databaseTableQueryable": { "type": "boolean" }, "probeError": { "type": [ "string", "null" ] } }, "required": [ "databaseTableQueryable", "probeError" ], "additionalProperties": {} } }, "required": [ "data" ], "additionalProperties": false } } } }, "401": { "description": "Not signed in (UNAUTHENTICATED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "Not allowed for this role (FORBIDDEN)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/attachments/sync": { "post": { "tags": [ "Admin" ], "summary": "Import attachments from old manifests", "description": "Attachments recorded in JSON files on disk by very old versions go into the database. `dryRun` only reports; `remove` deletes each manifest once imported.\n\n**Who:** Admins only.", "operationId": "postAttachmentsSync", "security": [ { "bearerAuth": [] } ], "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "dryRun": { "default": false, "type": "boolean" }, "remove": { "default": false, "type": "boolean" } } } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "dryRun": { "type": "boolean" }, "remove": { "type": "boolean" } }, "required": [ "dryRun", "remove" ], "additionalProperties": {} } }, "required": [ "data" ], "additionalProperties": false } } } }, "400": { "description": "Validation failed (VALIDATION_FAILED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "401": { "description": "Not signed in (UNAUTHENTICATED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "Not allowed for this role (FORBIDDEN)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/sections": { "get": { "tags": [ "Events (staff)" ], "summary": "Scanning sections", "description": "Which ticket types may come in at which door, for one event or every event you can see.\n\n**Who:** Staff, supervisors and admins.", "operationId": "getSections", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "eventId", "in": "query", "required": false, "schema": { "type": "string", "minLength": 1, "maxLength": 64 } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 64 }, "eventId": { "type": "string", "minLength": 1, "maxLength": 64 }, "name": { "type": "string" }, "allowedOptions": { "type": "array", "items": { "type": "object", "properties": { "eventOptionId": { "type": "string", "minLength": 1, "maxLength": 64 }, "eventOption": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 64 }, "name": { "type": "string" } }, "required": [ "id", "name" ], "additionalProperties": {} } }, "required": [ "eventOptionId", "eventOption" ], "additionalProperties": {} } }, "event": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 64 }, "title": { "type": "string" } }, "required": [ "id", "title" ], "additionalProperties": false } }, "required": [ "id", "eventId", "name", "allowedOptions", "event" ], "additionalProperties": {} } } }, "required": [ "data" ], "additionalProperties": false } } } }, "400": { "description": "Validation failed (VALIDATION_FAILED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "401": { "description": "Not signed in (UNAUTHENTICATED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "Not allowed for this role (FORBIDDEN)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } }, "post": { "tags": [ "Events (staff)" ], "summary": "Add a scanning section", "description": "**Who:** Supervisors and admins.", "operationId": "postSections", "security": [ { "bearerAuth": [] } ], "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "eventId": { "type": "string", "minLength": 1, "maxLength": 64 }, "name": { "type": "string", "minLength": 1, "maxLength": 120 }, "allowedOptionIds": { "maxItems": 100, "type": "array", "items": { "type": "string", "minLength": 1, "maxLength": 64 } } }, "required": [ "eventId", "name" ] } } } }, "responses": { "201": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 64 }, "eventId": { "type": "string", "minLength": 1, "maxLength": 64 }, "name": { "type": "string" }, "allowedOptions": { "type": "array", "items": { "type": "object", "properties": { "eventOptionId": { "type": "string", "minLength": 1, "maxLength": 64 }, "eventOption": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 64 }, "name": { "type": "string" } }, "required": [ "id", "name" ], "additionalProperties": {} } }, "required": [ "eventOptionId", "eventOption" ], "additionalProperties": {} } } }, "required": [ "id", "eventId", "name", "allowedOptions" ], "additionalProperties": {} } }, "required": [ "data" ], "additionalProperties": false } } } }, "400": { "description": "Validation failed (VALIDATION_FAILED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "401": { "description": "Not signed in (UNAUTHENTICATED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "Not allowed for this role (FORBIDDEN)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/sections/{id}": { "patch": { "tags": [ "Events (staff)" ], "summary": "Change a scanning section", "description": "`allowedOptionIds`, when sent, replaces its ticket types.\n\n**Who:** Supervisors and admins.", "operationId": "patchSectionsId", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "id", "in": "path", "required": true, "description": "The id", "schema": { "type": "string", "minLength": 1, "maxLength": 64 } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "name": { "type": "string", "minLength": 1, "maxLength": 120 }, "allowedOptionIds": { "maxItems": 100, "type": "array", "items": { "type": "string", "minLength": 1, "maxLength": 64 } } } } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 64 }, "eventId": { "type": "string", "minLength": 1, "maxLength": 64 }, "name": { "type": "string" }, "allowedOptions": { "type": "array", "items": { "type": "object", "properties": { "eventOptionId": { "type": "string", "minLength": 1, "maxLength": 64 }, "eventOption": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 64 }, "name": { "type": "string" } }, "required": [ "id", "name" ], "additionalProperties": {} } }, "required": [ "eventOptionId", "eventOption" ], "additionalProperties": {} } } }, "required": [ "id", "eventId", "name", "allowedOptions" ], "additionalProperties": {} } }, "required": [ "data" ], "additionalProperties": false } } } }, "400": { "description": "Validation failed (VALIDATION_FAILED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "401": { "description": "Not signed in (UNAUTHENTICATED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "Not allowed for this role (FORBIDDEN)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Not found (NOT_FOUND)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } }, "delete": { "tags": [ "Events (staff)" ], "summary": "Remove a scanning section", "description": "**Who:** Admins only.", "operationId": "deleteSectionsId", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "id", "in": "path", "required": true, "description": "The id", "schema": { "type": "string", "minLength": 1, "maxLength": 64 } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 64 }, "deleted": { "type": "boolean", "const": true } }, "required": [ "id", "deleted" ], "additionalProperties": false } }, "required": [ "data" ], "additionalProperties": false } } } }, "400": { "description": "Validation failed (VALIDATION_FAILED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "401": { "description": "Not signed in (UNAUTHENTICATED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "Not allowed for this role (FORBIDDEN)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Not found (NOT_FOUND)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/events/{id}/costs": { "get": { "tags": [ "Events (staff)" ], "summary": "An event's planned costs", "description": "**Who:** Supervisors and admins.", "operationId": "getEventsIdCosts", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "id", "in": "path", "required": true, "description": "The id", "schema": { "type": "string", "minLength": 1, "maxLength": 64 } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 64 }, "eventId": { "type": "string", "minLength": 1, "maxLength": 64 }, "label": { "type": "string" }, "costType": { "type": "string", "enum": [ "once_off", "per_item" ] }, "amount": { "type": "number" }, "eventOptionId": { "anyOf": [ { "type": "string", "minLength": 1, "maxLength": 64 }, { "type": "null" } ] }, "eventOption": { "anyOf": [ { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 64 }, "name": { "type": "string" } }, "required": [ "id", "name" ], "additionalProperties": false }, { "type": "null" } ] }, "paidFromMethod": { "description": "How it was paid out of the takings (cash, card, eft, other)", "type": [ "string", "null" ] }, "notes": { "type": [ "string", "null" ] }, "createdAt": { "type": "string", "format": "date-time", "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$" }, "updatedAt": { "type": "string", "format": "date-time", "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$" } }, "required": [ "id", "eventId", "label", "costType", "amount", "eventOptionId", "eventOption", "paidFromMethod", "notes", "createdAt" ], "additionalProperties": false } } }, "required": [ "data" ], "additionalProperties": false } } } }, "400": { "description": "Validation failed (VALIDATION_FAILED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "401": { "description": "Not signed in (UNAUTHENTICATED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "Not allowed for this role (FORBIDDEN)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Not found (NOT_FOUND)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } }, "post": { "tags": [ "Events (staff)" ], "summary": "Add a planned cost", "description": "Admins. Not on a cashed-up event.\n\n**Who:** Admins only.", "operationId": "postEventsIdCosts", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "id", "in": "path", "required": true, "description": "The id", "schema": { "type": "string", "minLength": 1, "maxLength": 64 } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "label": { "type": "string", "minLength": 1, "maxLength": 200 }, "costType": { "type": "string", "enum": [ "once_off", "per_item" ], "description": "per_item = per ticket sold of `eventOptionId`" }, "amount": { "anyOf": [ { "type": "number", "minimum": 0 }, { "type": "string", "maxLength": 20 } ] }, "eventOptionId": { "anyOf": [ { "type": "string", "minLength": 1, "maxLength": 64 }, { "type": "null" } ] }, "notes": { "anyOf": [ { "type": "string", "maxLength": 2000 }, { "type": "null" } ] }, "paidFromMethod": { "anyOf": [ { "type": "string", "enum": [ "cash", "card", "eft", "other" ] }, { "type": "null" } ] } }, "required": [ "label", "costType", "amount" ] } } } }, "responses": { "201": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 64 }, "eventId": { "type": "string", "minLength": 1, "maxLength": 64 }, "label": { "type": "string" }, "costType": { "type": "string", "enum": [ "once_off", "per_item" ] }, "amount": { "type": "number" }, "eventOptionId": { "anyOf": [ { "type": "string", "minLength": 1, "maxLength": 64 }, { "type": "null" } ] }, "eventOption": { "anyOf": [ { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 64 }, "name": { "type": "string" } }, "required": [ "id", "name" ], "additionalProperties": false }, { "type": "null" } ] }, "paidFromMethod": { "description": "How it was paid out of the takings (cash, card, eft, other)", "type": [ "string", "null" ] }, "notes": { "type": [ "string", "null" ] }, "createdAt": { "type": "string", "format": "date-time", "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$" }, "updatedAt": { "type": "string", "format": "date-time", "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$" } }, "required": [ "id", "eventId", "label", "costType", "amount", "eventOptionId", "eventOption", "paidFromMethod", "notes", "createdAt" ], "additionalProperties": false } }, "required": [ "data" ], "additionalProperties": false } } } }, "400": { "description": "Validation failed (VALIDATION_FAILED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "401": { "description": "Not signed in (UNAUTHENTICATED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "Not allowed for this role (FORBIDDEN)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Not found (NOT_FOUND)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/costs/{id}": { "patch": { "tags": [ "Events (staff)" ], "summary": "Change a planned cost", "description": "**Who:** Admins only.", "operationId": "patchCostsId", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "id", "in": "path", "required": true, "description": "The id", "schema": { "type": "string", "minLength": 1, "maxLength": 64 } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "label": { "type": "string", "minLength": 1, "maxLength": 200 }, "costType": { "type": "string", "enum": [ "once_off", "per_item" ], "description": "per_item = per ticket sold of `eventOptionId`" }, "amount": { "anyOf": [ { "type": "number", "minimum": 0 }, { "type": "string", "maxLength": 20 } ] }, "eventOptionId": { "anyOf": [ { "type": "string", "minLength": 1, "maxLength": 64 }, { "type": "null" } ] }, "notes": { "anyOf": [ { "type": "string", "maxLength": 2000 }, { "type": "null" } ] }, "paidFromMethod": { "anyOf": [ { "type": "string", "enum": [ "cash", "card", "eft", "other" ] }, { "type": "null" } ] } } } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 64 }, "eventId": { "type": "string", "minLength": 1, "maxLength": 64 }, "label": { "type": "string" }, "costType": { "type": "string", "enum": [ "once_off", "per_item" ] }, "amount": { "type": "number" }, "eventOptionId": { "anyOf": [ { "type": "string", "minLength": 1, "maxLength": 64 }, { "type": "null" } ] }, "eventOption": { "anyOf": [ { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 64 }, "name": { "type": "string" } }, "required": [ "id", "name" ], "additionalProperties": false }, { "type": "null" } ] }, "paidFromMethod": { "description": "How it was paid out of the takings (cash, card, eft, other)", "type": [ "string", "null" ] }, "notes": { "type": [ "string", "null" ] }, "createdAt": { "type": "string", "format": "date-time", "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$" }, "updatedAt": { "type": "string", "format": "date-time", "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$" } }, "required": [ "id", "eventId", "label", "costType", "amount", "eventOptionId", "eventOption", "paidFromMethod", "notes", "createdAt" ], "additionalProperties": false } }, "required": [ "data" ], "additionalProperties": false } } } }, "400": { "description": "Validation failed (VALIDATION_FAILED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "401": { "description": "Not signed in (UNAUTHENTICATED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "Not allowed for this role (FORBIDDEN)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Not found (NOT_FOUND)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } }, "delete": { "tags": [ "Events (staff)" ], "summary": "Remove a planned cost", "description": "**Who:** Admins only.", "operationId": "deleteCostsId", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "id", "in": "path", "required": true, "description": "The id", "schema": { "type": "string", "minLength": 1, "maxLength": 64 } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 64 }, "deleted": { "type": "boolean", "const": true } }, "required": [ "id", "deleted" ], "additionalProperties": false } }, "required": [ "data" ], "additionalProperties": false } } } }, "400": { "description": "Validation failed (VALIDATION_FAILED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "401": { "description": "Not signed in (UNAUTHENTICATED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "Not allowed for this role (FORBIDDEN)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Not found (NOT_FOUND)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/uploads/event-image": { "post": { "tags": [ "Uploads" ], "summary": "Upload an event picture", "description": "Returns the path to save as the event's `picture`.\n\n**Who:** Supervisors and admins.", "operationId": "postUploadsEvent-image", "security": [ { "bearerAuth": [] } ], "parameters": [], "requestBody": { "required": true, "content": { "multipart/form-data": { "schema": { "type": "object", "required": [ "image" ], "properties": { "image": { "type": "string", "format": "binary", "description": "A JPEG, PNG, GIF or WebP image" } } } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "path": { "type": "string", "description": "What to save on the event or setting" }, "url": { "type": "string", "description": "The same, as a full address" } }, "required": [ "path", "url" ], "additionalProperties": false } }, "required": [ "data" ], "additionalProperties": false } } } }, "401": { "description": "Not signed in (UNAUTHENTICATED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "Not allowed for this role (FORBIDDEN)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/uploads/logo": { "post": { "tags": [ "Uploads" ], "summary": "Upload the site logo", "description": "Admins — or anyone during first-time setup, before any account exists.\n\n**Who:** Anyone.", "operationId": "postUploadsLogo", "parameters": [], "requestBody": { "required": true, "content": { "multipart/form-data": { "schema": { "type": "object", "required": [ "image" ], "properties": { "image": { "type": "string", "format": "binary", "description": "A JPEG, PNG, WebP or SVG image" } } } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "path": { "type": "string", "description": "What to save on the event or setting" }, "url": { "type": "string", "description": "The same, as a full address" } }, "required": [ "path", "url" ], "additionalProperties": false } }, "required": [ "data" ], "additionalProperties": false } } } } } } }, "/uploads/favicon": { "post": { "tags": [ "Uploads" ], "summary": "Upload the site icon (favicon)", "description": "Admins — or anyone during first-time setup, before any account exists.\n\n**Who:** Anyone.", "operationId": "postUploadsFavicon", "parameters": [], "requestBody": { "required": true, "content": { "multipart/form-data": { "schema": { "type": "object", "required": [ "image" ], "properties": { "image": { "type": "string", "format": "binary", "description": "An ICO, PNG or SVG image" } } } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "path": { "type": "string", "description": "What to save on the event or setting" }, "url": { "type": "string", "description": "The same, as a full address" } }, "required": [ "path", "url" ], "additionalProperties": false } }, "required": [ "data" ], "additionalProperties": false } } } } } } }, "/series": { "get": { "tags": [ "Series" ], "summary": "Every series", "description": "With its events (the ones you may see — a series spans campuses), followers and event count.\n\n**Who:** Supervisors and admins.", "operationId": "getSeries", "security": [ { "bearerAuth": [] } ], "parameters": [], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 64 }, "name": { "type": "string" }, "slug": { "type": "string" }, "description": { "type": [ "string", "null" ] }, "picture": { "type": [ "string", "null" ] }, "followers": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, "eventCount": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, "events": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 64 }, "title": { "type": "string" }, "startDate": { "type": "string", "format": "date-time", "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$" } }, "required": [ "id", "title", "startDate" ], "additionalProperties": {} } } }, "required": [ "id", "name", "slug", "description", "picture", "followers", "eventCount", "events" ], "additionalProperties": {} } } }, "required": [ "data" ], "additionalProperties": false } } } }, "401": { "description": "Not signed in (UNAUTHENTICATED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "Not allowed for this role (FORBIDDEN)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } }, "post": { "tags": [ "Series" ], "summary": "Create a series", "description": "**Who:** Supervisors and admins.", "operationId": "postSeries", "security": [ { "bearerAuth": [] } ], "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "name": { "type": "string", "minLength": 1, "maxLength": 120 }, "slug": { "description": "The web address part (/series/); made from the name when left out", "type": "string", "maxLength": 80 }, "description": { "anyOf": [ { "type": "string", "maxLength": 5000 }, { "type": "null" } ] }, "picture": { "anyOf": [ { "type": "string", "maxLength": 500 }, { "type": "null" } ] } }, "required": [ "name" ] } } } }, "responses": { "201": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 64 }, "name": { "type": "string" }, "slug": { "type": "string" }, "description": { "type": [ "string", "null" ] }, "picture": { "type": [ "string", "null" ] } }, "required": [ "id", "name", "slug", "description", "picture" ], "additionalProperties": {} } }, "required": [ "data" ], "additionalProperties": false } } } }, "400": { "description": "Validation failed (VALIDATION_FAILED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "401": { "description": "Not signed in (UNAUTHENTICATED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "Not allowed for this role (FORBIDDEN)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/series/{id}": { "patch": { "tags": [ "Series" ], "summary": "Change a series", "description": "**Who:** Supervisors and admins.", "operationId": "patchSeriesId", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "id", "in": "path", "required": true, "description": "The id", "schema": { "type": "string", "minLength": 1, "maxLength": 64 } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "name": { "type": "string", "minLength": 1, "maxLength": 120 }, "slug": { "description": "The web address part (/series/); made from the name when left out", "type": "string", "maxLength": 80 }, "description": { "anyOf": [ { "type": "string", "maxLength": 5000 }, { "type": "null" } ] }, "picture": { "anyOf": [ { "type": "string", "maxLength": 500 }, { "type": "null" } ] } } } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 64 }, "name": { "type": "string" }, "slug": { "type": "string" }, "description": { "type": [ "string", "null" ] }, "picture": { "type": [ "string", "null" ] } }, "required": [ "id", "name", "slug", "description", "picture" ], "additionalProperties": {} } }, "required": [ "data" ], "additionalProperties": false } } } }, "400": { "description": "Validation failed (VALIDATION_FAILED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "401": { "description": "Not signed in (UNAUTHENTICATED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "Not allowed for this role (FORBIDDEN)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Not found (NOT_FOUND)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } }, "delete": { "tags": [ "Series" ], "summary": "Delete a series", "description": "Admins. Its events stay (without a series) and followers are dropped. Not once season passes have been sold.\n\n**Who:** Admins only.", "operationId": "deleteSeriesId", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "id", "in": "path", "required": true, "description": "The id", "schema": { "type": "string", "minLength": 1, "maxLength": 64 } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 64 }, "deleted": { "type": "boolean", "const": true } }, "required": [ "id", "deleted" ], "additionalProperties": false } }, "required": [ "data" ], "additionalProperties": false } } } }, "400": { "description": "Validation failed (VALIDATION_FAILED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "401": { "description": "Not signed in (UNAUTHENTICATED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "Not allowed for this role (FORBIDDEN)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Not found (NOT_FOUND)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/series/by-slug/{slug}": { "get": { "tags": [ "Series" ], "summary": "A series' public page", "description": "Upcoming and past public events, season passes on sale, and whether you follow it.\n\n**Who:** Anyone; signed-in staff may see more.", "operationId": "getSeriesBy-slugSlug", "security": [ {}, { "bearerAuth": [] } ], "parameters": [ { "name": "slug", "in": "path", "required": true, "schema": { "type": "string", "minLength": 1, "maxLength": 80 } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 64 }, "name": { "type": "string" }, "slug": { "type": "string" }, "description": { "type": [ "string", "null" ] }, "picture": { "type": [ "string", "null" ] }, "upcoming": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 64 } }, "required": [ "id" ], "additionalProperties": {} } }, "past": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 64 } }, "required": [ "id" ], "additionalProperties": {} } }, "following": { "type": "boolean" }, "passes": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 64 }, "name": { "type": "string" }, "price": { "type": "number" } }, "required": [ "id", "name", "price" ], "additionalProperties": {} } } }, "required": [ "id", "name", "slug", "description", "picture", "upcoming", "past", "following", "passes" ], "additionalProperties": {} } }, "required": [ "data" ], "additionalProperties": false } } } }, "400": { "description": "Validation failed (VALIDATION_FAILED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Not found (NOT_FOUND)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/series/{id}/compare": { "get": { "tags": [ "Series" ], "summary": "Year on year", "description": "Registrations, tickets, income and attendance for each event in the series that you may see, oldest first.\n\n**Who:** Supervisors and admins.", "operationId": "getSeriesIdCompare", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "id", "in": "path", "required": true, "description": "The id", "schema": { "type": "string", "minLength": 1, "maxLength": 64 } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": {}, "additionalProperties": {} } }, "required": [ "data" ], "additionalProperties": false } } } }, "400": { "description": "Validation failed (VALIDATION_FAILED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "401": { "description": "Not signed in (UNAUTHENTICATED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "Not allowed for this role (FORBIDDEN)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Not found (NOT_FOUND)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/series/{id}/follow": { "put": { "tags": [ "Series" ], "summary": "Follow a series", "description": "Hear about new events in it (News & announcements).\n\n**Who:** Any signed-in person.", "operationId": "putSeriesIdFollow", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "id", "in": "path", "required": true, "description": "The id", "schema": { "type": "string", "minLength": 1, "maxLength": 64 } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "following": { "type": "boolean" } }, "required": [ "following" ], "additionalProperties": false } }, "required": [ "data" ], "additionalProperties": false } } } }, "400": { "description": "Validation failed (VALIDATION_FAILED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "401": { "description": "Not signed in (UNAUTHENTICATED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Not found (NOT_FOUND)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } }, "delete": { "tags": [ "Series" ], "summary": "Stop following a series", "description": "**Who:** Any signed-in person.", "operationId": "deleteSeriesIdFollow", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "id", "in": "path", "required": true, "description": "The id", "schema": { "type": "string", "minLength": 1, "maxLength": 64 } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "following": { "type": "boolean" } }, "required": [ "following" ], "additionalProperties": false } }, "required": [ "data" ], "additionalProperties": false } } } }, "400": { "description": "Validation failed (VALIDATION_FAILED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "401": { "description": "Not signed in (UNAUTHENTICATED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Not found (NOT_FOUND)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/season-passes": { "get": { "tags": [ "Series" ], "summary": "Season passes", "description": "With their events, how the price is shared between them, and how many were sold or are unpaid.\n\n**Who:** Supervisors and admins.", "operationId": "getSeason-passes", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "seriesId", "in": "query", "required": false, "schema": { "type": "string", "minLength": 1, "maxLength": 64 } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 64 }, "seriesId": { "type": "string", "minLength": 1, "maxLength": 64 }, "name": { "type": "string" }, "price": { "type": "number" }, "isActive": { "type": "boolean" }, "items": { "type": "array", "items": { "type": "object", "properties": { "eventId": { "type": "string", "minLength": 1, "maxLength": 64 } }, "required": [ "eventId" ], "additionalProperties": {} } }, "sold": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, "unpaid": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 } }, "required": [ "id", "seriesId", "name", "price", "isActive", "items", "sold", "unpaid" ], "additionalProperties": {} } } }, "required": [ "data" ], "additionalProperties": false } } } }, "400": { "description": "Validation failed (VALIDATION_FAILED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "401": { "description": "Not signed in (UNAUTHENTICATED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "Not allowed for this role (FORBIDDEN)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } }, "post": { "tags": [ "Series" ], "summary": "Create a season pass", "description": "One price for several events in a series. Campus-scoped supervisors can only include their own campuses' events.\n\n**Who:** Supervisors and admins.", "operationId": "postSeason-passes", "security": [ { "bearerAuth": [] } ], "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "seriesId": { "type": "string", "minLength": 1, "maxLength": 64 }, "name": { "type": "string", "minLength": 1, "maxLength": 120 }, "description": { "anyOf": [ { "type": "string", "maxLength": 5000 }, { "type": "null" } ] }, "price": { "anyOf": [ { "type": "number", "minimum": 0 }, { "type": "string", "maxLength": 20 } ] }, "saleEndsAt": { "anyOf": [ { "type": "string", "maxLength": 40 }, { "type": "null" } ] }, "isActive": { "type": "boolean" }, "items": { "minItems": 1, "maxItems": 100, "type": "array", "items": { "type": "object", "properties": { "eventId": { "type": "string", "minLength": 1, "maxLength": 64 }, "eventOptionId": { "type": "string", "minLength": 1, "maxLength": 64 }, "variantId": { "anyOf": [ { "type": "string", "minLength": 1, "maxLength": 64 }, { "type": "null" } ] } }, "required": [ "eventId", "eventOptionId" ] } } }, "required": [ "seriesId", "name", "price", "items" ], "additionalProperties": {} } } } }, "responses": { "201": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 64 }, "seriesId": { "type": "string", "minLength": 1, "maxLength": 64 }, "name": { "type": "string" }, "price": { "type": "number" }, "isActive": { "type": "boolean" }, "items": { "type": "array", "items": { "type": "object", "properties": { "eventId": { "type": "string", "minLength": 1, "maxLength": 64 } }, "required": [ "eventId" ], "additionalProperties": {} } } }, "required": [ "id", "seriesId", "name", "price", "isActive", "items" ], "additionalProperties": {} } }, "required": [ "data" ], "additionalProperties": false } } } }, "400": { "description": "Validation failed (VALIDATION_FAILED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "401": { "description": "Not signed in (UNAUTHENTICATED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "Not allowed for this role (FORBIDDEN)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/season-passes/{id}": { "patch": { "tags": [ "Series" ], "summary": "Change a season pass", "description": "Its events and price can't change once somebody has bought it (switch it off and make a new one).\n\n**Who:** Supervisors and admins.", "operationId": "patchSeason-passesId", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "id", "in": "path", "required": true, "description": "The id", "schema": { "type": "string", "minLength": 1, "maxLength": 64 } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "seriesId": { "type": "string", "minLength": 1, "maxLength": 64 }, "name": { "type": "string", "minLength": 1, "maxLength": 120 }, "description": { "anyOf": [ { "type": "string", "maxLength": 5000 }, { "type": "null" } ] }, "price": { "anyOf": [ { "type": "number", "minimum": 0 }, { "type": "string", "maxLength": 20 } ] }, "saleEndsAt": { "anyOf": [ { "type": "string", "maxLength": 40 }, { "type": "null" } ] }, "isActive": { "type": "boolean" }, "items": { "minItems": 1, "maxItems": 100, "type": "array", "items": { "type": "object", "properties": { "eventId": { "type": "string", "minLength": 1, "maxLength": 64 }, "eventOptionId": { "type": "string", "minLength": 1, "maxLength": 64 }, "variantId": { "anyOf": [ { "type": "string", "minLength": 1, "maxLength": 64 }, { "type": "null" } ] } }, "required": [ "eventId", "eventOptionId" ] } } }, "additionalProperties": {} } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 64 }, "seriesId": { "type": "string", "minLength": 1, "maxLength": 64 }, "name": { "type": "string" }, "price": { "type": "number" }, "isActive": { "type": "boolean" }, "items": { "type": "array", "items": { "type": "object", "properties": { "eventId": { "type": "string", "minLength": 1, "maxLength": 64 } }, "required": [ "eventId" ], "additionalProperties": {} } } }, "required": [ "id", "seriesId", "name", "price", "isActive", "items" ], "additionalProperties": {} } }, "required": [ "data" ], "additionalProperties": false } } } }, "400": { "description": "Validation failed (VALIDATION_FAILED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "401": { "description": "Not signed in (UNAUTHENTICATED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "Not allowed for this role (FORBIDDEN)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Not found (NOT_FOUND)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } }, "delete": { "tags": [ "Series" ], "summary": "Delete a season pass", "description": "Only one nobody has bought — otherwise switch it off.\n\n**Who:** Supervisors and admins.", "operationId": "deleteSeason-passesId", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "id", "in": "path", "required": true, "description": "The id", "schema": { "type": "string", "minLength": 1, "maxLength": 64 } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 64 }, "deleted": { "type": "boolean", "const": true } }, "required": [ "id", "deleted" ], "additionalProperties": false } }, "required": [ "data" ], "additionalProperties": false } } } }, "400": { "description": "Validation failed (VALIDATION_FAILED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "401": { "description": "Not signed in (UNAUTHENTICATED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "Not allowed for this role (FORBIDDEN)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Not found (NOT_FOUND)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/season-passes/{id}/buy": { "post": { "tags": [ "Series" ], "summary": "Buy a season pass", "description": "Registers you at every event on it, then answers with a checkout to pay (or issues the tickets when it's free).\n\n**Who:** Any signed-in person.", "operationId": "postSeason-passesIdBuy", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "id", "in": "path", "required": true, "description": "The id", "schema": { "type": "string", "minLength": 1, "maxLength": 64 } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "quantity": { "default": 1, "type": "integer", "minimum": 1, "maximum": 50 }, "provider": { "type": "string", "maxLength": 40 } } } } } }, "responses": { "201": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": {}, "additionalProperties": {} } }, "required": [ "data" ], "additionalProperties": false } } } }, "400": { "description": "Validation failed (VALIDATION_FAILED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "401": { "description": "Not signed in (UNAUTHENTICATED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Not found (NOT_FOUND)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/season-pass-purchases/{id}/checkout": { "post": { "tags": [ "Series" ], "summary": "Pay what's owed on a pass", "description": "**Who:** Any signed-in person.", "operationId": "postSeason-pass-purchasesIdCheckout", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "id", "in": "path", "required": true, "description": "The id", "schema": { "type": "string", "minLength": 1, "maxLength": 64 } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "provider": { "type": "string", "maxLength": 40 } } } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": {}, "additionalProperties": {} } }, "required": [ "data" ], "additionalProperties": false } } } }, "400": { "description": "Validation failed (VALIDATION_FAILED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "401": { "description": "Not signed in (UNAUTHENTICATED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Not found (NOT_FOUND)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/me/season-passes": { "get": { "tags": [ "Me" ], "summary": "My season passes", "description": "**Who:** Any signed-in person.", "operationId": "getMeSeason-passes", "security": [ { "bearerAuth": [] } ], "parameters": [], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 64 }, "quantity": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, "total": { "type": "number" }, "status": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time", "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$" } }, "required": [ "id", "quantity", "total", "status", "createdAt" ], "additionalProperties": {} } } }, "required": [ "data" ], "additionalProperties": false } } } }, "401": { "description": "Not signed in (UNAUTHENTICATED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/events/{id}/bundles": { "get": { "tags": [ "Deals" ], "summary": "An event's bundle deals", "description": "With how often each has been used and the discount given.\n\n**Who:** Supervisors and admins.", "operationId": "getEventsIdBundles", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "id", "in": "path", "required": true, "description": "The id", "schema": { "type": "string", "minLength": 1, "maxLength": 64 } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 64 }, "eventId": { "type": "string", "minLength": 1, "maxLength": 64 }, "name": { "type": "string" }, "kind": { "type": "string", "enum": [ "exact", "mix", "free", "group" ] }, "price": { "type": [ "number", "null" ] }, "isActive": { "type": "boolean" }, "summary": { "type": "string" }, "headline": { "type": "string" }, "available": { "type": "boolean" }, "uses": { "type": "number" }, "registrations": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, "totalDiscount": { "type": "number" } }, "required": [ "id", "eventId", "name", "kind", "price", "isActive", "summary", "headline", "available", "uses", "registrations", "totalDiscount" ], "additionalProperties": {} } } }, "required": [ "data" ], "additionalProperties": false } } } }, "400": { "description": "Validation failed (VALIDATION_FAILED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "401": { "description": "Not signed in (UNAUTHENTICATED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "Not allowed for this role (FORBIDDEN)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Not found (NOT_FOUND)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } }, "post": { "tags": [ "Deals" ], "summary": "Add a bundle deal", "description": "**Who:** Supervisors and admins.", "operationId": "postEventsIdBundles", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "id", "in": "path", "required": true, "description": "The id", "schema": { "type": "string", "minLength": 1, "maxLength": 64 } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "name": { "type": "string", "minLength": 1, "maxLength": 80 }, "kind": { "description": "exact = this set; mix = any N; free = buy N get M free; group = a price for groups", "type": "string", "enum": [ "exact", "mix", "free", "group" ] }, "price": { "anyOf": [ { "anyOf": [ { "type": "number" }, { "type": "string", "maxLength": 20 } ] }, { "type": "null" } ] }, "setSize": { "anyOf": [ { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, { "type": "null" } ] }, "freeCount": { "anyOf": [ { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, { "type": "null" } ] }, "groupPricing": { "anyOf": [ { "type": "string", "enum": [ "per_ticket", "percent" ] }, { "type": "null" } ] }, "items": { "maxItems": 50, "type": "array", "items": { "type": "object", "properties": { "eventOptionId": { "type": "string", "minLength": 1, "maxLength": 64 }, "variantId": { "anyOf": [ { "type": "string", "minLength": 1, "maxLength": 64 }, { "type": "null" } ] }, "quantity": { "type": "integer", "minimum": 1, "maximum": 9007199254740991 } }, "required": [ "eventOptionId" ] } }, "description": { "anyOf": [ { "type": "string", "maxLength": 2000 }, { "type": "null" } ] }, "isActive": { "type": "boolean" }, "validFrom": { "anyOf": [ { "type": "string", "maxLength": 40 }, { "type": "null" } ] }, "validUntil": { "anyOf": [ { "type": "string", "maxLength": 40 }, { "type": "null" } ] } }, "required": [ "name" ], "additionalProperties": {} } } } }, "responses": { "201": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 64 }, "eventId": { "type": "string", "minLength": 1, "maxLength": 64 }, "name": { "type": "string" }, "kind": { "type": "string", "enum": [ "exact", "mix", "free", "group" ] }, "price": { "type": [ "number", "null" ] }, "isActive": { "type": "boolean" }, "summary": { "type": "string" }, "headline": { "type": "string" }, "available": { "type": "boolean" } }, "required": [ "id", "eventId", "name", "kind", "price", "isActive", "summary", "headline", "available" ], "additionalProperties": {} } }, "required": [ "data" ], "additionalProperties": false } } } }, "400": { "description": "Validation failed (VALIDATION_FAILED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "401": { "description": "Not signed in (UNAUTHENTICATED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "Not allowed for this role (FORBIDDEN)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Not found (NOT_FOUND)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/bundles/{id}": { "patch": { "tags": [ "Deals" ], "summary": "Change a bundle deal", "description": "Only what's sent changes; when a pricing field is sent the whole deal is checked again.\n\n**Who:** Supervisors and admins.", "operationId": "patchBundlesId", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "id", "in": "path", "required": true, "description": "The id", "schema": { "type": "string", "minLength": 1, "maxLength": 64 } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "name": { "type": "string", "minLength": 1, "maxLength": 80 }, "kind": { "description": "exact = this set; mix = any N; free = buy N get M free; group = a price for groups", "type": "string", "enum": [ "exact", "mix", "free", "group" ] }, "price": { "anyOf": [ { "anyOf": [ { "type": "number" }, { "type": "string", "maxLength": 20 } ] }, { "type": "null" } ] }, "setSize": { "anyOf": [ { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, { "type": "null" } ] }, "freeCount": { "anyOf": [ { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, { "type": "null" } ] }, "groupPricing": { "anyOf": [ { "type": "string", "enum": [ "per_ticket", "percent" ] }, { "type": "null" } ] }, "items": { "maxItems": 50, "type": "array", "items": { "type": "object", "properties": { "eventOptionId": { "type": "string", "minLength": 1, "maxLength": 64 }, "variantId": { "anyOf": [ { "type": "string", "minLength": 1, "maxLength": 64 }, { "type": "null" } ] }, "quantity": { "type": "integer", "minimum": 1, "maximum": 9007199254740991 } }, "required": [ "eventOptionId" ] } }, "description": { "anyOf": [ { "type": "string", "maxLength": 2000 }, { "type": "null" } ] }, "isActive": { "type": "boolean" }, "validFrom": { "anyOf": [ { "type": "string", "maxLength": 40 }, { "type": "null" } ] }, "validUntil": { "anyOf": [ { "type": "string", "maxLength": 40 }, { "type": "null" } ] } }, "additionalProperties": {} } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 64 }, "eventId": { "type": "string", "minLength": 1, "maxLength": 64 }, "name": { "type": "string" }, "kind": { "type": "string", "enum": [ "exact", "mix", "free", "group" ] }, "price": { "type": [ "number", "null" ] }, "isActive": { "type": "boolean" }, "summary": { "type": "string" }, "headline": { "type": "string" }, "available": { "type": "boolean" } }, "required": [ "id", "eventId", "name", "kind", "price", "isActive", "summary", "headline", "available" ], "additionalProperties": {} } }, "required": [ "data" ], "additionalProperties": false } } } }, "400": { "description": "Validation failed (VALIDATION_FAILED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "401": { "description": "Not signed in (UNAUTHENTICATED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "Not allowed for this role (FORBIDDEN)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Not found (NOT_FOUND)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } }, "delete": { "tags": [ "Deals" ], "summary": "Remove a bundle deal", "description": "One that's been used is switched off instead (`switchedOff`), so registrations that got it keep their price.\n\n**Who:** Supervisors and admins.", "operationId": "deleteBundlesId", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "id", "in": "path", "required": true, "description": "The id", "schema": { "type": "string", "minLength": 1, "maxLength": 64 } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "deleted": { "type": "boolean", "const": true }, "switchedOff": { "type": "boolean", "const": true }, "message": { "type": "string" } }, "required": [ "message" ], "additionalProperties": false } }, "required": [ "data" ], "additionalProperties": false } } } }, "400": { "description": "Validation failed (VALIDATION_FAILED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "401": { "description": "Not signed in (UNAUTHENTICATED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "Not allowed for this role (FORBIDDEN)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Not found (NOT_FOUND)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/bundles/quote": { "post": { "tags": [ "Deals" ], "summary": "The bundle deals a basket gets", "description": "Before any coupon code — what the register page shows as you choose tickets.\n\n**Who:** Anyone; signed-in staff may see more.", "operationId": "postBundlesQuote", "security": [ {}, { "bearerAuth": [] } ], "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "eventId": { "type": "string", "minLength": 1, "maxLength": 64 }, "options": { "maxItems": 50, "type": "array", "items": { "type": "object", "properties": { "eventOptionId": { "type": "string", "minLength": 1, "maxLength": 64 }, "variantId": { "anyOf": [ { "type": "string", "minLength": 1, "maxLength": 64 }, { "type": "null" } ] }, "quantity": { "type": "integer", "minimum": 1, "maximum": 1000 }, "sessionIds": { "maxItems": 200, "type": "array", "items": { "type": "string", "minLength": 1, "maxLength": 64 } } }, "required": [ "eventOptionId", "quantity" ] } }, "forUserId": { "description": "Staff: price it for this person (null = a walk-in without an account)", "anyOf": [ { "type": "string", "minLength": 1, "maxLength": 64 }, { "type": "null" } ] } }, "required": [ "eventId", "options" ] } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "subtotal": { "type": "number" }, "bundleDiscount": { "type": "number" }, "bundles": { "type": "array", "items": { "type": "object", "properties": {}, "additionalProperties": {} } }, "total": { "type": "number" } }, "required": [ "subtotal", "bundleDiscount", "bundles", "total" ], "additionalProperties": false } }, "required": [ "data" ], "additionalProperties": false } } } }, "400": { "description": "Validation failed (VALIDATION_FAILED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/coupons": { "get": { "tags": [ "Deals" ], "summary": "Coupon codes", "description": "With how often each has been used and the discount given. Campus-scoped supervisors see codes for their campuses' events.\n\n**Who:** Supervisors and admins.", "operationId": "getCoupons", "security": [ { "bearerAuth": [] } ], "parameters": [], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 64 }, "code": { "type": "string" }, "type": { "type": "string", "enum": [ "percent", "fixed", "comp" ] }, "value": { "type": "number" }, "active": { "type": "boolean" }, "summary": { "type": "string" }, "uses": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, "totalDiscount": { "type": "number" } }, "required": [ "id", "code", "type", "value", "active", "summary", "uses", "totalDiscount" ], "additionalProperties": {} } } }, "required": [ "data" ], "additionalProperties": false } } } }, "401": { "description": "Not signed in (UNAUTHENTICATED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "Not allowed for this role (FORBIDDEN)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } }, "post": { "tags": [ "Deals" ], "summary": "Create a coupon code", "description": "**Who:** Supervisors and admins.", "operationId": "postCoupons", "security": [ { "bearerAuth": [] } ], "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string", "minLength": 3, "maxLength": 32 }, "type": { "type": "string", "enum": [ "percent", "fixed", "comp" ], "description": "comp = free" }, "value": { "anyOf": [ { "type": "number" }, { "type": "string", "maxLength": 20 } ] }, "description": { "anyOf": [ { "type": "string", "maxLength": 2000 }, { "type": "null" } ] }, "active": { "type": "boolean" }, "stackEarlyBird": { "type": "boolean" }, "validFrom": { "anyOf": [ { "type": "string", "maxLength": 40 }, { "type": "null" } ] }, "validUntil": { "anyOf": [ { "type": "string", "maxLength": 40 }, { "type": "null" } ] }, "maxUses": { "anyOf": [ { "anyOf": [ { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, { "type": "string" } ] }, { "type": "null" } ] }, "maxUsesPerUser": { "anyOf": [ { "anyOf": [ { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, { "type": "string" } ] }, { "type": "null" } ] }, "minQuantity": { "anyOf": [ { "anyOf": [ { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, { "type": "string" } ] }, { "type": "null" } ] }, "restrictRoles": { "type": "array", "items": { "type": "string", "enum": [ "user", "staff", "supervisor", "admin" ] } }, "restrictDomain": { "anyOf": [ { "type": "string", "maxLength": 120 }, { "type": "null" } ] }, "eventIds": { "description": "Empty = every event (not for campus-scoped supervisors)", "maxItems": 200, "type": "array", "items": { "type": "string", "minLength": 1, "maxLength": 64 } }, "options": { "maxItems": 200, "type": "array", "items": { "type": "object", "properties": { "eventOptionId": { "type": "string", "minLength": 1, "maxLength": 64 }, "variantId": { "anyOf": [ { "type": "string", "minLength": 1, "maxLength": 64 }, { "type": "null" } ] } }, "required": [ "eventOptionId" ] } }, "userIds": { "maxItems": 1000, "type": "array", "items": { "type": "string", "minLength": 1, "maxLength": 64 } } }, "required": [ "code", "type" ], "additionalProperties": {} } } } }, "responses": { "201": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 64 }, "code": { "type": "string" }, "type": { "type": "string", "enum": [ "percent", "fixed", "comp" ] }, "value": { "type": "number" }, "active": { "type": "boolean" }, "summary": { "type": "string" } }, "required": [ "id", "code", "type", "value", "active", "summary" ], "additionalProperties": {} } }, "required": [ "data" ], "additionalProperties": false } } } }, "400": { "description": "Validation failed (VALIDATION_FAILED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "401": { "description": "Not signed in (UNAUTHENTICATED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "Not allowed for this role (FORBIDDEN)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/coupons/redemptions": { "get": { "tags": [ "Deals" ], "summary": "Coupon and bundle uses", "description": "For the Discounts report, newest first.\n\n**Who:** Supervisors and admins.", "operationId": "getCouponsRedemptions", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "eventIds", "in": "query", "required": false, "description": "Comma-separated", "schema": { "type": "string", "maxLength": 4000 } }, { "name": "from", "in": "query", "required": false, "schema": { "type": "string", "maxLength": 40 } }, { "name": "to", "in": "query", "required": false, "schema": { "type": "string", "maxLength": 40 } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 64 }, "kind": { "type": "string", "enum": [ "coupon", "bundle" ] }, "uses": { "type": "number" }, "discountAmount": { "type": "number" }, "createdAt": { "type": "string", "format": "date-time", "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$" } }, "required": [ "id", "kind", "uses", "discountAmount", "createdAt" ], "additionalProperties": {} } } }, "required": [ "data" ], "additionalProperties": false } } } }, "400": { "description": "Validation failed (VALIDATION_FAILED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "401": { "description": "Not signed in (UNAUTHENTICATED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "Not allowed for this role (FORBIDDEN)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/coupons/{id}": { "get": { "tags": [ "Deals" ], "summary": "One coupon code with its uses", "description": "**Who:** Supervisors and admins.", "operationId": "getCouponsId", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "id", "in": "path", "required": true, "description": "The id", "schema": { "type": "string", "minLength": 1, "maxLength": 64 } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 64 }, "code": { "type": "string" }, "type": { "type": "string", "enum": [ "percent", "fixed", "comp" ] }, "value": { "type": "number" }, "active": { "type": "boolean" }, "summary": { "type": "string" }, "redemptions": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 64 } }, "required": [ "id" ], "additionalProperties": {} } } }, "required": [ "id", "code", "type", "value", "active", "summary", "redemptions" ], "additionalProperties": {} } }, "required": [ "data" ], "additionalProperties": false } } } }, "400": { "description": "Validation failed (VALIDATION_FAILED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "401": { "description": "Not signed in (UNAUTHENTICATED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "Not allowed for this role (FORBIDDEN)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Not found (NOT_FOUND)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } }, "patch": { "tags": [ "Deals" ], "summary": "Change a coupon code", "description": "Only what's sent changes. Discounts already given keep their amount; a used code can't be renamed.\n\n**Who:** Supervisors and admins.", "operationId": "patchCouponsId", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "id", "in": "path", "required": true, "description": "The id", "schema": { "type": "string", "minLength": 1, "maxLength": 64 } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string", "minLength": 3, "maxLength": 32 }, "type": { "type": "string", "enum": [ "percent", "fixed", "comp" ], "description": "comp = free" }, "value": { "anyOf": [ { "type": "number" }, { "type": "string", "maxLength": 20 } ] }, "description": { "anyOf": [ { "type": "string", "maxLength": 2000 }, { "type": "null" } ] }, "active": { "type": "boolean" }, "stackEarlyBird": { "type": "boolean" }, "validFrom": { "anyOf": [ { "type": "string", "maxLength": 40 }, { "type": "null" } ] }, "validUntil": { "anyOf": [ { "type": "string", "maxLength": 40 }, { "type": "null" } ] }, "maxUses": { "anyOf": [ { "anyOf": [ { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, { "type": "string" } ] }, { "type": "null" } ] }, "maxUsesPerUser": { "anyOf": [ { "anyOf": [ { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, { "type": "string" } ] }, { "type": "null" } ] }, "minQuantity": { "anyOf": [ { "anyOf": [ { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, { "type": "string" } ] }, { "type": "null" } ] }, "restrictRoles": { "type": "array", "items": { "type": "string", "enum": [ "user", "staff", "supervisor", "admin" ] } }, "restrictDomain": { "anyOf": [ { "type": "string", "maxLength": 120 }, { "type": "null" } ] }, "eventIds": { "description": "Empty = every event (not for campus-scoped supervisors)", "maxItems": 200, "type": "array", "items": { "type": "string", "minLength": 1, "maxLength": 64 } }, "options": { "maxItems": 200, "type": "array", "items": { "type": "object", "properties": { "eventOptionId": { "type": "string", "minLength": 1, "maxLength": 64 }, "variantId": { "anyOf": [ { "type": "string", "minLength": 1, "maxLength": 64 }, { "type": "null" } ] } }, "required": [ "eventOptionId" ] } }, "userIds": { "maxItems": 1000, "type": "array", "items": { "type": "string", "minLength": 1, "maxLength": 64 } } }, "additionalProperties": {} } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 64 }, "code": { "type": "string" }, "type": { "type": "string", "enum": [ "percent", "fixed", "comp" ] }, "value": { "type": "number" }, "active": { "type": "boolean" }, "summary": { "type": "string" } }, "required": [ "id", "code", "type", "value", "active", "summary" ], "additionalProperties": {} } }, "required": [ "data" ], "additionalProperties": false } } } }, "400": { "description": "Validation failed (VALIDATION_FAILED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "401": { "description": "Not signed in (UNAUTHENTICATED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "Not allowed for this role (FORBIDDEN)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Not found (NOT_FOUND)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/coupons/check": { "post": { "tags": [ "Deals" ], "summary": "Check a coupon code against a basket", "description": "Always a 200: `valid` with the discount and total, or `valid: false` with why. Restricted codes need you signed in.\n\n**Who:** Anyone; signed-in staff may see more.", "operationId": "postCouponsCheck", "security": [ {}, { "bearerAuth": [] } ], "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "eventId": { "type": "string", "minLength": 1, "maxLength": 64 }, "options": { "maxItems": 50, "type": "array", "items": { "type": "object", "properties": { "eventOptionId": { "type": "string", "minLength": 1, "maxLength": 64 }, "variantId": { "anyOf": [ { "type": "string", "minLength": 1, "maxLength": 64 }, { "type": "null" } ] }, "quantity": { "type": "integer", "minimum": 1, "maximum": 1000 }, "sessionIds": { "maxItems": 200, "type": "array", "items": { "type": "string", "minLength": 1, "maxLength": 64 } } }, "required": [ "eventOptionId", "quantity" ] } }, "forUserId": { "description": "Staff: price it for this person (null = a walk-in without an account)", "anyOf": [ { "type": "string", "minLength": 1, "maxLength": 64 }, { "type": "null" } ] }, "code": { "type": "string", "minLength": 1, "maxLength": 40 } }, "required": [ "eventId", "options", "code" ] } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "oneOf": [ { "type": "object", "properties": { "valid": { "type": "boolean", "const": true }, "code": { "type": "string" }, "type": { "type": "string" }, "value": { "type": "number" }, "summary": { "type": "string" }, "description": { "type": [ "string", "null" ] }, "discount": { "type": "number" }, "bundleDiscount": { "type": "number" }, "bundles": { "type": "array", "items": { "type": "object", "properties": {}, "additionalProperties": {} } }, "subtotal": { "type": "number" }, "total": { "type": "number" } }, "required": [ "valid", "code", "type", "value", "summary", "description", "discount", "bundleDiscount", "bundles", "subtotal", "total" ], "additionalProperties": false }, { "type": "object", "properties": { "valid": { "type": "boolean", "const": false }, "message": { "type": "string" } }, "required": [ "valid", "message" ], "additionalProperties": false } ] } }, "required": [ "data" ], "additionalProperties": false } } } }, "400": { "description": "Validation failed (VALIDATION_FAILED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/campuses": { "get": { "tags": [ "Campuses" ], "summary": "The active campuses", "description": "`enabled` false means campuses are switched off (the list is then empty).\n\n**Who:** Anyone.", "operationId": "getCampuses", "parameters": [], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "enabled": { "type": "boolean" }, "campuses": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 64 }, "name": { "type": "string" }, "slug": { "type": "string" } }, "required": [ "id", "name", "slug" ], "additionalProperties": {} } } }, "required": [ "enabled", "campuses" ], "additionalProperties": false } }, "required": [ "data" ], "additionalProperties": false } } } } } }, "post": { "tags": [ "Campuses" ], "summary": "Add a campus", "description": "**Who:** Admins only.", "operationId": "postCampuses", "security": [ { "bearerAuth": [] } ], "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "name": { "type": "string", "minLength": 1, "maxLength": 120 }, "slug": { "type": "string", "maxLength": 80 }, "colour": { "anyOf": [ { "type": "string", "maxLength": 20 }, { "type": "null" } ] }, "notifyRecipientIds": { "description": "Who gets this campus's daily summary (staff only)", "maxItems": 100, "type": "array", "items": { "type": "string", "minLength": 1, "maxLength": 64 } }, "archived": { "type": "boolean" } }, "required": [ "name" ], "additionalProperties": {} } } } }, "responses": { "201": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 64 }, "name": { "type": "string" }, "slug": { "type": "string" }, "archivedAt": { "anyOf": [ { "type": "string", "format": "date-time", "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$" }, { "type": "null" } ] }, "order": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, "_count": { "type": "object", "properties": { "events": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 } }, "required": [ "events" ], "additionalProperties": {} } }, "required": [ "id", "name", "slug", "archivedAt", "order", "_count" ], "additionalProperties": {} } }, "required": [ "data" ], "additionalProperties": false } } } }, "400": { "description": "Validation failed (VALIDATION_FAILED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "401": { "description": "Not signed in (UNAUTHENTICATED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "Not allowed for this role (FORBIDDEN)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/campuses/admin": { "get": { "tags": [ "Campuses" ], "summary": "Every campus (Site settings)", "description": "Archived ones last, with event counts and summary recipients.\n\n**Who:** Admins only.", "operationId": "getCampusesAdmin", "security": [ { "bearerAuth": [] } ], "parameters": [], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "enabled": { "type": "boolean" }, "campuses": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 64 }, "name": { "type": "string" }, "slug": { "type": "string" }, "archivedAt": { "anyOf": [ { "type": "string", "format": "date-time", "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$" }, { "type": "null" } ] }, "order": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, "_count": { "type": "object", "properties": { "events": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 } }, "required": [ "events" ], "additionalProperties": {} } }, "required": [ "id", "name", "slug", "archivedAt", "order", "_count" ], "additionalProperties": {} } } }, "required": [ "enabled", "campuses" ], "additionalProperties": false } }, "required": [ "data" ], "additionalProperties": false } } } }, "401": { "description": "Not signed in (UNAUTHENTICATED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "Not allowed for this role (FORBIDDEN)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/campuses/by-slug/{slug}": { "get": { "tags": [ "Campuses" ], "summary": "A campus landing page", "description": "**Who:** Anyone.", "operationId": "getCampusesBy-slugSlug", "parameters": [ { "name": "slug", "in": "path", "required": true, "schema": { "type": "string", "minLength": 1, "maxLength": 80 } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 64 }, "name": { "type": "string" }, "slug": { "type": "string" } }, "required": [ "id", "name", "slug" ], "additionalProperties": {} } }, "required": [ "data" ], "additionalProperties": false } } } }, "400": { "description": "Validation failed (VALIDATION_FAILED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Not found (NOT_FOUND)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/campuses/enabled": { "put": { "tags": [ "Campuses" ], "summary": "Switch campuses on or off", "description": "Off hides campus fields and filters; nothing is deleted.\n\n**Who:** Admins only.", "operationId": "putCampusesEnabled", "security": [ { "bearerAuth": [] } ], "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "enabled": { "type": "boolean" } }, "required": [ "enabled" ] } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "enabled": { "type": "boolean" } }, "required": [ "enabled" ], "additionalProperties": false } }, "required": [ "data" ], "additionalProperties": false } } } }, "400": { "description": "Validation failed (VALIDATION_FAILED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "401": { "description": "Not signed in (UNAUTHENTICATED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "Not allowed for this role (FORBIDDEN)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/campuses/order": { "put": { "tags": [ "Campuses" ], "summary": "Put the campuses in order", "description": "**Who:** Admins only.", "operationId": "putCampusesOrder", "security": [ { "bearerAuth": [] } ], "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "ids": { "minItems": 1, "maxItems": 200, "type": "array", "items": { "type": "string", "minLength": 1, "maxLength": 64 } } }, "required": [ "ids" ] } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "ids": { "type": "array", "items": { "type": "string", "minLength": 1, "maxLength": 64 } } }, "required": [ "ids" ], "additionalProperties": false } }, "required": [ "data" ], "additionalProperties": false } } } }, "400": { "description": "Validation failed (VALIDATION_FAILED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "401": { "description": "Not signed in (UNAUTHENTICATED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "Not allowed for this role (FORBIDDEN)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/campuses/{id}": { "patch": { "tags": [ "Campuses" ], "summary": "Change a campus", "description": "Details, summary recipients, or `archived`.\n\n**Who:** Admins only.", "operationId": "patchCampusesId", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "id", "in": "path", "required": true, "description": "The id", "schema": { "type": "string", "minLength": 1, "maxLength": 64 } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "name": { "type": "string", "minLength": 1, "maxLength": 120 }, "slug": { "type": "string", "maxLength": 80 }, "colour": { "anyOf": [ { "type": "string", "maxLength": 20 }, { "type": "null" } ] }, "notifyRecipientIds": { "description": "Who gets this campus's daily summary (staff only)", "maxItems": 100, "type": "array", "items": { "type": "string", "minLength": 1, "maxLength": 64 } }, "archived": { "type": "boolean" } }, "additionalProperties": {} } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 64 }, "name": { "type": "string" }, "slug": { "type": "string" }, "archivedAt": { "anyOf": [ { "type": "string", "format": "date-time", "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$" }, { "type": "null" } ] }, "order": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, "_count": { "type": "object", "properties": { "events": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 } }, "required": [ "events" ], "additionalProperties": {} } }, "required": [ "id", "name", "slug", "archivedAt", "order", "_count" ], "additionalProperties": {} } }, "required": [ "data" ], "additionalProperties": false } } } }, "400": { "description": "Validation failed (VALIDATION_FAILED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "401": { "description": "Not signed in (UNAUTHENTICATED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "Not allowed for this role (FORBIDDEN)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Not found (NOT_FOUND)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } }, "delete": { "tags": [ "Campuses" ], "summary": "Delete a campus", "description": "Only one with no events and no staff limited to it — otherwise archive it (CONFLICT, `reason` CAMPUS_HAS_EVENTS or CAMPUS_HAS_SCOPED_STAFF).\n\n**Who:** Admins only.", "operationId": "deleteCampusesId", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "id", "in": "path", "required": true, "description": "The id", "schema": { "type": "string", "minLength": 1, "maxLength": 64 } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 64 }, "deleted": { "type": "boolean", "const": true } }, "required": [ "id", "deleted" ], "additionalProperties": false } }, "required": [ "data" ], "additionalProperties": false } } } }, "400": { "description": "Validation failed (VALIDATION_FAILED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "401": { "description": "Not signed in (UNAUTHENTICATED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "Not allowed for this role (FORBIDDEN)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Not found (NOT_FOUND)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/campuses/{id}/audience": { "get": { "tags": [ "Campuses" ], "summary": "Everyone at a campus", "description": "For the email and WhatsApp composers: people whose home campus it is, plus (`registrants=true`) people registered for its events in the last 12 months. News consent is checked when sending.\n\n**Who:** Supervisors and admins.", "operationId": "getCampusesIdAudience", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "id", "in": "path", "required": true, "description": "The id", "schema": { "type": "string", "minLength": 1, "maxLength": 64 } }, { "name": "registrants", "in": "query", "required": false, "schema": { "default": "false", "type": "string", "enum": [ "true", "false" ] } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "campus": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 64 }, "name": { "type": "string" } }, "required": [ "id", "name" ], "additionalProperties": false }, "users": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 64 }, "name": { "type": "string" }, "email": { "type": "string" }, "phoneNumber": { "type": [ "string", "null" ] } }, "required": [ "id", "name", "email", "phoneNumber" ], "additionalProperties": false } } }, "required": [ "campus", "users" ], "additionalProperties": false } }, "required": [ "data" ], "additionalProperties": false } } } }, "400": { "description": "Validation failed (VALIDATION_FAILED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "401": { "description": "Not signed in (UNAUTHENTICATED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "Not allowed for this role (FORBIDDEN)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Not found (NOT_FOUND)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/registrations": { "post": { "tags": [ "Registrations" ], "summary": "Register for an event", "description": "Signed in, or as a guest for a free event that allows it (`guest` then required), or with a waitlist link (`waitlistToken`).\n\nRegistering again for the same event adds to the existing registration. When nothing is owed it is marked paid and tickets are issued; otherwise pay with `POST /registrations/{id}/checkout`.\n\nA coupon that was valid when checked but used up a moment later is reported in `couponError`; the registration is still made.\n\n**Who:** Anyone; signed-in staff may see more.", "operationId": "postRegistrations", "security": [ {}, { "bearerAuth": [] } ], "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "eventId": { "type": "string", "minLength": 1, "maxLength": 64 }, "options": { "minItems": 1, "maxItems": 50, "type": "array", "items": { "type": "object", "properties": { "eventOptionId": { "type": "string", "minLength": 1, "maxLength": 64 }, "quantity": { "type": "integer", "minimum": 1, "maximum": 1000 }, "variantId": { "anyOf": [ { "type": "string", "minLength": 1, "maxLength": 64 }, { "type": "null" } ] }, "sessionIds": { "description": "\"Pick sessions\" tickets: the sessions chosen", "maxItems": 200, "type": "array", "items": { "type": "string", "minLength": 1, "maxLength": 64 } } }, "required": [ "eventOptionId", "quantity" ] } }, "guest": { "type": "object", "properties": { "name": { "type": "string", "minLength": 1, "maxLength": 200 }, "email": { "type": "string", "maxLength": 200, "format": "email", "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$" }, "phone": { "type": "string", "maxLength": 40 } }, "required": [ "name", "email" ] }, "couponCode": { "type": "string", "maxLength": 60 }, "attendees": { "description": "Names for the places (events that collect them)", "maxItems": 500, "type": "array", "items": { "type": "object", "properties": { "eventOptionId": { "type": "string", "minLength": 1, "maxLength": 64 }, "variantId": { "anyOf": [ { "type": "string", "minLength": 1, "maxLength": 64 }, { "type": "null" } ] }, "name": { "type": "string", "minLength": 1, "maxLength": 200 }, "email": { "anyOf": [ { "type": "string", "maxLength": 200 }, { "type": "null" } ] }, "phone": { "anyOf": [ { "type": "string", "maxLength": 40 }, { "type": "null" } ] }, "dateOfBirth": { "description": "YYYY-MM-DD (youth events)", "anyOf": [ { "type": "string", "maxLength": 40 }, { "type": "null" } ] }, "gender": { "anyOf": [ { "type": "string", "maxLength": 20 }, { "type": "null" } ] }, "parentName": { "anyOf": [ { "type": "string", "maxLength": 200 }, { "type": "null" } ] }, "parentEmail": { "anyOf": [ { "type": "string", "maxLength": 200 }, { "type": "null" } ] }, "parentPhone": { "anyOf": [ { "type": "string", "maxLength": 40 }, { "type": "null" } ] } }, "required": [ "eventOptionId", "name" ] } }, "ticketDelivery": { "description": "With attendees: tickets to the payer, or to each attendee", "type": "string", "enum": [ "payer", "each" ] }, "waitlistToken": { "type": "string", "maxLength": 200 }, "analyticsSessionId": { "type": "string", "maxLength": 100 } }, "required": [ "eventId", "options" ] } } } }, "responses": { "201": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 64 }, "status": { "type": "string", "enum": [ "pending", "confirmed", "partial_paid", "paid", "cancelled" ] }, "createdAt": { "type": "string", "format": "date-time", "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$" }, "event": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 64 }, "title": { "type": "string" }, "startDate": { "type": "string", "format": "date-time", "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$" }, "endDate": { "type": "string", "format": "date-time", "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$" } }, "required": [ "id", "title", "startDate", "endDate" ], "additionalProperties": false }, "items": { "type": "array", "items": { "type": "object", "properties": { "ticket": { "type": "string" }, "variant": { "type": [ "string", "null" ] }, "quantity": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, "unitPrice": { "type": "number" } }, "required": [ "ticket", "variant", "quantity", "unitPrice" ], "additionalProperties": false } }, "totalDue": { "type": "number", "description": "In rand, after discounts" }, "amountPaid": { "type": "number", "description": "In rand (refunds subtracted)" }, "balance": { "type": "number", "description": "totalDue − amountPaid; 0 or less = nothing owing" }, "isNew": { "type": "boolean", "description": "false = added to an existing registration" }, "couponError": { "type": [ "string", "null" ] } }, "required": [ "id", "status", "createdAt", "event", "items", "totalDue", "amountPaid", "balance", "isNew", "couponError" ], "additionalProperties": false } }, "required": [ "data" ], "additionalProperties": false } } } }, "400": { "description": "Validation failed (VALIDATION_FAILED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } }, "get": { "tags": [ "Registrations" ], "summary": "Every registration (staff)", "description": "Newest first, for the events you may see. `unpaid=true` for ones still owing; `userId` for one person's.\n\n**Who:** Staff, supervisors and admins.", "operationId": "getRegistrations", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "page", "in": "query", "required": false, "schema": { "default": 1, "type": "integer", "minimum": 1, "maximum": 9007199254740991 } }, { "name": "limit", "in": "query", "required": false, "description": "At most 200", "schema": { "default": 100, "type": "integer", "minimum": 1, "maximum": 200 } }, { "name": "unpaid", "in": "query", "required": false, "schema": { "default": "false", "type": "string", "enum": [ "true", "false" ] } }, { "name": "userId", "in": "query", "required": false, "schema": { "type": "string", "minLength": 1, "maxLength": 64 } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 64 }, "status": { "type": "string", "enum": [ "pending", "confirmed", "partial_paid", "paid", "cancelled" ] }, "eventId": { "type": "string", "minLength": 1, "maxLength": 64 }, "userId": { "type": "string", "minLength": 1, "maxLength": 64 }, "totalDueComputed": { "type": "number" } }, "required": [ "id", "status", "eventId", "userId" ], "additionalProperties": {} } }, "meta": { "type": "object", "properties": { "page": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, "limit": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, "total": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, "pages": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 } }, "required": [ "page", "limit", "total", "pages" ], "additionalProperties": false } }, "required": [ "data", "meta" ], "additionalProperties": false } } } }, "400": { "description": "Validation failed (VALIDATION_FAILED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "401": { "description": "Not signed in (UNAUTHENTICATED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "Not allowed for this role (FORBIDDEN)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/registrations/{id}": { "get": { "tags": [ "Registrations" ], "summary": "One of my registrations", "description": "**Who:** Any signed-in person.", "operationId": "getRegistrationsId", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "id", "in": "path", "required": true, "description": "The id", "schema": { "type": "string", "minLength": 1, "maxLength": 64 } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 64 }, "status": { "type": "string", "enum": [ "pending", "confirmed", "partial_paid", "paid", "cancelled" ] }, "createdAt": { "type": "string", "format": "date-time", "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$" }, "event": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 64 }, "title": { "type": "string" }, "startDate": { "type": "string", "format": "date-time", "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$" }, "endDate": { "type": "string", "format": "date-time", "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$" } }, "required": [ "id", "title", "startDate", "endDate" ], "additionalProperties": false }, "items": { "type": "array", "items": { "type": "object", "properties": { "ticket": { "type": "string" }, "variant": { "type": [ "string", "null" ] }, "quantity": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, "unitPrice": { "type": "number" } }, "required": [ "ticket", "variant", "quantity", "unitPrice" ], "additionalProperties": false } }, "totalDue": { "type": "number", "description": "In rand, after discounts" }, "amountPaid": { "type": "number", "description": "In rand (refunds subtracted)" }, "balance": { "type": "number", "description": "totalDue − amountPaid; 0 or less = nothing owing" } }, "required": [ "id", "status", "createdAt", "event", "items", "totalDue", "amountPaid", "balance" ], "additionalProperties": false } }, "required": [ "data" ], "additionalProperties": false } } } }, "400": { "description": "Validation failed (VALIDATION_FAILED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "401": { "description": "Not signed in (UNAUTHENTICATED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Not found (NOT_FOUND)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/registrations/{id}/cancel": { "post": { "tags": [ "Registrations" ], "summary": "Cancel my registration", "description": "Not after the event has ended, and not once anything has been paid (the church can do that). Its places go to the waitlist.\n\n**Who:** Any signed-in person.", "operationId": "postRegistrationsIdCancel", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "id", "in": "path", "required": true, "description": "The id", "schema": { "type": "string", "minLength": 1, "maxLength": 64 } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 64 }, "status": { "type": "string", "enum": [ "pending", "confirmed", "partial_paid", "paid", "cancelled" ] }, "createdAt": { "type": "string", "format": "date-time", "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$" }, "event": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 64 }, "title": { "type": "string" }, "startDate": { "type": "string", "format": "date-time", "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$" }, "endDate": { "type": "string", "format": "date-time", "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$" } }, "required": [ "id", "title", "startDate", "endDate" ], "additionalProperties": false }, "items": { "type": "array", "items": { "type": "object", "properties": { "ticket": { "type": "string" }, "variant": { "type": [ "string", "null" ] }, "quantity": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, "unitPrice": { "type": "number" } }, "required": [ "ticket", "variant", "quantity", "unitPrice" ], "additionalProperties": false } }, "totalDue": { "type": "number", "description": "In rand, after discounts" }, "amountPaid": { "type": "number", "description": "In rand (refunds subtracted)" }, "balance": { "type": "number", "description": "totalDue − amountPaid; 0 or less = nothing owing" } }, "required": [ "id", "status", "createdAt", "event", "items", "totalDue", "amountPaid", "balance" ], "additionalProperties": false } }, "required": [ "data" ], "additionalProperties": false } } } }, "400": { "description": "Validation failed (VALIDATION_FAILED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "401": { "description": "Not signed in (UNAUTHENTICATED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Not found (NOT_FOUND)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/registrations/{id}/checkout": { "post": { "tags": [ "Registrations" ], "summary": "Pay what I owe online", "description": "Starts a payment with the church's provider (Yoco or PayFast) and returns where to send the person (`redirectUrl`).\n\nIf an early-bird price ran out since the registration was made, nothing is started: `priceUpdated` is true with the new amount owing — show it, then call again.\n\n**Who:** Any signed-in person.", "operationId": "postRegistrationsIdCheckout", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "id", "in": "path", "required": true, "description": "The id", "schema": { "type": "string", "minLength": 1, "maxLength": 64 } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "donationAmount": { "description": "An optional donation added on top, in rand", "type": "number", "minimum": 0, "maximum": 100000 }, "provider": { "description": "yoco or payfast (default: the first one switched on)", "type": "string", "maxLength": 40 }, "successUrl": { "type": "string", "maxLength": 2000, "format": "uri" }, "cancelUrl": { "type": "string", "maxLength": 2000, "format": "uri" }, "failureUrl": { "type": "string", "maxLength": 2000, "format": "uri" } } } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "oneOf": [ { "type": "object", "properties": { "priceUpdated": { "type": "boolean", "const": true }, "newBalance": { "type": "number" }, "message": { "type": "string" } }, "required": [ "priceUpdated", "newBalance", "message" ], "additionalProperties": false }, { "type": "object", "properties": { "priceUpdated": { "type": "boolean", "const": false }, "checkoutId": { "type": "string" }, "redirectUrl": { "type": "string" }, "provider": { "type": "string" }, "amount": { "type": "number", "description": "Charged now, in rand (with any donation)" } }, "required": [ "priceUpdated", "checkoutId", "redirectUrl", "provider", "amount" ], "additionalProperties": false } ] } }, "required": [ "data" ], "additionalProperties": false } } } }, "400": { "description": "Validation failed (VALIDATION_FAILED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "401": { "description": "Not signed in (UNAUTHENTICATED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Not found (NOT_FOUND)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/me": { "get": { "tags": [ "Me" ], "summary": "The signed-in person", "description": "**Who:** Any signed-in person.", "operationId": "getMe", "security": [ { "bearerAuth": [] } ], "parameters": [], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 64 }, "name": { "type": "string" }, "email": { "type": "string" }, "phone": { "type": [ "string", "null" ] }, "role": { "type": "string", "enum": [ "admin", "supervisor", "staff", "user" ] }, "twoFactorEnabled": { "type": "boolean" }, "notificationPreference": { "type": "string", "enum": [ "email", "whatsapp", "both" ] }, "homeCampusId": { "anyOf": [ { "type": "string", "minLength": 1, "maxLength": 64 }, { "type": "null" } ] }, "createdAt": { "type": "string", "format": "date-time", "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$" } }, "required": [ "id", "name", "email", "phone", "role", "twoFactorEnabled", "notificationPreference", "homeCampusId", "createdAt" ], "additionalProperties": false } }, "required": [ "data" ], "additionalProperties": false } } } }, "401": { "description": "Not signed in (UNAUTHENTICATED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } }, "patch": { "tags": [ "Me" ], "summary": "Change my details", "description": "Only what is sent changes. A new `password` needs `currentPassword`; it sends a security notice and stops other devices skipping the 2FA code. The answer has a fresh `token` (the old one keeps working).\n\n**Who:** Any signed-in person.", "operationId": "patchMe", "security": [ { "bearerAuth": [] } ], "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "name": { "type": "string", "minLength": 1, "maxLength": 200 }, "email": { "type": "string", "maxLength": 200, "format": "email", "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$" }, "phone": { "description": "null or empty removes it", "anyOf": [ { "type": "string", "maxLength": 40 }, { "type": "null" } ] }, "notificationPreference": { "type": "string", "enum": [ "email", "whatsapp", "both" ] }, "homeCampusId": { "description": "While campuses are on", "anyOf": [ { "type": "string", "minLength": 1, "maxLength": 64 }, { "type": "null" } ] }, "password": { "type": "string", "minLength": 8, "maxLength": 200 }, "currentPassword": { "type": "string", "maxLength": 200 } } } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 64 }, "name": { "type": "string" }, "email": { "type": "string" }, "phone": { "type": [ "string", "null" ] }, "role": { "type": "string", "enum": [ "admin", "supervisor", "staff", "user" ] }, "twoFactorEnabled": { "type": "boolean" }, "notificationPreference": { "type": "string", "enum": [ "email", "whatsapp", "both" ] }, "homeCampusId": { "anyOf": [ { "type": "string", "minLength": 1, "maxLength": 64 }, { "type": "null" } ] }, "createdAt": { "type": "string", "format": "date-time", "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$" } }, "required": [ "id", "name", "email", "phone", "role", "twoFactorEnabled", "notificationPreference", "homeCampusId", "createdAt" ], "additionalProperties": false }, "token": { "type": "string" } }, "required": [ "data", "token" ], "additionalProperties": false } } } }, "400": { "description": "Validation failed (VALIDATION_FAILED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "401": { "description": "Not signed in (UNAUTHENTICATED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/me/registrations": { "get": { "tags": [ "Me" ], "summary": "My registrations", "description": "Newest first. By default only ones for events that have not ended, and not cancelled; `past=true` lists everything.\n\n**Who:** Any signed-in person.", "operationId": "getMeRegistrations", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "page", "in": "query", "required": false, "description": "Page number, from 1", "schema": { "default": 1, "type": "integer", "minimum": 1, "maximum": 9007199254740991 } }, { "name": "limit", "in": "query", "required": false, "description": "Items per page (at most 100)", "schema": { "default": 25, "type": "integer", "minimum": 1, "maximum": 100 } }, { "name": "past", "in": "query", "required": false, "description": "Include past and cancelled registrations", "schema": { "default": "false", "type": "string", "enum": [ "true", "false" ] } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 64 }, "status": { "type": "string", "enum": [ "pending", "confirmed", "partial_paid", "paid", "cancelled" ] }, "createdAt": { "type": "string", "format": "date-time", "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$" }, "event": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 64 }, "title": { "type": "string" }, "startDate": { "type": "string", "format": "date-time", "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$" }, "endDate": { "type": "string", "format": "date-time", "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$" } }, "required": [ "id", "title", "startDate", "endDate" ], "additionalProperties": false }, "items": { "type": "array", "items": { "type": "object", "properties": { "ticket": { "type": "string" }, "variant": { "type": [ "string", "null" ] }, "quantity": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, "unitPrice": { "type": "number" } }, "required": [ "ticket", "variant", "quantity", "unitPrice" ], "additionalProperties": false } }, "totalDue": { "type": "number", "description": "In rand, after discounts" }, "amountPaid": { "type": "number", "description": "In rand (refunds subtracted)" }, "balance": { "type": "number", "description": "totalDue − amountPaid; 0 or less = nothing owing" } }, "required": [ "id", "status", "createdAt", "event", "items", "totalDue", "amountPaid", "balance" ], "additionalProperties": false } }, "meta": { "type": "object", "properties": { "page": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, "limit": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, "total": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991, "description": "Items across all pages" }, "pages": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991, "description": "Number of pages (at least 1)" } }, "required": [ "page", "limit", "total", "pages" ], "additionalProperties": false } }, "required": [ "data", "meta" ], "additionalProperties": false } } } }, "400": { "description": "Validation failed (VALIDATION_FAILED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "401": { "description": "Not signed in (UNAUTHENTICATED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/registrations/{id}/full": { "get": { "tags": [ "Registrations" ], "summary": "A registration with everything on it", "description": "Items and prices, payments, coupons and bundles, named attendees, form answers and the total due.\n\nThe owner, a named attendee or staff — or anyone with the link when not signed in (registration ids can't be guessed). Attendees' contact details are only shown to the payer and staff.\n\n**Who:** Anyone; signed-in staff may see more.", "operationId": "getRegistrationsIdFull", "security": [ {}, { "bearerAuth": [] } ], "parameters": [ { "name": "id", "in": "path", "required": true, "description": "The id", "schema": { "type": "string", "minLength": 1, "maxLength": 64 } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 64 }, "status": { "type": "string", "enum": [ "pending", "confirmed", "partial_paid", "paid", "cancelled" ] }, "eventId": { "type": "string", "minLength": 1, "maxLength": 64 }, "userId": { "type": "string", "minLength": 1, "maxLength": 64 }, "totalDueComputed": { "type": "number" } }, "required": [ "id", "status", "eventId", "userId" ], "additionalProperties": {} } }, "required": [ "data" ], "additionalProperties": false } } } }, "400": { "description": "Validation failed (VALIDATION_FAILED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Not found (NOT_FOUND)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/me/registrations/full": { "get": { "tags": [ "Me" ], "summary": "My registrations with everything on them", "description": "What the dashboard shows: as `/registrations/{id}/full`, newest first, with the event and its form. Only upcoming ones unless `past=true`.\n\n**Who:** Any signed-in person.", "operationId": "getMeRegistrationsFull", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "past", "in": "query", "required": false, "schema": { "default": "false", "type": "string", "enum": [ "true", "false" ] } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 64 }, "status": { "type": "string", "enum": [ "pending", "confirmed", "partial_paid", "paid", "cancelled" ] }, "eventId": { "type": "string", "minLength": 1, "maxLength": 64 }, "userId": { "type": "string", "minLength": 1, "maxLength": 64 }, "totalDueComputed": { "type": "number" } }, "required": [ "id", "status", "eventId", "userId" ], "additionalProperties": {} } } }, "required": [ "data" ], "additionalProperties": false } } } }, "400": { "description": "Validation failed (VALIDATION_FAILED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "401": { "description": "Not signed in (UNAUTHENTICATED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/registrations/{id}/items": { "put": { "tags": [ "Registrations" ], "summary": "Change the tickets on a registration", "description": "The whole list of items it should have. Added places need stock and are priced now; places already paid for keep their price, and nothing goes below tickets already issued or the amount paid.\n\nNot for registrations made with a season pass, nor once the event has ended or is closed. Staff can add kids and volunteer places; owners can only keep or lower them.\n\n**Who:** Any signed-in person.", "operationId": "putRegistrationsIdItems", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "id", "in": "path", "required": true, "description": "The id", "schema": { "type": "string", "minLength": 1, "maxLength": 64 } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "options": { "minItems": 1, "maxItems": 100, "type": "array", "items": { "type": "object", "properties": { "eventOptionId": { "type": "string", "minLength": 1, "maxLength": 64 }, "variantId": { "anyOf": [ { "type": "string", "minLength": 1, "maxLength": 64 }, { "type": "null" } ] }, "quantity": { "type": "integer", "minimum": 1, "maximum": 1000 } }, "required": [ "eventOptionId", "quantity" ] } } }, "required": [ "options" ] } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 64 }, "status": { "type": "string", "enum": [ "pending", "confirmed", "partial_paid", "paid", "cancelled" ] }, "eventId": { "type": "string", "minLength": 1, "maxLength": 64 }, "userId": { "type": "string", "minLength": 1, "maxLength": 64 }, "totalDueComputed": { "type": "number" } }, "required": [ "id", "status", "eventId", "userId" ], "additionalProperties": {} } }, "required": [ "data" ], "additionalProperties": false } } } }, "400": { "description": "Validation failed (VALIDATION_FAILED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "401": { "description": "Not signed in (UNAUTHENTICATED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Not found (NOT_FOUND)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/registrations/{id}/invoice": { "post": { "tags": [ "Registrations" ], "summary": "Send me the invoice again", "description": "**Who:** Any signed-in person.", "operationId": "postRegistrationsIdInvoice", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "id", "in": "path", "required": true, "description": "The id", "schema": { "type": "string", "minLength": 1, "maxLength": 64 } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "channel": { "default": "email", "type": "string", "enum": [ "email", "whatsapp" ] } } } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "message": { "type": "string" } }, "required": [ "message" ], "additionalProperties": {} } }, "required": [ "data" ], "additionalProperties": false } } } }, "400": { "description": "Validation failed (VALIDATION_FAILED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "401": { "description": "Not signed in (UNAUTHENTICATED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Not found (NOT_FOUND)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/registrations/{id}/coupon": { "post": { "tags": [ "Registrations" ], "summary": "Apply a coupon code", "description": "By the owner, or by staff on their behalf (logged). Not on season pass registrations.\n\n**Who:** Any signed-in person.", "operationId": "postRegistrationsIdCoupon", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "id", "in": "path", "required": true, "description": "The id", "schema": { "type": "string", "minLength": 1, "maxLength": 64 } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string", "minLength": 1, "maxLength": 40 } }, "required": [ "code" ] } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 64 }, "status": { "type": "string", "enum": [ "pending", "confirmed", "partial_paid", "paid", "cancelled" ] }, "eventId": { "type": "string", "minLength": 1, "maxLength": 64 }, "userId": { "type": "string", "minLength": 1, "maxLength": 64 }, "totalDueComputed": { "type": "number" }, "message": { "type": "string" } }, "required": [ "id", "status", "eventId", "userId", "message" ], "additionalProperties": {} } }, "required": [ "data" ], "additionalProperties": false } } } }, "400": { "description": "Validation failed (VALIDATION_FAILED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "401": { "description": "Not signed in (UNAUTHENTICATED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Not found (NOT_FOUND)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } }, "delete": { "tags": [ "Registrations" ], "summary": "Take a coupon code off", "description": "Staff. Its use is freed. Not once a ticket on it has been scanned; unused tickets are withdrawn if it's no longer paid.\n\n**Who:** Staff, supervisors and admins.", "operationId": "deleteRegistrationsIdCoupon", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "id", "in": "path", "required": true, "description": "The id", "schema": { "type": "string", "minLength": 1, "maxLength": 64 } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "message": { "type": "string" } }, "required": [ "message" ], "additionalProperties": {} } }, "required": [ "data" ], "additionalProperties": false } } } }, "400": { "description": "Validation failed (VALIDATION_FAILED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "401": { "description": "Not signed in (UNAUTHENTICATED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "Not allowed for this role (FORBIDDEN)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Not found (NOT_FOUND)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/registrations/{id}/attendees": { "put": { "tags": [ "Registrations" ], "summary": "Name the people on a registration", "description": "The whole list: attendees left out are removed (not once their ticket has been scanned). `ticketDelivery` says who gets the tickets.\n\n**Who:** Any signed-in person.", "operationId": "putRegistrationsIdAttendees", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "id", "in": "path", "required": true, "description": "The id", "schema": { "type": "string", "minLength": 1, "maxLength": 64 } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "attendees": { "maxItems": 1000, "type": "array", "items": { "type": "object", "properties": { "id": { "description": "An attendee already on it (left out = removed)", "type": "string", "minLength": 1, "maxLength": 64 }, "eventOptionId": { "type": "string", "minLength": 1, "maxLength": 64 }, "variantId": { "anyOf": [ { "type": "string", "minLength": 1, "maxLength": 64 }, { "type": "null" } ] }, "name": { "type": "string", "maxLength": 200 } }, "required": [ "eventOptionId", "name" ], "additionalProperties": {} } }, "ticketDelivery": { "type": "string", "enum": [ "payer", "each" ] } }, "required": [ "attendees" ] } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 64 }, "ticketDelivery": { "type": [ "string", "null" ] }, "attendees": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 64 }, "name": { "type": "string" } }, "required": [ "id", "name" ], "additionalProperties": {} } } }, "required": [ "id", "ticketDelivery", "attendees" ], "additionalProperties": {} } }, "required": [ "data" ], "additionalProperties": false } } } }, "400": { "description": "Validation failed (VALIDATION_FAILED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "401": { "description": "Not signed in (UNAUTHENTICATED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Not found (NOT_FOUND)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/registrations/{id}/attendees/{attendeeId}/form-link": { "post": { "tags": [ "Registrations" ], "summary": "Send an attendee their form", "description": "A link to fill in their own attendee form, by email and/or WhatsApp.\n\n**Who:** Any signed-in person.", "operationId": "postRegistrationsIdAttendeesAttendeeIdForm-link", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "type": "string", "minLength": 1, "maxLength": 64 } }, { "name": "attendeeId", "in": "path", "required": true, "schema": { "type": "string", "minLength": 1, "maxLength": 64 } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "message": { "type": "string" } }, "required": [ "message" ], "additionalProperties": {} } }, "required": [ "data" ], "additionalProperties": false } } } }, "400": { "description": "Validation failed (VALIDATION_FAILED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "401": { "description": "Not signed in (UNAUTHENTICATED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Not found (NOT_FOUND)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/registrations/{id}/form-draft": { "get": { "tags": [ "Registrations" ], "summary": "Attendee forms saved part-way", "description": "**Who:** Anyone; signed-in staff may see more.", "operationId": "getRegistrationsIdForm-draft", "security": [ {}, { "bearerAuth": [] } ], "parameters": [ { "name": "id", "in": "path", "required": true, "description": "The id", "schema": { "type": "string", "minLength": 1, "maxLength": 64 } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "data": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "updatedAt": { "type": [ "string", "null" ] } }, "required": [ "data", "updatedAt" ], "additionalProperties": false } }, "required": [ "data" ], "additionalProperties": false } } } }, "400": { "description": "Validation failed (VALIDATION_FAILED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Not found (NOT_FOUND)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } }, "put": { "tags": [ "Registrations" ], "summary": "Save attendee forms part-way", "description": "Kept for the registration's owner (also when staff save it), until the forms are submitted.\n\n**Who:** Anyone; signed-in staff may see more.", "operationId": "putRegistrationsIdForm-draft", "security": [ {}, { "bearerAuth": [] } ], "parameters": [ { "name": "id", "in": "path", "required": true, "description": "The id", "schema": { "type": "string", "minLength": 1, "maxLength": 64 } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } }, "required": [ "data" ] } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "message": { "type": "string" }, "updatedAt": { "type": "string" } }, "required": [ "message", "updatedAt" ], "additionalProperties": false } }, "required": [ "data" ], "additionalProperties": false } } } }, "400": { "description": "Validation failed (VALIDATION_FAILED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Not found (NOT_FOUND)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/registrations/{id}/form-responses": { "post": { "tags": [ "Registrations" ], "summary": "Submit attendee forms", "description": "One response per main ticket at most; each named attendee answers once. Tickets are issued once it's paid and the forms are in.\n\n**Who:** Anyone; signed-in staff may see more.", "operationId": "postRegistrationsIdForm-responses", "security": [ {}, { "bearerAuth": [] } ], "parameters": [ { "name": "id", "in": "path", "required": true, "description": "The id", "schema": { "type": "string", "minLength": 1, "maxLength": 64 } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "responses": { "maxItems": 500, "type": "array", "items": { "type": "object", "properties": { "attendeeId": { "description": "The named attendee this form is for", "anyOf": [ { "type": "string", "minLength": 1, "maxLength": 64 }, { "type": "null" } ] }, "answers": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {}, "description": "Field id → answer (stored as text)" } }, "required": [ "answers" ] } } }, "required": [ "responses" ] } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "message": { "type": "string" }, "count": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 } }, "required": [ "message" ], "additionalProperties": {} } }, "required": [ "data" ], "additionalProperties": false } } } }, "400": { "description": "Validation failed (VALIDATION_FAILED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Not found (NOT_FOUND)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } }, "put": { "tags": [ "Registrations" ], "summary": "Replace the attendee forms", "description": "Supervisors: every response on the registration is replaced by these.\n\n**Who:** Supervisors and admins.", "operationId": "putRegistrationsIdForm-responses", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "id", "in": "path", "required": true, "description": "The id", "schema": { "type": "string", "minLength": 1, "maxLength": 64 } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "responses": { "maxItems": 500, "type": "array", "items": { "type": "object", "properties": { "attendeeId": { "description": "The named attendee this form is for", "anyOf": [ { "type": "string", "minLength": 1, "maxLength": 64 }, { "type": "null" } ] }, "answers": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {}, "description": "Field id → answer (stored as text)" } }, "required": [ "answers" ] } } }, "required": [ "responses" ] } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "message": { "type": "string" } }, "required": [ "message" ], "additionalProperties": {} } }, "required": [ "data" ], "additionalProperties": false } } } }, "400": { "description": "Validation failed (VALIDATION_FAILED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "401": { "description": "Not signed in (UNAUTHENTICATED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "Not allowed for this role (FORBIDDEN)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Not found (NOT_FOUND)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/events/{id}/registrations": { "get": { "tags": [ "Registrations" ], "summary": "An event's registrations", "description": "Oldest first, with tickets, payments and attendees. `search` matches the name, email or phone.\n\n**Who:** Staff, supervisors and admins.", "operationId": "getEventsIdRegistrations", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "id", "in": "path", "required": true, "description": "The id", "schema": { "type": "string", "minLength": 1, "maxLength": 64 } }, { "name": "search", "in": "query", "required": false, "schema": { "type": "string", "maxLength": 200 } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 64 }, "status": { "type": "string", "enum": [ "pending", "confirmed", "partial_paid", "paid", "cancelled" ] }, "eventId": { "type": "string", "minLength": 1, "maxLength": 64 }, "userId": { "type": "string", "minLength": 1, "maxLength": 64 }, "totalDueComputed": { "type": "number" } }, "required": [ "id", "status", "eventId", "userId" ], "additionalProperties": {} } } }, "required": [ "data" ], "additionalProperties": false } } } }, "400": { "description": "Validation failed (VALIDATION_FAILED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "401": { "description": "Not signed in (UNAUTHENTICATED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "Not allowed for this role (FORBIDDEN)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Not found (NOT_FOUND)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/registrations/{id}/status": { "patch": { "tags": [ "Registrations" ], "summary": "Set a registration's status", "description": "Staff. `paid` issues and sends the tickets; leaving `paid` withdraws unused tickets (refused once one has been scanned); `cancelled` frees its places for the waitlist.\n\n**Who:** Staff, supervisors and admins.", "operationId": "patchRegistrationsIdStatus", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "id", "in": "path", "required": true, "description": "The id", "schema": { "type": "string", "minLength": 1, "maxLength": 64 } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "status": { "type": "string", "enum": [ "pending", "confirmed", "partial_paid", "paid", "cancelled" ] } }, "required": [ "status" ] } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 64 }, "status": { "type": "string", "enum": [ "pending", "confirmed", "partial_paid", "paid", "cancelled" ] }, "eventId": { "type": "string", "minLength": 1, "maxLength": 64 }, "userId": { "type": "string", "minLength": 1, "maxLength": 64 }, "totalDueComputed": { "type": "number" } }, "required": [ "id", "status", "eventId", "userId" ], "additionalProperties": {} } }, "required": [ "data" ], "additionalProperties": false } } } }, "400": { "description": "Validation failed (VALIDATION_FAILED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "401": { "description": "Not signed in (UNAUTHENTICATED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "Not allowed for this role (FORBIDDEN)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Not found (NOT_FOUND)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/registrations/manual": { "post": { "tags": [ "Registrations" ], "summary": "Register someone (at the door, by phone)", "description": "Supervisors. Finds the person by email or phone (refused when those are two different accounts) or makes an account and sends them an activation link (`skipActivationNotice` to not).\n\nAdded to their existing registration for the event if they have one. Free ones are marked paid and get their tickets; otherwise they're sent a link to pay.\n\n**Who:** Supervisors and admins.", "operationId": "postRegistrationsManual", "security": [ { "bearerAuth": [] } ], "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "eventId": { "type": "string", "minLength": 1, "maxLength": 64 }, "options": { "minItems": 1, "maxItems": 100, "type": "array", "items": { "type": "object", "properties": { "eventOptionId": { "type": "string", "minLength": 1, "maxLength": 64 }, "variantId": { "anyOf": [ { "type": "string", "minLength": 1, "maxLength": 64 }, { "type": "null" } ] }, "quantity": { "type": "integer", "minimum": 1, "maximum": 1000 }, "sessionIds": { "maxItems": 200, "type": "array", "items": { "type": "string", "minLength": 1, "maxLength": 64 } } }, "required": [ "eventOptionId", "quantity" ] } }, "user": { "type": "object", "properties": { "name": { "type": "string", "minLength": 1, "maxLength": 200 }, "email": { "anyOf": [ { "type": "string", "maxLength": 200 }, { "type": "null" } ] }, "phoneNumber": { "anyOf": [ { "type": "string", "maxLength": 40 }, { "type": "null" } ] }, "password": { "description": "Self-service kiosk: the visitor sets it, and the account is active at once", "type": "string", "maxLength": 200 } }, "required": [ "name" ], "additionalProperties": {} }, "notificationPreference": { "type": "string", "enum": [ "email", "whatsapp", "both" ] }, "skipActivationNotice": { "type": "boolean" }, "couponCode": { "type": "string", "maxLength": 40 }, "attendees": { "maxItems": 1000, "type": "array", "items": { "type": "object", "properties": { "id": { "description": "An attendee already on it (left out = removed)", "type": "string", "minLength": 1, "maxLength": 64 }, "eventOptionId": { "type": "string", "minLength": 1, "maxLength": 64 }, "variantId": { "anyOf": [ { "type": "string", "minLength": 1, "maxLength": 64 }, { "type": "null" } ] }, "name": { "type": "string", "maxLength": 200 } }, "required": [ "eventOptionId", "name" ], "additionalProperties": {} } }, "ticketDelivery": { "type": "string", "enum": [ "payer", "each" ] } }, "required": [ "eventId", "options", "user" ], "additionalProperties": {} } } } }, "responses": { "201": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 64 }, "status": { "type": "string", "enum": [ "pending", "confirmed", "partial_paid", "paid", "cancelled" ] }, "eventId": { "type": "string", "minLength": 1, "maxLength": 64 }, "userId": { "type": "string", "minLength": 1, "maxLength": 64 }, "totalDueComputed": { "type": "number" }, "couponError": { "type": "string" } }, "required": [ "id", "status", "eventId", "userId" ], "additionalProperties": {} } }, "required": [ "data" ], "additionalProperties": false } } } }, "400": { "description": "Validation failed (VALIDATION_FAILED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "401": { "description": "Not signed in (UNAUTHENTICATED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "Not allowed for this role (FORBIDDEN)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/registrations/bulk": { "post": { "tags": [ "Registrations" ], "summary": "Do one thing to many registrations", "description": "`markPaid`, `cancel`, `moveOption`, `allocate` or `message`, for up to 500 you may manage. Each is done on its own: the answer lists what worked and what didn't.\n\n**Who:** Supervisors and admins.", "operationId": "postRegistrationsBulk", "security": [ { "bearerAuth": [] } ], "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "action": { "type": "string", "enum": [ "markPaid", "cancel", "moveOption", "allocate", "message" ] }, "registrationIds": { "minItems": 1, "maxItems": 500, "type": "array", "items": { "type": "string", "minLength": 1, "maxLength": 64 } } }, "required": [ "action", "registrationIds" ], "additionalProperties": {} } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": {}, "additionalProperties": {} } }, "required": [ "data" ], "additionalProperties": false } } } }, "400": { "description": "Validation failed (VALIDATION_FAILED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "401": { "description": "Not signed in (UNAUTHENTICATED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "Not allowed for this role (FORBIDDEN)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/checkin/{qrCode}": { "get": { "tags": [ "Check-in" ], "summary": "Look a ticket up before checking it in", "description": "Who it is for, how many are left to check in (for today's session on multi-day events, or `sessionId`), and parental consent. Nothing is changed.\n\n**Who:** Staff, supervisors and admins.", "operationId": "getCheckinQrCode", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "qrCode", "in": "path", "required": true, "description": "The code in the ticket's QR", "schema": { "type": "string", "minLength": 1, "maxLength": 200 } }, { "name": "sessionId", "in": "query", "required": false, "description": "Multi-day events: the session (default: today's)", "schema": { "type": "string", "minLength": 1, "maxLength": 64 } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "outcome": { "type": "string", "enum": [ "found", "transferred" ] }, "message": { "description": "For a transferred ticket: who has it now", "type": [ "string", "null" ] }, "ticket": { "anyOf": [ { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 64 }, "eventId": { "type": "string", "minLength": 1, "maxLength": 64 }, "eventTitle": { "type": [ "string", "null" ] }, "ticketOptionId": { "anyOf": [ { "type": "string", "minLength": 1, "maxLength": 64 }, { "type": "null" } ], "description": "For section checks" }, "ticketName": { "type": [ "string", "null" ] }, "variant": { "type": [ "string", "null" ] }, "attendee": { "description": "The attendee named on it, if any", "type": [ "string", "null" ] }, "bookedBy": { "description": "Who registered", "type": [ "string", "null" ] }, "quantity": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, "remaining": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991, "description": "Still to check in (this session, on multi-day events)" }, "session": { "anyOf": [ { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 64 }, "label": { "type": "string" } }, "required": [ "id", "label" ], "additionalProperties": false }, { "type": "null" } ] }, "sessionError": { "description": "Why no session is open for check-in now", "type": [ "string", "null" ] }, "consentStatus": { "type": "string", "description": "not_required, given, pending, declined or missing" } }, "required": [ "id", "eventId", "eventTitle", "ticketOptionId", "ticketName", "variant", "attendee", "bookedBy", "quantity", "remaining", "session", "sessionError", "consentStatus" ], "additionalProperties": false }, { "type": "null" } ] } }, "required": [ "outcome", "message", "ticket" ], "additionalProperties": false } }, "required": [ "data" ], "additionalProperties": false } } } }, "400": { "description": "Validation failed (VALIDATION_FAILED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "401": { "description": "Not signed in (UNAUTHENTICATED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "Not allowed for this role (FORBIDDEN)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Not found (NOT_FOUND)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } }, "post": { "tags": [ "Check-in" ], "summary": "Check a ticket in", "description": "Checks in everyone left on the ticket, or `people`. Every normal result is a 200 with an `outcome`:\n\n`checked_in`, `already_used`, `consent_required` (a supervisor can resend with `overrideConsent`, which is logged), `wrong_event`, `wrong_section`, `section_not_found`, `no_session` (multi-day: nothing open now), `locked` (offline-locked to another device) or `transferred` (handed on; `message` says to whom).\n\nAn unknown code is `NOT_FOUND`.\n\n**Who:** Staff, supervisors and admins.", "operationId": "postCheckinQrCode", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "qrCode", "in": "path", "required": true, "description": "The code in the ticket's QR", "schema": { "type": "string", "minLength": 1, "maxLength": 200 } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "eventId": { "description": "Refuse tickets for any other event", "type": "string", "minLength": 1, "maxLength": 64 }, "sectionId": { "description": "Only tickets valid for this section", "type": "string", "minLength": 1, "maxLength": 64 }, "sessionId": { "description": "Multi-day events: the session (default: today's)", "type": "string", "minLength": 1, "maxLength": 64 }, "people": { "description": "How many to check in (default: everyone left)", "type": "integer", "minimum": 1, "maximum": 10000 }, "overrideConsent": { "type": "boolean" }, "deviceId": { "description": "This scanner, so its own offline lock doesn't block it", "type": "string", "maxLength": 200 } } } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "outcome": { "type": "string", "enum": [ "checked_in", "already_used", "consent_required", "wrong_event", "wrong_section", "section_not_found", "no_session", "locked", "transferred" ] }, "message": { "type": "string" }, "ticket": { "anyOf": [ { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 64 }, "eventId": { "type": "string", "minLength": 1, "maxLength": 64 }, "eventTitle": { "type": [ "string", "null" ] }, "ticketName": { "description": "The ticket option, e.g. \"Adult\"", "type": [ "string", "null" ] }, "quantity": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991, "description": "People on this ticket" } }, "required": [ "id", "eventId", "eventTitle", "ticketName", "quantity" ], "additionalProperties": false }, { "type": "null" } ] }, "checkedIn": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991, "description": "People checked in by this request (0 unless checked_in)" }, "remaining": { "anyOf": [ { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, { "type": "null" } ], "description": "Still to check in afterwards" }, "session": { "anyOf": [ { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 64 }, "label": { "type": "string" } }, "required": [ "id", "label" ], "additionalProperties": false }, { "type": "null" } ] }, "consentStatus": { "type": [ "string", "null" ] }, "canOverride": { "type": "boolean", "description": "consent_required: whether you may override" } }, "required": [ "outcome", "message", "ticket", "checkedIn", "remaining", "session", "consentStatus", "canOverride" ], "additionalProperties": false } }, "required": [ "data" ], "additionalProperties": false } } } }, "400": { "description": "Validation failed (VALIDATION_FAILED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "401": { "description": "Not signed in (UNAUTHENTICATED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "Not allowed for this role (FORBIDDEN)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Not found (NOT_FOUND)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/auth/signup": { "post": { "tags": [ "Accounts" ], "summary": "Create an account", "description": "Signs the new account in straight away. `acceptTerms` must be true (the Terms of Use and Privacy Policy); `newsOptIn` is the unticked \"News & announcements\" box.\n\n**Who:** Anyone.", "operationId": "postAuthSignup", "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "name": { "type": "string", "minLength": 1, "maxLength": 200 }, "email": { "type": "string", "maxLength": 200, "format": "email", "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$" }, "password": { "type": "string", "minLength": 8, "maxLength": 200 }, "phone": { "type": "string", "maxLength": 40 }, "notificationPreference": { "description": "WhatsApp needs a valid South African number; otherwise email is used", "type": "string", "enum": [ "email", "whatsapp", "both" ] }, "newsOptIn": { "type": "boolean" }, "acceptTerms": { "type": "boolean", "const": true } }, "required": [ "name", "email", "password", "acceptTerms" ] } } } }, "responses": { "201": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "status": { "type": "string", "const": "signed_in" }, "token": { "type": "string", "description": "Send as `Authorization: Bearer `" }, "user": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 64 }, "name": { "type": "string" }, "email": { "type": "string" }, "role": { "type": "string", "enum": [ "admin", "supervisor", "staff", "user" ] } }, "required": [ "id", "name", "email", "role" ], "additionalProperties": false }, "newsPromptPending": { "type": "boolean", "description": "Ask once whether they want News & announcements" }, "noticePromptPending": { "anyOf": [ { "type": "boolean", "const": false }, { "type": "string", "enum": [ "first", "updated" ] } ], "description": "A privacy notice they must accept: never accepted (first) or a newer version (updated)" }, "deviceToken": { "description": "With rememberDevice: send it with the next login to skip the code on this device", "type": "string" } }, "required": [ "status", "token", "user", "newsPromptPending", "noticePromptPending" ], "additionalProperties": false } }, "required": [ "data" ], "additionalProperties": false } } } }, "400": { "description": "Validation failed (VALIDATION_FAILED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/auth/login": { "post": { "tags": [ "Accounts" ], "summary": "Log in", "description": "With an email address or phone number. Five wrong passwords lock the account for five minutes (`RATE_LIMITED`).\n\nWith two-factor authentication (always for supervisors and admins), the answer is `code_required`: a code was sent by email or WhatsApp — finish with `POST /auth/login/code`.\n\n**Who:** Anyone.", "operationId": "postAuthLogin", "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "identifier": { "type": "string", "minLength": 1, "maxLength": 200, "description": "Email address or phone number" }, "password": { "type": "string", "minLength": 1, "maxLength": 200 }, "deviceToken": { "description": "From an earlier login with rememberDevice", "type": "string", "maxLength": 500 } }, "required": [ "identifier", "password" ] } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "oneOf": [ { "type": "object", "properties": { "status": { "type": "string", "const": "signed_in" }, "token": { "type": "string", "description": "Send as `Authorization: Bearer `" }, "user": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 64 }, "name": { "type": "string" }, "email": { "type": "string" }, "role": { "type": "string", "enum": [ "admin", "supervisor", "staff", "user" ] } }, "required": [ "id", "name", "email", "role" ], "additionalProperties": false }, "newsPromptPending": { "type": "boolean", "description": "Ask once whether they want News & announcements" }, "noticePromptPending": { "anyOf": [ { "type": "boolean", "const": false }, { "type": "string", "enum": [ "first", "updated" ] } ], "description": "A privacy notice they must accept: never accepted (first) or a newer version (updated)" }, "deviceToken": { "description": "With rememberDevice: send it with the next login to skip the code on this device", "type": "string" } }, "required": [ "status", "token", "user", "newsPromptPending", "noticePromptPending" ], "additionalProperties": false }, { "type": "object", "properties": { "status": { "type": "string", "const": "code_required" }, "challengeId": { "type": "string" }, "method": { "type": "string", "enum": [ "email", "whatsapp" ] }, "destination": { "description": "Where the code went, partly hidden", "type": [ "string", "null" ] }, "enrolling": { "type": "boolean", "description": "true = this turns two-factor on (required for the role)" } }, "required": [ "status", "challengeId", "method", "destination", "enrolling" ], "additionalProperties": false } ] } }, "required": [ "data" ], "additionalProperties": false } } } }, "400": { "description": "Validation failed (VALIDATION_FAILED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/auth/login/code": { "post": { "tags": [ "Accounts" ], "summary": "Finish logging in with the code", "description": "**Who:** Anyone.", "operationId": "postAuthLoginCode", "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "challengeId": { "type": "string", "minLength": 1, "maxLength": 100 }, "code": { "type": "string", "minLength": 4, "maxLength": 12 }, "rememberDevice": { "description": "Skip the code on this device next time (30 days)", "type": "boolean" } }, "required": [ "challengeId", "code" ] } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "status": { "type": "string", "const": "signed_in" }, "token": { "type": "string", "description": "Send as `Authorization: Bearer `" }, "user": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 64 }, "name": { "type": "string" }, "email": { "type": "string" }, "role": { "type": "string", "enum": [ "admin", "supervisor", "staff", "user" ] } }, "required": [ "id", "name", "email", "role" ], "additionalProperties": false }, "newsPromptPending": { "type": "boolean", "description": "Ask once whether they want News & announcements" }, "noticePromptPending": { "anyOf": [ { "type": "boolean", "const": false }, { "type": "string", "enum": [ "first", "updated" ] } ], "description": "A privacy notice they must accept: never accepted (first) or a newer version (updated)" }, "deviceToken": { "description": "With rememberDevice: send it with the next login to skip the code on this device", "type": "string" } }, "required": [ "status", "token", "user", "newsPromptPending", "noticePromptPending" ], "additionalProperties": false } }, "required": [ "data" ], "additionalProperties": false } } } }, "400": { "description": "Validation failed (VALIDATION_FAILED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } } }, "components": { "securitySchemes": { "bearerAuth": { "type": "http", "scheme": "bearer", "bearerFormat": "JWT" } }, "schemas": { "Error": { "type": "object", "required": [ "error" ], "properties": { "error": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string", "enum": [ "VALIDATION_FAILED", "UNAUTHENTICATED", "FORBIDDEN", "NOT_FOUND", "CONFLICT", "RATE_LIMITED", "READ_ONLY", "INTERNAL" ] }, "message": { "type": "string" }, "fields": { "type": "object", "additionalProperties": { "type": "string" }, "description": "Per-field problems (VALIDATION_FAILED only)" }, "reason": { "type": "string", "description": "A more specific cause when there is one, e.g. TWO_FACTOR_REQUIRED, IMPERSONATION_ENDED, LICENCE_READ_ONLY, OTHER_CAMPUS" } } } } } } } }