{ "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/…`) was removed in 2.0: its addresses answer `410 Gone`. See the migration guide (MIGRATING-TO-2.md)." }, "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": "Payments" }, { "name": "Cash-ups" }, { "name": "Waitlist" }, { "name": "Sponsorship" }, { "name": "Consent" }, { "name": "Feedback" }, { "name": "Tickets" }, { "name": "Check-in" }, { "name": "Attendance" }, { "name": "Allocations" }, { "name": "Corrections" }, { "name": "Kids" }, { "name": "Volunteers" }, { "name": "Accounts" }, { "name": "Messaging" }, { "name": "WhatsApp" }, { "name": "Site" }, { "name": "Dashboard" }, { "name": "Reports" }, { "name": "Privacy" }, { "name": "Webhooks" }, { "name": "AI" } ], "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": { "sets": { "type": "number", "description": "Allocation sets copied" }, "groups": { "type": "number", "description": "Groups copied" }, "costs": { "type": "number", "description": "Costs copied (admins)" } }, "required": [ "sets", "groups", "costs" ], "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, "description": "The id", "schema": { "type": "string", "minLength": 1, "maxLength": 64 } }, { "name": "attachmentId", "in": "path", "required": true, "description": "The attachment's 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" } } } } } } }, "/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, "description": "Only this event", "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, "description": "The short name in the address", "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": { "series": { "type": "object", "properties": {}, "additionalProperties": {} }, "events": { "type": "array", "items": { "type": "object", "properties": { "eventId": { "type": "string" }, "title": { "type": "string" }, "startDate": { "type": "string", "description": "Date and time (ISO 8601)" }, "endDate": { "type": "string", "description": "Date and time (ISO 8601)" }, "campus": { "anyOf": [ { "type": "object", "properties": {}, "additionalProperties": {} }, { "type": "null" } ] }, "isActive": { "type": "boolean" }, "sessions": { "type": [ "number", "null" ] }, "registrations": { "type": "number" }, "tickets": { "type": "number" }, "income": { "type": "number", "description": "Rand" }, "checkedIn": { "type": "number" }, "attendanceRate": { "description": "%", "type": [ "number", "null" ] }, "change": { "anyOf": [ { "type": "object", "properties": { "registrations": { "description": "% change from the year before", "type": [ "number", "null" ] }, "tickets": { "description": "% change from the year before", "type": [ "number", "null" ] }, "income": { "description": "% change from the year before", "type": [ "number", "null" ] }, "checkedIn": { "description": "% change from the year before", "type": [ "number", "null" ] } }, "additionalProperties": {} }, { "type": "null" } ] } }, "required": [ "eventId", "title", "startDate", "endDate", "isActive", "registrations", "tickets", "income", "checkedIn", "change" ], "additionalProperties": {} } } }, "required": [ "series", "events" ], "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, "description": "Only this event series", "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": { "purchaseId": { "type": "string" }, "total": { "type": "number", "description": "Rand" }, "paid": { "type": "boolean", "description": "Free: the tickets are issued straight away" }, "redirectUrl": { "description": "Where to send them to pay", "type": [ "string", "null" ] }, "provider": { "type": [ "string", "null" ] }, "message": { "type": [ "string", "null" ] } }, "required": [ "purchaseId", "total", "paid" ], "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": { "redirectUrl": { "type": [ "string", "null" ] }, "provider": { "type": [ "string", "null" ] }, "message": { "type": [ "string", "null" ] } }, "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, "description": "On or after (ISO date or date-time)", "schema": { "type": "string", "maxLength": 40 } }, { "name": "to", "in": "query", "required": false, "description": "On or before (ISO date or date-time)", "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, "description": "The short name in the address", "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, "description": "`true`: also people registered for its events in the last 12 months", "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, "description": "Page number, from 1", "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, "description": "`true`: only ones with money still owed", "schema": { "default": "false", "type": "string", "enum": [ "true", "false" ] } }, { "name": "userId", "in": "query", "required": false, "description": "Only this person", "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": "With what the app asks after sign-in (`newsPromptPending`, `noticePromptPending`), whether two-step sign-in is required for their role, and the campuses they're limited to (`campusScope`, null = every campus). Viewing as someone else never prompts.\n\n**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))$" }, "twoFactorRequired": { "type": "boolean", "description": "Their role must use two-step sign-in" }, "newsPromptPending": { "type": "boolean" }, "noticePromptPending": { "anyOf": [ { "type": "boolean", "const": false }, { "type": "string", "enum": [ "first", "updated" ] } ] }, "campusScope": { "anyOf": [ { "type": "array", "items": { "type": "string", "minLength": 1, "maxLength": 64 } }, { "type": "null" } ] } }, "required": [ "id", "name", "email", "phone", "role", "twoFactorEnabled", "notificationPreference", "homeCampusId", "createdAt", "twoFactorRequired", "newsPromptPending", "noticePromptPending", "campusScope" ], "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, "description": "`true`: include ones that are over too", "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, "description": "The id", "schema": { "type": "string", "minLength": 1, "maxLength": 64 } }, { "name": "attendeeId", "in": "path", "required": true, "description": "The named attendee's 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" } } } }, "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, "description": "Text to search for", "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": { "description": "email, whatsapp or both (anything else: worked out from the contact details given)", "anyOf": [ { "type": "string", "maxLength": 20 }, { "type": "null" } ] }, "skipActivationNotice": { "type": "boolean" }, "couponCode": { "anyOf": [ { "type": "string", "maxLength": 40 }, { "type": "null" } ] }, "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 } }, "method": { "description": "markPaid: cash, eft, card or other", "type": [ "string", "null" ] }, "paidAt": { "description": "markPaid", "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "fromOptionId": { "description": "moveOption", "type": [ "string", "null" ] }, "toOptionId": { "description": "moveOption", "type": [ "string", "null" ] }, "setId": { "description": "allocate", "type": [ "string", "null" ] }, "groupId": { "description": "allocate", "type": [ "string", "null" ] }, "channel": { "description": "message", "type": "string", "enum": [ "email", "whatsapp" ] }, "subject": { "description": "message (email)", "type": [ "string", "null" ] }, "text": { "description": "message", "type": [ "string", "null" ] } }, "required": [ "action", "registrationIds" ], "additionalProperties": {} } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "action": { "type": "string" }, "done": { "type": "number" }, "skipped": { "type": "number" }, "failed": { "type": "number" }, "results": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "ok": { "type": "boolean" }, "skipped": { "type": [ "boolean", "null" ] }, "message": { "type": [ "string", "null" ] } }, "required": [ "id", "ok" ], "additionalProperties": {} } } }, "required": [ "action", "done", "skipped", "failed", "results" ], "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" } } } } } } }, "/payments/providers": { "get": { "tags": [ "Payments" ], "summary": "The payment providers switched on", "description": "**Who:** Anyone.", "operationId": "getPaymentsProviders", "parameters": [], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "providers": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "description": "yoco, payfast" }, "label": { "type": "string" } }, "required": [ "id", "label" ], "additionalProperties": {} } }, "minimumAmount": { "type": "number", "description": "Smallest online payment" } }, "required": [ "providers", "minimumAmount" ], "additionalProperties": {} } }, "required": [ "data" ], "additionalProperties": false } } } } } } }, "/payments/providers/settings": { "get": { "tags": [ "Payments" ], "summary": "Payment provider settings", "description": "Admins. Keys are masked.\n\n**Who:** Admins only.", "operationId": "getPaymentsProvidersSettings", "security": [ { "bearerAuth": [] } ], "parameters": [], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "providers": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "label": { "type": "string" }, "enabled": { "type": "boolean" }, "configured": { "type": "boolean", "description": "Its keys are set up" }, "capabilities": { "type": "object", "properties": {}, "additionalProperties": {}, "description": "What the provider can do, e.g. look payments up" } }, "required": [ "id", "label", "enabled", "configured", "capabilities" ], "additionalProperties": {} } }, "minimumAmount": { "type": "number", "description": "Rand" } }, "required": [ "providers", "minimumAmount" ], "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" } } } } } }, "put": { "tags": [ "Payments" ], "summary": "Change payment provider settings", "description": "**Who:** Admins only.", "operationId": "putPaymentsProvidersSettings", "security": [ { "bearerAuth": [] } ], "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "providers": { "minItems": 1, "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "enabled": { "type": "boolean" } }, "required": [ "id", "enabled" ], "additionalProperties": {} }, "description": "Every provider, in the order to offer them" } }, "required": [ "providers" ], "additionalProperties": {} } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "message": { "type": "string" }, "providers": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "label": { "type": "string" }, "enabled": { "type": "boolean" }, "configured": { "type": "boolean", "description": "Its keys are set up" }, "capabilities": { "type": "object", "properties": {}, "additionalProperties": {}, "description": "What the provider can do, e.g. look payments up" } }, "required": [ "id", "label", "enabled", "configured", "capabilities" ], "additionalProperties": {} } } }, "required": [ "message", "providers" ], "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" } } } } } } }, "/payments/open-checkouts": { "get": { "tags": [ "Payments" ], "summary": "Checkouts started but not finished", "description": "**Who:** Supervisors and admins.", "operationId": "getPaymentsOpen-checkouts", "security": [ { "bearerAuth": [] } ], "parameters": [], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "checkouts": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "provider": { "type": "string" }, "providerLabel": { "type": "string" }, "canCheck": { "type": "boolean", "description": "The provider can be asked whether it was paid" }, "amount": { "type": "number", "description": "Rand" }, "description": { "type": "string" }, "type": { "description": "registration, donation, sponsorship, season_pass…", "type": [ "string", "null" ] }, "registrationId": { "type": [ "string", "null" ] }, "payer": { "type": [ "string", "null" ] }, "createdAt": { "type": "string", "description": "Date and time (ISO 8601)" } }, "required": [ "id", "provider", "providerLabel", "canCheck", "amount", "description", "createdAt" ], "additionalProperties": {} } }, "days": { "type": "number", "description": "How far back it looks" } }, "required": [ "checkouts", "days" ], "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" } } } } } } }, "/payments/open-checkouts/check": { "post": { "tags": [ "Payments" ], "summary": "Ask the provider about open checkouts", "description": "Records any that were paid (for when a webhook was missed).\n\n**Who:** Supervisors and admins.", "operationId": "postPaymentsOpen-checkoutsCheck", "security": [ { "bearerAuth": [] } ], "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "ids": { "description": "Checkouts to ask about (default: every open one), at most 200", "type": "array", "items": { "type": "string" } } }, "additionalProperties": {} } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "results": { "type": "array", "items": { "type": "object", "properties": {}, "additionalProperties": {} } }, "recorded": { "type": "number", "description": "Payments found and recorded" }, "message": { "type": "string" } }, "required": [ "results", "recorded", "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" } } } } } } }, "/payments/stats": { "get": { "tags": [ "Payments" ], "summary": "Payment totals", "description": "**Who:** Admins only.", "operationId": "getPaymentsStats", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "page", "in": "query", "required": false, "description": "Page number, from 1", "schema": { "type": "string", "maxLength": 4000 } }, { "name": "limit", "in": "query", "required": false, "description": "How many per page", "schema": { "type": "string", "maxLength": 4000 } }, { "name": "userId", "in": "query", "required": false, "description": "Only this person", "schema": { "type": "string", "maxLength": 4000 } }, { "name": "from", "in": "query", "required": false, "description": "On or after (ISO date or date-time)", "schema": { "type": "string", "maxLength": 4000 } }, { "name": "donations", "in": "query", "required": false, "description": "`1`: only donations and the parts put towards registrations", "schema": { "type": "string", "maxLength": 4000 } }, { "name": "method", "in": "query", "required": false, "description": "Payment method: cash, card, eft, other", "schema": { "type": "string", "maxLength": 4000 } }, { "name": "kind", "in": "query", "required": false, "description": "payment or refund", "schema": { "type": "string", "maxLength": 4000 } }, { "name": "startDate", "in": "query", "required": false, "description": "On or after (ISO date)", "schema": { "type": "string", "maxLength": 4000 } }, { "name": "endDate", "in": "query", "required": false, "description": "On or before (ISO date)", "schema": { "type": "string", "maxLength": 4000 } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "totalToday": { "type": "number", "description": "Rand" }, "totalWeek": { "type": "number", "description": "Rand" }, "totalMonth": { "type": "number", "description": "Rand" } }, "required": [ "totalToday", "totalWeek", "totalMonth" ], "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" } } } } } } }, "/payments": { "get": { "tags": [ "Payments" ], "summary": "Every payment", "description": "For the events you may see. `page` and `limit` page it (otherwise everything); see v1 for the filters it takes.\n\n**Who:** Supervisors and admins.", "operationId": "getPayments", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "page", "in": "query", "required": false, "description": "Page number, from 1", "schema": { "type": "string", "maxLength": 4000 } }, { "name": "limit", "in": "query", "required": false, "description": "How many per page", "schema": { "type": "string", "maxLength": 4000 } }, { "name": "userId", "in": "query", "required": false, "description": "Only this person", "schema": { "type": "string", "maxLength": 4000 } }, { "name": "from", "in": "query", "required": false, "description": "On or after (ISO date or date-time)", "schema": { "type": "string", "maxLength": 4000 } }, { "name": "donations", "in": "query", "required": false, "description": "`1`: only donations and the parts put towards registrations", "schema": { "type": "string", "maxLength": 4000 } }, { "name": "method", "in": "query", "required": false, "description": "Payment method: cash, card, eft, other", "schema": { "type": "string", "maxLength": 4000 } }, { "name": "kind", "in": "query", "required": false, "description": "payment or refund", "schema": { "type": "string", "maxLength": 4000 } }, { "name": "startDate", "in": "query", "required": false, "description": "On or after (ISO date)", "schema": { "type": "string", "maxLength": 4000 } }, { "name": "endDate", "in": "query", "required": false, "description": "On or before (ISO date)", "schema": { "type": "string", "maxLength": 4000 } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "data": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "amount": { "type": "number", "description": "Rand; a refund is negative" }, "method": { "type": "string", "description": "cash, card, eft, other — or the wallet type for an online payment" }, "provider": { "description": "yoco or payfast for an online payment", "type": [ "string", "null" ] }, "userId": { "type": "string" }, "recordedById": { "type": [ "string", "null" ] }, "registrationId": { "type": [ "string", "null" ] }, "eventId": { "type": [ "string", "null" ] }, "isDonation": { "type": "boolean" }, "isSponsorship": { "type": [ "boolean", "null" ] }, "originalPaymentId": { "description": "A refund: the payment it refunds; a donation leg: the donation", "type": [ "string", "null" ] }, "externalId": { "type": [ "string", "null" ] }, "createdAt": { "type": "string", "description": "Date and time (ISO 8601)" }, "user": { "anyOf": [ { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "email": { "type": [ "string", "null" ] }, "phoneNumber": { "type": [ "string", "null" ] } }, "required": [ "name" ], "additionalProperties": {} }, { "type": "null" } ] }, "recordedBy": { "anyOf": [ { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "email": { "type": [ "string", "null" ] } }, "required": [ "name" ], "additionalProperties": {} }, { "type": "null" } ] }, "event": { "anyOf": [ { "type": "object", "properties": { "id": { "type": "string" }, "title": { "type": "string" }, "startDate": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "endDate": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] } }, "required": [ "id", "title" ], "additionalProperties": {} }, { "type": "null" } ] }, "registration": { "anyOf": [ { "type": "object", "properties": { "id": { "type": "string" }, "userId": { "type": "string" }, "eventId": { "type": "string" }, "status": { "type": "string", "enum": [ "pending", "confirmed", "partial_paid", "paid", "cancelled" ] }, "discountTotal": { "anyOf": [ { "type": "number", "description": "Rand" }, { "type": "null" } ] }, "totalDueComputed": { "description": "What it costs now, after discounts", "anyOf": [ { "type": "number", "description": "Rand" }, { "type": "null" } ] }, "createdAt": { "type": "string", "description": "Date and time (ISO 8601)" }, "user": { "anyOf": [ { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "email": { "type": [ "string", "null" ] }, "phoneNumber": { "type": [ "string", "null" ] } }, "required": [ "name" ], "additionalProperties": {} }, { "type": "null" } ] }, "event": { "anyOf": [ { "type": "object", "properties": { "id": { "type": "string" }, "title": { "type": "string" }, "startDate": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "endDate": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] } }, "required": [ "id", "title" ], "additionalProperties": {} }, { "type": "null" } ] } }, "required": [ "id", "userId", "eventId", "status", "createdAt" ], "additionalProperties": {} }, { "type": "null" } ] } }, "required": [ "id", "amount", "method", "userId", "isDonation", "createdAt" ], "additionalProperties": {} } }, "total": { "type": "number" }, "page": { "type": "number" }, "limit": { "type": "number" }, "pages": { "type": "number" } }, "required": [ "data", "total", "page", "limit", "pages" ], "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": [ "Payments" ], "summary": "Record a payment", "description": "Cash, card, EFT or other, against a registration or (a donation) an event. Paid in full issues and sends the tickets.\n\n**Who:** Supervisors and admins.", "operationId": "postPayments", "security": [ { "bearerAuth": [] } ], "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "registrationId": { "type": [ "string", "null" ] }, "eventId": { "description": "A donation: the event", "type": [ "string", "null" ] }, "amount": { "type": [ "number", "string" ] }, "method": { "type": "string", "description": "cash, card, eft or other" }, "isDonation": { "type": [ "boolean", "null" ] }, "paidAt": { "description": "Backdate it", "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "userId": { "description": "A donation: who gave it", "type": [ "string", "null" ] } }, "required": [ "amount", "method" ], "additionalProperties": {} } } } }, "responses": { "201": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "id": { "type": "string" }, "amount": { "type": "number", "description": "Rand; a refund is negative" }, "method": { "type": "string", "description": "cash, card, eft, other — or the wallet type for an online payment" }, "provider": { "description": "yoco or payfast for an online payment", "type": [ "string", "null" ] }, "userId": { "type": "string" }, "recordedById": { "type": [ "string", "null" ] }, "registrationId": { "type": [ "string", "null" ] }, "eventId": { "type": [ "string", "null" ] }, "isDonation": { "type": "boolean" }, "isSponsorship": { "type": [ "boolean", "null" ] }, "originalPaymentId": { "description": "A refund: the payment it refunds; a donation leg: the donation", "type": [ "string", "null" ] }, "externalId": { "type": [ "string", "null" ] }, "createdAt": { "type": "string", "description": "Date and time (ISO 8601)" }, "user": { "anyOf": [ { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "email": { "type": [ "string", "null" ] }, "phoneNumber": { "type": [ "string", "null" ] } }, "required": [ "name" ], "additionalProperties": {} }, { "type": "null" } ] }, "recordedBy": { "anyOf": [ { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "email": { "type": [ "string", "null" ] } }, "required": [ "name" ], "additionalProperties": {} }, { "type": "null" } ] }, "event": { "anyOf": [ { "type": "object", "properties": { "id": { "type": "string" }, "title": { "type": "string" }, "startDate": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "endDate": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] } }, "required": [ "id", "title" ], "additionalProperties": {} }, { "type": "null" } ] }, "registration": { "anyOf": [ { "type": "object", "properties": { "id": { "type": "string" }, "userId": { "type": "string" }, "eventId": { "type": "string" }, "status": { "type": "string", "enum": [ "pending", "confirmed", "partial_paid", "paid", "cancelled" ] }, "discountTotal": { "anyOf": [ { "type": "number", "description": "Rand" }, { "type": "null" } ] }, "totalDueComputed": { "description": "What it costs now, after discounts", "anyOf": [ { "type": "number", "description": "Rand" }, { "type": "null" } ] }, "createdAt": { "type": "string", "description": "Date and time (ISO 8601)" }, "user": { "anyOf": [ { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "email": { "type": [ "string", "null" ] }, "phoneNumber": { "type": [ "string", "null" ] } }, "required": [ "name" ], "additionalProperties": {} }, { "type": "null" } ] }, "event": { "anyOf": [ { "type": "object", "properties": { "id": { "type": "string" }, "title": { "type": "string" }, "startDate": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "endDate": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] } }, "required": [ "id", "title" ], "additionalProperties": {} }, { "type": "null" } ] } }, "required": [ "id", "userId", "eventId", "status", "createdAt" ], "additionalProperties": {} }, { "type": "null" } ] }, "generatedTickets": { "description": "Tickets issued because this paid it in full", "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "qrCode": { "type": "string", "description": "What the QR code holds" }, "quantity": { "type": "number", "description": "People on the ticket" }, "isUsed": { "type": "boolean" }, "eventId": { "type": "string" }, "userId": { "type": "string", "description": "The payer" }, "registrationOptionId": { "type": "string" }, "attendeeId": { "description": "A named ticket: the person it's for", "type": [ "string", "null" ] }, "holderUserId": { "type": [ "string", "null" ] }, "createdAt": { "type": "string", "description": "Date and time (ISO 8601)" } }, "required": [ "id", "qrCode", "quantity", "isUsed", "eventId", "userId", "registrationOptionId", "createdAt" ], "additionalProperties": {} } }, "formsNeeded": { "description": "Attendee forms still holding the tickets back (1.52.0)", "type": [ "number", "null" ] }, "donationSplit": { "description": "What was paid over the balance, kept as a donation", "type": "object", "properties": { "id": { "type": "string" }, "amount": { "type": "number", "description": "Rand; a refund is negative" }, "method": { "type": "string", "description": "cash, card, eft, other — or the wallet type for an online payment" }, "provider": { "description": "yoco or payfast for an online payment", "type": [ "string", "null" ] }, "userId": { "type": "string" }, "recordedById": { "type": [ "string", "null" ] }, "registrationId": { "type": [ "string", "null" ] }, "eventId": { "type": [ "string", "null" ] }, "isDonation": { "type": "boolean" }, "isSponsorship": { "type": [ "boolean", "null" ] }, "originalPaymentId": { "description": "A refund: the payment it refunds; a donation leg: the donation", "type": [ "string", "null" ] }, "externalId": { "type": [ "string", "null" ] }, "createdAt": { "type": "string", "description": "Date and time (ISO 8601)" }, "user": { "anyOf": [ { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "email": { "type": [ "string", "null" ] }, "phoneNumber": { "type": [ "string", "null" ] } }, "required": [ "name" ], "additionalProperties": {} }, { "type": "null" } ] }, "recordedBy": { "anyOf": [ { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "email": { "type": [ "string", "null" ] } }, "required": [ "name" ], "additionalProperties": {} }, { "type": "null" } ] }, "event": { "anyOf": [ { "type": "object", "properties": { "id": { "type": "string" }, "title": { "type": "string" }, "startDate": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "endDate": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] } }, "required": [ "id", "title" ], "additionalProperties": {} }, { "type": "null" } ] } }, "required": [ "id", "amount", "method", "userId", "isDonation", "createdAt" ], "additionalProperties": {} } }, "required": [ "id", "amount", "method", "userId", "isDonation", "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" } } } } } } }, "/payments/refunds": { "post": { "tags": [ "Payments" ], "summary": "Refund a payment", "description": "**Who:** Supervisors and admins.", "operationId": "postPaymentsRefunds", "security": [ { "bearerAuth": [] } ], "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "paymentId": { "description": "The payment refunded (or registrationId)", "type": [ "string", "null" ] }, "registrationId": { "type": [ "string", "null" ] }, "userId": { "type": "string" }, "amount": { "description": "Positive; stored as a negative payment", "type": [ "number", "string" ] }, "method": { "type": "string" }, "reason": { "type": [ "string", "null" ] } }, "required": [ "userId", "amount", "method" ], "additionalProperties": {} } } } }, "responses": { "201": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "id": { "type": "string" }, "amount": { "type": "number", "description": "Rand; a refund is negative" }, "method": { "type": "string", "description": "cash, card, eft, other — or the wallet type for an online payment" }, "provider": { "description": "yoco or payfast for an online payment", "type": [ "string", "null" ] }, "userId": { "type": "string" }, "recordedById": { "type": [ "string", "null" ] }, "registrationId": { "type": [ "string", "null" ] }, "eventId": { "type": [ "string", "null" ] }, "isDonation": { "type": "boolean" }, "isSponsorship": { "type": [ "boolean", "null" ] }, "originalPaymentId": { "description": "A refund: the payment it refunds; a donation leg: the donation", "type": [ "string", "null" ] }, "externalId": { "type": [ "string", "null" ] }, "createdAt": { "type": "string", "description": "Date and time (ISO 8601)" }, "user": { "anyOf": [ { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "email": { "type": [ "string", "null" ] }, "phoneNumber": { "type": [ "string", "null" ] } }, "required": [ "name" ], "additionalProperties": {} }, { "type": "null" } ] }, "recordedBy": { "anyOf": [ { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "email": { "type": [ "string", "null" ] } }, "required": [ "name" ], "additionalProperties": {} }, { "type": "null" } ] }, "event": { "anyOf": [ { "type": "object", "properties": { "id": { "type": "string" }, "title": { "type": "string" }, "startDate": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "endDate": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] } }, "required": [ "id", "title" ], "additionalProperties": {} }, { "type": "null" } ] } }, "required": [ "id", "amount", "method", "userId", "isDonation", "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" } } } } } } }, "/payments/donations/assign": { "post": { "tags": [ "Payments" ], "summary": "Put a donation towards a registration", "description": "**Who:** Supervisors and admins.", "operationId": "postPaymentsDonationsAssign", "security": [ { "bearerAuth": [] } ], "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "paymentId": { "type": "string", "description": "The donation" }, "registrationId": { "type": "string" }, "amount": { "description": "Default: as much as both allow", "type": [ "number", "string" ] } }, "required": [ "paymentId", "registrationId" ], "additionalProperties": {} } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "message": { "type": [ "string", "null" ] }, "updatedRegistration": { "type": "object", "properties": { "id": { "type": "string" }, "userId": { "type": "string" }, "eventId": { "type": "string" }, "status": { "type": "string", "enum": [ "pending", "confirmed", "partial_paid", "paid", "cancelled" ] }, "discountTotal": { "anyOf": [ { "type": "number", "description": "Rand" }, { "type": "null" } ] }, "totalDueComputed": { "description": "What it costs now, after discounts", "anyOf": [ { "type": "number", "description": "Rand" }, { "type": "null" } ] }, "createdAt": { "type": "string", "description": "Date and time (ISO 8601)" }, "user": { "anyOf": [ { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "email": { "type": [ "string", "null" ] }, "phoneNumber": { "type": [ "string", "null" ] } }, "required": [ "name" ], "additionalProperties": {} }, { "type": "null" } ] }, "event": { "anyOf": [ { "type": "object", "properties": { "id": { "type": "string" }, "title": { "type": "string" }, "startDate": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "endDate": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] } }, "required": [ "id", "title" ], "additionalProperties": {} }, { "type": "null" } ] } }, "required": [ "id", "userId", "eventId", "status", "createdAt" ], "additionalProperties": {} }, "generatedTickets": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "qrCode": { "type": "string", "description": "What the QR code holds" }, "quantity": { "type": "number", "description": "People on the ticket" }, "isUsed": { "type": "boolean" }, "eventId": { "type": "string" }, "userId": { "type": "string", "description": "The payer" }, "registrationOptionId": { "type": "string" }, "attendeeId": { "description": "A named ticket: the person it's for", "type": [ "string", "null" ] }, "holderUserId": { "type": [ "string", "null" ] }, "createdAt": { "type": "string", "description": "Date and time (ISO 8601)" } }, "required": [ "id", "qrCode", "quantity", "isUsed", "eventId", "userId", "registrationOptionId", "createdAt" ], "additionalProperties": {} } } }, "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" } } } } } } }, "/payments/donations/unassign": { "post": { "tags": [ "Payments" ], "summary": "Take a donation back off a registration", "description": "**Who:** Supervisors and admins.", "operationId": "postPaymentsDonationsUnassign", "security": [ { "bearerAuth": [] } ], "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "legId": { "type": "string", "minLength": 1, "maxLength": 64 } }, "required": [ "legId" ], "additionalProperties": {} } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "message": { "type": "string" }, "updatedRegistration": { "type": "object", "properties": { "id": { "type": "string" }, "userId": { "type": "string" }, "eventId": { "type": "string" }, "status": { "type": "string", "enum": [ "pending", "confirmed", "partial_paid", "paid", "cancelled" ] }, "discountTotal": { "anyOf": [ { "type": "number", "description": "Rand" }, { "type": "null" } ] }, "totalDueComputed": { "description": "What it costs now, after discounts", "anyOf": [ { "type": "number", "description": "Rand" }, { "type": "null" } ] }, "createdAt": { "type": "string", "description": "Date and time (ISO 8601)" }, "user": { "anyOf": [ { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "email": { "type": [ "string", "null" ] }, "phoneNumber": { "type": [ "string", "null" ] } }, "required": [ "name" ], "additionalProperties": {} }, { "type": "null" } ] }, "event": { "anyOf": [ { "type": "object", "properties": { "id": { "type": "string" }, "title": { "type": "string" }, "startDate": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "endDate": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] } }, "required": [ "id", "title" ], "additionalProperties": {} }, { "type": "null" } ] } }, "required": [ "id", "userId", "eventId", "status", "createdAt" ], "additionalProperties": {} }, "donationId": { "type": "string" } }, "required": [ "message", "updatedRegistration", "donationId" ], "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" } } } } } } }, "/donations/checkout": { "post": { "tags": [ "Payments" ], "summary": "Give to an event", "description": "Starts a checkout for a donation of `amount` to `eventId`; answers where to send the person (`redirectUrl`).\n\n**Who:** Any signed-in person.", "operationId": "postDonationsCheckout", "security": [ { "bearerAuth": [] } ], "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "eventId": { "type": "string" }, "amount": { "type": [ "number", "string" ] }, "provider": { "type": [ "string", "null" ] }, "successUrl": { "type": [ "string", "null" ] }, "cancelUrl": { "type": [ "string", "null" ] }, "failureUrl": { "type": [ "string", "null" ] } }, "required": [ "eventId", "amount" ], "additionalProperties": {} } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "checkoutId": { "type": [ "string", "null" ] }, "redirectUrl": { "description": "Where to send the person to pay (null when the provider takes a form)", "type": [ "string", "null" ] }, "provider": { "type": [ "string", "null" ] }, "form": { "description": "A form to post (PayFast)", "anyOf": [ { "type": "object", "properties": { "action": { "type": "string" }, "fields": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "string" } } }, "required": [ "action", "fields" ], "additionalProperties": {} }, { "type": "null" } ] }, "amount": { "type": "number", "description": "Rand" }, "event": { "type": "object", "properties": { "id": { "type": "string" }, "title": { "type": "string" }, "startDate": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "endDate": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] } }, "additionalProperties": {} } }, "required": [ "amount", "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" } } } } } } }, "/me/payments": { "get": { "tags": [ "Me" ], "summary": "My payments", "description": "**Who:** Any signed-in person.", "operationId": "getMePayments", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "page", "in": "query", "required": false, "description": "Page number, from 1", "schema": { "type": "string", "maxLength": 4000 } }, { "name": "limit", "in": "query", "required": false, "description": "How many per page", "schema": { "type": "string", "maxLength": 4000 } }, { "name": "userId", "in": "query", "required": false, "description": "Only this person", "schema": { "type": "string", "maxLength": 4000 } }, { "name": "from", "in": "query", "required": false, "description": "On or after (ISO date or date-time)", "schema": { "type": "string", "maxLength": 4000 } }, { "name": "donations", "in": "query", "required": false, "description": "`1`: only donations and the parts put towards registrations", "schema": { "type": "string", "maxLength": 4000 } }, { "name": "method", "in": "query", "required": false, "description": "Payment method: cash, card, eft, other", "schema": { "type": "string", "maxLength": 4000 } }, { "name": "kind", "in": "query", "required": false, "description": "payment or refund", "schema": { "type": "string", "maxLength": 4000 } }, { "name": "startDate", "in": "query", "required": false, "description": "On or after (ISO date)", "schema": { "type": "string", "maxLength": 4000 } }, { "name": "endDate", "in": "query", "required": false, "description": "On or before (ISO date)", "schema": { "type": "string", "maxLength": 4000 } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "data": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "amount": { "type": "number", "description": "Rand; a refund is negative" }, "method": { "type": "string", "description": "cash, card, eft, other — or the wallet type for an online payment" }, "provider": { "description": "yoco or payfast for an online payment", "type": [ "string", "null" ] }, "userId": { "type": "string" }, "recordedById": { "type": [ "string", "null" ] }, "registrationId": { "type": [ "string", "null" ] }, "eventId": { "type": [ "string", "null" ] }, "isDonation": { "type": "boolean" }, "isSponsorship": { "type": [ "boolean", "null" ] }, "originalPaymentId": { "description": "A refund: the payment it refunds; a donation leg: the donation", "type": [ "string", "null" ] }, "externalId": { "type": [ "string", "null" ] }, "createdAt": { "type": "string", "description": "Date and time (ISO 8601)" }, "user": { "anyOf": [ { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "email": { "type": [ "string", "null" ] }, "phoneNumber": { "type": [ "string", "null" ] } }, "required": [ "name" ], "additionalProperties": {} }, { "type": "null" } ] }, "recordedBy": { "anyOf": [ { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "email": { "type": [ "string", "null" ] } }, "required": [ "name" ], "additionalProperties": {} }, { "type": "null" } ] }, "event": { "anyOf": [ { "type": "object", "properties": { "id": { "type": "string" }, "title": { "type": "string" }, "startDate": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "endDate": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] } }, "required": [ "id", "title" ], "additionalProperties": {} }, { "type": "null" } ] }, "registration": { "anyOf": [ { "type": "object", "properties": { "id": { "type": "string" }, "userId": { "type": "string" }, "eventId": { "type": "string" }, "status": { "type": "string", "enum": [ "pending", "confirmed", "partial_paid", "paid", "cancelled" ] }, "discountTotal": { "anyOf": [ { "type": "number", "description": "Rand" }, { "type": "null" } ] }, "totalDueComputed": { "description": "What it costs now, after discounts", "anyOf": [ { "type": "number", "description": "Rand" }, { "type": "null" } ] }, "createdAt": { "type": "string", "description": "Date and time (ISO 8601)" }, "user": { "anyOf": [ { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "email": { "type": [ "string", "null" ] }, "phoneNumber": { "type": [ "string", "null" ] } }, "required": [ "name" ], "additionalProperties": {} }, { "type": "null" } ] }, "event": { "anyOf": [ { "type": "object", "properties": { "id": { "type": "string" }, "title": { "type": "string" }, "startDate": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "endDate": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] } }, "required": [ "id", "title" ], "additionalProperties": {} }, { "type": "null" } ] } }, "required": [ "id", "userId", "eventId", "status", "createdAt" ], "additionalProperties": {} }, { "type": "null" } ] } }, "required": [ "id", "amount", "method", "userId", "isDonation", "createdAt" ], "additionalProperties": {} } }, "total": { "type": "number" }, "page": { "type": "number" }, "limit": { "type": "number" }, "pages": { "type": "number" } }, "required": [ "data", "total", "page", "limit", "pages" ], "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" } } } } } } }, "/payments/{id}": { "get": { "tags": [ "Payments" ], "summary": "One payment", "description": "**Who:** Any signed-in person.", "operationId": "getPaymentsId", "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" }, "amount": { "type": "number", "description": "Rand; a refund is negative" }, "method": { "type": "string", "description": "cash, card, eft, other — or the wallet type for an online payment" }, "provider": { "description": "yoco or payfast for an online payment", "type": [ "string", "null" ] }, "userId": { "type": "string" }, "recordedById": { "type": [ "string", "null" ] }, "registrationId": { "type": [ "string", "null" ] }, "eventId": { "type": [ "string", "null" ] }, "isDonation": { "type": "boolean" }, "isSponsorship": { "type": [ "boolean", "null" ] }, "originalPaymentId": { "description": "A refund: the payment it refunds; a donation leg: the donation", "type": [ "string", "null" ] }, "externalId": { "type": [ "string", "null" ] }, "createdAt": { "type": "string", "description": "Date and time (ISO 8601)" }, "user": { "anyOf": [ { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "email": { "type": [ "string", "null" ] }, "phoneNumber": { "type": [ "string", "null" ] } }, "required": [ "name" ], "additionalProperties": {} }, { "type": "null" } ] }, "recordedBy": { "anyOf": [ { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "email": { "type": [ "string", "null" ] } }, "required": [ "name" ], "additionalProperties": {} }, { "type": "null" } ] }, "event": { "anyOf": [ { "type": "object", "properties": { "id": { "type": "string" }, "title": { "type": "string" }, "startDate": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "endDate": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] } }, "required": [ "id", "title" ], "additionalProperties": {} }, { "type": "null" } ] }, "registration": { "anyOf": [ { "type": "object", "properties": { "id": { "type": "string" }, "userId": { "type": "string" }, "eventId": { "type": "string" }, "status": { "type": "string", "enum": [ "pending", "confirmed", "partial_paid", "paid", "cancelled" ] }, "discountTotal": { "anyOf": [ { "type": "number", "description": "Rand" }, { "type": "null" } ] }, "totalDueComputed": { "description": "What it costs now, after discounts", "anyOf": [ { "type": "number", "description": "Rand" }, { "type": "null" } ] }, "createdAt": { "type": "string", "description": "Date and time (ISO 8601)" }, "user": { "anyOf": [ { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "email": { "type": [ "string", "null" ] }, "phoneNumber": { "type": [ "string", "null" ] } }, "required": [ "name" ], "additionalProperties": {} }, { "type": "null" } ] }, "event": { "anyOf": [ { "type": "object", "properties": { "id": { "type": "string" }, "title": { "type": "string" }, "startDate": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "endDate": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] } }, "required": [ "id", "title" ], "additionalProperties": {} }, { "type": "null" } ] } }, "required": [ "id", "userId", "eventId", "status", "createdAt" ], "additionalProperties": {} }, { "type": "null" } ] } }, "required": [ "id", "amount", "method", "userId", "isDonation", "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" } } } }, "404": { "description": "Not found (NOT_FOUND)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/payments/{id}/receipt": { "post": { "tags": [ "Payments" ], "summary": "Send the receipt again", "description": "**Who:** Any signed-in person.", "operationId": "postPaymentsIdReceipt", "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": { "type": "string", "maxLength": 20 } }, "additionalProperties": {} } } } }, "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}/payments": { "get": { "tags": [ "Payments" ], "summary": "A registration's payments", "description": "**Who:** Any signed-in person.", "operationId": "getRegistrationsIdPayments", "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" }, "amount": { "type": "number", "description": "Rand; a refund is negative" }, "method": { "type": "string", "description": "cash, card, eft, other — or the wallet type for an online payment" }, "provider": { "description": "yoco or payfast for an online payment", "type": [ "string", "null" ] }, "userId": { "type": "string" }, "recordedById": { "type": [ "string", "null" ] }, "registrationId": { "type": [ "string", "null" ] }, "eventId": { "type": [ "string", "null" ] }, "isDonation": { "type": "boolean" }, "isSponsorship": { "type": [ "boolean", "null" ] }, "originalPaymentId": { "description": "A refund: the payment it refunds; a donation leg: the donation", "type": [ "string", "null" ] }, "externalId": { "type": [ "string", "null" ] }, "createdAt": { "type": "string", "description": "Date and time (ISO 8601)" }, "user": { "anyOf": [ { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "email": { "type": [ "string", "null" ] }, "phoneNumber": { "type": [ "string", "null" ] } }, "required": [ "name" ], "additionalProperties": {} }, { "type": "null" } ] }, "recordedBy": { "anyOf": [ { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "email": { "type": [ "string", "null" ] } }, "required": [ "name" ], "additionalProperties": {} }, { "type": "null" } ] }, "event": { "anyOf": [ { "type": "object", "properties": { "id": { "type": "string" }, "title": { "type": "string" }, "startDate": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "endDate": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] } }, "required": [ "id", "title" ], "additionalProperties": {} }, { "type": "null" } ] } }, "required": [ "id", "amount", "method", "userId", "isDonation", "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" } } } }, "404": { "description": "Not found (NOT_FOUND)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/registrations/{id}/payment-link": { "post": { "tags": [ "Payments" ], "summary": "Make a link to pay", "description": "Supervisors: a checkout for `amount` (part of what's owed) for someone else to pay. Answers `redirectUrl` (the link) — or `priceUpdated` when an early-bird price ran out.\n\n**Who:** Supervisors and admins.", "operationId": "postRegistrationsIdPayment-link", "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": { "amount": { "type": [ "number", "string" ] }, "donationAmount": { "type": [ "number", "string" ] }, "provider": { "type": [ "string", "null" ] }, "successUrl": { "type": [ "string", "null" ] }, "cancelUrl": { "type": [ "string", "null" ] }, "failureUrl": { "type": [ "string", "null" ] } }, "additionalProperties": {} } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "checkoutId": { "type": [ "string", "null" ] }, "redirectUrl": { "description": "Where to send the person to pay (null when the provider takes a form)", "type": [ "string", "null" ] }, "provider": { "type": [ "string", "null" ] }, "form": { "description": "A form to post (PayFast)", "anyOf": [ { "type": "object", "properties": { "action": { "type": "string" }, "fields": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "string" } } }, "required": [ "action", "fields" ], "additionalProperties": {} }, { "type": "null" } ] }, "priceUpdated": { "type": [ "boolean", "null" ] }, "newTotal": { "anyOf": [ { "type": "number", "description": "Rand" }, { "type": "null" } ] } }, "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}/payment-link/send": { "post": { "tags": [ "Payments" ], "summary": "Send someone a link to pay", "description": "By email and/or WhatsApp, for what's still owing.\n\n**Who:** Supervisors and admins.", "operationId": "postRegistrationsIdPayment-linkSend", "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": { "redirectUrl": { "type": "string", "description": "The link to send" }, "channel": { "type": "string", "enum": [ "email", "whatsapp" ] } }, "required": [ "redirectUrl", "channel" ], "additionalProperties": {} } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "sent": { "type": "boolean", "const": true }, "channel": { "type": "string" } }, "required": [ "sent", "channel" ], "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}/payments": { "get": { "tags": [ "Payments" ], "summary": "An event's payments", "description": "**Who:** Staff, supervisors and admins.", "operationId": "getEventsIdPayments", "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" }, "amount": { "type": "number", "description": "Rand; a refund is negative" }, "method": { "type": "string", "description": "cash, card, eft, other — or the wallet type for an online payment" }, "provider": { "description": "yoco or payfast for an online payment", "type": [ "string", "null" ] }, "userId": { "type": "string" }, "recordedById": { "type": [ "string", "null" ] }, "registrationId": { "type": [ "string", "null" ] }, "eventId": { "type": [ "string", "null" ] }, "isDonation": { "type": "boolean" }, "isSponsorship": { "type": [ "boolean", "null" ] }, "originalPaymentId": { "description": "A refund: the payment it refunds; a donation leg: the donation", "type": [ "string", "null" ] }, "externalId": { "type": [ "string", "null" ] }, "createdAt": { "type": "string", "description": "Date and time (ISO 8601)" }, "user": { "anyOf": [ { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "email": { "type": [ "string", "null" ] }, "phoneNumber": { "type": [ "string", "null" ] } }, "required": [ "name" ], "additionalProperties": {} }, { "type": "null" } ] }, "recordedBy": { "anyOf": [ { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "email": { "type": [ "string", "null" ] } }, "required": [ "name" ], "additionalProperties": {} }, { "type": "null" } ] }, "event": { "anyOf": [ { "type": "object", "properties": { "id": { "type": "string" }, "title": { "type": "string" }, "startDate": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "endDate": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] } }, "required": [ "id", "title" ], "additionalProperties": {} }, { "type": "null" } ] } }, "required": [ "id", "amount", "method", "userId", "isDonation", "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" } } } }, "404": { "description": "Not found (NOT_FOUND)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/payment-links/{id}": { "get": { "tags": [ "Payments" ], "summary": "A pay page", "description": "What a payment link shows: what's owed and the providers to pay with. The id in the link is the credential.\n\n**Who:** Anyone.", "operationId": "getPayment-linksId", "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" }, "status": { "type": "string", "enum": [ "open", "paid" ] }, "amount": { "type": "number", "description": "Rand" }, "description": { "type": "string" }, "provider": { "description": "The provider already chosen, if any", "type": [ "string", "null" ] }, "providers": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "description": "yoco, payfast" }, "label": { "type": "string" } }, "required": [ "id", "label" ], "additionalProperties": {} } }, "cancelUrl": { "type": [ "string", "null" ] }, "redirectUrl": { "type": [ "string", "null" ] }, "form": { "description": "A signed form to post (PayFast)", "anyOf": [ { "type": "object", "properties": {}, "additionalProperties": {} }, { "type": "null" } ] } }, "required": [ "id", "status", "amount", "description", "providers" ], "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" } } } } } }, "post": { "tags": [ "Payments" ], "summary": "Pay from a pay page", "description": "Starts a checkout with the chosen provider; answers where to send the person.\n\n**Who:** Anyone.", "operationId": "postPayment-linksId", "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 } }, "additionalProperties": {} } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "provider": { "type": "string" }, "redirectUrl": { "type": [ "string", "null" ] }, "form": { "anyOf": [ { "type": "object", "properties": {}, "additionalProperties": {} }, { "type": "null" } ] } }, "required": [ "provider" ], "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" } } } } } } }, "/cashups/audit": { "get": { "tags": [ "Cash-ups" ], "summary": "Cash-up history", "description": "**Who:** Supervisors and admins.", "operationId": "getCashupsAudit", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "eventId", "in": "query", "required": false, "description": "Only this event", "schema": { "type": "string", "maxLength": 4000 } }, { "name": "from", "in": "query", "required": false, "description": "On or after (ISO date or date-time)", "schema": { "type": "string", "maxLength": 4000 } }, { "name": "to", "in": "query", "required": false, "description": "On or before (ISO date or date-time)", "schema": { "type": "string", "maxLength": 4000 } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "eventId": { "type": "string" }, "action": { "description": "close, quick_close, reopen", "type": [ "string", "null" ] }, "notes": { "type": [ "string", "null" ] }, "createdAt": { "type": "string", "description": "Date and time (ISO 8601)" }, "performedBy": { "anyOf": [ { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "email": { "type": [ "string", "null" ] } }, "required": [ "name" ], "additionalProperties": {} }, { "type": "null" } ] } }, "required": [ "id", "eventId", "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" } } } } } } }, "/events/{id}/cashup": { "get": { "tags": [ "Cash-ups" ], "summary": "An event's cash-up", "description": "Income by method, costs, what each drawer should hold, and the saved draft.\n\n**Who:** Supervisors and admins.", "operationId": "getEventsIdCashup", "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": { "event": { "type": "object", "properties": {}, "additionalProperties": {} }, "paymentsByMethod": { "type": "object", "properties": {}, "additionalProperties": {}, "description": "Income per method" }, "totalRevenue": { "type": "number", "description": "Rand" }, "costs": { "type": "array", "items": { "type": "object", "properties": {}, "additionalProperties": {} } }, "totalCosts": { "type": "number", "description": "Rand" }, "expectedCashByMethod": { "type": "object", "properties": {}, "additionalProperties": {} }, "reconciled": { "description": "The last close, line by line", "anyOf": [ { "type": "object", "properties": {}, "additionalProperties": {} }, { "type": "null" } ] }, "netProfit": { "type": "number", "description": "Rand" }, "totalDonations": { "type": "number", "description": "Rand" }, "unallocatedDonationsTotal": { "type": "number", "description": "Rand" }, "discountsTotal": { "anyOf": [ { "type": "number", "description": "Rand" }, { "type": "null" } ] }, "salesByOption": { "type": "array", "items": { "type": "object", "properties": {}, "additionalProperties": {} } } }, "required": [ "event", "paymentsByMethod", "totalRevenue", "costs", "totalCosts", "expectedCashByMethod", "netProfit", "totalDonations", "unallocatedDonationsTotal" ], "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}/cashup/cash-by-user": { "get": { "tags": [ "Cash-ups" ], "summary": "Cash taken by each person", "description": "**Who:** Supervisors and admins.", "operationId": "getEventsIdCashupCash-by-user", "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": { "rows": { "type": "array", "items": { "type": "object", "properties": {}, "additionalProperties": {} }, "description": "Per person: who, cash recorded, cash counted" }, "cashActualTotal": { "anyOf": [ { "type": "number", "description": "Rand" }, { "type": "null" } ] }, "cashDenominations": { "type": "array", "items": { "type": "object", "properties": { "value": { "type": "number", "description": "The note or coin, in rand" }, "count": { "type": "number" } }, "required": [ "value", "count" ], "additionalProperties": {} }, "description": "Counted cash by note and coin" } }, "required": [ "rows", "cashDenominations" ], "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}/cashup/person-cash/{userId}": { "put": { "tags": [ "Cash-ups" ], "summary": "Count one person's cash", "description": "**Who:** Supervisors and admins.", "operationId": "putEventsIdCashupPerson-cashUserId", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "id", "in": "path", "required": true, "description": "The id", "schema": { "type": "string", "minLength": 1, "maxLength": 64 } }, { "name": "userId", "in": "path", "required": true, "description": "The person's id", "schema": { "type": "string", "minLength": 1, "maxLength": 64 } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "denominations": { "type": "array", "items": { "type": "object", "properties": { "value": { "type": "number", "description": "The note or coin, in rand" }, "count": { "type": "number" } }, "required": [ "value", "count" ], "additionalProperties": {} } }, "notes": { "type": [ "string", "null" ] } }, "required": [ "denominations" ], "additionalProperties": {} } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": {}, "additionalProperties": {}, "description": "The saved count" } }, "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}/cashup/draft": { "put": { "tags": [ "Cash-ups" ], "summary": "Save the cash-up as a draft", "description": "**Who:** Admins only.", "operationId": "putEventsIdCashupDraft", "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": { "lines": { "type": "array", "items": { "type": "object", "properties": { "method": { "type": "string", "description": "cash, card, eft…" }, "bankAmount": { "anyOf": [ { "type": "number", "description": "Rand" }, { "type": "null" } ] }, "onHandAmount": { "description": "Cash only", "anyOf": [ { "type": "number", "description": "Rand" }, { "type": "null" } ] }, "pendingAmount": { "description": "Not cash", "anyOf": [ { "type": "number", "description": "Rand" }, { "type": "null" } ] }, "pendingReference": { "type": [ "string", "null" ] }, "writeOffs": { "type": "array", "items": { "type": "object", "properties": { "category": { "type": "string" }, "amount": { "anyOf": [ { "type": "number", "description": "Rand" }, { "type": "null" } ] }, "reason": { "type": [ "string", "null" ] } }, "required": [ "category" ], "additionalProperties": {} } }, "notes": { "type": [ "string", "null" ] } }, "required": [ "method" ], "additionalProperties": {} } }, "notes": { "type": [ "string", "null" ] } }, "required": [ "lines" ], "additionalProperties": {} } } } }, "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}/cashup/close": { "post": { "tags": [ "Cash-ups" ], "summary": "Close the event", "description": "Admins. Nothing about the event's money can change until it's reopened.\n\n**Who:** Admins only.", "operationId": "postEventsIdCashupClose", "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": { "lines": { "description": "Per payment method: in the bank, on hand, pending, write-offs (leave out for a quick close)", "type": "array", "items": { "type": "object", "properties": { "method": { "type": "string", "description": "cash, card, eft…" }, "bankAmount": { "anyOf": [ { "type": "number", "description": "Rand" }, { "type": "null" } ] }, "onHandAmount": { "description": "Cash only", "anyOf": [ { "type": "number", "description": "Rand" }, { "type": "null" } ] }, "pendingAmount": { "description": "Not cash", "anyOf": [ { "type": "number", "description": "Rand" }, { "type": "null" } ] }, "pendingReference": { "type": [ "string", "null" ] }, "writeOffs": { "type": "array", "items": { "type": "object", "properties": { "category": { "type": "string" }, "amount": { "anyOf": [ { "type": "number", "description": "Rand" }, { "type": "null" } ] }, "reason": { "type": [ "string", "null" ] } }, "required": [ "category" ], "additionalProperties": {} } }, "notes": { "type": [ "string", "null" ] } }, "required": [ "method" ], "additionalProperties": {} } }, "notes": { "type": [ "string", "null" ] } }, "additionalProperties": {} } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "id": { "type": "string" }, "eventId": { "type": "string" }, "action": { "description": "close, quick_close, reopen", "type": [ "string", "null" ] }, "notes": { "type": [ "string", "null" ] }, "createdAt": { "type": "string", "description": "Date and time (ISO 8601)" }, "performedBy": { "anyOf": [ { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "email": { "type": [ "string", "null" ] } }, "required": [ "name" ], "additionalProperties": {} }, { "type": "null" } ] } }, "required": [ "id", "eventId", "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" } } } }, "404": { "description": "Not found (NOT_FOUND)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/events/{id}/cashup/reopen": { "post": { "tags": [ "Cash-ups" ], "summary": "Reopen a closed event", "description": "**Who:** Admins only.", "operationId": "postEventsIdCashupReopen", "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": { "notes": { "description": "Why", "type": [ "string", "null" ] } }, "additionalProperties": {} } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "id": { "type": "string" }, "eventId": { "type": "string" }, "action": { "description": "close, quick_close, reopen", "type": [ "string", "null" ] }, "notes": { "type": [ "string", "null" ] }, "createdAt": { "type": "string", "description": "Date and time (ISO 8601)" }, "performedBy": { "anyOf": [ { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "email": { "type": [ "string", "null" ] } }, "required": [ "name" ], "additionalProperties": {} }, { "type": "null" } ] } }, "required": [ "id", "eventId", "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" } } } }, "404": { "description": "Not found (NOT_FOUND)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/cashup-lines/{id}/pending": { "post": { "tags": [ "Cash-ups" ], "summary": "Settle a pending cash-up line", "description": "**Who:** Admins only.", "operationId": "postCashup-linesIdPending", "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": { "outcome": { "type": "string", "enum": [ "received", "written_off" ] }, "amount": { "type": [ "number", "string" ] }, "category": { "description": "A write-off: what it was for", "type": [ "string", "null" ] }, "notes": { "type": [ "string", "null" ] } }, "required": [ "outcome", "amount" ], "additionalProperties": {} } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": {}, "additionalProperties": {}, "description": "The settlement recorded" } }, "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" } } } } } } }, "/provider-transactions": { "get": { "tags": [ "Payments" ], "summary": "Transactions from Yoco and PayFast", "description": "**Who:** Supervisors and admins.", "operationId": "getProvider-transactions", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "provider", "in": "query", "required": false, "description": "yoco or payfast", "schema": { "type": "string", "maxLength": 4000 } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "success": { "type": "boolean" }, "data": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "provider": { "type": "string" }, "providerLabel": { "type": "string" }, "externalId": { "type": "string", "description": "The provider's id" }, "amount": { "description": "Cents", "type": [ "number", "null" ] }, "currency": { "type": [ "string", "null" ] }, "createdDate": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "checkoutId": { "type": [ "string", "null" ] }, "methodType": { "type": [ "string", "null" ] }, "reconciled": { "type": "boolean" }, "ignored": { "type": "boolean" }, "paymentId": { "type": [ "string", "null" ] }, "note": { "description": "Why it needs a look", "type": [ "string", "null" ] }, "metadata": { "anyOf": [ { "type": "object", "properties": {}, "additionalProperties": {} }, { "type": "null" } ] } }, "required": [ "id", "provider", "providerLabel", "externalId", "reconciled", "ignored" ], "additionalProperties": {} } }, "message": { "type": [ "string", "null" ] } }, "required": [ "success", "data" ], "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" } } } } } } }, "/provider-transactions/unreconciled": { "get": { "tags": [ "Payments" ], "summary": "Provider transactions not matched yet", "description": "**Who:** Supervisors and admins.", "operationId": "getProvider-transactionsUnreconciled", "security": [ { "bearerAuth": [] } ], "parameters": [], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "success": { "type": "boolean" }, "data": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "provider": { "type": "string" }, "providerLabel": { "type": "string" }, "externalId": { "type": "string", "description": "The provider's id" }, "amount": { "description": "Cents", "type": [ "number", "null" ] }, "currency": { "type": [ "string", "null" ] }, "createdDate": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "checkoutId": { "type": [ "string", "null" ] }, "methodType": { "type": [ "string", "null" ] }, "reconciled": { "type": "boolean" }, "ignored": { "type": "boolean" }, "paymentId": { "type": [ "string", "null" ] }, "note": { "description": "Why it needs a look", "type": [ "string", "null" ] }, "metadata": { "anyOf": [ { "type": "object", "properties": {}, "additionalProperties": {} }, { "type": "null" } ] } }, "required": [ "id", "provider", "providerLabel", "externalId", "reconciled", "ignored" ], "additionalProperties": {} } }, "message": { "type": [ "string", "null" ] } }, "required": [ "success", "data" ], "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" } } } } } } }, "/provider-transactions/{id}/reconcile": { "post": { "tags": [ "Payments" ], "summary": "Match a provider transaction to a registration", "description": "**Who:** Supervisors and admins.", "operationId": "postProvider-transactionsIdReconcile", "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": { "registrationId": { "type": [ "string", "null" ] }, "eventId": { "description": "As a donation to this event instead", "type": [ "string", "null" ] }, "userId": { "type": [ "string", "null" ] } }, "additionalProperties": {} } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "success": { "type": "boolean" }, "data": { "type": "object", "properties": { "transaction": { "type": "object", "properties": { "id": { "type": "string" }, "provider": { "type": "string" }, "providerLabel": { "type": "string" }, "externalId": { "type": "string", "description": "The provider's id" }, "amount": { "description": "Cents", "type": [ "number", "null" ] }, "currency": { "type": [ "string", "null" ] }, "createdDate": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "checkoutId": { "type": [ "string", "null" ] }, "methodType": { "type": [ "string", "null" ] }, "reconciled": { "type": "boolean" }, "ignored": { "type": "boolean" }, "paymentId": { "type": [ "string", "null" ] }, "note": { "description": "Why it needs a look", "type": [ "string", "null" ] }, "metadata": { "anyOf": [ { "type": "object", "properties": {}, "additionalProperties": {} }, { "type": "null" } ] } }, "required": [ "id", "provider", "providerLabel", "externalId", "reconciled", "ignored" ], "additionalProperties": {} }, "payment": { "type": "object", "properties": { "id": { "type": "string" }, "amount": { "type": "number", "description": "Rand; a refund is negative" }, "method": { "type": "string", "description": "cash, card, eft, other — or the wallet type for an online payment" }, "provider": { "description": "yoco or payfast for an online payment", "type": [ "string", "null" ] }, "userId": { "type": "string" }, "recordedById": { "type": [ "string", "null" ] }, "registrationId": { "type": [ "string", "null" ] }, "eventId": { "type": [ "string", "null" ] }, "isDonation": { "type": "boolean" }, "isSponsorship": { "type": [ "boolean", "null" ] }, "originalPaymentId": { "description": "A refund: the payment it refunds; a donation leg: the donation", "type": [ "string", "null" ] }, "externalId": { "type": [ "string", "null" ] }, "createdAt": { "type": "string", "description": "Date and time (ISO 8601)" }, "user": { "anyOf": [ { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "email": { "type": [ "string", "null" ] }, "phoneNumber": { "type": [ "string", "null" ] } }, "required": [ "name" ], "additionalProperties": {} }, { "type": "null" } ] }, "recordedBy": { "anyOf": [ { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "email": { "type": [ "string", "null" ] } }, "required": [ "name" ], "additionalProperties": {} }, { "type": "null" } ] }, "event": { "anyOf": [ { "type": "object", "properties": { "id": { "type": "string" }, "title": { "type": "string" }, "startDate": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "endDate": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] } }, "required": [ "id", "title" ], "additionalProperties": {} }, { "type": "null" } ] } }, "required": [ "id", "amount", "method", "userId", "isDonation", "createdAt" ], "additionalProperties": {} }, "generatedTickets": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "qrCode": { "type": "string", "description": "What the QR code holds" }, "quantity": { "type": "number", "description": "People on the ticket" }, "isUsed": { "type": "boolean" }, "eventId": { "type": "string" }, "userId": { "type": "string", "description": "The payer" }, "registrationOptionId": { "type": "string" }, "attendeeId": { "description": "A named ticket: the person it's for", "type": [ "string", "null" ] }, "holderUserId": { "type": [ "string", "null" ] }, "createdAt": { "type": "string", "description": "Date and time (ISO 8601)" } }, "required": [ "id", "qrCode", "quantity", "isUsed", "eventId", "userId", "registrationOptionId", "createdAt" ], "additionalProperties": {} } } }, "required": [ "transaction", "payment" ], "additionalProperties": {} }, "message": { "type": [ "string", "null" ] } }, "required": [ "success", "data" ], "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" } } } } } } }, "/provider-transactions/{id}/ignore": { "post": { "tags": [ "Payments" ], "summary": "Ignore a provider transaction", "description": "**Who:** Supervisors and admins.", "operationId": "postProvider-transactionsIdIgnore", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "id", "in": "path", "required": true, "description": "The id", "schema": { "type": "string", "minLength": 1, "maxLength": 64 } } ], "requestBody": { "required": true, "description": "No body needed: send an empty object.", "content": { "application/json": { "schema": { "type": "object", "properties": {}, "additionalProperties": {} } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "success": { "type": "boolean" }, "data": { "type": "object", "properties": { "id": { "type": "string" }, "provider": { "type": "string" }, "providerLabel": { "type": "string" }, "externalId": { "type": "string", "description": "The provider's id" }, "amount": { "description": "Cents", "type": [ "number", "null" ] }, "currency": { "type": [ "string", "null" ] }, "createdDate": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "checkoutId": { "type": [ "string", "null" ] }, "methodType": { "type": [ "string", "null" ] }, "reconciled": { "type": "boolean" }, "ignored": { "type": "boolean" }, "paymentId": { "type": [ "string", "null" ] }, "note": { "description": "Why it needs a look", "type": [ "string", "null" ] }, "metadata": { "anyOf": [ { "type": "object", "properties": {}, "additionalProperties": {} }, { "type": "null" } ] } }, "required": [ "id", "provider", "providerLabel", "externalId", "reconciled", "ignored" ], "additionalProperties": {} }, "message": { "type": [ "string", "null" ] } }, "required": [ "success", "data" ], "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" } } } } } } }, "/waitlist": { "post": { "tags": [ "Waitlist" ], "summary": "Join a sold-out event's waitlist", "description": "Signed in, or with a name and email or phone. When places free up, people are offered them in order.\n\n**Who:** Anyone; signed-in staff may see more.", "operationId": "postWaitlist", "security": [ {}, { "bearerAuth": [] } ], "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "eventId": { "type": "string" }, "eventOptionId": { "type": "string" }, "variantId": { "type": [ "string", "null" ] }, "sessionId": { "description": "Per-session tickets: the session", "type": [ "string", "null" ] }, "quantity": { "type": [ "number", "string" ] }, "guestName": { "description": "Not signed in", "type": [ "string", "null" ] }, "guestEmail": { "type": [ "string", "null" ] }, "guestPhone": { "type": [ "string", "null" ] } }, "required": [ "eventId", "eventOptionId", "quantity" ], "additionalProperties": {} } } } }, "responses": { "201": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "id": { "type": "string" }, "eventId": { "type": "string" }, "eventOptionId": { "type": "string" }, "variantId": { "type": [ "string", "null" ] }, "sessionId": { "type": [ "string", "null" ] }, "userId": { "type": "string" }, "quantity": { "type": "number" }, "position": { "type": "number", "description": "Place in the queue" }, "status": { "type": "string", "description": "waiting, offered, claimed, expired, removed, left" }, "offeredQuantity": { "type": [ "number", "null" ] }, "offeredAt": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "offerExpiresAt": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "claimedAt": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "registrationId": { "type": [ "string", "null" ] }, "createdAt": { "type": "string", "description": "Date and time (ISO 8601)" }, "ahead": { "type": "number", "description": "People ahead" }, "message": { "type": "string" } }, "required": [ "id", "eventId", "eventOptionId", "userId", "quantity", "position", "status", "createdAt", "ahead", "message" ], "additionalProperties": {} } }, "required": [ "data" ], "additionalProperties": false } } } }, "400": { "description": "Validation failed (VALIDATION_FAILED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/me/waitlist": { "get": { "tags": [ "Me" ], "summary": "Waitlists I'm on", "description": "**Who:** Any signed-in person.", "operationId": "getMeWaitlist", "security": [ { "bearerAuth": [] } ], "parameters": [], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "eventId": { "type": "string" }, "eventOptionId": { "type": "string" }, "variantId": { "type": [ "string", "null" ] }, "sessionId": { "type": [ "string", "null" ] }, "userId": { "type": "string" }, "quantity": { "type": "number" }, "position": { "type": "number", "description": "Place in the queue" }, "status": { "type": "string", "description": "waiting, offered, claimed, expired, removed, left" }, "offeredQuantity": { "type": [ "number", "null" ] }, "offeredAt": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "offerExpiresAt": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "claimedAt": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "registrationId": { "type": [ "string", "null" ] }, "createdAt": { "type": "string", "description": "Date and time (ISO 8601)" } }, "required": [ "id", "eventId", "eventOptionId", "userId", "quantity", "position", "status", "createdAt" ], "additionalProperties": {} } } }, "required": [ "data" ], "additionalProperties": false } } } }, "401": { "description": "Not signed in (UNAUTHENTICATED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/waitlist/claims/{token}": { "get": { "tags": [ "Waitlist" ], "summary": "A waitlist offer", "description": "What an offer link shows (the token is the credential). Register with `waitlistToken` to take it.\n\n**Who:** Anyone.", "operationId": "getWaitlistClaimsToken", "parameters": [ { "name": "token", "in": "path", "required": true, "description": "The token from the link (it is the credential)", "schema": { "type": "string", "minLength": 1, "maxLength": 200 } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "eventId": { "type": [ "string", "null" ] }, "eventTitle": { "type": [ "string", "null" ] }, "eventStart": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "eventOptionId": { "type": "string" }, "optionName": { "type": "string" }, "variantId": { "type": [ "string", "null" ] }, "variantName": { "type": [ "string", "null" ] }, "sessionId": { "type": [ "string", "null" ] }, "sessionName": { "type": [ "string", "null" ] }, "sessionStart": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "lineName": { "type": "string" }, "quantity": { "description": "Places offered", "type": [ "number", "null" ] }, "requested": { "type": "number" }, "expiresAt": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "name": { "type": [ "string", "null" ] } }, "required": [ "eventOptionId", "optionName", "lineName", "requested" ], "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}/waitlist": { "get": { "tags": [ "Waitlist" ], "summary": "An event's waitlist", "description": "**Who:** Staff, supervisors and admins.", "operationId": "getEventsIdWaitlist", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "id", "in": "path", "required": true, "description": "The id", "schema": { "type": "string", "minLength": 1, "maxLength": 64 } }, { "name": "all", "in": "query", "required": false, "description": "`true`/`1`: include everything, not just the current ones", "schema": { "type": "string", "maxLength": 4000 } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "eventId": { "type": "string" }, "eventOptionId": { "type": "string" }, "variantId": { "type": [ "string", "null" ] }, "sessionId": { "type": [ "string", "null" ] }, "userId": { "type": "string" }, "quantity": { "type": "number" }, "position": { "type": "number", "description": "Place in the queue" }, "status": { "type": "string", "description": "waiting, offered, claimed, expired, removed, left" }, "offeredQuantity": { "type": [ "number", "null" ] }, "offeredAt": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "offerExpiresAt": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "claimedAt": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "registrationId": { "type": [ "string", "null" ] }, "createdAt": { "type": "string", "description": "Date and time (ISO 8601)" }, "user": { "anyOf": [ { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "email": { "type": [ "string", "null" ] }, "phoneNumber": { "type": [ "string", "null" ] } }, "required": [ "name" ], "additionalProperties": {} }, { "type": "null" } ] } }, "required": [ "id", "eventId", "eventOptionId", "userId", "quantity", "position", "status", "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" } } } }, "404": { "description": "Not found (NOT_FOUND)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/waitlist/{id}/offer": { "post": { "tags": [ "Waitlist" ], "summary": "Offer someone their places now", "description": "**Who:** Supervisors and admins.", "operationId": "postWaitlistIdOffer", "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": { "description": "Places to offer (default: all they asked for)", "type": [ "number", "string" ] } }, "additionalProperties": {} } } } }, "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" } } } } } } }, "/waitlist/{id}/move": { "post": { "tags": [ "Waitlist" ], "summary": "Move someone up or down the waitlist", "description": "**Who:** Supervisors and admins.", "operationId": "postWaitlistIdMove", "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": { "direction": { "type": "string", "enum": [ "up", "down" ] } }, "required": [ "direction" ], "additionalProperties": {} } } } }, "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" } } } } } } }, "/waitlist/{id}/remove": { "post": { "tags": [ "Waitlist" ], "summary": "Take someone off the waitlist", "description": "**Who:** Supervisors and admins.", "operationId": "postWaitlistIdRemove", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "id", "in": "path", "required": true, "description": "The id", "schema": { "type": "string", "minLength": 1, "maxLength": 64 } } ], "requestBody": { "required": true, "description": "No body needed: send an empty object.", "content": { "application/json": { "schema": { "type": "object", "properties": {}, "additionalProperties": {} } } } }, "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" } } } } } } }, "/waitlist/{id}": { "delete": { "tags": [ "Waitlist" ], "summary": "Leave a waitlist", "description": "**Who:** Any signed-in person.", "operationId": "deleteWaitlistId", "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" } } } }, "404": { "description": "Not found (NOT_FOUND)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/events/{id}/sponsorship": { "get": { "tags": [ "Sponsorship" ], "summary": "Sponsoring places at an event", "description": "Whether it's on, and the suggested amounts.\n\n**Who:** Anyone.", "operationId": "getEventsIdSponsorship", "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": { "enabled": { "type": "boolean" }, "open": { "type": [ "boolean", "null" ] }, "spotPrice": { "anyOf": [ { "type": "number", "description": "Rand" }, { "type": "null" } ] }, "showProgress": { "type": [ "boolean", "null" ] }, "goalSpots": { "type": [ "number", "null" ] }, "spotsFunded": { "type": [ "number", "null" ] }, "sponsors": {} }, "required": [ "enabled" ], "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}/sponsorship/pool": { "get": { "tags": [ "Sponsorship" ], "summary": "The sponsorship pool", "description": "What's been given and what's been used.\n\n**Who:** Supervisors and admins.", "operationId": "getEventsIdSponsorshipPool", "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": { "eventId": { "type": "string" }, "spotPrice": { "type": "number", "description": "Rand" }, "goalSpots": { "type": [ "number", "null" ] } }, "required": [ "eventId", "spotPrice" ], "additionalProperties": {}, "description": "Plus the pool: given, used and places funded" } }, "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" } } } } } } }, "/sponsorships/checkout": { "post": { "tags": [ "Sponsorship" ], "summary": "Give towards places", "description": "Starts a checkout; answers where to send the person.\n\n**Who:** Anyone; signed-in staff may see more.", "operationId": "postSponsorshipsCheckout", "security": [ {}, { "bearerAuth": [] } ], "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "eventId": { "type": "string" }, "spots": { "description": "Places to fund (or amount)", "type": [ "number", "string" ] }, "amount": { "type": [ "number", "string" ] }, "anonymous": { "type": [ "boolean", "null" ] }, "sponsorName": { "type": [ "string", "null" ] }, "message": { "type": [ "string", "null" ] }, "name": { "description": "Not signed in", "type": [ "string", "null" ] }, "email": { "type": [ "string", "null" ] }, "phone": { "type": [ "string", "null" ] }, "provider": { "type": [ "string", "null" ] } }, "required": [ "eventId" ], "additionalProperties": {} } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "checkoutId": { "type": [ "string", "null" ] }, "redirectUrl": { "description": "Where to send the person to pay (null when the provider takes a form)", "type": [ "string", "null" ] }, "provider": { "type": [ "string", "null" ] }, "form": { "description": "A form to post (PayFast)", "anyOf": [ { "type": "object", "properties": { "action": { "type": "string" }, "fields": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "string" } } }, "required": [ "action", "fields" ], "additionalProperties": {} }, { "type": "null" } ] }, "amount": { "type": "number", "description": "Rand" } }, "required": [ "amount" ], "additionalProperties": {} } }, "required": [ "data" ], "additionalProperties": false } } } }, "400": { "description": "Validation failed (VALIDATION_FAILED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/events/{id}/consent": { "get": { "tags": [ "Consent" ], "summary": "Parental consent for an event", "description": "**Who:** Staff, supervisors and admins.", "operationId": "getEventsIdConsent", "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": { "event": { "type": "object", "properties": {}, "additionalProperties": {} }, "counts": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "number" }, "description": "Status → how many" }, "rows": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string", "description": "The young person" }, "status": { "type": "string", "description": "not_requested, pending, given, declined" }, "parentName": { "type": [ "string", "null" ] }, "parentEmail": { "type": [ "string", "null" ] }, "parentPhone": { "type": [ "string", "null" ] }, "request": { "anyOf": [ { "type": "object", "properties": {}, "additionalProperties": {} }, { "type": "null" } ] } }, "required": [ "name", "status" ], "additionalProperties": {} } } }, "required": [ "event", "counts", "rows" ], "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}/consent/medical": { "get": { "tags": [ "Consent" ], "summary": "Medical notes from consent forms", "description": "**Who:** Supervisors and admins.", "operationId": "getEventsIdConsentMedical", "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": { "event": { "type": "object", "properties": { "id": { "type": "string" }, "title": { "type": "string" }, "startDate": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "endDate": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] } }, "additionalProperties": {} }, "rows": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string" }, "dateOfBirth": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "parentName": { "type": [ "string", "null" ] }, "parentPhone": { "type": [ "string", "null" ] }, "parentEmail": { "type": [ "string", "null" ] }, "medical": { "anyOf": [ { "type": "object", "properties": {}, "additionalProperties": {} }, { "type": "null" } ] }, "emergency": { "anyOf": [ { "type": "object", "properties": {}, "additionalProperties": {} }, { "type": "null" } ] }, "photoConsent": { "type": [ "boolean", "null" ] }, "purged": { "type": "boolean", "description": "Medical details removed after the event" } }, "required": [ "name", "purged" ], "additionalProperties": {} } } }, "required": [ "event", "rows" ], "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}/consent/resend-pending": { "post": { "tags": [ "Consent" ], "summary": "Remind everyone who hasn't answered", "description": "**Who:** Supervisors and admins.", "operationId": "postEventsIdConsentResend-pending", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "id", "in": "path", "required": true, "description": "The id", "schema": { "type": "string", "minLength": 1, "maxLength": 64 } } ], "requestBody": { "required": true, "description": "No body needed: send an empty object.", "content": { "application/json": { "schema": { "type": "object", "properties": {}, "additionalProperties": {} } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "message": { "type": "string" }, "sent": { "type": "number" }, "pending": { "type": "number" } }, "required": [ "message", "sent", "pending" ], "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}/consent/rerequest": { "post": { "tags": [ "Consent" ], "summary": "Ask for consent again", "description": "After the consent wording changed.\n\n**Who:** Supervisors and admins.", "operationId": "postEventsIdConsentRerequest", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "id", "in": "path", "required": true, "description": "The id", "schema": { "type": "string", "minLength": 1, "maxLength": 64 } } ], "requestBody": { "required": true, "description": "No body needed: send an empty object.", "content": { "application/json": { "schema": { "type": "object", "properties": {}, "additionalProperties": {} } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "message": { "type": "string" }, "created": { "type": "number" } }, "required": [ "message", "created" ], "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" } } } } } } }, "/consent-requests/{id}/resend": { "post": { "tags": [ "Consent" ], "summary": "Send a consent request again", "description": "**Who:** Any signed-in person.", "operationId": "postConsent-requestsIdResend", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "id", "in": "path", "required": true, "description": "The id", "schema": { "type": "string", "minLength": 1, "maxLength": 64 } } ], "requestBody": { "required": true, "description": "No body needed: send an empty object.", "content": { "application/json": { "schema": { "type": "object", "properties": {}, "additionalProperties": {} } } } }, "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" } } } } } } }, "/consent/{token}": { "get": { "tags": [ "Consent" ], "summary": "A consent form", "description": "What the link in a consent request shows (the token is the parent's credential).\n\n**Who:** Anyone.", "operationId": "getConsentToken", "parameters": [ { "name": "token", "in": "path", "required": true, "description": "The token from the link (it is the credential)", "schema": { "type": "string", "minLength": 1, "maxLength": 200 } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "status": { "type": "string" }, "superseded": { "type": "boolean" }, "expired": { "type": "boolean" }, "respondedAt": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "attendeeName": { "type": "string" }, "parentName": { "type": [ "string", "null" ] }, "consentText": { "type": "string" }, "textVersion": { "type": [ "number", "null" ] }, "event": { "type": "object", "properties": { "title": { "type": "string" }, "startDate": { "type": "string", "description": "Date and time (ISO 8601)" }, "endDate": { "type": "string", "description": "Date and time (ISO 8601)" }, "location": { "type": [ "string", "null" ] } }, "required": [ "title", "startDate", "endDate" ], "additionalProperties": {} }, "collect": { "type": "object", "properties": { "medical": { "type": "boolean" }, "emergency": { "type": "boolean" }, "photo": { "type": "boolean" } }, "required": [ "medical", "emergency", "photo" ], "additionalProperties": {}, "description": "What the form asks for" } }, "required": [ "status", "superseded", "expired", "attendeeName", "consentText", "event", "collect" ], "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" } } } } } }, "post": { "tags": [ "Consent" ], "summary": "Answer a consent form", "description": "**Who:** Anyone.", "operationId": "postConsentToken", "parameters": [ { "name": "token", "in": "path", "required": true, "description": "The token from the link (it is the credential)", "schema": { "type": "string", "minLength": 1, "maxLength": 200 } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "decision": { "type": "string", "enum": [ "give", "decline" ] }, "signedName": { "type": "string" }, "isGuardian": { "type": "boolean", "description": "Must be true" }, "medical": { "type": "object", "properties": { "allergies": { "type": [ "string", "null" ] }, "medication": { "type": [ "string", "null" ] }, "conditions": { "type": [ "string", "null" ] }, "medicalAid": { "type": [ "string", "null" ] } }, "additionalProperties": {} }, "emergency": { "type": "object", "properties": { "name": { "type": "string" }, "phone": { "type": "string" }, "relationship": { "type": [ "string", "null" ] } }, "required": [ "name", "phone" ], "additionalProperties": {} }, "photoConsent": { "type": [ "boolean", "null" ] } }, "required": [ "decision", "signedName", "isGuardian" ], "additionalProperties": {} } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "message": { "type": "string" }, "status": { "type": "string", "enum": [ "given", "declined" ] } }, "required": [ "message", "status" ], "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" } } } } } } }, "/form-responses": { "get": { "tags": [ "Registrations" ], "summary": "Attendee form answers", "description": "For an event (`eventId`) or a registration (`registrationId`), for events you may see.\n\n**Who:** Staff, supervisors and admins.", "operationId": "getForm-responses", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "eventId", "in": "query", "required": false, "description": "Only this event", "schema": { "type": "string", "maxLength": 4000 } }, { "name": "registrationId", "in": "query", "required": false, "description": "Only this registration", "schema": { "type": "string", "maxLength": 4000 } }, { "name": "userId", "in": "query", "required": false, "description": "Only this person", "schema": { "type": "string", "maxLength": 4000 } }, { "name": "cursor", "in": "query", "required": false, "description": "Where the last page ended (its `nextCursor`)", "schema": { "type": "string", "maxLength": 4000 } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "items": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "registrationId": { "type": "string" }, "attendeeId": { "type": [ "string", "null" ] }, "createdAt": { "type": "string", "description": "Date and time (ISO 8601)" }, "answers": { "type": "array", "items": { "type": "object", "properties": { "fieldId": { "type": "string" }, "value": { "type": "string" } }, "required": [ "fieldId", "value" ], "additionalProperties": {} } } }, "required": [ "id", "registrationId", "createdAt" ], "additionalProperties": {} } }, "nextCursor": { "description": "Pass as `cursor` for the next page", "type": [ "string", "null" ] } }, "required": [ "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" } } } } } } }, "/feedback/summary": { "get": { "tags": [ "Feedback" ], "summary": "Feedback across events", "description": "**Who:** Supervisors and admins.", "operationId": "getFeedbackSummary", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "eventIds", "in": "query", "required": false, "description": "These events (comma-separated ids)", "schema": { "type": "string", "maxLength": 4000 } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "array", "items": { "type": "object", "properties": { "eventId": { "type": "string" }, "title": { "type": "string" }, "startDate": { "type": "string", "description": "Date and time (ISO 8601)" }, "anonymous": { "type": "boolean" }, "sentAt": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "invited": { "type": "number" }, "responses": { "type": "number" }, "responseRate": { "description": "%", "type": [ "number", "null" ] }, "questions": { "type": "array", "items": { "type": "object", "properties": {}, "additionalProperties": {} }, "description": "Each question with its answers summarised" } }, "required": [ "eventId", "title", "startDate", "anonymous", "invited", "responses", "questions" ], "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" } } } } } } }, "/feedback-forms/{token}": { "get": { "tags": [ "Feedback" ], "summary": "A feedback form", "description": "What the link sent after an event shows (the token is the credential).\n\n**Who:** Anyone.", "operationId": "getFeedback-formsToken", "parameters": [ { "name": "token", "in": "path", "required": true, "description": "The token from the link (it is the credential)", "schema": { "type": "string", "minLength": 1, "maxLength": 200 } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "event": { "type": "object", "properties": {}, "additionalProperties": {} }, "name": { "type": "string" }, "intro": { "type": [ "string", "null" ] }, "anonymous": { "type": "boolean" }, "responded": { "type": "boolean" }, "fields": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "type": { "type": "string", "description": "rating, multiple_choice, text, yes_no…" }, "label": { "type": "string" }, "isRequired": { "type": [ "boolean", "null" ] }, "helpText": { "type": [ "string", "null" ] }, "options": { "anyOf": [ { "type": "array", "items": { "type": "string" } }, { "type": "null" } ] } }, "required": [ "type", "label" ], "additionalProperties": {} } } }, "required": [ "event", "name", "anonymous", "responded", "fields" ], "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" } } } } } }, "post": { "tags": [ "Feedback" ], "summary": "Answer a feedback form", "description": "**Who:** Anyone.", "operationId": "postFeedback-formsToken", "parameters": [ { "name": "token", "in": "path", "required": true, "description": "The token from the link (it is the credential)", "schema": { "type": "string", "minLength": 1, "maxLength": 200 } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "answers": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {}, "description": "Field id → answer" } }, "required": [ "answers" ], "additionalProperties": {} } } } }, "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" } } } }, "404": { "description": "Not found (NOT_FOUND)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/events/{id}/feedback": { "get": { "tags": [ "Feedback" ], "summary": "An event's feedback set-up and answers", "description": "**Who:** Supervisors and admins.", "operationId": "getEventsIdFeedback", "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": { "anyOf": [ { "type": "object", "properties": { "id": { "type": "string" }, "eventId": { "type": "string" }, "sendAt": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "sentAt": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "audience": { "type": "string", "description": "checked_in or everyone" }, "anonymous": { "type": "boolean" }, "intro": { "type": [ "string", "null" ] }, "fields": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "type": { "type": "string", "description": "rating, multiple_choice, text, yes_no…" }, "label": { "type": "string" }, "isRequired": { "type": [ "boolean", "null" ] }, "helpText": { "type": [ "string", "null" ] }, "options": { "anyOf": [ { "type": "array", "items": { "type": "string" } }, { "type": "null" } ] } }, "required": [ "type", "label" ], "additionalProperties": {} } }, "invited": { "type": [ "number", "null" ] }, "responses": { "description": "Answers per question" } }, "required": [ "id", "eventId", "audience", "anonymous", "fields" ], "additionalProperties": {} }, { "type": "null" } ], "description": "null when the event has no feedback form" } }, "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": [ "Feedback" ], "summary": "Set up an event's feedback form", "description": "**Who:** Supervisors and admins.", "operationId": "putEventsIdFeedback", "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": { "sendAt": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "audience": { "description": "checked_in or everyone", "type": [ "string", "null" ] }, "anonymous": { "type": [ "boolean", "null" ] }, "intro": { "type": [ "string", "null" ] }, "fields": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "type": { "type": "string", "description": "rating, multiple_choice, text, yes_no…" }, "label": { "type": "string" }, "isRequired": { "type": [ "boolean", "null" ] }, "helpText": { "type": [ "string", "null" ] }, "options": { "anyOf": [ { "type": "array", "items": { "type": "string" } }, { "type": "null" } ] } }, "required": [ "type", "label" ], "additionalProperties": {} } } }, "required": [ "fields" ], "additionalProperties": {} } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "anyOf": [ { "type": "object", "properties": { "id": { "type": "string" }, "eventId": { "type": "string" }, "sendAt": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "sentAt": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "audience": { "type": "string", "description": "checked_in or everyone" }, "anonymous": { "type": "boolean" }, "intro": { "type": [ "string", "null" ] }, "fields": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "type": { "type": "string", "description": "rating, multiple_choice, text, yes_no…" }, "label": { "type": "string" }, "isRequired": { "type": [ "boolean", "null" ] }, "helpText": { "type": [ "string", "null" ] }, "options": { "anyOf": [ { "type": "array", "items": { "type": "string" } }, { "type": "null" } ] } }, "required": [ "type", "label" ], "additionalProperties": {} } }, "invited": { "type": [ "number", "null" ] }, "responses": { "description": "Answers per question" } }, "required": [ "id", "eventId", "audience", "anonymous", "fields" ], "additionalProperties": {} }, { "type": "null" } ], "description": "null when the event has no feedback form" } }, "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": [ "Feedback" ], "summary": "Remove an event's feedback form", "description": "**Who:** Supervisors and admins.", "operationId": "deleteEventsIdFeedback", "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" } } } } } } }, "/events/{id}/feedback/send-now": { "post": { "tags": [ "Feedback" ], "summary": "Send the feedback form now", "description": "Answers straight away: `invited` is how many it is going to; the emails go out in the background.\n\n**Who:** Supervisors and admins.", "operationId": "postEventsIdFeedbackSend-now", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "id", "in": "path", "required": true, "description": "The id", "schema": { "type": "string", "minLength": 1, "maxLength": 64 } } ], "requestBody": { "required": true, "description": "No body needed: send an empty object.", "content": { "application/json": { "schema": { "type": "object", "properties": {}, "additionalProperties": {} } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "invited": { "type": "number" }, "message": { "type": "string" } }, "required": [ "invited", "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" } } } } } } }, "/me/tickets": { "get": { "tags": [ "Tickets" ], "summary": "My tickets", "description": "Including ones transferred to me.\n\n**Who:** Any signed-in person.", "operationId": "getMeTickets", "security": [ { "bearerAuth": [] } ], "parameters": [], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "qrCode": { "type": "string", "description": "What the QR code holds" }, "quantity": { "type": "number", "description": "People on the ticket" }, "isUsed": { "type": "boolean" }, "eventId": { "type": "string" }, "userId": { "type": "string", "description": "The payer" }, "registrationOptionId": { "type": "string" }, "attendeeId": { "description": "A named ticket: the person it's for", "type": [ "string", "null" ] }, "holderUserId": { "type": [ "string", "null" ] }, "createdAt": { "type": "string", "description": "Date and time (ISO 8601)" }, "usages": { "description": "Check-ins", "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "scannedAt": { "type": "string", "description": "Date and time (ISO 8601)" }, "quantityRedeemed": { "type": "number" }, "sessionId": { "type": [ "string", "null" ] }, "manual": { "description": "Ticked present by hand", "type": [ "boolean", "null" ] } }, "required": [ "scannedAt", "quantityRedeemed" ], "additionalProperties": {} } }, "event": { "anyOf": [ { "type": "object", "properties": { "id": { "type": "string" }, "title": { "type": "string" }, "description": { "type": [ "string", "null" ] }, "startDate": { "type": "string", "description": "Date and time (ISO 8601)" }, "endDate": { "type": "string", "description": "Date and time (ISO 8601)" }, "location": { "type": [ "string", "null" ] }, "price": { "anyOf": [ { "type": "number", "description": "Rand" }, { "type": "null" } ] }, "isActive": { "type": [ "boolean", "null" ] }, "isHidden": { "type": [ "boolean", "null" ] }, "imageUrl": { "type": [ "string", "null" ] }, "campusId": { "type": [ "string", "null" ] }, "scheduleType": { "anyOf": [ { "type": "string", "enum": [ "single", "sessions" ] }, { "type": "null" } ] }, "cashupStatus": { "anyOf": [ { "type": "string", "enum": [ "open", "closed" ] }, { "type": "null" } ] } }, "additionalProperties": {} }, { "type": "null" } ] }, "user": { "description": "The payer", "anyOf": [ { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "email": { "type": [ "string", "null" ] }, "phoneNumber": { "type": [ "string", "null" ] } }, "required": [ "name" ], "additionalProperties": {} }, { "type": "null" } ] }, "attendee": { "anyOf": [ { "type": "object", "properties": { "name": { "type": "string" } }, "required": [ "name" ], "additionalProperties": {} }, { "type": "null" } ] }, "registrationOption": { "anyOf": [ { "type": "object", "properties": { "eventOption": { "anyOf": [ { "type": "object", "properties": { "id": { "type": "string" }, "eventId": { "type": "string" }, "name": { "type": "string" }, "description": { "type": [ "string", "null" ] }, "price": { "type": "number", "description": "Rand" }, "isMainTicket": { "type": "boolean" }, "stockLimit": { "type": [ "number", "null" ] } }, "additionalProperties": {} }, { "type": "null" } ] }, "variant": { "anyOf": [ { "type": "object", "properties": { "name": { "type": "string" } }, "required": [ "name" ], "additionalProperties": {} }, { "type": "null" } ] }, "registration": { "anyOf": [ { "type": "object", "properties": { "id": { "type": "string" }, "userId": { "type": "string" }, "eventId": { "type": "string" }, "status": { "type": "string", "enum": [ "pending", "confirmed", "partial_paid", "paid", "cancelled" ] }, "discountTotal": { "anyOf": [ { "type": "number", "description": "Rand" }, { "type": "null" } ] }, "totalDueComputed": { "description": "What it costs now, after discounts", "anyOf": [ { "type": "number", "description": "Rand" }, { "type": "null" } ] }, "createdAt": { "type": "string", "description": "Date and time (ISO 8601)" }, "user": { "anyOf": [ { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "email": { "type": [ "string", "null" ] }, "phoneNumber": { "type": [ "string", "null" ] } }, "required": [ "name" ], "additionalProperties": {} }, { "type": "null" } ] }, "event": { "anyOf": [ { "type": "object", "properties": { "id": { "type": "string" }, "title": { "type": "string" }, "startDate": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "endDate": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] } }, "required": [ "id", "title" ], "additionalProperties": {} }, { "type": "null" } ] } }, "additionalProperties": {} }, { "type": "null" } ] } }, "additionalProperties": {} }, { "type": "null" } ] } }, "required": [ "id", "qrCode", "quantity", "isUsed", "eventId", "userId", "registrationOptionId", "createdAt" ], "additionalProperties": {} } } }, "required": [ "data" ], "additionalProperties": false } } } }, "401": { "description": "Not signed in (UNAUTHENTICATED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/me/tickets/email": { "post": { "tags": [ "Tickets" ], "summary": "Send me my tickets", "description": "For a registration (`registrationId`) or chosen tickets (`ticketIds`), by email and/or WhatsApp (`channel`).\n\n**Who:** Any signed-in person.", "operationId": "postMeTicketsEmail", "security": [ { "bearerAuth": [] } ], "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "registrationId": { "type": "string", "minLength": 1, "maxLength": 64 }, "ticketIds": { "maxItems": 500, "type": "array", "items": { "type": "string", "minLength": 1, "maxLength": 64 } }, "channel": { "type": "string", "maxLength": 20 } }, "additionalProperties": {} } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "message": { "type": "string" }, "ticketIds": { "description": "The tickets sent", "type": "array", "items": { "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" } } } } } } }, "/tickets/scans/recent": { "get": { "tags": [ "Tickets" ], "summary": "Recent scans", "description": "**Who:** Staff, supervisors and admins.", "operationId": "getTicketsScansRecent", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "eventId", "in": "query", "required": false, "description": "Only this event", "schema": { "type": "string", "maxLength": 4000 } }, { "name": "limit", "in": "query", "required": false, "description": "How many per page", "schema": { "type": "string", "maxLength": 4000 } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "scannedAt": { "type": "string", "description": "Date and time (ISO 8601)" }, "quantityRedeemed": { "type": "number" }, "scannedBy": { "anyOf": [ { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "email": { "type": [ "string", "null" ] } }, "required": [ "name" ], "additionalProperties": {} }, { "type": "null" } ] }, "ticket": { "type": "object", "properties": { "id": { "type": "string" }, "event": { "type": "object", "properties": { "title": { "type": "string" } }, "required": [ "title" ], "additionalProperties": {} }, "registrationOption": { "anyOf": [ { "type": "object", "properties": {}, "additionalProperties": {} }, { "type": "null" } ] } }, "required": [ "id", "event" ], "additionalProperties": {} } }, "required": [ "id", "scannedAt", "quantityRedeemed", "ticket" ], "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" } } } } } } }, "/tickets/scans/stats": { "get": { "tags": [ "Tickets" ], "summary": "Scan counts", "description": "**Who:** Staff, supervisors and admins.", "operationId": "getTicketsScansStats", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "eventId", "in": "query", "required": false, "description": "Only this event", "schema": { "type": "string", "maxLength": 4000 } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "totalToday": { "type": "number" }, "myToday": { "type": "number" }, "lastHour": { "type": "number" }, "byStaff": { "type": "array", "items": { "type": "object", "properties": { "scannedById": { "type": "string" }, "name": { "type": "string" }, "count": { "type": "number" } }, "required": [ "scannedById", "name", "count" ], "additionalProperties": {} } } }, "required": [ "totalToday", "myToday", "lastHour", "byStaff" ], "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" } } } } } } }, "/tickets/send": { "post": { "tags": [ "Tickets" ], "summary": "Send tickets to someone", "description": "Staff: a registration's tickets (or chosen ones) to an email address or phone number.\n\n**Who:** Staff, supervisors and admins.", "operationId": "postTicketsSend", "security": [ { "bearerAuth": [] } ], "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "registrationId": { "type": [ "string", "null" ] }, "ticketIds": { "description": "Or registrationId", "type": "array", "items": { "type": "string" } }, "channel": { "type": "string", "enum": [ "email", "whatsapp", "both" ], "description": "How to send it" }, "overrideEmail": { "description": "Send here instead", "type": [ "string", "null" ] }, "overridePhone": { "type": [ "string", "null" ] } }, "required": [ "channel" ], "additionalProperties": {} } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "message": { "type": "string" }, "ticketIds": { "description": "The tickets sent", "type": "array", "items": { "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" } } } } } } }, "/tickets/generate": { "post": { "tags": [ "Tickets" ], "summary": "Issue a registration's tickets", "description": "**Who:** Supervisors and admins.", "operationId": "postTicketsGenerate", "security": [ { "bearerAuth": [] } ], "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "registrationId": { "type": "string", "minLength": 1, "maxLength": 64 } }, "required": [ "registrationId" ], "additionalProperties": {} } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "message": { "type": "string" }, "tickets": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "qrCode": { "type": "string", "description": "What the QR code holds" }, "quantity": { "type": "number", "description": "People on the ticket" }, "isUsed": { "type": "boolean" }, "eventId": { "type": "string" }, "userId": { "type": "string", "description": "The payer" }, "registrationOptionId": { "type": "string" }, "attendeeId": { "description": "A named ticket: the person it's for", "type": [ "string", "null" ] }, "holderUserId": { "type": [ "string", "null" ] }, "createdAt": { "type": "string", "description": "Date and time (ISO 8601)" }, "usages": { "description": "Check-ins", "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "scannedAt": { "type": "string", "description": "Date and time (ISO 8601)" }, "quantityRedeemed": { "type": "number" }, "sessionId": { "type": [ "string", "null" ] }, "manual": { "description": "Ticked present by hand", "type": [ "boolean", "null" ] } }, "required": [ "scannedAt", "quantityRedeemed" ], "additionalProperties": {} } }, "event": { "anyOf": [ { "type": "object", "properties": { "id": { "type": "string" }, "title": { "type": "string" }, "description": { "type": [ "string", "null" ] }, "startDate": { "type": "string", "description": "Date and time (ISO 8601)" }, "endDate": { "type": "string", "description": "Date and time (ISO 8601)" }, "location": { "type": [ "string", "null" ] }, "price": { "anyOf": [ { "type": "number", "description": "Rand" }, { "type": "null" } ] }, "isActive": { "type": [ "boolean", "null" ] }, "isHidden": { "type": [ "boolean", "null" ] }, "imageUrl": { "type": [ "string", "null" ] }, "campusId": { "type": [ "string", "null" ] }, "scheduleType": { "anyOf": [ { "type": "string", "enum": [ "single", "sessions" ] }, { "type": "null" } ] }, "cashupStatus": { "anyOf": [ { "type": "string", "enum": [ "open", "closed" ] }, { "type": "null" } ] } }, "additionalProperties": {} }, { "type": "null" } ] }, "user": { "description": "The payer", "anyOf": [ { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "email": { "type": [ "string", "null" ] }, "phoneNumber": { "type": [ "string", "null" ] } }, "required": [ "name" ], "additionalProperties": {} }, { "type": "null" } ] }, "attendee": { "anyOf": [ { "type": "object", "properties": { "name": { "type": "string" } }, "required": [ "name" ], "additionalProperties": {} }, { "type": "null" } ] }, "registrationOption": { "anyOf": [ { "type": "object", "properties": { "eventOption": { "anyOf": [ { "type": "object", "properties": { "id": { "type": "string" }, "eventId": { "type": "string" }, "name": { "type": "string" }, "description": { "type": [ "string", "null" ] }, "price": { "type": "number", "description": "Rand" }, "isMainTicket": { "type": "boolean" }, "stockLimit": { "type": [ "number", "null" ] } }, "additionalProperties": {} }, { "type": "null" } ] }, "variant": { "anyOf": [ { "type": "object", "properties": { "name": { "type": "string" } }, "required": [ "name" ], "additionalProperties": {} }, { "type": "null" } ] }, "registration": { "anyOf": [ { "type": "object", "properties": { "id": { "type": "string" }, "userId": { "type": "string" }, "eventId": { "type": "string" }, "status": { "type": "string", "enum": [ "pending", "confirmed", "partial_paid", "paid", "cancelled" ] }, "discountTotal": { "anyOf": [ { "type": "number", "description": "Rand" }, { "type": "null" } ] }, "totalDueComputed": { "description": "What it costs now, after discounts", "anyOf": [ { "type": "number", "description": "Rand" }, { "type": "null" } ] }, "createdAt": { "type": "string", "description": "Date and time (ISO 8601)" }, "user": { "anyOf": [ { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "email": { "type": [ "string", "null" ] }, "phoneNumber": { "type": [ "string", "null" ] } }, "required": [ "name" ], "additionalProperties": {} }, { "type": "null" } ] }, "event": { "anyOf": [ { "type": "object", "properties": { "id": { "type": "string" }, "title": { "type": "string" }, "startDate": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "endDate": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] } }, "required": [ "id", "title" ], "additionalProperties": {} }, { "type": "null" } ] } }, "additionalProperties": {} }, { "type": "null" } ] } }, "additionalProperties": {} }, { "type": "null" } ] } }, "required": [ "id", "qrCode", "quantity", "isUsed", "eventId", "userId", "registrationOptionId", "createdAt" ], "additionalProperties": {} } } }, "required": [ "message", "tickets" ], "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" } } } } } } }, "/tickets/email-sent": { "post": { "tags": [ "Tickets" ], "summary": "Mark tickets as emailed", "description": "**Who:** Admins only.", "operationId": "postTicketsEmail-sent", "security": [ { "bearerAuth": [] } ], "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "ticketIds": { "type": "array", "items": { "type": "string" }, "description": "Ids" } }, "required": [ "ticketIds" ], "additionalProperties": {} } } } }, "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" } } } } } } }, "/tickets": { "get": { "tags": [ "Tickets" ], "summary": "Every ticket", "description": "**Who:** Supervisors and admins.", "operationId": "getTickets", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "eventId", "in": "query", "required": false, "description": "Only this event", "schema": { "type": "string", "maxLength": 4000 } }, { "name": "page", "in": "query", "required": false, "description": "Page number, from 1", "schema": { "type": "string", "maxLength": 4000 } }, { "name": "limit", "in": "query", "required": false, "description": "How many per page", "schema": { "type": "string", "maxLength": 4000 } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "data": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "qrCode": { "type": "string", "description": "What the QR code holds" }, "quantity": { "type": "number", "description": "People on the ticket" }, "isUsed": { "type": "boolean" }, "eventId": { "type": "string" }, "userId": { "type": "string", "description": "The payer" }, "registrationOptionId": { "type": "string" }, "attendeeId": { "description": "A named ticket: the person it's for", "type": [ "string", "null" ] }, "holderUserId": { "type": [ "string", "null" ] }, "createdAt": { "type": "string", "description": "Date and time (ISO 8601)" }, "usages": { "description": "Check-ins", "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "scannedAt": { "type": "string", "description": "Date and time (ISO 8601)" }, "quantityRedeemed": { "type": "number" }, "sessionId": { "type": [ "string", "null" ] }, "manual": { "description": "Ticked present by hand", "type": [ "boolean", "null" ] } }, "required": [ "scannedAt", "quantityRedeemed" ], "additionalProperties": {} } }, "event": { "anyOf": [ { "type": "object", "properties": { "id": { "type": "string" }, "title": { "type": "string" }, "description": { "type": [ "string", "null" ] }, "startDate": { "type": "string", "description": "Date and time (ISO 8601)" }, "endDate": { "type": "string", "description": "Date and time (ISO 8601)" }, "location": { "type": [ "string", "null" ] }, "price": { "anyOf": [ { "type": "number", "description": "Rand" }, { "type": "null" } ] }, "isActive": { "type": [ "boolean", "null" ] }, "isHidden": { "type": [ "boolean", "null" ] }, "imageUrl": { "type": [ "string", "null" ] }, "campusId": { "type": [ "string", "null" ] }, "scheduleType": { "anyOf": [ { "type": "string", "enum": [ "single", "sessions" ] }, { "type": "null" } ] }, "cashupStatus": { "anyOf": [ { "type": "string", "enum": [ "open", "closed" ] }, { "type": "null" } ] } }, "additionalProperties": {} }, { "type": "null" } ] }, "user": { "description": "The payer", "anyOf": [ { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "email": { "type": [ "string", "null" ] }, "phoneNumber": { "type": [ "string", "null" ] } }, "required": [ "name" ], "additionalProperties": {} }, { "type": "null" } ] }, "attendee": { "anyOf": [ { "type": "object", "properties": { "name": { "type": "string" } }, "required": [ "name" ], "additionalProperties": {} }, { "type": "null" } ] }, "registrationOption": { "anyOf": [ { "type": "object", "properties": { "eventOption": { "anyOf": [ { "type": "object", "properties": { "id": { "type": "string" }, "eventId": { "type": "string" }, "name": { "type": "string" }, "description": { "type": [ "string", "null" ] }, "price": { "type": "number", "description": "Rand" }, "isMainTicket": { "type": "boolean" }, "stockLimit": { "type": [ "number", "null" ] } }, "additionalProperties": {} }, { "type": "null" } ] }, "variant": { "anyOf": [ { "type": "object", "properties": { "name": { "type": "string" } }, "required": [ "name" ], "additionalProperties": {} }, { "type": "null" } ] }, "registration": { "anyOf": [ { "type": "object", "properties": { "id": { "type": "string" }, "userId": { "type": "string" }, "eventId": { "type": "string" }, "status": { "type": "string", "enum": [ "pending", "confirmed", "partial_paid", "paid", "cancelled" ] }, "discountTotal": { "anyOf": [ { "type": "number", "description": "Rand" }, { "type": "null" } ] }, "totalDueComputed": { "description": "What it costs now, after discounts", "anyOf": [ { "type": "number", "description": "Rand" }, { "type": "null" } ] }, "createdAt": { "type": "string", "description": "Date and time (ISO 8601)" }, "user": { "anyOf": [ { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "email": { "type": [ "string", "null" ] }, "phoneNumber": { "type": [ "string", "null" ] } }, "required": [ "name" ], "additionalProperties": {} }, { "type": "null" } ] }, "event": { "anyOf": [ { "type": "object", "properties": { "id": { "type": "string" }, "title": { "type": "string" }, "startDate": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "endDate": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] } }, "required": [ "id", "title" ], "additionalProperties": {} }, { "type": "null" } ] } }, "additionalProperties": {} }, { "type": "null" } ] } }, "additionalProperties": {} }, { "type": "null" } ] } }, "required": [ "id", "qrCode", "quantity", "isUsed", "eventId", "userId", "registrationOptionId", "createdAt" ], "additionalProperties": {} } }, "total": { "type": "number" }, "page": { "type": "number" }, "limit": { "type": "number" }, "pages": { "type": "number" } }, "required": [ "data", "total", "page", "limit", "pages" ], "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" } } } } } } }, "/tickets/qr/{qrCode}": { "get": { "tags": [ "Tickets" ], "summary": "The ticket for a QR code", "description": "Without checking it in (that's POST /checkin/{qrCode}).\n\n**Who:** Staff, supervisors and admins.", "operationId": "getTicketsQrQrCode", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "qrCode", "in": "path", "required": true, "description": "What the ticket's QR code holds", "schema": { "type": "string", "minLength": 1, "maxLength": 200 } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "id": { "type": "string" }, "qrCode": { "type": "string", "description": "What the QR code holds" }, "quantity": { "type": "number", "description": "People on the ticket" }, "isUsed": { "type": "boolean" }, "eventId": { "type": "string" }, "userId": { "type": "string", "description": "The payer" }, "registrationOptionId": { "type": "string" }, "attendeeId": { "description": "A named ticket: the person it's for", "type": [ "string", "null" ] }, "holderUserId": { "type": [ "string", "null" ] }, "createdAt": { "type": "string", "description": "Date and time (ISO 8601)" }, "usages": { "description": "Check-ins", "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "scannedAt": { "type": "string", "description": "Date and time (ISO 8601)" }, "quantityRedeemed": { "type": "number" }, "sessionId": { "type": [ "string", "null" ] }, "manual": { "description": "Ticked present by hand", "type": [ "boolean", "null" ] } }, "required": [ "scannedAt", "quantityRedeemed" ], "additionalProperties": {} } }, "event": { "anyOf": [ { "type": "object", "properties": { "id": { "type": "string" }, "title": { "type": "string" }, "description": { "type": [ "string", "null" ] }, "startDate": { "type": "string", "description": "Date and time (ISO 8601)" }, "endDate": { "type": "string", "description": "Date and time (ISO 8601)" }, "location": { "type": [ "string", "null" ] }, "price": { "anyOf": [ { "type": "number", "description": "Rand" }, { "type": "null" } ] }, "isActive": { "type": [ "boolean", "null" ] }, "isHidden": { "type": [ "boolean", "null" ] }, "imageUrl": { "type": [ "string", "null" ] }, "campusId": { "type": [ "string", "null" ] }, "scheduleType": { "anyOf": [ { "type": "string", "enum": [ "single", "sessions" ] }, { "type": "null" } ] }, "cashupStatus": { "anyOf": [ { "type": "string", "enum": [ "open", "closed" ] }, { "type": "null" } ] } }, "additionalProperties": {} }, { "type": "null" } ] }, "user": { "description": "The payer", "anyOf": [ { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "email": { "type": [ "string", "null" ] }, "phoneNumber": { "type": [ "string", "null" ] } }, "required": [ "name" ], "additionalProperties": {} }, { "type": "null" } ] }, "attendee": { "anyOf": [ { "type": "object", "properties": { "name": { "type": "string" } }, "required": [ "name" ], "additionalProperties": {} }, { "type": "null" } ] }, "registrationOption": { "anyOf": [ { "type": "object", "properties": { "eventOption": { "anyOf": [ { "type": "object", "properties": { "id": { "type": "string" }, "eventId": { "type": "string" }, "name": { "type": "string" }, "description": { "type": [ "string", "null" ] }, "price": { "type": "number", "description": "Rand" }, "isMainTicket": { "type": "boolean" }, "stockLimit": { "type": [ "number", "null" ] } }, "additionalProperties": {} }, { "type": "null" } ] }, "variant": { "anyOf": [ { "type": "object", "properties": { "name": { "type": "string" } }, "required": [ "name" ], "additionalProperties": {} }, { "type": "null" } ] }, "registration": { "anyOf": [ { "type": "object", "properties": { "id": { "type": "string" }, "userId": { "type": "string" }, "eventId": { "type": "string" }, "status": { "type": "string", "enum": [ "pending", "confirmed", "partial_paid", "paid", "cancelled" ] }, "discountTotal": { "anyOf": [ { "type": "number", "description": "Rand" }, { "type": "null" } ] }, "totalDueComputed": { "description": "What it costs now, after discounts", "anyOf": [ { "type": "number", "description": "Rand" }, { "type": "null" } ] }, "createdAt": { "type": "string", "description": "Date and time (ISO 8601)" }, "user": { "anyOf": [ { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "email": { "type": [ "string", "null" ] }, "phoneNumber": { "type": [ "string", "null" ] } }, "required": [ "name" ], "additionalProperties": {} }, { "type": "null" } ] }, "event": { "anyOf": [ { "type": "object", "properties": { "id": { "type": "string" }, "title": { "type": "string" }, "startDate": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "endDate": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] } }, "required": [ "id", "title" ], "additionalProperties": {} }, { "type": "null" } ] } }, "additionalProperties": {} }, { "type": "null" } ] } }, "additionalProperties": {} }, { "type": "null" } ] } }, "required": [ "id", "qrCode", "quantity", "isUsed", "eventId", "userId", "registrationOptionId", "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" } } } }, "404": { "description": "Not found (NOT_FOUND)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/events/{id}/tickets": { "get": { "tags": [ "Tickets" ], "summary": "An event's tickets", "description": "**Who:** Staff, supervisors and admins.", "operationId": "getEventsIdTickets", "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" }, "qrCode": { "type": "string", "description": "What the QR code holds" }, "quantity": { "type": "number", "description": "People on the ticket" }, "isUsed": { "type": "boolean" }, "eventId": { "type": "string" }, "userId": { "type": "string", "description": "The payer" }, "registrationOptionId": { "type": "string" }, "attendeeId": { "description": "A named ticket: the person it's for", "type": [ "string", "null" ] }, "holderUserId": { "type": [ "string", "null" ] }, "createdAt": { "type": "string", "description": "Date and time (ISO 8601)" }, "usages": { "description": "Check-ins", "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "scannedAt": { "type": "string", "description": "Date and time (ISO 8601)" }, "quantityRedeemed": { "type": "number" }, "sessionId": { "type": [ "string", "null" ] }, "manual": { "description": "Ticked present by hand", "type": [ "boolean", "null" ] } }, "required": [ "scannedAt", "quantityRedeemed" ], "additionalProperties": {} } }, "event": { "anyOf": [ { "type": "object", "properties": { "id": { "type": "string" }, "title": { "type": "string" }, "description": { "type": [ "string", "null" ] }, "startDate": { "type": "string", "description": "Date and time (ISO 8601)" }, "endDate": { "type": "string", "description": "Date and time (ISO 8601)" }, "location": { "type": [ "string", "null" ] }, "price": { "anyOf": [ { "type": "number", "description": "Rand" }, { "type": "null" } ] }, "isActive": { "type": [ "boolean", "null" ] }, "isHidden": { "type": [ "boolean", "null" ] }, "imageUrl": { "type": [ "string", "null" ] }, "campusId": { "type": [ "string", "null" ] }, "scheduleType": { "anyOf": [ { "type": "string", "enum": [ "single", "sessions" ] }, { "type": "null" } ] }, "cashupStatus": { "anyOf": [ { "type": "string", "enum": [ "open", "closed" ] }, { "type": "null" } ] } }, "additionalProperties": {} }, { "type": "null" } ] }, "user": { "description": "The payer", "anyOf": [ { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "email": { "type": [ "string", "null" ] }, "phoneNumber": { "type": [ "string", "null" ] } }, "required": [ "name" ], "additionalProperties": {} }, { "type": "null" } ] }, "attendee": { "anyOf": [ { "type": "object", "properties": { "name": { "type": "string" } }, "required": [ "name" ], "additionalProperties": {} }, { "type": "null" } ] }, "registrationOption": { "anyOf": [ { "type": "object", "properties": { "eventOption": { "anyOf": [ { "type": "object", "properties": { "id": { "type": "string" }, "eventId": { "type": "string" }, "name": { "type": "string" }, "description": { "type": [ "string", "null" ] }, "price": { "type": "number", "description": "Rand" }, "isMainTicket": { "type": "boolean" }, "stockLimit": { "type": [ "number", "null" ] } }, "additionalProperties": {} }, { "type": "null" } ] }, "variant": { "anyOf": [ { "type": "object", "properties": { "name": { "type": "string" } }, "required": [ "name" ], "additionalProperties": {} }, { "type": "null" } ] }, "registration": { "anyOf": [ { "type": "object", "properties": { "id": { "type": "string" }, "userId": { "type": "string" }, "eventId": { "type": "string" }, "status": { "type": "string", "enum": [ "pending", "confirmed", "partial_paid", "paid", "cancelled" ] }, "discountTotal": { "anyOf": [ { "type": "number", "description": "Rand" }, { "type": "null" } ] }, "totalDueComputed": { "description": "What it costs now, after discounts", "anyOf": [ { "type": "number", "description": "Rand" }, { "type": "null" } ] }, "createdAt": { "type": "string", "description": "Date and time (ISO 8601)" }, "user": { "anyOf": [ { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "email": { "type": [ "string", "null" ] }, "phoneNumber": { "type": [ "string", "null" ] } }, "required": [ "name" ], "additionalProperties": {} }, { "type": "null" } ] }, "event": { "anyOf": [ { "type": "object", "properties": { "id": { "type": "string" }, "title": { "type": "string" }, "startDate": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "endDate": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] } }, "required": [ "id", "title" ], "additionalProperties": {} }, { "type": "null" } ] } }, "additionalProperties": {} }, { "type": "null" } ] } }, "additionalProperties": {} }, { "type": "null" } ] } }, "required": [ "id", "qrCode", "quantity", "isUsed", "eventId", "userId", "registrationOptionId", "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" } } } }, "404": { "description": "Not found (NOT_FOUND)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/ticket-transfers/{token}": { "get": { "tags": [ "Tickets" ], "summary": "A ticket someone is giving you", "description": "What the transfer link shows (the token is the credential).\n\n**Who:** Anyone.", "operationId": "getTicket-transfersToken", "parameters": [ { "name": "token", "in": "path", "required": true, "description": "The token from the link (it is the credential)", "schema": { "type": "string", "minLength": 1, "maxLength": 200 } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "status": { "type": "string", "description": "pending, accepted, declined, cancelled, expired" }, "toName": { "type": "string" }, "expiresAt": { "type": "string", "description": "Date and time (ISO 8601)" }, "fromName": { "type": "string" }, "event": { "type": "object", "properties": { "id": { "type": "string" }, "title": { "type": "string" }, "description": { "type": [ "string", "null" ] }, "startDate": { "type": "string", "description": "Date and time (ISO 8601)" }, "endDate": { "type": "string", "description": "Date and time (ISO 8601)" }, "location": { "type": [ "string", "null" ] }, "price": { "anyOf": [ { "type": "number", "description": "Rand" }, { "type": "null" } ] }, "isActive": { "type": [ "boolean", "null" ] }, "isHidden": { "type": [ "boolean", "null" ] }, "imageUrl": { "type": [ "string", "null" ] }, "campusId": { "type": [ "string", "null" ] }, "scheduleType": { "anyOf": [ { "type": "string", "enum": [ "single", "sessions" ] }, { "type": "null" } ] }, "cashupStatus": { "anyOf": [ { "type": "string", "enum": [ "open", "closed" ] }, { "type": "null" } ] } }, "additionalProperties": {} }, "option": { "type": "string" } }, "required": [ "status", "toName", "expiresAt", "fromName", "event", "option" ], "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" } } } } } } }, "/ticket-transfers/{token}/accept": { "post": { "tags": [ "Tickets" ], "summary": "Accept a ticket", "description": "**Who:** Anyone.", "operationId": "postTicket-transfersTokenAccept", "parameters": [ { "name": "token", "in": "path", "required": true, "description": "The token from the link (it is the credential)", "schema": { "type": "string", "minLength": 1, "maxLength": 200 } } ], "requestBody": { "required": true, "description": "No body needed: send an empty object.", "content": { "application/json": { "schema": { "type": "object", "properties": {}, "additionalProperties": {} } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "message": { "type": "string" }, "ticketId": { "type": "string" } }, "required": [ "message", "ticketId" ], "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" } } } } } } }, "/ticket-transfers/{token}/decline": { "post": { "tags": [ "Tickets" ], "summary": "Decline a ticket", "description": "**Who:** Anyone.", "operationId": "postTicket-transfersTokenDecline", "parameters": [ { "name": "token", "in": "path", "required": true, "description": "The token from the link (it is the credential)", "schema": { "type": "string", "minLength": 1, "maxLength": 200 } } ], "requestBody": { "required": true, "description": "No body needed: send an empty object.", "content": { "application/json": { "schema": { "type": "object", "properties": {}, "additionalProperties": {} } } } }, "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" } } } }, "404": { "description": "Not found (NOT_FOUND)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/tickets/{id}": { "get": { "tags": [ "Tickets" ], "summary": "One ticket", "description": "**Who:** Any signed-in person.", "operationId": "getTicketsId", "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" }, "qrCode": { "type": "string", "description": "What the QR code holds" }, "quantity": { "type": "number", "description": "People on the ticket" }, "isUsed": { "type": "boolean" }, "eventId": { "type": "string" }, "userId": { "type": "string", "description": "The payer" }, "registrationOptionId": { "type": "string" }, "attendeeId": { "description": "A named ticket: the person it's for", "type": [ "string", "null" ] }, "holderUserId": { "type": [ "string", "null" ] }, "createdAt": { "type": "string", "description": "Date and time (ISO 8601)" }, "usages": { "description": "Check-ins", "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "scannedAt": { "type": "string", "description": "Date and time (ISO 8601)" }, "quantityRedeemed": { "type": "number" }, "sessionId": { "type": [ "string", "null" ] }, "manual": { "description": "Ticked present by hand", "type": [ "boolean", "null" ] } }, "required": [ "scannedAt", "quantityRedeemed" ], "additionalProperties": {} } }, "event": { "anyOf": [ { "type": "object", "properties": { "id": { "type": "string" }, "title": { "type": "string" }, "description": { "type": [ "string", "null" ] }, "startDate": { "type": "string", "description": "Date and time (ISO 8601)" }, "endDate": { "type": "string", "description": "Date and time (ISO 8601)" }, "location": { "type": [ "string", "null" ] }, "price": { "anyOf": [ { "type": "number", "description": "Rand" }, { "type": "null" } ] }, "isActive": { "type": [ "boolean", "null" ] }, "isHidden": { "type": [ "boolean", "null" ] }, "imageUrl": { "type": [ "string", "null" ] }, "campusId": { "type": [ "string", "null" ] }, "scheduleType": { "anyOf": [ { "type": "string", "enum": [ "single", "sessions" ] }, { "type": "null" } ] }, "cashupStatus": { "anyOf": [ { "type": "string", "enum": [ "open", "closed" ] }, { "type": "null" } ] } }, "additionalProperties": {} }, { "type": "null" } ] }, "user": { "description": "The payer", "anyOf": [ { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "email": { "type": [ "string", "null" ] }, "phoneNumber": { "type": [ "string", "null" ] } }, "required": [ "name" ], "additionalProperties": {} }, { "type": "null" } ] }, "attendee": { "anyOf": [ { "type": "object", "properties": { "name": { "type": "string" } }, "required": [ "name" ], "additionalProperties": {} }, { "type": "null" } ] }, "registrationOption": { "anyOf": [ { "type": "object", "properties": { "eventOption": { "anyOf": [ { "type": "object", "properties": { "id": { "type": "string" }, "eventId": { "type": "string" }, "name": { "type": "string" }, "description": { "type": [ "string", "null" ] }, "price": { "type": "number", "description": "Rand" }, "isMainTicket": { "type": "boolean" }, "stockLimit": { "type": [ "number", "null" ] } }, "additionalProperties": {} }, { "type": "null" } ] }, "variant": { "anyOf": [ { "type": "object", "properties": { "name": { "type": "string" } }, "required": [ "name" ], "additionalProperties": {} }, { "type": "null" } ] }, "registration": { "anyOf": [ { "type": "object", "properties": { "id": { "type": "string" }, "userId": { "type": "string" }, "eventId": { "type": "string" }, "status": { "type": "string", "enum": [ "pending", "confirmed", "partial_paid", "paid", "cancelled" ] }, "discountTotal": { "anyOf": [ { "type": "number", "description": "Rand" }, { "type": "null" } ] }, "totalDueComputed": { "description": "What it costs now, after discounts", "anyOf": [ { "type": "number", "description": "Rand" }, { "type": "null" } ] }, "createdAt": { "type": "string", "description": "Date and time (ISO 8601)" }, "user": { "anyOf": [ { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "email": { "type": [ "string", "null" ] }, "phoneNumber": { "type": [ "string", "null" ] } }, "required": [ "name" ], "additionalProperties": {} }, { "type": "null" } ] }, "event": { "anyOf": [ { "type": "object", "properties": { "id": { "type": "string" }, "title": { "type": "string" }, "startDate": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "endDate": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] } }, "required": [ "id", "title" ], "additionalProperties": {} }, { "type": "null" } ] } }, "additionalProperties": {} }, { "type": "null" } ] } }, "additionalProperties": {} }, { "type": "null" } ] } }, "required": [ "id", "qrCode", "quantity", "isUsed", "eventId", "userId", "registrationOptionId", "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" } } } }, "404": { "description": "Not found (NOT_FOUND)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/tickets/{id}/transfer": { "post": { "tags": [ "Tickets" ], "summary": "Give a ticket to someone", "description": "Sends them a link to accept it; the ticket is theirs once they do.\n\n**Who:** Any signed-in person.", "operationId": "postTicketsIdTransfer", "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", "description": "Who it goes to" }, "email": { "type": [ "string", "null" ] }, "phone": { "description": "Email or phone needed", "type": [ "string", "null" ] }, "dateOfBirth": { "description": "Youth events", "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "gender": { "type": [ "string", "null" ] }, "parentName": { "type": [ "string", "null" ] }, "parentEmail": { "type": [ "string", "null" ] }, "parentPhone": { "type": [ "string", "null" ] } }, "required": [ "name" ], "additionalProperties": {} } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "message": { "type": "string" }, "requestId": { "type": "string" }, "expiresAt": { "type": "string", "description": "Date and time (ISO 8601)" } }, "required": [ "message", "requestId", "expiresAt" ], "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": [ "Tickets" ], "summary": "Cancel a ticket transfer", "description": "**Who:** Any signed-in person.", "operationId": "deleteTicketsIdTransfer", "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" } } } }, "404": { "description": "Not found (NOT_FOUND)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/tickets/{id}/transfers": { "get": { "tags": [ "Tickets" ], "summary": "A ticket's transfers", "description": "**Who:** Any signed-in person.", "operationId": "getTicketsIdTransfers", "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" }, "ticketId": { "type": "string" }, "fromUserId": { "type": [ "string", "null" ] }, "toUserId": { "type": [ "string", "null" ] }, "createdAt": { "type": "string", "description": "Date and time (ISO 8601)" } }, "required": [ "id", "ticketId", "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" } } } }, "404": { "description": "Not found (NOT_FOUND)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/scan-locks": { "get": { "tags": [ "Check-in" ], "summary": "Devices scanning offline for an event", "description": "**Who:** Staff, supervisors and admins.", "operationId": "getScan-locks", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "eventId", "in": "query", "required": true, "description": "Only this event", "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" }, "eventId": { "type": "string" }, "sectionId": { "type": [ "string", "null" ] }, "sectionName": { "type": [ "string", "null" ] }, "deviceId": { "type": "string" }, "deviceName": { "type": [ "string", "null" ] }, "user": { "description": "Who holds it", "anyOf": [ { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "email": { "type": [ "string", "null" ] } }, "required": [ "name" ], "additionalProperties": {} }, { "type": "null" } ] }, "lockedAt": { "type": "string", "description": "Date and time (ISO 8601)" }, "snapshotAt": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "lastSyncAt": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "releasedAt": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] } }, "required": [ "id", "eventId", "deviceId", "lockedAt" ], "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": [ "Check-in" ], "summary": "Take tickets offline on this device", "description": "Locks the chosen tickets to this device until it syncs or releases them.\n\n**Who:** Staff, supervisors and admins.", "operationId": "postScan-locks", "security": [ { "bearerAuth": [] } ], "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "eventId": { "type": "string" }, "sectionId": { "description": "Just this section (default: the whole event)", "type": [ "string", "null" ] }, "deviceId": { "type": "string" }, "deviceName": { "type": [ "string", "null" ] } }, "required": [ "eventId", "deviceId" ], "additionalProperties": {} } } } }, "responses": { "201": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "id": { "type": "string" }, "eventId": { "type": "string" }, "sectionId": { "type": [ "string", "null" ] }, "sectionName": { "type": [ "string", "null" ] }, "deviceId": { "type": "string" }, "deviceName": { "type": [ "string", "null" ] }, "user": { "description": "Who holds it", "anyOf": [ { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "email": { "type": [ "string", "null" ] } }, "required": [ "name" ], "additionalProperties": {} }, { "type": "null" } ] }, "lockedAt": { "type": "string", "description": "Date and time (ISO 8601)" }, "snapshotAt": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "lastSyncAt": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "releasedAt": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] } }, "required": [ "id", "eventId", "deviceId", "lockedAt" ], "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" } } } } } } }, "/scan-locks/reports": { "get": { "tags": [ "Check-in" ], "summary": "Offline sync reports to review", "description": "**Who:** Supervisors and admins.", "operationId": "getScan-locksReports", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "eventId", "in": "query", "required": true, "description": "Only this event", "schema": { "type": "string", "minLength": 1, "maxLength": 64 } }, { "name": "unreviewed", "in": "query", "required": false, "description": "`true`: only the ones not reviewed yet", "schema": { "type": "string", "maxLength": 10 } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "accepted": { "type": [ "number", "null" ] }, "duplicates": { "type": [ "number", "null" ] }, "conflicts": {}, "reviewedAt": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "createdAt": { "type": "string", "description": "Date and time (ISO 8601)" }, "scanLock": { "type": "object", "properties": { "id": { "type": "string" }, "eventId": { "type": "string" }, "sectionId": { "type": [ "string", "null" ] }, "sectionName": { "type": [ "string", "null" ] }, "deviceId": { "type": "string" }, "deviceName": { "type": [ "string", "null" ] }, "user": { "description": "Who holds it", "anyOf": [ { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "email": { "type": [ "string", "null" ] } }, "required": [ "name" ], "additionalProperties": {} }, { "type": "null" } ] }, "lockedAt": { "type": "string", "description": "Date and time (ISO 8601)" }, "snapshotAt": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "lastSyncAt": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "releasedAt": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] } }, "required": [ "id", "eventId", "deviceId", "lockedAt" ], "additionalProperties": {} } }, "required": [ "id", "createdAt", "scanLock" ], "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" } } } } } } }, "/scan-locks/reports/{id}/review": { "post": { "tags": [ "Check-in" ], "summary": "Mark a sync report reviewed", "description": "**Who:** Supervisors and admins.", "operationId": "postScan-locksReportsIdReview", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "id", "in": "path", "required": true, "description": "The id", "schema": { "type": "string", "minLength": 1, "maxLength": 64 } } ], "requestBody": { "required": true, "description": "No body needed: send an empty object.", "content": { "application/json": { "schema": { "type": "object", "properties": {}, "additionalProperties": {} } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "id": { "type": "string" }, "reviewedAt": { "type": "string", "description": "Date and time (ISO 8601)" }, "reviewedById": { "type": "string" } }, "required": [ "id", "reviewedAt", "reviewedById" ], "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" } } } } } } }, "/scan-locks/{id}/snapshot": { "get": { "tags": [ "Check-in" ], "summary": "The tickets a device took offline", "description": "**Who:** Staff, supervisors and admins.", "operationId": "getScan-locksIdSnapshot", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "id", "in": "path", "required": true, "description": "The id", "schema": { "type": "string", "minLength": 1, "maxLength": 64 } }, { "name": "deviceId", "in": "query", "required": false, "description": "This device's id (offline scanning)", "schema": { "type": "string", "maxLength": 4000 } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "lock": { "type": "object", "properties": { "id": { "type": "string" }, "eventId": { "type": "string" }, "sectionId": { "type": [ "string", "null" ] }, "sectionName": { "type": [ "string", "null" ] }, "deviceId": { "type": "string" }, "deviceName": { "type": [ "string", "null" ] }, "user": { "description": "Who holds it", "anyOf": [ { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "email": { "type": [ "string", "null" ] } }, "required": [ "name" ], "additionalProperties": {} }, { "type": "null" } ] }, "lockedAt": { "type": "string", "description": "Date and time (ISO 8601)" }, "snapshotAt": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "lastSyncAt": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "releasedAt": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] } }, "required": [ "id", "eventId", "deviceId", "lockedAt" ], "additionalProperties": {} }, "snapshotAt": { "type": "string", "description": "Date and time (ISO 8601)" }, "session": { "anyOf": [ { "type": "object", "properties": { "id": { "type": "string" }, "label": { "type": "string" } }, "required": [ "id", "label" ], "additionalProperties": {} }, { "type": "null" } ] }, "noSessionToday": { "type": "boolean" }, "tickets": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "qrCode": { "type": "string" }, "holder": { "type": "string" }, "bookedBy": { "type": "string" }, "option": { "type": "string" }, "variant": { "type": [ "string", "null" ] }, "quantity": { "type": "number" }, "remaining": { "type": "number" }, "consentStatus": { "type": "string" } }, "required": [ "id", "qrCode", "holder", "bookedBy", "option", "quantity", "remaining", "consentStatus" ], "additionalProperties": {} } } }, "required": [ "lock", "snapshotAt", "session", "noSessionToday", "tickets" ], "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" } } } } } } }, "/scan-locks/{id}/sync": { "post": { "tags": [ "Check-in" ], "summary": "Upload scans made offline", "description": "**Who:** Staff, supervisors and admins.", "operationId": "postScan-locksIdSync", "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": { "deviceId": { "type": "string" }, "scans": { "maxItems": 2000, "type": "array", "items": { "type": "object", "properties": { "clientScanId": { "type": "string", "description": "The device's id for the scan (repeats are ignored)" }, "qrCode": { "type": "string" }, "qty": { "type": [ "number", "string" ] }, "scannedAt": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "sessionId": { "type": [ "string", "null" ] } }, "required": [ "clientScanId", "qrCode" ], "additionalProperties": {} } } }, "required": [ "deviceId", "scans" ], "additionalProperties": {} } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "accepted": { "type": "number" }, "duplicates": { "type": "number" }, "conflicts": { "type": "array", "items": { "type": "object", "properties": {}, "additionalProperties": {} }, "description": "Scans that clashed with online check-ins" }, "reportId": { "type": "string" }, "released": { "type": "boolean" } }, "required": [ "accepted", "duplicates", "conflicts", "reportId", "released" ], "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" } } } } } } }, "/scan-locks/{id}/force-release": { "post": { "tags": [ "Check-in" ], "summary": "Release a lost device's tickets", "description": "**Who:** Supervisors and admins.", "operationId": "postScan-locksIdForce-release", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "id", "in": "path", "required": true, "description": "The id", "schema": { "type": "string", "minLength": 1, "maxLength": 64 } } ], "requestBody": { "required": true, "description": "No body needed: send an empty object.", "content": { "application/json": { "schema": { "type": "object", "properties": {}, "additionalProperties": {} } } } }, "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" } } } } } } }, "/scan-locks/{id}": { "delete": { "tags": [ "Check-in" ], "summary": "Release tickets back online", "description": "**Who:** Staff, supervisors and admins.", "operationId": "deleteScan-locksId", "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": { "deviceId": { "type": "string", "maxLength": 200 } }, "additionalProperties": {} } } } }, "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" } } } } } } }, "/certificates/verify/{code}": { "get": { "tags": [ "Attendance" ], "summary": "Check a certificate is genuine", "description": "**Who:** Anyone.", "operationId": "getCertificatesVerifyCode", "parameters": [ { "name": "code", "in": "path", "required": true, "description": "The code", "schema": { "type": "string", "minLength": 1, "maxLength": 100 } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "valid": { "type": "boolean" }, "revoked": { "type": [ "boolean", "null" ] }, "name": { "type": [ "string", "null" ] }, "event": { "type": [ "string", "null" ] }, "completedOn": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "issuedAt": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] } }, "required": [ "valid" ], "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/certificates": { "get": { "tags": [ "Me" ], "summary": "My certificates", "description": "**Who:** Any signed-in person.", "operationId": "getMeCertificates", "security": [ { "bearerAuth": [] } ], "parameters": [], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "code": { "type": "string", "description": "For checking it at /verify" }, "name": { "type": "string" }, "issuedAt": { "type": "string", "description": "Date and time (ISO 8601)" }, "sessionsAttended": { "type": [ "number", "null" ] }, "totalSessions": { "type": [ "number", "null" ] }, "event": { "anyOf": [ { "type": "object", "properties": { "id": { "type": "string" }, "title": { "type": "string" }, "startDate": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "endDate": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] } }, "additionalProperties": {} }, { "type": "null" } ] } }, "required": [ "id", "code", "name", "issuedAt" ], "additionalProperties": {} } } }, "required": [ "data" ], "additionalProperties": false } } } }, "401": { "description": "Not signed in (UNAUTHENTICATED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/certificates/preview": { "post": { "tags": [ "Attendance" ], "summary": "Preview a certificate template", "description": "**Who:** Supervisors and admins.", "operationId": "postCertificatesPreview", "security": [ { "bearerAuth": [] } ], "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "title": { "description": "Event title to show", "type": [ "string", "null" ] }, "config": { "type": "object", "properties": { "template": { "description": "classic, modern, elegant, simple", "type": [ "string", "null" ] }, "title": { "type": [ "string", "null" ] }, "body": { "description": "{name} and {event} are filled in", "type": [ "string", "null" ] } }, "additionalProperties": {} } }, "additionalProperties": {} } } } }, "responses": { "200": { "description": "The file", "content": { "application/pdf": { "schema": { "type": "string" } } } }, "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" } } } } } } }, "/certificates/{id}/pdf": { "get": { "tags": [ "Attendance" ], "summary": "Download a certificate", "description": "Its owner, or staff.\n\n**Who:** Any signed-in person.", "operationId": "getCertificatesIdPdf", "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": { "application/pdf": { "schema": { "type": "string" } } } }, "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" } } } } } } }, "/certificates/{id}/revoke": { "post": { "tags": [ "Attendance" ], "summary": "Withdraw a certificate", "description": "**Who:** Supervisors and admins.", "operationId": "postCertificatesIdRevoke", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "id", "in": "path", "required": true, "description": "The id", "schema": { "type": "string", "minLength": 1, "maxLength": 64 } } ], "requestBody": { "required": true, "description": "No body needed: send an empty object.", "content": { "application/json": { "schema": { "type": "object", "properties": {}, "additionalProperties": {} } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "ok": { "type": "boolean", "const": true } }, "required": [ "ok" ], "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}/attendance": { "get": { "tags": [ "Attendance" ], "summary": "An event's attendance register", "description": "**Who:** Staff, supervisors and admins.", "operationId": "getEventsIdAttendance", "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": { "event": { "type": "object", "properties": { "id": { "type": "string" }, "title": { "type": "string" }, "description": { "type": [ "string", "null" ] }, "startDate": { "type": "string", "description": "Date and time (ISO 8601)" }, "endDate": { "type": "string", "description": "Date and time (ISO 8601)" }, "location": { "type": [ "string", "null" ] }, "price": { "anyOf": [ { "type": "number", "description": "Rand" }, { "type": "null" } ] }, "isActive": { "type": [ "boolean", "null" ] }, "isHidden": { "type": [ "boolean", "null" ] }, "imageUrl": { "type": [ "string", "null" ] }, "campusId": { "type": [ "string", "null" ] }, "scheduleType": { "anyOf": [ { "type": "string", "enum": [ "single", "sessions" ] }, { "type": "null" } ] }, "cashupStatus": { "anyOf": [ { "type": "string", "enum": [ "open", "closed" ] }, { "type": "null" } ] }, "certificatesEnabled": { "type": [ "boolean", "null" ] }, "certificateConfig": { "anyOf": [ { "type": "object", "properties": {}, "additionalProperties": {} }, { "type": "null" } ] } }, "additionalProperties": {} }, "columns": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "description": "Session id, or `event`" }, "label": { "type": "string" } }, "required": [ "id", "label" ], "additionalProperties": {} } }, "rows": { "type": "array", "items": { "type": "object", "properties": { "ticketId": { "type": "string" }, "bookedSessions": { "anyOf": [ { "type": "array", "items": { "type": "string" }, "description": "Ids" }, { "type": "null" } ], "description": "Picked/ticked sessions (null: all)" }, "sessionTickets": { "anyOf": [ { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "string" } }, { "type": "null" } ] }, "name": { "type": "string" }, "bookedBy": { "type": "string" }, "email": { "type": "string" }, "phone": { "type": "string" }, "option": { "type": "string" }, "variant": { "type": [ "string", "null" ] }, "quantity": { "type": "number" }, "checkIns": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "number" }, "description": "Session id (or `event`) → people checked in" }, "attended": { "type": "number" }, "total": { "type": "number" }, "completed": { "type": "boolean", "description": "Meets the certificate rule" }, "certificate": { "anyOf": [ { "type": "object", "properties": {}, "additionalProperties": {} }, { "type": "null" } ] } }, "required": [ "ticketId", "bookedSessions", "sessionTickets", "name", "bookedBy", "email", "phone", "option", "quantity", "checkIns", "attended", "total", "completed" ], "additionalProperties": {} } }, "totals": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "number" } } }, "required": [ "event", "columns", "rows", "totals" ], "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": [ "Attendance" ], "summary": "Mark attendance", "description": "**Who:** Supervisors and admins.", "operationId": "postEventsIdAttendance", "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": { "ticketId": { "type": "string" }, "sessionId": { "type": "string", "description": "A session id, or `event` on a single-date event" }, "present": { "type": "boolean" } }, "required": [ "ticketId", "sessionId", "present" ], "additionalProperties": {} } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "ok": { "type": "boolean", "const": true } }, "required": [ "ok" ], "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}/attendance/export": { "get": { "tags": [ "Attendance" ], "summary": "The register as a file", "description": "`format=pdf` or `xlsx`.\n\n**Who:** Staff, supervisors and admins.", "operationId": "getEventsIdAttendanceExport", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "id", "in": "path", "required": true, "description": "The id", "schema": { "type": "string", "minLength": 1, "maxLength": 64 } }, { "name": "format", "in": "query", "required": false, "description": "File type, e.g. `pdf` or `xlsx`", "schema": { "type": "string", "maxLength": 4000 } }, { "name": "sessionId", "in": "query", "required": false, "description": "Multi-day events: the session (default: today's)", "schema": { "type": "string", "maxLength": 4000 } } ], "responses": { "200": { "description": "The file", "content": { "application/pdf": { "schema": { "type": "string" } } } }, "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}/certificates": { "post": { "tags": [ "Attendance" ], "summary": "Issue certificates", "description": "**Who:** Supervisors and admins.", "operationId": "postEventsIdCertificates", "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": { "ticketId": { "description": "Just this person (default: everyone who qualifies)", "type": [ "string", "null" ] } }, "additionalProperties": {} } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "issued": { "type": "number" } }, "required": [ "issued" ], "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}/certificates/send": { "post": { "tags": [ "Attendance" ], "summary": "Send certificates", "description": "**Who:** Supervisors and admins.", "operationId": "postEventsIdCertificatesSend", "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": { "certificateId": { "description": "Just this one (default: every one not sent yet)", "type": [ "string", "null" ] } }, "additionalProperties": {} } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "sent": { "type": "number" }, "skipped": { "type": "number" } }, "required": [ "sent", "skipped" ], "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}/certificates.pdf": { "get": { "tags": [ "Attendance" ], "summary": "Every certificate for an event, as one PDF", "description": "**Who:** Supervisors and admins.", "operationId": "getEventsIdCertificates.pdf", "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": { "application/pdf": { "schema": { "type": "string" } } } }, "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" } } } } } } }, "/me/allocation-groups": { "get": { "tags": [ "Allocations" ], "summary": "Groups I lead", "description": "**Who:** Staff, supervisors and admins.", "operationId": "getMeAllocation-groups", "security": [ { "bearerAuth": [] } ], "parameters": [], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "medicalShown": { "type": "boolean" }, "groups": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "capacity": { "type": [ "number", "null" ] }, "gender": { "type": [ "string", "null" ] }, "setName": { "type": "string" }, "event": { "type": "object", "properties": { "id": { "type": "string" }, "title": { "type": "string" }, "startDate": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "endDate": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] } }, "additionalProperties": {} }, "members": { "type": "array", "items": { "type": "object", "properties": { "attendeeId": { "type": "string" }, "name": { "type": "string" }, "gender": { "type": [ "string", "null" ] }, "dateOfBirth": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "groupId": { "type": [ "string", "null" ] } }, "required": [ "name" ], "additionalProperties": {} } } }, "required": [ "id", "name", "setName", "event", "members" ], "additionalProperties": {} } } }, "required": [ "medicalShown", "groups" ], "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" } } } } } } }, "/events/{id}/allocations": { "get": { "tags": [ "Allocations" ], "summary": "An event's allocation board", "description": "**Who:** Supervisors and admins.", "operationId": "getEventsIdAllocations", "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": { "event": { "type": "object", "properties": {}, "additionalProperties": {} }, "sets": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "eventId": { "type": "string" }, "name": { "type": "string" }, "showOnTicket": { "type": "boolean" }, "order": { "type": "number" }, "groups": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "setId": { "type": "string" }, "name": { "type": "string" }, "capacity": { "type": [ "number", "null" ] }, "gender": { "type": [ "string", "null" ] }, "leaderUserId": { "type": [ "string", "null" ] }, "minAge": { "type": [ "number", "null" ] }, "maxAge": { "type": [ "number", "null" ] }, "ratio": { "type": [ "number", "null" ] }, "order": { "type": "number" } }, "required": [ "id", "setId", "name", "order" ], "additionalProperties": {} } }, "assignments": { "type": "array", "items": { "type": "object", "properties": { "attendeeId": { "type": "string" }, "groupId": { "type": "string" } }, "required": [ "attendeeId", "groupId" ], "additionalProperties": {} } } }, "required": [ "id", "eventId", "name", "showOnTicket", "order", "groups", "assignments" ], "additionalProperties": {} } }, "attendees": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "gender": { "type": [ "string", "null" ] }, "dateOfBirth": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "registrationId": { "type": "string" }, "bookedBy": { "type": "string" } }, "required": [ "id", "name", "registrationId", "bookedBy" ], "additionalProperties": {} } }, "leaders": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "email": { "type": [ "string", "null" ] } }, "required": [ "name" ], "additionalProperties": {} } }, "unnamedPlaces": { "type": "number", "description": "Places with no name yet" } }, "required": [ "event", "sets", "attendees", "leaders", "unnamedPlaces" ], "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" } } } } } } }, "/allocation-sets": { "post": { "tags": [ "Allocations" ], "summary": "Start a set of groups", "description": "**Who:** Supervisors and admins.", "operationId": "postAllocation-sets", "security": [ { "bearerAuth": [] } ], "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "eventId": { "type": "string" }, "name": { "type": "string", "description": "e.g. Cabins, Buses" }, "showOnTicket": { "type": [ "boolean", "null" ] } }, "required": [ "eventId", "name" ], "additionalProperties": {} } } } }, "responses": { "201": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "id": { "type": "string" }, "eventId": { "type": "string" }, "name": { "type": "string" }, "showOnTicket": { "type": "boolean" }, "order": { "type": "number" } }, "required": [ "id", "eventId", "name", "showOnTicket", "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" } } } } } } }, "/allocation-sets/{id}": { "patch": { "tags": [ "Allocations" ], "summary": "Change a set", "description": "**Who:** Supervisors and admins.", "operationId": "patchAllocation-setsId", "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", "null" ] }, "showOnTicket": { "type": [ "boolean", "null" ] } }, "additionalProperties": {} } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "id": { "type": "string" }, "eventId": { "type": "string" }, "name": { "type": "string" }, "showOnTicket": { "type": "boolean" }, "order": { "type": "number" } }, "required": [ "id", "eventId", "name", "showOnTicket", "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": [ "Allocations" ], "summary": "Delete a set", "description": "**Who:** Supervisors and admins.", "operationId": "deleteAllocation-setsId", "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" } } } } } } }, "/allocation-sets/{id}/lists": { "get": { "tags": [ "Allocations" ], "summary": "A set's lists (who is in each group)", "description": "**Who:** Supervisors and admins.", "operationId": "getAllocation-setsIdLists", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "id", "in": "path", "required": true, "description": "The id", "schema": { "type": "string", "minLength": 1, "maxLength": 64 } }, { "name": "medical", "in": "query", "required": false, "description": "`true`: include medical notes (supervisors; logged)", "schema": { "type": "string", "maxLength": 4000 } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "set": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" } }, "required": [ "id", "name" ], "additionalProperties": {} }, "event": { "type": "object", "properties": {}, "additionalProperties": {} }, "groups": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "capacity": { "type": [ "number", "null" ] }, "gender": { "type": [ "string", "null" ] }, "leader": { "type": [ "string", "null" ] }, "members": { "type": "array", "items": { "type": "object", "properties": { "attendeeId": { "type": "string" }, "name": { "type": "string" }, "gender": { "type": [ "string", "null" ] }, "dateOfBirth": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "groupId": { "type": [ "string", "null" ] } }, "required": [ "name" ], "additionalProperties": {} } } }, "required": [ "id", "name", "members" ], "additionalProperties": {} } } }, "required": [ "set", "event", "groups" ], "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" } } } } } } }, "/allocation-sets/{id}/groups": { "post": { "tags": [ "Allocations" ], "summary": "Add a group", "description": "**Who:** Supervisors and admins.", "operationId": "postAllocation-setsIdGroups", "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", "null" ] }, "capacity": { "type": [ "number", "string", "null" ] }, "gender": { "anyOf": [ { "type": "string", "enum": [ "male", "female", "mixed" ] }, { "type": "null" } ] }, "leaderUserId": { "description": "A staff member", "type": [ "string", "null" ] }, "minAge": { "type": [ "number", "string", "null" ] }, "maxAge": { "type": [ "number", "string", "null" ] }, "ratio": { "description": "Children per leader", "type": [ "number", "string", "null" ] } }, "additionalProperties": {} } } } }, "responses": { "201": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "id": { "type": "string" }, "setId": { "type": "string" }, "name": { "type": "string" }, "capacity": { "type": [ "number", "null" ] }, "gender": { "type": [ "string", "null" ] }, "leaderUserId": { "type": [ "string", "null" ] }, "minAge": { "type": [ "number", "null" ] }, "maxAge": { "type": [ "number", "null" ] }, "ratio": { "type": [ "number", "null" ] }, "order": { "type": "number" } }, "required": [ "id", "setId", "name", "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" } } } } } } }, "/allocation-sets/{id}/assignments": { "put": { "tags": [ "Allocations" ], "summary": "Put people in groups", "description": "**Who:** Supervisors and admins.", "operationId": "putAllocation-setsIdAssignments", "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": { "attendeeId": { "type": "string" }, "groupId": { "description": "null takes them out", "type": [ "string", "null" ] } }, "required": [ "attendeeId" ], "additionalProperties": {} } } } }, "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" } } } } } }, "delete": { "tags": [ "Allocations" ], "summary": "Empty every group", "description": "**Who:** Supervisors and admins.", "operationId": "deleteAllocation-setsIdAssignments", "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" } } } } } } }, "/allocation-sets/{id}/auto": { "post": { "tags": [ "Allocations" ], "summary": "Fill the groups automatically", "description": "**Who:** Supervisors and admins.", "operationId": "postAllocation-setsIdAuto", "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": { "mode": { "description": "Keep each booking together, or spread them", "type": "string", "enum": [ "together", "split" ] } }, "additionalProperties": {} } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "placed": { "type": "number" }, "unplaced": { "type": "number" }, "message": { "type": "string" } }, "required": [ "placed", "unplaced", "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" } } } } } } }, "/allocation-groups/{id}": { "patch": { "tags": [ "Allocations" ], "summary": "Change a group", "description": "**Who:** Supervisors and admins.", "operationId": "patchAllocation-groupsId", "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", "null" ] }, "capacity": { "type": [ "number", "string", "null" ] }, "gender": { "anyOf": [ { "type": "string", "enum": [ "male", "female", "mixed" ] }, { "type": "null" } ] }, "leaderUserId": { "description": "A staff member", "type": [ "string", "null" ] }, "minAge": { "type": [ "number", "string", "null" ] }, "maxAge": { "type": [ "number", "string", "null" ] }, "ratio": { "description": "Children per leader", "type": [ "number", "string", "null" ] } }, "additionalProperties": {} } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "id": { "type": "string" }, "setId": { "type": "string" }, "name": { "type": "string" }, "capacity": { "type": [ "number", "null" ] }, "gender": { "type": [ "string", "null" ] }, "leaderUserId": { "type": [ "string", "null" ] }, "minAge": { "type": [ "number", "null" ] }, "maxAge": { "type": [ "number", "null" ] }, "ratio": { "type": [ "number", "null" ] }, "order": { "type": "number" } }, "required": [ "id", "setId", "name", "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": [ "Allocations" ], "summary": "Delete a group", "description": "**Who:** Supervisors and admins.", "operationId": "deleteAllocation-groupsId", "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" } } } } } } }, "/corrections/events/{id}": { "get": { "tags": [ "Corrections" ], "summary": "An event's registrations, with what needs putting right", "description": "Every registration that isn't cancelled — closed and past events too — with its balance, forms still to fill in, tickets and check-ins.\n\n**Who:** Admins only.", "operationId": "getCorrectionsEventsId", "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": { "event": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 64 }, "title": { "type": "string" }, "startDate": {}, "endDate": {}, "closed": { "type": "boolean" }, "formRequired": { "type": "boolean" }, "sessions": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 64 }, "label": { "type": "string" }, "startsAt": {} }, "required": [ "id", "label", "startsAt" ], "additionalProperties": false } } }, "required": [ "id", "title", "startDate", "endDate", "closed", "formRequired", "sessions" ], "additionalProperties": false }, "registrations": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 64 }, "status": { "type": "string" }, "createdAt": {}, "user": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 64 }, "name": { "type": "string" }, "email": { "type": [ "string", "null" ] }, "phoneNumber": { "type": [ "string", "null" ] } }, "required": [ "id", "name", "email", "phoneNumber" ], "additionalProperties": false }, "totalDue": { "type": "number" }, "paid": { "type": "number" }, "balance": { "type": "number" }, "places": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991, "description": "Places booked (every line)" }, "ticketPlaces": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991, "description": "Places with a ticket" }, "missingTickets": { "type": "boolean", "description": "Paid (or released unpaid) but not every place has a ticket" }, "formsNeeded": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991, "description": "Attendee forms still holding the tickets back" }, "formWaived": { "type": "boolean", "description": "The form was left for later" }, "ticketsReleased": { "type": "boolean", "description": "Tickets issued before it was paid" }, "complimentary": { "type": "number", "description": "Balance written off" }, "tickets": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 64 }, "qrCode": { "type": "string" }, "label": { "type": "string", "description": "Ticket option, variant and (a picked session) the session" }, "isMainTicket": { "type": "boolean" }, "name": { "type": "string", "description": "Who it's for" }, "quantity": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, "sessionIds": { "type": "array", "items": { "type": "string" }, "description": "The sessions it covers (`event` on a single-date event)" }, "checkedIn": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, "description": "People checked in, per session" } }, "required": [ "id", "qrCode", "label", "isMainTicket", "name", "quantity", "sessionIds", "checkedIn" ], "additionalProperties": false } } }, "required": [ "id", "status", "createdAt", "user", "totalDue", "paid", "balance", "places", "ticketPlaces", "missingTickets", "formsNeeded", "formWaived", "ticketsReleased", "complimentary", "tickets" ], "additionalProperties": false } } }, "required": [ "event", "registrations" ], "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" } } } } } } }, "/corrections/events/{id}/issue-missing": { "post": { "tags": [ "Corrections" ], "summary": "Issue every missing ticket at an event", "description": "For each paid registration (or one released unpaid) without all its tickets. Attendee forms still outstanding are left for later.\n\n**Who:** Admins only.", "operationId": "postCorrectionsEventsIdIssue-missing", "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": { "send": { "description": "Send the new tickets to the attendee (off by default)", "type": "boolean" } } } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "registrations": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, "tickets": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, "failed": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 64 }, "name": { "type": "string" }, "message": { "type": "string" } }, "required": [ "id", "name", "message" ], "additionalProperties": false } } }, "required": [ "registrations", "tickets", "failed" ], "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" } } } } } } }, "/corrections/registrations/{id}/tickets": { "post": { "tags": [ "Corrections" ], "summary": "Issue a registration's tickets now", "description": "`skipForm` leaves the attendee form for later; `payLater` issues them before it's paid (the balance is still owed).\n\n**Who:** Admins only.", "operationId": "postCorrectionsRegistrationsIdTickets", "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": { "skipForm": { "type": "boolean" }, "payLater": { "type": "boolean" }, "send": { "description": "Send the new tickets to the attendee (off by default)", "type": "boolean" }, "reason": { "description": "Why — kept in the audit log", "anyOf": [ { "type": "string", "maxLength": 500 }, { "type": "null" } ] } } } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "ticketsIssued": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, "registration": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 64 }, "status": { "type": "string" }, "createdAt": {}, "user": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 64 }, "name": { "type": "string" }, "email": { "type": [ "string", "null" ] }, "phoneNumber": { "type": [ "string", "null" ] } }, "required": [ "id", "name", "email", "phoneNumber" ], "additionalProperties": false }, "totalDue": { "type": "number" }, "paid": { "type": "number" }, "balance": { "type": "number" }, "places": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991, "description": "Places booked (every line)" }, "ticketPlaces": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991, "description": "Places with a ticket" }, "missingTickets": { "type": "boolean", "description": "Paid (or released unpaid) but not every place has a ticket" }, "formsNeeded": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991, "description": "Attendee forms still holding the tickets back" }, "formWaived": { "type": "boolean", "description": "The form was left for later" }, "ticketsReleased": { "type": "boolean", "description": "Tickets issued before it was paid" }, "complimentary": { "type": "number", "description": "Balance written off" }, "tickets": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 64 }, "qrCode": { "type": "string" }, "label": { "type": "string", "description": "Ticket option, variant and (a picked session) the session" }, "isMainTicket": { "type": "boolean" }, "name": { "type": "string", "description": "Who it's for" }, "quantity": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, "sessionIds": { "type": "array", "items": { "type": "string" }, "description": "The sessions it covers (`event` on a single-date event)" }, "checkedIn": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, "description": "People checked in, per session" } }, "required": [ "id", "qrCode", "label", "isMainTicket", "name", "quantity", "sessionIds", "checkedIn" ], "additionalProperties": false } } }, "required": [ "id", "status", "createdAt", "user", "totalDue", "paid", "balance", "places", "ticketPlaces", "missingTickets", "formsNeeded", "formWaived", "ticketsReleased", "complimentary", "tickets" ], "additionalProperties": false } }, "required": [ "ticketsIssued", "registration" ], "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" } } } } } } }, "/corrections/registrations/{id}/complimentary": { "post": { "tags": [ "Corrections" ], "summary": "Make it free", "description": "What's still owed is written off as a complimentary discount (income stays what was really paid), it's marked paid and its tickets are issued. Not on a closed event.\n\n**Who:** Admins only.", "operationId": "postCorrectionsRegistrationsIdComplimentary", "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": { "skipForm": { "type": "boolean" }, "send": { "description": "Send the new tickets to the attendee (off by default)", "type": "boolean" }, "reason": { "description": "Why — kept in the audit log", "anyOf": [ { "type": "string", "maxLength": 500 }, { "type": "null" } ] } } } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "amount": { "type": "number" }, "ticketsIssued": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, "registration": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 64 }, "status": { "type": "string" }, "createdAt": {}, "user": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 64 }, "name": { "type": "string" }, "email": { "type": [ "string", "null" ] }, "phoneNumber": { "type": [ "string", "null" ] } }, "required": [ "id", "name", "email", "phoneNumber" ], "additionalProperties": false }, "totalDue": { "type": "number" }, "paid": { "type": "number" }, "balance": { "type": "number" }, "places": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991, "description": "Places booked (every line)" }, "ticketPlaces": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991, "description": "Places with a ticket" }, "missingTickets": { "type": "boolean", "description": "Paid (or released unpaid) but not every place has a ticket" }, "formsNeeded": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991, "description": "Attendee forms still holding the tickets back" }, "formWaived": { "type": "boolean", "description": "The form was left for later" }, "ticketsReleased": { "type": "boolean", "description": "Tickets issued before it was paid" }, "complimentary": { "type": "number", "description": "Balance written off" }, "tickets": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 64 }, "qrCode": { "type": "string" }, "label": { "type": "string", "description": "Ticket option, variant and (a picked session) the session" }, "isMainTicket": { "type": "boolean" }, "name": { "type": "string", "description": "Who it's for" }, "quantity": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, "sessionIds": { "type": "array", "items": { "type": "string" }, "description": "The sessions it covers (`event` on a single-date event)" }, "checkedIn": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, "description": "People checked in, per session" } }, "required": [ "id", "qrCode", "label", "isMainTicket", "name", "quantity", "sessionIds", "checkedIn" ], "additionalProperties": false } } }, "required": [ "id", "status", "createdAt", "user", "totalDue", "paid", "balance", "places", "ticketPlaces", "missingTickets", "formsNeeded", "formWaived", "ticketsReleased", "complimentary", "tickets" ], "additionalProperties": false } }, "required": [ "amount", "ticketsIssued", "registration" ], "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" } } } } } } }, "/corrections/tickets/{id}/check-in": { "post": { "tags": [ "Corrections" ], "summary": "Check a ticket in (or undo it) after the fact", "description": "Any time — after the event or session, or once the event is closed. `present: false` undoes the check-in for that session. Recorded as a manual check-in; no message is sent.\n\n**Who:** Admins only.", "operationId": "postCorrectionsTicketsIdCheck-in", "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": { "sessionId": { "description": "Multi-day events: the session", "anyOf": [ { "type": "string", "minLength": 1, "maxLength": 64 }, { "type": "null" } ] }, "people": { "description": "How many (default: everyone left on the ticket)", "anyOf": [ { "type": "integer", "minimum": 1, "maximum": 1000 }, { "type": "null" } ] }, "present": { "description": "false undoes it", "type": "boolean" }, "reason": { "description": "Why — kept in the audit log", "anyOf": [ { "type": "string", "maxLength": 500 }, { "type": "null" } ] } } } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "checkedIn": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, "quantity": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 } }, "required": [ "checkedIn", "quantity" ], "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/{id}/form-later": { "post": { "tags": [ "Registrations" ], "summary": "Fill in the attendee form later", "description": "At the door: the tickets stop waiting for the required attendee form (issued now if it's paid) and the payer is sent a link to fill it in (`notify: false` to not).\n\n**Who:** Staff, supervisors and admins.", "operationId": "postRegistrationsIdForm-later", "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": { "notify": { "type": "boolean" } } } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "ticketsIssued": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, "sentTo": { "type": "array", "items": { "type": "string" } } }, "required": [ "ticketsIssued", "sentTo" ], "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" } } } } } } }, "/me/family": { "get": { "tags": [ "Kids" ], "summary": "My family", "description": "Children, the adults who may collect them, and the family QR code.\n\n**Who:** Any signed-in person.", "operationId": "getMeFamily", "security": [ { "bearerAuth": [] } ], "parameters": [], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "family": { "anyOf": [ { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "parents": { "type": "array", "items": { "type": "object", "properties": { "userId": { "type": "string" }, "name": { "type": "string" }, "phone": { "type": [ "string", "null" ] }, "email": { "type": [ "string", "null" ] } }, "required": [ "userId", "name" ], "additionalProperties": {} } }, "children": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "firstName": { "type": "string" }, "lastName": { "type": "string" }, "name": { "type": "string" }, "dateOfBirth": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "age": { "type": [ "number", "null" ] }, "gender": { "type": [ "string", "null" ] }, "allergies": { "type": [ "string", "null" ] }, "hasMedical": { "type": "boolean" }, "hasCustody": { "type": "boolean", "description": "There are custody notes" }, "medicalNotes": { "description": "Only where notes may be shown", "type": [ "string", "null" ] }, "custodyNotes": { "type": [ "string", "null" ] }, "lastCheckInAt": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] } }, "required": [ "id", "firstName", "lastName", "name", "hasMedical", "hasCustody" ], "additionalProperties": {} } }, "adults": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string" }, "phone": { "type": [ "string", "null" ] }, "relationship": { "type": [ "string", "null" ] }, "id": { "type": "string" } }, "required": [ "name", "id" ], "additionalProperties": {} }, "description": "Others who may collect the children" } }, "required": [ "id", "name", "parents", "children", "adults" ], "additionalProperties": {} }, { "type": "null" } ] }, "qrToken": { "description": "The family QR code (shown at the desk)", "type": [ "string", "null" ] }, "codes": { "type": "array", "items": { "type": "object", "properties": {}, "additionalProperties": {} }, "description": "Collection codes for children checked in now" }, "pages": { "type": "array", "items": { "type": "object", "properties": {}, "additionalProperties": {} }, "description": "Recent \"come to the room\" messages" } }, "required": [ "family", "codes", "pages" ], "additionalProperties": {} } }, "required": [ "data" ], "additionalProperties": false } } } }, "401": { "description": "Not signed in (UNAUTHENTICATED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } }, "post": { "tags": [ "Kids" ], "summary": "Start my family", "description": "**Who:** Any signed-in person.", "operationId": "postMeFamily", "security": [ { "bearerAuth": [] } ], "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "name": { "type": [ "string", "null" ] } }, "additionalProperties": {} } } } }, "responses": { "201": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "family": { "anyOf": [ { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "parents": { "type": "array", "items": { "type": "object", "properties": { "userId": { "type": "string" }, "name": { "type": "string" }, "phone": { "type": [ "string", "null" ] }, "email": { "type": [ "string", "null" ] } }, "required": [ "userId", "name" ], "additionalProperties": {} } }, "children": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "firstName": { "type": "string" }, "lastName": { "type": "string" }, "name": { "type": "string" }, "dateOfBirth": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "age": { "type": [ "number", "null" ] }, "gender": { "type": [ "string", "null" ] }, "allergies": { "type": [ "string", "null" ] }, "hasMedical": { "type": "boolean" }, "hasCustody": { "type": "boolean", "description": "There are custody notes" }, "medicalNotes": { "description": "Only where notes may be shown", "type": [ "string", "null" ] }, "custodyNotes": { "type": [ "string", "null" ] }, "lastCheckInAt": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] } }, "required": [ "id", "firstName", "lastName", "name", "hasMedical", "hasCustody" ], "additionalProperties": {} } }, "adults": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string" }, "phone": { "type": [ "string", "null" ] }, "relationship": { "type": [ "string", "null" ] }, "id": { "type": "string" } }, "required": [ "name", "id" ], "additionalProperties": {} }, "description": "Others who may collect the children" } }, "required": [ "id", "name", "parents", "children", "adults" ], "additionalProperties": {} }, { "type": "null" } ] }, "qrToken": { "description": "The family QR code (shown at the desk)", "type": [ "string", "null" ] }, "codes": { "type": "array", "items": { "type": "object", "properties": {}, "additionalProperties": {} }, "description": "Collection codes for children checked in now" }, "pages": { "type": "array", "items": { "type": "object", "properties": {}, "additionalProperties": {} }, "description": "Recent \"come to the room\" messages" } }, "required": [ "family", "codes", "pages" ], "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" } } } } } }, "patch": { "tags": [ "Kids" ], "summary": "Rename my family", "description": "**Who:** Any signed-in person.", "operationId": "patchMeFamily", "security": [ { "bearerAuth": [] } ], "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "name": { "type": "string" } }, "required": [ "name" ], "additionalProperties": {} } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "parents": { "type": "array", "items": { "type": "object", "properties": { "userId": { "type": "string" }, "name": { "type": "string" }, "phone": { "type": [ "string", "null" ] }, "email": { "type": [ "string", "null" ] } }, "required": [ "userId", "name" ], "additionalProperties": {} } }, "children": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "firstName": { "type": "string" }, "lastName": { "type": "string" }, "name": { "type": "string" }, "dateOfBirth": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "age": { "type": [ "number", "null" ] }, "gender": { "type": [ "string", "null" ] }, "allergies": { "type": [ "string", "null" ] }, "hasMedical": { "type": "boolean" }, "hasCustody": { "type": "boolean", "description": "There are custody notes" }, "medicalNotes": { "description": "Only where notes may be shown", "type": [ "string", "null" ] }, "custodyNotes": { "type": [ "string", "null" ] }, "lastCheckInAt": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] } }, "required": [ "id", "firstName", "lastName", "name", "hasMedical", "hasCustody" ], "additionalProperties": {} } }, "adults": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string" }, "phone": { "type": [ "string", "null" ] }, "relationship": { "type": [ "string", "null" ] }, "id": { "type": "string" } }, "required": [ "name", "id" ], "additionalProperties": {} }, "description": "Others who may collect the children" } }, "required": [ "id", "name", "parents", "children", "adults" ], "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" } } } } } }, "delete": { "tags": [ "Kids" ], "summary": "Leave my family", "description": "**Who:** Any signed-in person.", "operationId": "deleteMeFamily", "security": [ { "bearerAuth": [] } ], "parameters": [], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": {}, "additionalProperties": {}, "description": "What happened: left, or the family was deleted as the last parent" } }, "required": [ "data" ], "additionalProperties": false } } } }, "401": { "description": "Not signed in (UNAUTHENTICATED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/me/family/children": { "post": { "tags": [ "Kids" ], "summary": "Add a child", "description": "**Who:** Any signed-in person.", "operationId": "postMeFamilyChildren", "security": [ { "bearerAuth": [] } ], "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "firstName": { "type": "string" }, "lastName": { "type": [ "string", "null" ] }, "dateOfBirth": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "gender": { "description": "male or female (anything else: not given)", "type": [ "string", "null" ] }, "allergies": { "type": [ "string", "null" ] }, "medicalNotes": { "type": [ "string", "null" ] }, "custodyNotes": { "description": "Kept encrypted, like the medical notes", "type": [ "string", "null" ] } }, "required": [ "firstName" ], "additionalProperties": {} } } } }, "responses": { "201": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "id": { "type": "string" }, "firstName": { "type": "string" }, "lastName": { "type": "string" }, "name": { "type": "string" }, "dateOfBirth": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "age": { "type": [ "number", "null" ] }, "gender": { "type": [ "string", "null" ] }, "allergies": { "type": [ "string", "null" ] }, "hasMedical": { "type": "boolean" }, "hasCustody": { "type": "boolean", "description": "There are custody notes" }, "medicalNotes": { "description": "Only where notes may be shown", "type": [ "string", "null" ] }, "custodyNotes": { "type": [ "string", "null" ] }, "lastCheckInAt": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] } }, "required": [ "id", "firstName", "lastName", "name", "hasMedical", "hasCustody" ], "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" } } } } } } }, "/me/family/children/{id}": { "put": { "tags": [ "Kids" ], "summary": "Change a child", "description": "**Who:** Any signed-in person.", "operationId": "putMeFamilyChildrenId", "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": { "firstName": { "type": "string" }, "lastName": { "type": [ "string", "null" ] }, "dateOfBirth": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "gender": { "description": "male or female (anything else: not given)", "type": [ "string", "null" ] }, "allergies": { "type": [ "string", "null" ] }, "medicalNotes": { "type": [ "string", "null" ] }, "custodyNotes": { "description": "Kept encrypted, like the medical notes", "type": [ "string", "null" ] } }, "additionalProperties": {} } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "id": { "type": "string" }, "firstName": { "type": "string" }, "lastName": { "type": "string" }, "name": { "type": "string" }, "dateOfBirth": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "age": { "type": [ "number", "null" ] }, "gender": { "type": [ "string", "null" ] }, "allergies": { "type": [ "string", "null" ] }, "hasMedical": { "type": "boolean" }, "hasCustody": { "type": "boolean", "description": "There are custody notes" }, "medicalNotes": { "description": "Only where notes may be shown", "type": [ "string", "null" ] }, "custodyNotes": { "type": [ "string", "null" ] }, "lastCheckInAt": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] } }, "required": [ "id", "firstName", "lastName", "name", "hasMedical", "hasCustody" ], "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": [ "Kids" ], "summary": "Remove a child", "description": "**Who:** Any signed-in person.", "operationId": "deleteMeFamilyChildrenId", "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" } } } }, "404": { "description": "Not found (NOT_FOUND)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/me/family/adults": { "post": { "tags": [ "Kids" ], "summary": "Add an adult who may collect", "description": "**Who:** Any signed-in person.", "operationId": "postMeFamilyAdults", "security": [ { "bearerAuth": [] } ], "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "name": { "type": "string" }, "phone": { "type": [ "string", "null" ] }, "relationship": { "type": [ "string", "null" ] } }, "required": [ "name" ], "additionalProperties": {} } } } }, "responses": { "201": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "name": { "type": "string" }, "phone": { "type": [ "string", "null" ] }, "relationship": { "type": [ "string", "null" ] }, "id": { "type": "string" } }, "required": [ "name", "id" ], "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" } } } } } } }, "/me/family/adults/{id}": { "put": { "tags": [ "Kids" ], "summary": "Change an adult", "description": "**Who:** Any signed-in person.", "operationId": "putMeFamilyAdultsId", "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" }, "phone": { "type": [ "string", "null" ] }, "relationship": { "type": [ "string", "null" ] } }, "required": [ "name" ], "additionalProperties": {} } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "name": { "type": "string" }, "phone": { "type": [ "string", "null" ] }, "relationship": { "type": [ "string", "null" ] }, "id": { "type": "string" } }, "required": [ "name", "id" ], "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": [ "Kids" ], "summary": "Remove an adult", "description": "**Who:** Any signed-in person.", "operationId": "deleteMeFamilyAdultsId", "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" } } } }, "404": { "description": "Not found (NOT_FOUND)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/kids/setup-events": { "get": { "tags": [ "Kids" ], "summary": "Events that can have kids check-in", "description": "**Who:** Supervisors and admins.", "operationId": "getKidsSetup-events", "security": [ { "bearerAuth": [] } ], "parameters": [], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "title": { "type": "string" }, "description": { "type": [ "string", "null" ] }, "startDate": { "type": "string", "description": "Date and time (ISO 8601)" }, "endDate": { "type": "string", "description": "Date and time (ISO 8601)" }, "location": { "type": [ "string", "null" ] }, "price": { "anyOf": [ { "type": "number", "description": "Rand" }, { "type": "null" } ] }, "isActive": { "type": [ "boolean", "null" ] }, "isHidden": { "type": [ "boolean", "null" ] }, "imageUrl": { "type": [ "string", "null" ] }, "campusId": { "type": [ "string", "null" ] }, "scheduleType": { "anyOf": [ { "type": "string", "enum": [ "single", "sessions" ] }, { "type": "null" } ] }, "cashupStatus": { "anyOf": [ { "type": "string", "enum": [ "open", "closed" ] }, { "type": "null" } ] }, "kidsCheckIn": { "type": [ "boolean", "null" ] } }, "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" } } } } } } }, "/kids/events": { "get": { "tags": [ "Kids" ], "summary": "Events with kids check-in", "description": "**Who:** Staff, supervisors and admins.", "operationId": "getKidsEvents", "security": [ { "bearerAuth": [] } ], "parameters": [], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "title": { "type": "string" }, "description": { "type": [ "string", "null" ] }, "startDate": { "type": "string", "description": "Date and time (ISO 8601)" }, "endDate": { "type": "string", "description": "Date and time (ISO 8601)" }, "location": { "type": [ "string", "null" ] }, "price": { "anyOf": [ { "type": "number", "description": "Rand" }, { "type": "null" } ] }, "isActive": { "type": [ "boolean", "null" ] }, "isHidden": { "type": [ "boolean", "null" ] }, "imageUrl": { "type": [ "string", "null" ] }, "campusId": { "type": [ "string", "null" ] }, "scheduleType": { "anyOf": [ { "type": "string", "enum": [ "single", "sessions" ] }, { "type": "null" } ] }, "cashupStatus": { "anyOf": [ { "type": "string", "enum": [ "open", "closed" ] }, { "type": "null" } ] } }, "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" } } } } } } }, "/events/{id}/kids/settings": { "get": { "tags": [ "Kids" ], "summary": "An event's kids check-in set-up", "description": "**Who:** Supervisors and admins.", "operationId": "getEventsIdKidsSettings", "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": { "event": { "type": "object", "properties": { "id": { "type": "string" }, "title": { "type": "string" }, "scheduleType": { "type": [ "string", "null" ] }, "kidsCheckIn": { "type": "boolean" }, "kidsOptionId": { "type": [ "string", "null" ] }, "kidsRoomSetId": { "type": [ "string", "null" ] } }, "required": [ "id", "title", "kidsCheckIn" ], "additionalProperties": {} }, "options": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "eventId": { "type": "string" }, "name": { "type": "string" }, "description": { "type": [ "string", "null" ] }, "price": { "type": "number", "description": "Rand" }, "isMainTicket": { "type": "boolean" }, "stockLimit": { "type": [ "number", "null" ] } }, "additionalProperties": {} } }, "sets": { "type": "array", "items": { "type": "object", "properties": {}, "additionalProperties": {} }, "description": "Allocation sets that can be the rooms" } }, "required": [ "event", "options", "sets" ], "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" } } } } } }, "put": { "tags": [ "Kids" ], "summary": "Set up kids check-in", "description": "**Who:** Supervisors and admins.", "operationId": "putEventsIdKidsSettings", "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": { "enabled": { "type": [ "boolean", "null" ] }, "optionId": { "description": "The kids ticket (`new` makes a free one; null: none)", "type": [ "string", "null" ] }, "roomSetId": { "description": "The allocation set used as rooms", "type": [ "string", "null" ] } }, "additionalProperties": {}, "description": "Only what changes" } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": {}, "additionalProperties": {}, "description": "The saved set-up, as GET answers" } }, "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}/kids/board": { "get": { "tags": [ "Kids" ], "summary": "Who is checked in, by room", "description": "**Who:** Staff, supervisors and admins.", "operationId": "getEventsIdKidsBoard", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "id", "in": "path", "required": true, "description": "The id", "schema": { "type": "string", "minLength": 1, "maxLength": 64 } }, { "name": "sessionId", "in": "query", "required": false, "description": "Multi-day events: the session (default: today's)", "schema": { "type": "string", "maxLength": 4000 } }, { "name": "log", "in": "query", "required": false, "description": "`1` also writes it to the access log (a list with personal details)", "schema": { "type": "string", "maxLength": 4000 } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "event": { "type": "object", "properties": {}, "additionalProperties": {} }, "occasion": { "type": "string", "description": "The day or session it's for" }, "sessionId": { "type": [ "string", "null" ] }, "sessionLabel": { "type": [ "string", "null" ] }, "rooms": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "minAge": { "type": [ "number", "null" ] }, "maxAge": { "type": [ "number", "null" ] }, "capacity": { "type": [ "number", "null" ] }, "ratio": { "type": [ "number", "null" ] }, "order": { "type": [ "number", "null" ] }, "leaderNames": { "type": "array", "items": { "type": "string" } }, "leaderIds": { "type": "array", "items": { "type": "string" }, "description": "Ids" } }, "required": [ "id", "name" ], "additionalProperties": {} } }, "checkIns": { "type": "array", "items": { "type": "object", "properties": {}, "additionalProperties": {} }, "description": "Children checked in, with room and code" } }, "required": [ "event", "occasion", "rooms", "checkIns" ], "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}/kids/families": { "get": { "tags": [ "Kids" ], "summary": "Find a family", "description": "**Who:** Staff, supervisors and admins.", "operationId": "getEventsIdKidsFamilies", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "id", "in": "path", "required": true, "description": "The id", "schema": { "type": "string", "minLength": 1, "maxLength": 64 } }, { "name": "q", "in": "query", "required": false, "description": "Text to search for", "schema": { "type": "string", "maxLength": 4000 } }, { "name": "sessionId", "in": "query", "required": false, "description": "Multi-day events: the session (default: today's)", "schema": { "type": "string", "maxLength": 4000 } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "parents": { "type": "array", "items": { "type": "object", "properties": { "userId": { "type": "string" }, "name": { "type": "string" }, "phone": { "type": [ "string", "null" ] }, "email": { "type": [ "string", "null" ] } }, "required": [ "userId", "name" ], "additionalProperties": {} } }, "children": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "firstName": { "type": "string" }, "lastName": { "type": "string" }, "name": { "type": "string" }, "dateOfBirth": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "age": { "type": [ "number", "null" ] }, "gender": { "type": [ "string", "null" ] }, "allergies": { "type": [ "string", "null" ] }, "hasMedical": { "type": "boolean" }, "hasCustody": { "type": "boolean", "description": "There are custody notes" }, "medicalNotes": { "description": "Only where notes may be shown", "type": [ "string", "null" ] }, "custodyNotes": { "type": [ "string", "null" ] }, "lastCheckInAt": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] } }, "required": [ "id", "firstName", "lastName", "name", "hasMedical", "hasCustody" ], "additionalProperties": {} } }, "adults": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string" }, "phone": { "type": [ "string", "null" ] }, "relationship": { "type": [ "string", "null" ] }, "id": { "type": "string" } }, "required": [ "name", "id" ], "additionalProperties": {} }, "description": "Others who may collect the children" } }, "required": [ "id", "name", "parents", "children", "adults" ], "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": [ "Kids" ], "summary": "Register a family at the desk", "description": "**Who:** Staff, supervisors and admins.", "operationId": "postEventsIdKidsFamilies", "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", "null" ] }, "parent": { "type": "object", "properties": { "name": { "type": "string" }, "email": { "type": [ "string", "null" ] }, "phone": { "description": "Email or phone needed: the collection code is sent there", "type": [ "string", "null" ] } }, "required": [ "name" ], "additionalProperties": {} }, "children": { "maxItems": 12, "type": "array", "items": { "type": "object", "properties": { "firstName": { "type": "string" }, "lastName": { "type": [ "string", "null" ] }, "dateOfBirth": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "gender": { "description": "male or female (anything else: not given)", "type": [ "string", "null" ] }, "allergies": { "type": [ "string", "null" ] }, "medicalNotes": { "type": [ "string", "null" ] }, "custodyNotes": { "description": "Kept encrypted, like the medical notes", "type": [ "string", "null" ] } }, "required": [ "firstName" ], "additionalProperties": {} } } }, "required": [ "parent" ], "additionalProperties": {} } } } }, "responses": { "201": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "parents": { "type": "array", "items": { "type": "object", "properties": { "userId": { "type": "string" }, "name": { "type": "string" }, "phone": { "type": [ "string", "null" ] }, "email": { "type": [ "string", "null" ] } }, "required": [ "userId", "name" ], "additionalProperties": {} } }, "children": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "firstName": { "type": "string" }, "lastName": { "type": "string" }, "name": { "type": "string" }, "dateOfBirth": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "age": { "type": [ "number", "null" ] }, "gender": { "type": [ "string", "null" ] }, "allergies": { "type": [ "string", "null" ] }, "hasMedical": { "type": "boolean" }, "hasCustody": { "type": "boolean", "description": "There are custody notes" }, "medicalNotes": { "description": "Only where notes may be shown", "type": [ "string", "null" ] }, "custodyNotes": { "type": [ "string", "null" ] }, "lastCheckInAt": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] } }, "required": [ "id", "firstName", "lastName", "name", "hasMedical", "hasCustody" ], "additionalProperties": {} } }, "adults": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string" }, "phone": { "type": [ "string", "null" ] }, "relationship": { "type": [ "string", "null" ] }, "id": { "type": "string" } }, "required": [ "name", "id" ], "additionalProperties": {} }, "description": "Others who may collect the children" } }, "required": [ "id", "name", "parents", "children", "adults" ], "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}/kids/families/qr/{token}": { "get": { "tags": [ "Kids" ], "summary": "The family for a QR code", "description": "**Who:** Staff, supervisors and admins.", "operationId": "getEventsIdKidsFamiliesQrToken", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "id", "in": "path", "required": true, "description": "The id", "schema": { "type": "string", "minLength": 1, "maxLength": 64 } }, { "name": "token", "in": "path", "required": true, "description": "The token from the link (it is the credential)", "schema": { "type": "string", "minLength": 1, "maxLength": 200 } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "parents": { "type": "array", "items": { "type": "object", "properties": { "userId": { "type": "string" }, "name": { "type": "string" }, "phone": { "type": [ "string", "null" ] }, "email": { "type": [ "string", "null" ] } }, "required": [ "userId", "name" ], "additionalProperties": {} } }, "children": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "firstName": { "type": "string" }, "lastName": { "type": "string" }, "name": { "type": "string" }, "dateOfBirth": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "age": { "type": [ "number", "null" ] }, "gender": { "type": [ "string", "null" ] }, "allergies": { "type": [ "string", "null" ] }, "hasMedical": { "type": "boolean" }, "hasCustody": { "type": "boolean", "description": "There are custody notes" }, "medicalNotes": { "description": "Only where notes may be shown", "type": [ "string", "null" ] }, "custodyNotes": { "type": [ "string", "null" ] }, "lastCheckInAt": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] } }, "required": [ "id", "firstName", "lastName", "name", "hasMedical", "hasCustody" ], "additionalProperties": {} } }, "adults": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string" }, "phone": { "type": [ "string", "null" ] }, "relationship": { "type": [ "string", "null" ] }, "id": { "type": "string" } }, "required": [ "name", "id" ], "additionalProperties": {} }, "description": "Others who may collect the children" } }, "required": [ "id", "name", "parents", "children", "adults" ], "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}/kids/families/{familyId}": { "get": { "tags": [ "Kids" ], "summary": "One family", "description": "**Who:** Staff, supervisors and admins.", "operationId": "getEventsIdKidsFamiliesFamilyId", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "id", "in": "path", "required": true, "description": "The id", "schema": { "type": "string", "minLength": 1, "maxLength": 64 } }, { "name": "familyId", "in": "path", "required": true, "description": "The family's 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" }, "name": { "type": "string" }, "parents": { "type": "array", "items": { "type": "object", "properties": { "userId": { "type": "string" }, "name": { "type": "string" }, "phone": { "type": [ "string", "null" ] }, "email": { "type": [ "string", "null" ] } }, "required": [ "userId", "name" ], "additionalProperties": {} } }, "children": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "firstName": { "type": "string" }, "lastName": { "type": "string" }, "name": { "type": "string" }, "dateOfBirth": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "age": { "type": [ "number", "null" ] }, "gender": { "type": [ "string", "null" ] }, "allergies": { "type": [ "string", "null" ] }, "hasMedical": { "type": "boolean" }, "hasCustody": { "type": "boolean", "description": "There are custody notes" }, "medicalNotes": { "description": "Only where notes may be shown", "type": [ "string", "null" ] }, "custodyNotes": { "type": [ "string", "null" ] }, "lastCheckInAt": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] } }, "required": [ "id", "firstName", "lastName", "name", "hasMedical", "hasCustody" ], "additionalProperties": {} } }, "adults": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string" }, "phone": { "type": [ "string", "null" ] }, "relationship": { "type": [ "string", "null" ] }, "id": { "type": "string" } }, "required": [ "name", "id" ], "additionalProperties": {} }, "description": "Others who may collect the children" } }, "required": [ "id", "name", "parents", "children", "adults" ], "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}/kids/families/{familyId}/parents": { "post": { "tags": [ "Kids" ], "summary": "Add a parent at the desk", "description": "**Who:** Staff, supervisors and admins.", "operationId": "postEventsIdKidsFamiliesFamilyIdParents", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "id", "in": "path", "required": true, "description": "The id", "schema": { "type": "string", "minLength": 1, "maxLength": 64 } }, { "name": "familyId", "in": "path", "required": true, "description": "The family's id", "schema": { "type": "string", "minLength": 1, "maxLength": 64 } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "name": { "type": "string" }, "email": { "type": [ "string", "null" ] }, "phone": { "description": "Email or phone needed: the collection code is sent there", "type": [ "string", "null" ] } }, "required": [ "name" ], "additionalProperties": {} } } } }, "responses": { "201": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "parents": { "type": "array", "items": { "type": "object", "properties": { "userId": { "type": "string" }, "name": { "type": "string" }, "phone": { "type": [ "string", "null" ] }, "email": { "type": [ "string", "null" ] } }, "required": [ "userId", "name" ], "additionalProperties": {} } }, "children": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "firstName": { "type": "string" }, "lastName": { "type": "string" }, "name": { "type": "string" }, "dateOfBirth": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "age": { "type": [ "number", "null" ] }, "gender": { "type": [ "string", "null" ] }, "allergies": { "type": [ "string", "null" ] }, "hasMedical": { "type": "boolean" }, "hasCustody": { "type": "boolean", "description": "There are custody notes" }, "medicalNotes": { "description": "Only where notes may be shown", "type": [ "string", "null" ] }, "custodyNotes": { "type": [ "string", "null" ] }, "lastCheckInAt": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] } }, "required": [ "id", "firstName", "lastName", "name", "hasMedical", "hasCustody" ], "additionalProperties": {} } }, "adults": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string" }, "phone": { "type": [ "string", "null" ] }, "relationship": { "type": [ "string", "null" ] }, "id": { "type": "string" } }, "required": [ "name", "id" ], "additionalProperties": {} }, "description": "Others who may collect the children" } }, "required": [ "id", "name", "parents", "children", "adults" ], "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}/kids/families/{familyId}/children": { "post": { "tags": [ "Kids" ], "summary": "Add a child at the desk", "description": "**Who:** Staff, supervisors and admins.", "operationId": "postEventsIdKidsFamiliesFamilyIdChildren", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "id", "in": "path", "required": true, "description": "The id", "schema": { "type": "string", "minLength": 1, "maxLength": 64 } }, { "name": "familyId", "in": "path", "required": true, "description": "The family's id", "schema": { "type": "string", "minLength": 1, "maxLength": 64 } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "firstName": { "type": "string" }, "lastName": { "type": [ "string", "null" ] }, "dateOfBirth": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "gender": { "description": "male or female (anything else: not given)", "type": [ "string", "null" ] }, "allergies": { "type": [ "string", "null" ] }, "medicalNotes": { "type": [ "string", "null" ] }, "custodyNotes": { "description": "Kept encrypted, like the medical notes", "type": [ "string", "null" ] } }, "required": [ "firstName" ], "additionalProperties": {} } } } }, "responses": { "201": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "id": { "type": "string" }, "firstName": { "type": "string" }, "lastName": { "type": "string" }, "name": { "type": "string" }, "dateOfBirth": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "age": { "type": [ "number", "null" ] }, "gender": { "type": [ "string", "null" ] }, "allergies": { "type": [ "string", "null" ] }, "hasMedical": { "type": "boolean" }, "hasCustody": { "type": "boolean", "description": "There are custody notes" }, "medicalNotes": { "description": "Only where notes may be shown", "type": [ "string", "null" ] }, "custodyNotes": { "type": [ "string", "null" ] }, "lastCheckInAt": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] } }, "required": [ "id", "firstName", "lastName", "name", "hasMedical", "hasCustody" ], "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}/kids/families/{familyId}/children/{childId}": { "put": { "tags": [ "Kids" ], "summary": "Change a child at the desk", "description": "**Who:** Staff, supervisors and admins.", "operationId": "putEventsIdKidsFamiliesFamilyIdChildrenChildId", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "id", "in": "path", "required": true, "description": "The id", "schema": { "type": "string", "minLength": 1, "maxLength": 64 } }, { "name": "familyId", "in": "path", "required": true, "description": "The family's id", "schema": { "type": "string", "minLength": 1, "maxLength": 64 } }, { "name": "childId", "in": "path", "required": true, "description": "The child's id", "schema": { "type": "string", "minLength": 1, "maxLength": 64 } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "firstName": { "type": "string" }, "lastName": { "type": [ "string", "null" ] }, "dateOfBirth": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "gender": { "description": "male or female (anything else: not given)", "type": [ "string", "null" ] }, "allergies": { "type": [ "string", "null" ] }, "medicalNotes": { "type": [ "string", "null" ] }, "custodyNotes": { "description": "Kept encrypted, like the medical notes", "type": [ "string", "null" ] } }, "additionalProperties": {} } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "id": { "type": "string" }, "firstName": { "type": "string" }, "lastName": { "type": "string" }, "name": { "type": "string" }, "dateOfBirth": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "age": { "type": [ "number", "null" ] }, "gender": { "type": [ "string", "null" ] }, "allergies": { "type": [ "string", "null" ] }, "hasMedical": { "type": "boolean" }, "hasCustody": { "type": "boolean", "description": "There are custody notes" }, "medicalNotes": { "description": "Only where notes may be shown", "type": [ "string", "null" ] }, "custodyNotes": { "type": [ "string", "null" ] }, "lastCheckInAt": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] } }, "required": [ "id", "firstName", "lastName", "name", "hasMedical", "hasCustody" ], "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}/kids/families/{familyId}/adults": { "post": { "tags": [ "Kids" ], "summary": "Add an adult at the desk", "description": "**Who:** Staff, supervisors and admins.", "operationId": "postEventsIdKidsFamiliesFamilyIdAdults", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "id", "in": "path", "required": true, "description": "The id", "schema": { "type": "string", "minLength": 1, "maxLength": 64 } }, { "name": "familyId", "in": "path", "required": true, "description": "The family's id", "schema": { "type": "string", "minLength": 1, "maxLength": 64 } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "name": { "type": "string" }, "phone": { "type": [ "string", "null" ] }, "relationship": { "type": [ "string", "null" ] } }, "required": [ "name" ], "additionalProperties": {} } } } }, "responses": { "201": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "parents": { "type": "array", "items": { "type": "object", "properties": { "userId": { "type": "string" }, "name": { "type": "string" }, "phone": { "type": [ "string", "null" ] }, "email": { "type": [ "string", "null" ] } }, "required": [ "userId", "name" ], "additionalProperties": {} } }, "children": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "firstName": { "type": "string" }, "lastName": { "type": "string" }, "name": { "type": "string" }, "dateOfBirth": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "age": { "type": [ "number", "null" ] }, "gender": { "type": [ "string", "null" ] }, "allergies": { "type": [ "string", "null" ] }, "hasMedical": { "type": "boolean" }, "hasCustody": { "type": "boolean", "description": "There are custody notes" }, "medicalNotes": { "description": "Only where notes may be shown", "type": [ "string", "null" ] }, "custodyNotes": { "type": [ "string", "null" ] }, "lastCheckInAt": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] } }, "required": [ "id", "firstName", "lastName", "name", "hasMedical", "hasCustody" ], "additionalProperties": {} } }, "adults": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string" }, "phone": { "type": [ "string", "null" ] }, "relationship": { "type": [ "string", "null" ] }, "id": { "type": "string" } }, "required": [ "name", "id" ], "additionalProperties": {} }, "description": "Others who may collect the children" } }, "required": [ "id", "name", "parents", "children", "adults" ], "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}/kids/check-in": { "post": { "tags": [ "Kids" ], "summary": "Check children in", "description": "Answers the collection code and labels to print.\n\n**Who:** Staff, supervisors and admins.", "operationId": "postEventsIdKidsCheck-in", "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": { "familyId": { "type": "string" }, "sessionId": { "type": [ "string", "null" ] }, "children": { "type": "array", "items": { "type": "object", "properties": { "childId": { "type": "string" }, "roomId": { "type": [ "string", "null" ] } }, "required": [ "childId" ], "additionalProperties": {} }, "description": "Who, and into which room (default: by age)" }, "sendToAdultId": { "description": "Send the code to this adult too", "type": [ "string", "null" ] } }, "required": [ "familyId", "children" ], "additionalProperties": {} } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "code": { "type": "string", "description": "The collection code" }, "qr": { "type": "string" }, "occasion": { "type": "string" }, "family": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" } }, "required": [ "id", "name" ], "additionalProperties": {} }, "checkIns": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "firstName": { "type": "string" }, "room": { "anyOf": [ { "type": "object", "properties": {}, "additionalProperties": {} }, { "type": "null" } ] }, "already": { "type": "boolean" }, "sticker": { "description": "Write this on the sticker", "type": [ "string", "null" ] } }, "required": [ "id", "name", "firstName", "already" ], "additionalProperties": {} } } }, "required": [ "code", "qr", "occasion", "family", "checkIns" ], "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}/kids/check-out": { "post": { "tags": [ "Kids" ], "summary": "Check children out", "description": "With the collection code; refused for someone not allowed to collect.\n\n**Who:** Staff, supervisors and admins.", "operationId": "postEventsIdKidsCheck-out", "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" }, "checkInIds": { "description": "Just these children (default: all on the code)", "type": "array", "items": { "type": "string" } }, "collectedBy": { "description": "Who collected them", "type": [ "string", "null" ] }, "roomId": { "type": [ "string", "null" ] }, "sessionId": { "type": [ "string", "null" ] } }, "required": [ "code" ], "additionalProperties": {} } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "checkedOut": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "room": { "type": [ "string", "null" ] } }, "required": [ "id", "name" ], "additionalProperties": {} } } }, "required": [ "checkedOut" ], "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}/kids/code/{code}": { "get": { "tags": [ "Kids" ], "summary": "Who a collection code is for", "description": "**Who:** Staff, supervisors and admins.", "operationId": "getEventsIdKidsCodeCode", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "id", "in": "path", "required": true, "description": "The id", "schema": { "type": "string", "minLength": 1, "maxLength": 64 } }, { "name": "code", "in": "path", "required": true, "description": "The code", "schema": { "type": "string", "minLength": 1, "maxLength": 40 } }, { "name": "sessionId", "in": "query", "required": false, "description": "Multi-day events: the session (default: today's)", "schema": { "type": "string", "maxLength": 4000 } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "code": { "type": "string" }, "found": { "type": "boolean" }, "family": { "anyOf": [ { "type": "object", "properties": {}, "additionalProperties": {} }, { "type": "null" } ] }, "children": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "room": { "anyOf": [ { "type": "object", "properties": {}, "additionalProperties": {} }, { "type": "null" } ] }, "checkedOutAt": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "collectedBy": { "type": [ "string", "null" ] } }, "required": [ "id", "name" ], "additionalProperties": {} } } }, "required": [ "code", "found", "children" ], "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}/kids/duty": { "post": { "tags": [ "Kids" ], "summary": "Say which room I'm on", "description": "**Who:** Staff, supervisors and admins.", "operationId": "postEventsIdKidsDuty", "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": { "roomId": { "type": "string" }, "sessionId": { "type": [ "string", "null" ] }, "on": { "description": "false: off duty", "type": [ "boolean", "null" ] } }, "required": [ "roomId" ], "additionalProperties": {} } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "roomId": { "type": "string" }, "on": { "type": "boolean" } }, "required": [ "roomId", "on" ], "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}/kids/offline": { "get": { "tags": [ "Kids" ], "summary": "Everything the desk needs offline", "description": "**Who:** Staff, supervisors and admins.", "operationId": "getEventsIdKidsOffline", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "id", "in": "path", "required": true, "description": "The id", "schema": { "type": "string", "minLength": 1, "maxLength": 64 } }, { "name": "deviceId", "in": "query", "required": false, "description": "This device's id (offline scanning)", "schema": { "type": "string", "maxLength": 4000 } }, { "name": "sessionId", "in": "query", "required": false, "description": "Multi-day events: the session (default: today's)", "schema": { "type": "string", "maxLength": 4000 } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "event": { "type": "object", "properties": {}, "additionalProperties": {} }, "occasion": { "type": "string", "description": "The day or session it's for" }, "sessionId": { "type": [ "string", "null" ] }, "sessionLabel": { "type": [ "string", "null" ] }, "rooms": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "minAge": { "type": [ "number", "null" ] }, "maxAge": { "type": [ "number", "null" ] }, "capacity": { "type": [ "number", "null" ] }, "ratio": { "type": [ "number", "null" ] }, "order": { "type": [ "number", "null" ] }, "leaderNames": { "type": "array", "items": { "type": "string" } }, "leaderIds": { "type": "array", "items": { "type": "string" }, "description": "Ids" } }, "required": [ "id", "name" ], "additionalProperties": {} } }, "checkIns": { "type": "array", "items": { "type": "object", "properties": {}, "additionalProperties": {} }, "description": "Children checked in, with room and code" }, "families": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "parents": { "type": "array", "items": { "type": "object", "properties": { "userId": { "type": "string" }, "name": { "type": "string" }, "phone": { "type": [ "string", "null" ] }, "email": { "type": [ "string", "null" ] } }, "required": [ "userId", "name" ], "additionalProperties": {} } }, "children": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "firstName": { "type": "string" }, "lastName": { "type": "string" }, "name": { "type": "string" }, "dateOfBirth": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "age": { "type": [ "number", "null" ] }, "gender": { "type": [ "string", "null" ] }, "allergies": { "type": [ "string", "null" ] }, "hasMedical": { "type": "boolean" }, "hasCustody": { "type": "boolean", "description": "There are custody notes" }, "medicalNotes": { "description": "Only where notes may be shown", "type": [ "string", "null" ] }, "custodyNotes": { "type": [ "string", "null" ] }, "lastCheckInAt": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] } }, "required": [ "id", "firstName", "lastName", "name", "hasMedical", "hasCustody" ], "additionalProperties": {} } }, "adults": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string" }, "phone": { "type": [ "string", "null" ] }, "relationship": { "type": [ "string", "null" ] }, "id": { "type": "string" } }, "required": [ "name", "id" ], "additionalProperties": {} }, "description": "Others who may collect the children" } }, "required": [ "id", "name", "parents", "children", "adults" ], "additionalProperties": {} } }, "codes": { "type": "array", "items": { "type": "object", "properties": {}, "additionalProperties": {} }, "description": "Codes reserved for this device" }, "downloadedAt": { "type": "string", "description": "Date and time (ISO 8601)" } }, "required": [ "event", "occasion", "rooms", "checkIns", "families", "codes", "downloadedAt" ], "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}/kids/sync": { "post": { "tags": [ "Kids" ], "summary": "Upload check-ins made offline", "description": "**Who:** Staff, supervisors and admins.", "operationId": "postEventsIdKidsSync", "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": { "deviceId": { "type": "string" }, "sessionId": { "type": [ "string", "null" ] }, "checkIns": { "type": "array", "items": { "type": "object", "properties": {}, "additionalProperties": {} } }, "checkOuts": { "type": "array", "items": { "type": "object", "properties": {}, "additionalProperties": {} } } }, "required": [ "deviceId" ], "additionalProperties": {} } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "checkedIn": { "type": "number" }, "checkedOut": { "type": "number" }, "conflicts": { "type": "array", "items": { "type": "object", "properties": {}, "additionalProperties": {} } } }, "required": [ "checkedIn", "checkedOut", "conflicts" ], "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" } } } } } } }, "/kids/check-ins/{id}/override": { "post": { "tags": [ "Kids" ], "summary": "Let someone not on the list collect", "description": "Logged, with the reason.\n\n**Who:** Staff, supervisors and admins.", "operationId": "postKidsCheck-insIdOverride", "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": { "reason": { "type": "string" }, "collectedBy": { "type": "string" } }, "required": [ "reason", "collectedBy" ], "additionalProperties": {} } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "id": { "type": "string" }, "checkedOutAt": { "type": "string", "description": "Date and time (ISO 8601)" } }, "required": [ "id", "checkedOutAt" ], "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" } } } } } } }, "/kids/check-ins/{id}/page": { "post": { "tags": [ "Kids" ], "summary": "Page a child's parent", "description": "**Who:** Staff, supervisors and admins.", "operationId": "postKidsCheck-insIdPage", "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": { "message": { "type": [ "string", "null" ] } }, "additionalProperties": {} } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "sent": { "type": "array", "items": { "type": "string" }, "description": "Channels used" }, "text": { "type": "string" } }, "required": [ "sent", "text" ], "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" } } } } } } }, "/kids/check-ins/{id}/room": { "put": { "tags": [ "Kids" ], "summary": "Move a child to another room", "description": "**Who:** Staff, supervisors and admins.", "operationId": "putKidsCheck-insIdRoom", "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": { "roomId": { "type": "string" } }, "required": [ "roomId" ], "additionalProperties": {} } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "id": { "type": "string" }, "roomId": { "type": "string" } }, "required": [ "id", "roomId" ], "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" } } } } } } }, "/kids/alerts/{id}/resolve": { "post": { "tags": [ "Kids" ], "summary": "Resolve an alert", "description": "**Who:** Staff, supervisors and admins.", "operationId": "postKidsAlertsIdResolve", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "id", "in": "path", "required": true, "description": "The id", "schema": { "type": "string", "minLength": 1, "maxLength": 64 } } ], "requestBody": { "required": true, "description": "No body needed: send an empty object.", "content": { "application/json": { "schema": { "type": "object", "properties": {}, "additionalProperties": {} } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "resolved": { "type": "number" } }, "required": [ "resolved" ], "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" } } } } } } }, "/me/volunteering": { "get": { "tags": [ "Volunteers" ], "summary": "Where I'm serving", "description": "**Who:** Any signed-in person.", "operationId": "getMeVolunteering", "security": [ { "bearerAuth": [] } ], "parameters": [], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "slots": { "type": "array", "items": { "type": "object", "properties": { "slotId": { "type": "string" }, "role": { "type": "object", "properties": {}, "additionalProperties": {} }, "event": { "type": "object", "properties": {}, "additionalProperties": {} }, "shift": { "type": "object", "properties": { "startsAt": { "type": "string", "description": "Date and time (ISO 8601)" }, "endsAt": { "type": "string", "description": "Date and time (ISO 8601)" }, "text": { "type": "string" }, "hours": { "type": "number" } }, "required": [ "startsAt", "endsAt", "text", "hours" ], "additionalProperties": {} }, "checkedInAt": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "canCheckIn": { "type": "boolean" }, "past": { "type": "boolean" }, "swapId": { "type": [ "string", "null" ] }, "hasTicket": { "type": "boolean" } }, "required": [ "slotId", "role", "event", "shift", "canCheckIn", "past", "hasTicket" ], "additionalProperties": {} } }, "cover": { "type": "array", "items": { "type": "object", "properties": {}, "additionalProperties": {} }, "description": "Slots others want covered" }, "events": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "title": { "type": "string" }, "startDate": { "type": "string", "description": "Date and time (ISO 8601)" }, "endDate": { "type": "string", "description": "Date and time (ISO 8601)" }, "location": { "type": [ "string", "null" ] }, "roles": { "type": "number" } }, "required": [ "id", "title", "startDate", "endDate", "roles" ], "additionalProperties": {} } } }, "required": [ "slots", "cover", "events" ], "additionalProperties": {} } }, "required": [ "data" ], "additionalProperties": false } } } }, "401": { "description": "Not signed in (UNAUTHENTICATED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/events/{id}/volunteer-roles": { "get": { "tags": [ "Volunteers" ], "summary": "Roles I can serve in at an event", "description": "**Who:** Any signed-in person.", "operationId": "getEventsIdVolunteer-roles", "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": { "event": { "type": "object", "properties": {}, "additionalProperties": {} }, "sessions": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "label": { "type": "string" }, "startsAt": { "type": "string", "description": "Date and time (ISO 8601)" }, "endsAt": { "type": "string", "description": "Date and time (ISO 8601)" } }, "required": [ "id", "label", "startsAt", "endsAt" ], "additionalProperties": {} } }, "roles": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "eventId": { "type": "string" }, "sessionId": { "type": [ "string", "null" ] }, "sessionLabel": { "type": [ "string", "null" ] }, "name": { "type": "string" }, "description": { "type": "string" }, "startsAt": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "endsAt": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "shift": { "type": "object", "properties": { "startsAt": { "type": "string", "description": "Date and time (ISO 8601)" }, "endsAt": { "type": "string", "description": "Date and time (ISO 8601)" }, "text": { "type": "string" }, "hours": { "type": "number" } }, "required": [ "startsAt", "endsAt", "text", "hours" ], "additionalProperties": {} }, "kidsRoom": { "anyOf": [ { "type": "object", "properties": {}, "additionalProperties": {} }, { "type": "null" } ] }, "order": { "type": "number" }, "past": { "type": "boolean" }, "needed": { "type": [ "number", "null" ] }, "filled": { "type": [ "number", "null" ] }, "mine": { "anyOf": [ { "type": "object", "properties": { "slotId": { "type": "string" }, "checkedInAt": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "swapId": { "type": [ "string", "null" ] } }, "required": [ "slotId" ], "additionalProperties": {} }, { "type": "null" } ], "description": "My place in it" }, "coverNeeded": { "type": "array", "items": { "type": "object", "properties": { "swapId": { "type": "string" }, "note": { "type": "string" } }, "required": [ "swapId", "note" ], "additionalProperties": {} } }, "volunteers": { "description": "Staff only", "type": "array", "items": { "type": "object", "properties": { "slotId": { "type": "string" }, "userId": { "type": "string" }, "name": { "type": "string" }, "phone": { "type": [ "string", "null" ] }, "email": { "type": [ "string", "null" ] }, "assignedBy": { "type": [ "string", "null" ] }, "checkedInAt": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "checkedInBy": { "type": [ "string", "null" ] }, "checkInMethod": { "type": [ "string", "null" ] }, "swapOpen": { "type": "boolean" }, "hasTicket": { "type": "boolean" } }, "required": [ "slotId", "userId", "name", "swapOpen", "hasTicket" ], "additionalProperties": {} } } }, "required": [ "id", "eventId", "name", "description", "shift", "order", "past", "mine", "coverNeeded" ], "additionalProperties": {} } }, "totals": { "type": "object", "properties": { "needed": { "type": [ "number", "null" ] }, "filled": { "type": [ "number", "null" ] }, "fillRate": { "description": "%", "type": [ "number", "null" ] } }, "additionalProperties": {} } }, "required": [ "event", "sessions", "roles", "totals" ], "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" } } } } } }, "post": { "tags": [ "Volunteers" ], "summary": "Add a role", "description": "**Who:** Supervisors and admins.", "operationId": "postEventsIdVolunteer-roles", "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" }, "description": { "type": [ "string", "null" ] }, "sessionId": { "description": "A multi-day event: the session", "type": [ "string", "null" ] }, "startsAt": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "endsAt": { "description": "Default: the event's or session's times", "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "needed": { "description": "How many people", "type": [ "number", "string", "null" ] }, "kidsRoomId": { "description": "Serving in a kids room: counts as a leader on duty", "type": [ "string", "null" ] }, "order": { "type": [ "number", "string" ] } }, "required": [ "name" ], "additionalProperties": {} } } } }, "responses": { "201": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "id": { "type": "string" }, "eventId": { "type": "string" }, "name": { "type": "string" }, "description": { "type": [ "string", "null" ] }, "sessionId": { "type": [ "string", "null" ] }, "startsAt": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "endsAt": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "needed": { "type": [ "number", "null" ] }, "kidsRoomId": { "type": [ "string", "null" ] }, "order": { "type": "number" } }, "required": [ "id", "eventId", "name", "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" } } } } } } }, "/volunteer-roles/{id}/sign-up": { "post": { "tags": [ "Volunteers" ], "summary": "Sign up to serve", "description": "**Who:** Any signed-in person.", "operationId": "postVolunteer-rolesIdSign-up", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "id", "in": "path", "required": true, "description": "The id", "schema": { "type": "string", "minLength": 1, "maxLength": 64 } } ], "requestBody": { "required": true, "description": "No body needed: send an empty object.", "content": { "application/json": { "schema": { "type": "object", "properties": {}, "additionalProperties": {} } } } }, "responses": { "201": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "slotId": { "type": "string" }, "ticket": { "type": "boolean", "description": "A free volunteer ticket was issued" } }, "required": [ "slotId", "ticket" ], "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" } } } } } } }, "/volunteer-slots/{id}": { "delete": { "tags": [ "Volunteers" ], "summary": "Stop serving in a slot", "description": "**Who:** Any signed-in person.", "operationId": "deleteVolunteer-slotsId", "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" } } } }, "404": { "description": "Not found (NOT_FOUND)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/volunteer-slots/{id}/swap": { "post": { "tags": [ "Volunteers" ], "summary": "Ask someone to take my slot", "description": "**Who:** Any signed-in person.", "operationId": "postVolunteer-slotsIdSwap", "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": { "note": { "type": [ "string", "null" ] } }, "additionalProperties": {} } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "swapId": { "type": "string" } }, "required": [ "swapId" ], "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" } } } } } } }, "/volunteer-swaps/{id}": { "delete": { "tags": [ "Volunteers" ], "summary": "Cancel a swap request", "description": "**Who:** Any signed-in person.", "operationId": "deleteVolunteer-swapsId", "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": { "cancelled": { "type": "boolean", "const": true } }, "required": [ "cancelled" ], "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" } } } } } } }, "/volunteer-swaps/{id}/accept": { "post": { "tags": [ "Volunteers" ], "summary": "Take someone's slot", "description": "**Who:** Any signed-in person.", "operationId": "postVolunteer-swapsIdAccept", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "id", "in": "path", "required": true, "description": "The id", "schema": { "type": "string", "minLength": 1, "maxLength": 64 } } ], "requestBody": { "required": true, "description": "No body needed: send an empty object.", "content": { "application/json": { "schema": { "type": "object", "properties": {}, "additionalProperties": {} } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "slotId": { "type": "string" }, "role": { "type": "string" }, "event": { "type": "string" } }, "required": [ "slotId", "role", "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" } } } }, "404": { "description": "Not found (NOT_FOUND)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/volunteering/check-in": { "post": { "tags": [ "Volunteers" ], "summary": "Check myself in (the event's QR code)", "description": "**Who:** Any signed-in person.", "operationId": "postVolunteeringCheck-in", "security": [ { "bearerAuth": [] } ], "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "qr": { "type": "string", "description": "What the QR code holds" } }, "required": [ "qr" ], "additionalProperties": {} } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "event": { "type": "object", "properties": { "id": { "type": "string" }, "title": { "type": "string" } }, "required": [ "id", "title" ], "additionalProperties": {} }, "checkedIn": { "type": "array", "items": { "type": "object", "properties": { "role": { "type": "string" }, "kidsRoom": { "type": [ "string", "null" ] } }, "required": [ "role" ], "additionalProperties": {} } }, "already": { "type": "array", "items": { "type": "string" } } }, "required": [ "event", "checkedIn", "already" ], "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" } } } } } } }, "/volunteering/events": { "get": { "tags": [ "Volunteers" ], "summary": "Events with volunteer roles", "description": "**Who:** Staff, supervisors and admins.", "operationId": "getVolunteeringEvents", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "all", "in": "query", "required": false, "description": "`true`/`1`: include everything, not just the current ones", "schema": { "type": "string", "maxLength": 4000 } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "title": { "type": "string" }, "startDate": { "type": "string", "description": "Date and time (ISO 8601)" }, "endDate": { "type": "string", "description": "Date and time (ISO 8601)" }, "scheduleType": { "type": [ "string", "null" ] }, "campusId": { "type": [ "string", "null" ] }, "roles": { "type": "number" } }, "required": [ "id", "title", "startDate", "endDate", "roles" ], "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" } } } } } } }, "/volunteering/hours": { "get": { "tags": [ "Volunteers" ], "summary": "Hours served", "description": "**Who:** Supervisors and admins.", "operationId": "getVolunteeringHours", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "from", "in": "query", "required": false, "description": "On or after (ISO date or date-time)", "schema": { "type": "string", "maxLength": 4000 } }, { "name": "to", "in": "query", "required": false, "description": "On or before (ISO date or date-time)", "schema": { "type": "string", "maxLength": 4000 } }, { "name": "eventId", "in": "query", "required": false, "description": "Only this event", "schema": { "type": "string", "maxLength": 4000 } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "array", "items": { "type": "object", "properties": { "userId": { "type": "string" }, "name": { "type": "string" }, "hours": { "type": "number" }, "shifts": { "type": [ "number", "null" ] } }, "required": [ "name", "hours" ], "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/{id}/volunteers": { "get": { "tags": [ "Volunteers" ], "summary": "An event's roster", "description": "**Who:** Staff, supervisors and admins.", "operationId": "getEventsIdVolunteers", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "id", "in": "path", "required": true, "description": "The id", "schema": { "type": "string", "minLength": 1, "maxLength": 64 } }, { "name": "log", "in": "query", "required": false, "description": "`1` also writes it to the access log (a list with personal details)", "schema": { "type": "string", "maxLength": 4000 } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "event": { "type": "object", "properties": {}, "additionalProperties": {} }, "sessions": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "label": { "type": "string" }, "startsAt": { "type": "string", "description": "Date and time (ISO 8601)" }, "endsAt": { "type": "string", "description": "Date and time (ISO 8601)" } }, "required": [ "id", "label", "startsAt", "endsAt" ], "additionalProperties": {} } }, "roles": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "eventId": { "type": "string" }, "sessionId": { "type": [ "string", "null" ] }, "sessionLabel": { "type": [ "string", "null" ] }, "name": { "type": "string" }, "description": { "type": "string" }, "startsAt": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "endsAt": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "shift": { "type": "object", "properties": { "startsAt": { "type": "string", "description": "Date and time (ISO 8601)" }, "endsAt": { "type": "string", "description": "Date and time (ISO 8601)" }, "text": { "type": "string" }, "hours": { "type": "number" } }, "required": [ "startsAt", "endsAt", "text", "hours" ], "additionalProperties": {} }, "kidsRoom": { "anyOf": [ { "type": "object", "properties": {}, "additionalProperties": {} }, { "type": "null" } ] }, "order": { "type": "number" }, "past": { "type": "boolean" }, "needed": { "type": [ "number", "null" ] }, "filled": { "type": [ "number", "null" ] }, "mine": { "anyOf": [ { "type": "object", "properties": { "slotId": { "type": "string" }, "checkedInAt": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "swapId": { "type": [ "string", "null" ] } }, "required": [ "slotId" ], "additionalProperties": {} }, { "type": "null" } ], "description": "My place in it" }, "coverNeeded": { "type": "array", "items": { "type": "object", "properties": { "swapId": { "type": "string" }, "note": { "type": "string" } }, "required": [ "swapId", "note" ], "additionalProperties": {} } }, "volunteers": { "description": "Staff only", "type": "array", "items": { "type": "object", "properties": { "slotId": { "type": "string" }, "userId": { "type": "string" }, "name": { "type": "string" }, "phone": { "type": [ "string", "null" ] }, "email": { "type": [ "string", "null" ] }, "assignedBy": { "type": [ "string", "null" ] }, "checkedInAt": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "checkedInBy": { "type": [ "string", "null" ] }, "checkInMethod": { "type": [ "string", "null" ] }, "swapOpen": { "type": "boolean" }, "hasTicket": { "type": "boolean" } }, "required": [ "slotId", "userId", "name", "swapOpen", "hasTicket" ], "additionalProperties": {} } } }, "required": [ "id", "eventId", "name", "description", "shift", "order", "past", "mine", "coverNeeded" ], "additionalProperties": {} } }, "totals": { "type": "object", "properties": { "needed": { "type": [ "number", "null" ] }, "filled": { "type": [ "number", "null" ] }, "fillRate": { "description": "%", "type": [ "number", "null" ] } }, "additionalProperties": {} } }, "required": [ "event", "sessions", "roles", "totals" ], "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}/volunteers/qr": { "get": { "tags": [ "Volunteers" ], "summary": "The self check-in QR code", "description": "**Who:** Staff, supervisors and admins.", "operationId": "getEventsIdVolunteersQr", "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": { "token": { "type": "string" }, "qr": { "type": "string", "description": "Put this in the QR code" } }, "required": [ "token", "qr" ], "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}/volunteers/settings": { "get": { "tags": [ "Volunteers" ], "summary": "Volunteer set-up", "description": "**Who:** Supervisors and admins.", "operationId": "getEventsIdVolunteersSettings", "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": { "event": { "type": "object", "properties": { "id": { "type": "string" }, "title": { "type": "string" }, "volunteerOptionId": { "type": [ "string", "null" ] } }, "required": [ "id", "title" ], "additionalProperties": {} }, "options": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "eventId": { "type": "string" }, "name": { "type": "string" }, "description": { "type": [ "string", "null" ] }, "price": { "type": "number", "description": "Rand" }, "isMainTicket": { "type": "boolean" }, "stockLimit": { "type": [ "number", "null" ] } }, "additionalProperties": {} } }, "kidsRooms": { "type": "array", "items": { "type": "object", "properties": {}, "additionalProperties": {} } } }, "required": [ "event", "options", "kidsRooms" ], "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" } } } } } }, "put": { "tags": [ "Volunteers" ], "summary": "Set up volunteering", "description": "**Who:** Supervisors and admins.", "operationId": "putEventsIdVolunteersSettings", "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": { "optionId": { "description": "The free volunteer ticket (null: none)", "type": [ "string", "null" ] } }, "additionalProperties": {} } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": {}, "additionalProperties": {}, "description": "The saved set-up, as GET answers" } }, "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" } } } } } } }, "/volunteer-roles/{id}": { "patch": { "tags": [ "Volunteers" ], "summary": "Change a role", "description": "**Who:** Supervisors and admins.", "operationId": "patchVolunteer-rolesId", "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" }, "description": { "type": [ "string", "null" ] }, "sessionId": { "description": "A multi-day event: the session", "type": [ "string", "null" ] }, "startsAt": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "endsAt": { "description": "Default: the event's or session's times", "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "needed": { "description": "How many people", "type": [ "number", "string", "null" ] }, "kidsRoomId": { "description": "Serving in a kids room: counts as a leader on duty", "type": [ "string", "null" ] }, "order": { "type": [ "number", "string" ] } }, "additionalProperties": {} } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "id": { "type": "string" }, "eventId": { "type": "string" }, "name": { "type": "string" }, "description": { "type": [ "string", "null" ] }, "sessionId": { "type": [ "string", "null" ] }, "startsAt": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "endsAt": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "needed": { "type": [ "number", "null" ] }, "kidsRoomId": { "type": [ "string", "null" ] }, "order": { "type": "number" } }, "required": [ "id", "eventId", "name", "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": [ "Volunteers" ], "summary": "Delete a role", "description": "**Who:** Supervisors and admins.", "operationId": "deleteVolunteer-rolesId", "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" }, "volunteers": { "type": "number", "description": "People who were in it (told by message)" } }, "required": [ "message", "volunteers" ], "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" } } } } } } }, "/volunteer-roles/{id}/assign": { "post": { "tags": [ "Volunteers" ], "summary": "Put someone in a role", "description": "**Who:** Supervisors and admins.", "operationId": "postVolunteer-rolesIdAssign", "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": { "userId": { "type": "string" } }, "required": [ "userId" ], "additionalProperties": {} } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "slotId": { "type": "string" }, "ticket": { "type": "boolean", "description": "A free volunteer ticket was issued" } }, "required": [ "slotId", "ticket" ], "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" } } } } } } }, "/volunteer-slots/{id}/check-in": { "post": { "tags": [ "Volunteers" ], "summary": "Check a volunteer in", "description": "**Who:** Staff, supervisors and admins.", "operationId": "postVolunteer-slotsIdCheck-in", "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": { "undo": { "type": [ "boolean", "null" ] } }, "additionalProperties": {} } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "slotId": { "type": "string" }, "changed": { "type": "boolean" } }, "required": [ "slotId", "changed" ], "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" } } } } } } }, "/volunteer-slots/{id}/remove": { "post": { "tags": [ "Volunteers" ], "summary": "Take someone off a slot", "description": "**Who:** Supervisors and admins.", "operationId": "postVolunteer-slotsIdRemove", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "id", "in": "path", "required": true, "description": "The id", "schema": { "type": "string", "minLength": 1, "maxLength": 64 } } ], "requestBody": { "required": true, "description": "No body needed: send an empty object.", "content": { "application/json": { "schema": { "type": "object", "properties": {}, "additionalProperties": {} } } } }, "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" } } } } } } }, "/auth/login/code/resend": { "post": { "tags": [ "Accounts" ], "summary": "Send the sign-in code again", "description": "**Who:** Anyone.", "operationId": "postAuthLoginCodeResend", "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "challengeId": { "type": "string" } }, "required": [ "challengeId" ], "additionalProperties": {} } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "challengeId": { "type": "string" }, "method": { "type": "string", "enum": [ "email", "whatsapp" ] }, "destination": { "type": "string", "description": "Where the code went, partly hidden" } }, "required": [ "challengeId", "method", "destination" ], "additionalProperties": {} } }, "required": [ "data" ], "additionalProperties": false } } } }, "400": { "description": "Validation failed (VALIDATION_FAILED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/auth/password/forgot": { "post": { "tags": [ "Accounts" ], "summary": "Email me a link to reset my password", "description": "Always the same answer, so it doesn't say whether an account has that email. Rate-limited like sign-in.\n\n**Who:** Anyone.", "operationId": "postAuthPasswordForgot", "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "email": { "type": "string", "maxLength": 200 } }, "required": [ "email" ], "additionalProperties": {} } } } }, "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" } } } } } } }, "/auth/password/reset": { "post": { "tags": [ "Accounts" ], "summary": "Set a new password with a reset link", "description": "**Who:** Anyone.", "operationId": "postAuthPasswordReset", "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "token": { "type": "string", "description": "From the link" }, "password": { "type": "string" } }, "required": [ "token", "password" ], "additionalProperties": {} } } } }, "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" } } } } } } }, "/auth/activate": { "post": { "tags": [ "Accounts" ], "summary": "Activate an account with its link", "description": "**Who:** Anyone.", "operationId": "postAuthActivate", "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "token": { "type": "string", "description": "From the link" }, "password": { "type": "string", "description": "At least 8 characters" }, "acceptTerms": { "type": [ "boolean", "null" ] } }, "required": [ "token", "password" ], "additionalProperties": {} } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "message": { "type": [ "string", "null" ] }, "id": { "type": "string" }, "name": { "type": "string" }, "email": { "type": "string" }, "role": { "type": "string" }, "token": { "type": "string", "description": "A new sign-in token" } }, "required": [ "id", "name", "email", "role", "token" ], "additionalProperties": {} } }, "required": [ "data" ], "additionalProperties": false } } } }, "400": { "description": "Validation failed (VALIDATION_FAILED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/me/sessions/revoke": { "post": { "tags": [ "Me" ], "summary": "Sign out everywhere else", "description": "**Who:** Any signed-in person.", "operationId": "postMeSessionsRevoke", "security": [ { "bearerAuth": [] } ], "parameters": [], "requestBody": { "required": true, "description": "No body needed: send an empty object.", "content": { "application/json": { "schema": { "type": "object", "properties": {}, "additionalProperties": {} } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "message": { "type": "string" }, "token": { "type": "string", "description": "A new token for this device (the old one stops working)" } }, "required": [ "message", "token" ], "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" } } } } } } }, "/me/close": { "post": { "tags": [ "Me" ], "summary": "Close my account", "description": "Needs the password. Personal details are removed; payment records stay, anonymised.\n\n**Who:** Any signed-in person.", "operationId": "postMeClose", "security": [ { "bearerAuth": [] } ], "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "password": { "type": "string" }, "deleteData": { "description": "Also ask for my personal information to be deleted", "type": [ "boolean", "null" ] } }, "required": [ "password" ], "additionalProperties": {} } } } }, "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" } } } } } } }, "/me/activity": { "get": { "tags": [ "Me" ], "summary": "Recent sign-ins and changes to my account", "description": "**Who:** Any signed-in person.", "operationId": "getMeActivity", "security": [ { "bearerAuth": [] } ], "parameters": [], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "type": { "type": "string", "description": "login, password_changed, two_factor_enabled…" }, "device": { "type": [ "string", "null" ] }, "createdAt": { "type": "string", "description": "Date and time (ISO 8601)" } }, "required": [ "id", "type", "createdAt" ], "additionalProperties": {} } } }, "required": [ "data" ], "additionalProperties": false } } } }, "401": { "description": "Not signed in (UNAUTHENTICATED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/me/verify-password": { "post": { "tags": [ "Me" ], "summary": "Check my password (before a sensitive change)", "description": "**Who:** Any signed-in person.", "operationId": "postMeVerify-password", "security": [ { "bearerAuth": [] } ], "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "password": { "type": "string" } }, "required": [ "password" ], "additionalProperties": {} } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "ok": { "type": "boolean", "const": true } }, "required": [ "ok" ], "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" } } } } } } }, "/me/two-factor/enable": { "post": { "tags": [ "Me" ], "summary": "Start turning on two-step sign-in", "description": "Sends a code to confirm with.\n\n**Who:** Any signed-in person.", "operationId": "postMeTwo-factorEnable", "security": [ { "bearerAuth": [] } ], "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "method": { "type": "string", "enum": [ "email", "whatsapp" ] }, "password": { "type": "string" } }, "required": [ "method", "password" ], "additionalProperties": {} } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "challengeId": { "type": "string" }, "method": { "type": "string", "enum": [ "email", "whatsapp" ] }, "destination": { "type": "string", "description": "Where the code went, partly hidden" } }, "required": [ "challengeId", "method", "destination" ], "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" } } } } } } }, "/me/two-factor/confirm": { "post": { "tags": [ "Me" ], "summary": "Confirm two-step sign-in with the code", "description": "**Who:** Any signed-in person.", "operationId": "postMeTwo-factorConfirm", "security": [ { "bearerAuth": [] } ], "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "challengeId": { "type": "string" }, "code": { "type": "string" } }, "required": [ "challengeId", "code" ], "additionalProperties": {} } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "twoFactorEnabled": { "type": "boolean", "const": true }, "twoFactorMethod": { "type": "string" } }, "required": [ "twoFactorEnabled", "twoFactorMethod" ], "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" } } } } } } }, "/me/two-factor/disable": { "post": { "tags": [ "Me" ], "summary": "Turn off two-step sign-in", "description": "**Who:** Any signed-in person.", "operationId": "postMeTwo-factorDisable", "security": [ { "bearerAuth": [] } ], "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "password": { "type": "string" } }, "required": [ "password" ], "additionalProperties": {} } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "twoFactorEnabled": { "type": "boolean", "const": false }, "twoFactorMethod": { "type": "null" } }, "required": [ "twoFactorEnabled", "twoFactorMethod" ], "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" } } } } } } }, "/users/exists": { "get": { "tags": [ "Accounts" ], "summary": "Is there an account with this email or phone?", "description": "**Who:** Supervisors and admins.", "operationId": "getUsersExists", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "email", "in": "query", "required": false, "description": "An email address", "schema": { "type": "string", "maxLength": 4000 } }, { "name": "phone", "in": "query", "required": false, "description": "A phone number", "schema": { "type": "string", "maxLength": 4000 } }, { "name": "phoneNumber", "in": "query", "required": false, "description": "A phone number", "schema": { "type": "string", "maxLength": 4000 } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "exists": { "type": "boolean" }, "hasEmail": { "type": [ "boolean", "null" ] }, "hasPhone": { "type": [ "boolean", "null" ] }, "user": { "anyOf": [ { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "email": { "type": [ "string", "null" ] }, "phoneNumber": { "type": [ "string", "null" ] }, "notificationPreference": { "type": [ "string", "null" ] } }, "required": [ "id", "name" ], "additionalProperties": {} }, { "type": "null" } ] } }, "required": [ "exists" ], "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" } } } } } } }, "/users": { "get": { "tags": [ "Accounts" ], "summary": "Every account", "description": "Paged (`page`, `limit`) and searchable (`q`, `role`, `campus`, …) — see v1 for every filter.\n\n**Who:** Supervisors and admins.", "operationId": "getUsers", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "page", "in": "query", "required": false, "description": "Page number, from 1", "schema": { "type": "string", "maxLength": 4000 } }, { "name": "limit", "in": "query", "required": false, "description": "How many per page", "schema": { "type": "string", "maxLength": 4000 } }, { "name": "search", "in": "query", "required": false, "description": "Text to search for", "schema": { "type": "string", "maxLength": 4000 } }, { "name": "role", "in": "query", "required": false, "description": "admin, supervisor, staff or user", "schema": { "type": "string", "maxLength": 4000 } }, { "name": "isActive", "in": "query", "required": false, "description": "`true` or `false`", "schema": { "type": "string", "maxLength": 4000 } }, { "name": "campus", "in": "query", "required": false, "description": "Campus id or slug (`all` for every campus)", "schema": { "type": "string", "maxLength": 4000 } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "data": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "email": { "type": "string" }, "phoneNumber": { "type": [ "string", "null" ] }, "role": { "type": "string", "enum": [ "admin", "supervisor", "staff", "user" ] }, "isActive": { "type": [ "boolean", "null" ] }, "notificationPreference": { "anyOf": [ { "type": "string", "enum": [ "email", "whatsapp", "both" ] }, { "type": "null" } ] }, "homeCampusId": { "type": [ "string", "null" ] }, "createdAt": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] } }, "required": [ "id", "name", "email", "role" ], "additionalProperties": {} } }, "total": { "type": "number" }, "page": { "type": "number" }, "limit": { "type": "number" }, "pages": { "type": "number" } }, "required": [ "data", "total", "page", "limit", "pages" ], "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" } } } } } } }, "/users/{id}": { "get": { "tags": [ "Accounts" ], "summary": "One account", "description": "**Who:** Admins only.", "operationId": "getUsersId", "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" }, "name": { "type": "string" }, "email": { "type": "string" }, "phoneNumber": { "type": [ "string", "null" ] }, "role": { "type": "string", "enum": [ "admin", "supervisor", "staff", "user" ] }, "isActive": { "type": [ "boolean", "null" ] }, "notificationPreference": { "anyOf": [ { "type": "string", "enum": [ "email", "whatsapp", "both" ] }, { "type": "null" } ] }, "homeCampusId": { "type": [ "string", "null" ] }, "createdAt": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "scopedCampusIds": { "description": "Campuses they're limited to", "type": "array", "items": { "type": "string" } } }, "required": [ "id", "name", "email", "role" ], "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": [ "Accounts" ], "summary": "Change an account", "description": "Name, contact details, role, campus limits, active.\n\n**Who:** Admins only.", "operationId": "patchUsersId", "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", "null" ] }, "email": { "type": [ "string", "null" ] }, "phoneNumber": { "type": [ "string", "null" ] }, "role": { "description": "admin, supervisor, staff or user", "type": [ "string", "null" ] }, "isActive": { "type": [ "boolean", "null" ] }, "password": { "description": "Set a new password", "type": [ "string", "null" ] }, "notificationPreference": { "description": "email, whatsapp or both", "type": [ "string", "null" ] }, "twoFactorEnabled": { "description": "Only to turn it off", "type": [ "boolean", "null" ] }, "scopedCampusIds": { "description": "Limit staff to these campuses (empty: all)", "type": "array", "items": { "type": "string" } } }, "additionalProperties": {} } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "email": { "type": "string" }, "phoneNumber": { "type": [ "string", "null" ] }, "role": { "type": "string", "enum": [ "admin", "supervisor", "staff", "user" ] }, "isActive": { "type": [ "boolean", "null" ] }, "notificationPreference": { "anyOf": [ { "type": "string", "enum": [ "email", "whatsapp", "both" ] }, { "type": "null" } ] }, "homeCampusId": { "type": [ "string", "null" ] }, "createdAt": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] } }, "required": [ "id", "name", "email", "role" ], "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": [ "Accounts" ], "summary": "Delete an account", "description": "**Who:** Admins only.", "operationId": "deleteUsersId", "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" } } } } } } }, "/users/{id}/sessions/revoke": { "post": { "tags": [ "Accounts" ], "summary": "Sign someone out everywhere", "description": "**Who:** Admins only.", "operationId": "postUsersIdSessionsRevoke", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "id", "in": "path", "required": true, "description": "The id", "schema": { "type": "string", "minLength": 1, "maxLength": 64 } } ], "requestBody": { "required": true, "description": "No body needed: send an empty object.", "content": { "application/json": { "schema": { "type": "object", "properties": {}, "additionalProperties": {} } } } }, "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" } } } } } } }, "/users/{id}/anonymize": { "post": { "tags": [ "Accounts" ], "summary": "Anonymise an account", "description": "Admins. Personal details are removed for good; payment records stay.\n\n**Who:** Admins only.", "operationId": "postUsersIdAnonymize", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "id", "in": "path", "required": true, "description": "The id", "schema": { "type": "string", "minLength": 1, "maxLength": 64 } } ], "requestBody": { "required": true, "description": "No body needed: send an empty object.", "content": { "application/json": { "schema": { "type": "object", "properties": {}, "additionalProperties": {} } } } }, "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" } } } } } } }, "/event-listing": { "get": { "tags": [ "Events" ], "summary": "Upcoming public events in full", "description": "What the site's event lists show (ticket options, prices, early-bird tiers), not paged. `campus` (id or slug) and `series` (slug) narrow it. For a paged, slimmer list use GET /events.\n\n**Who:** Anyone.", "operationId": "getEvent-listing", "parameters": [ { "name": "campus", "in": "query", "required": false, "description": "Campus id or slug (`all` for every campus)", "schema": { "type": "string", "maxLength": 4000 } }, { "name": "series", "in": "query", "required": false, "description": "Event series slug", "schema": { "type": "string", "maxLength": 4000 } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "title": { "type": "string" }, "description": { "type": [ "string", "null" ] }, "startDate": { "type": "string", "description": "Date and time (ISO 8601)" }, "endDate": { "type": "string", "description": "Date and time (ISO 8601)" }, "location": { "type": [ "string", "null" ] }, "price": { "anyOf": [ { "type": "number", "description": "Rand" }, { "type": "null" } ] }, "isActive": { "type": [ "boolean", "null" ] }, "isHidden": { "type": [ "boolean", "null" ] }, "imageUrl": { "type": [ "string", "null" ] }, "campusId": { "type": [ "string", "null" ] }, "scheduleType": { "anyOf": [ { "type": "string", "enum": [ "single", "sessions" ] }, { "type": "null" } ] }, "cashupStatus": { "anyOf": [ { "type": "string", "enum": [ "open", "closed" ] }, { "type": "null" } ] }, "eventOptions": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "eventId": { "type": "string" }, "name": { "type": "string" }, "description": { "type": [ "string", "null" ] }, "price": { "type": "number", "description": "Rand" }, "isMainTicket": { "type": "boolean" }, "stockLimit": { "type": [ "number", "null" ] } }, "required": [ "id", "name", "price", "isMainTicket" ], "additionalProperties": {} } }, "isSoldOut": { "type": [ "boolean", "null" ] } }, "required": [ "id", "title", "startDate", "endDate" ], "additionalProperties": {} } } }, "required": [ "data" ], "additionalProperties": false } } } }, "400": { "description": "Validation failed (VALIDATION_FAILED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/admin/events": { "get": { "tags": [ "Events (staff)" ], "summary": "Every event, including deactivated ones", "description": "**Who:** Admins only.", "operationId": "getAdminEvents", "security": [ { "bearerAuth": [] } ], "parameters": [], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "title": { "type": "string" }, "description": { "type": [ "string", "null" ] }, "startDate": { "type": "string", "description": "Date and time (ISO 8601)" }, "endDate": { "type": "string", "description": "Date and time (ISO 8601)" }, "location": { "type": [ "string", "null" ] }, "price": { "anyOf": [ { "type": "number", "description": "Rand" }, { "type": "null" } ] }, "isActive": { "type": [ "boolean", "null" ] }, "isHidden": { "type": [ "boolean", "null" ] }, "imageUrl": { "type": [ "string", "null" ] }, "campusId": { "type": [ "string", "null" ] }, "scheduleType": { "anyOf": [ { "type": "string", "enum": [ "single", "sessions" ] }, { "type": "null" } ] }, "cashupStatus": { "anyOf": [ { "type": "string", "enum": [ "open", "closed" ] }, { "type": "null" } ] } }, "required": [ "id", "title", "startDate", "endDate" ], "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" } } } } } } }, "/events/{id}/email-attendees": { "post": { "tags": [ "Messaging" ], "summary": "Email an event's people", "description": "Filtered by status or chosen people; news consent is checked.\n\n**Who:** Supervisors and admins.", "operationId": "postEventsIdEmail-attendees", "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": { "subject": { "type": [ "string", "null" ] }, "html": { "type": [ "string", "null" ] }, "text": { "description": "subject and html or text, unless template is tickets", "type": [ "string", "null" ] }, "template": { "description": "tickets: send everyone their tickets; the reminders fill in a standard message", "type": "string", "enum": [ "custom", "tickets", "payment_reminder", "event_reminder" ] }, "filter": { "type": "object", "properties": { "status": { "description": "any, paid, unpaid, checked_in, not_checked_in…", "type": [ "string", "null" ] }, "attendeeIds": { "type": "array", "items": { "type": "string" }, "description": "Ids" }, "registrationIds": { "type": "array", "items": { "type": "string" }, "description": "Ids" }, "allocationGroupId": { "description": "People in one room or group", "type": [ "string", "null" ] }, "name": { "type": [ "string", "null" ] }, "email": { "type": [ "string", "null" ] }, "phone": { "type": [ "string", "null" ] }, "audience": { "description": "Sponsors of the event instead", "type": "string", "enum": [ "sponsors" ] } }, "additionalProperties": {} }, "dryRun": { "description": "Only say who it would reach", "type": [ "boolean", "null" ] }, "kind": { "type": "string", "enum": [ "update", "news" ], "description": "update: about something they booked (always sent). news: needs their news consent" }, "promoEventId": { "description": "Promote another event (news)", "type": [ "string", "null" ] } }, "additionalProperties": {} } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "eventId": { "type": [ "string", "null" ] }, "kind": { "type": [ "string", "null" ] }, "matched": { "type": "number" }, "skipped": { "description": "Left out: no news consent", "type": [ "number", "null" ] }, "recipients": { "description": "The first 20", "type": "array", "items": { "type": "object", "properties": {}, "additionalProperties": {} } }, "queued": { "type": [ "number", "null" ] }, "template": { "type": [ "string", "null" ] }, "sent": { "type": [ "number", "null" ] } }, "required": [ "matched" ], "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}/email-attendees/schedule": { "post": { "tags": [ "Messaging" ], "summary": "Schedule an email to an event's people", "description": "**Who:** Supervisors and admins.", "operationId": "postEventsIdEmail-attendeesSchedule", "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": { "subject": { "type": [ "string", "null" ] }, "html": { "type": [ "string", "null" ] }, "text": { "description": "subject and html or text, unless template is tickets", "type": [ "string", "null" ] }, "template": { "description": "tickets: send everyone their tickets; the reminders fill in a standard message", "type": "string", "enum": [ "custom", "tickets", "payment_reminder", "event_reminder" ] }, "filter": { "type": "object", "properties": { "status": { "description": "any, paid, unpaid, checked_in, not_checked_in…", "type": [ "string", "null" ] }, "attendeeIds": { "type": "array", "items": { "type": "string" }, "description": "Ids" }, "registrationIds": { "type": "array", "items": { "type": "string" }, "description": "Ids" }, "allocationGroupId": { "description": "People in one room or group", "type": [ "string", "null" ] }, "name": { "type": [ "string", "null" ] }, "email": { "type": [ "string", "null" ] }, "phone": { "type": [ "string", "null" ] }, "audience": { "description": "Sponsors of the event instead", "type": "string", "enum": [ "sponsors" ] } }, "additionalProperties": {} }, "dryRun": { "description": "Only say who it would reach", "type": [ "boolean", "null" ] }, "kind": { "type": "string", "enum": [ "update", "news" ], "description": "update: about something they booked (always sent). news: needs their news consent" }, "promoEventId": { "description": "Promote another event (news)", "type": [ "string", "null" ] }, "scheduledAt": { "type": "string", "description": "Date and time (ISO 8601)" } }, "required": [ "scheduledAt" ], "additionalProperties": {} } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "message": { "type": "string" }, "job": { "type": "object", "properties": {}, "additionalProperties": {} } }, "required": [ "message", "job" ], "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}/whatsapp-attendees": { "post": { "tags": [ "Messaging" ], "summary": "WhatsApp an event's people", "description": "**Who:** Supervisors and admins.", "operationId": "postEventsIdWhatsapp-attendees", "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": { "message": { "description": "Required unless template is tickets", "type": [ "string", "null" ] }, "template": { "type": "string", "enum": [ "custom", "tickets", "payment_reminder", "event_reminder" ] }, "filter": { "type": "object", "properties": { "status": { "description": "any, paid, unpaid, checked_in, not_checked_in…", "type": [ "string", "null" ] }, "attendeeIds": { "type": "array", "items": { "type": "string" }, "description": "Ids" }, "registrationIds": { "type": "array", "items": { "type": "string" }, "description": "Ids" }, "allocationGroupId": { "description": "People in one room or group", "type": [ "string", "null" ] }, "name": { "type": [ "string", "null" ] }, "email": { "type": [ "string", "null" ] }, "phone": { "type": [ "string", "null" ] }, "audience": { "description": "Sponsors of the event instead", "type": "string", "enum": [ "sponsors" ] } }, "additionalProperties": {} }, "dryRun": { "type": [ "boolean", "null" ] }, "kind": { "type": "string", "enum": [ "update", "news" ], "description": "update: about something they booked (always sent). news: needs their news consent" }, "promoEventId": { "type": [ "string", "null" ] } }, "additionalProperties": {} } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "eventId": { "type": [ "string", "null" ] }, "kind": { "type": [ "string", "null" ] }, "matched": { "type": "number" }, "skipped": { "description": "Left out: no news consent", "type": [ "number", "null" ] }, "recipients": { "description": "The first 20", "type": "array", "items": { "type": "object", "properties": {}, "additionalProperties": {} } }, "queued": { "type": [ "number", "null" ] }, "template": { "type": [ "string", "null" ] }, "sent": { "type": [ "number", "null" ] } }, "required": [ "matched" ], "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}/whatsapp-attendees/schedule": { "post": { "tags": [ "Messaging" ], "summary": "Schedule a WhatsApp to an event's people", "description": "**Who:** Supervisors and admins.", "operationId": "postEventsIdWhatsapp-attendeesSchedule", "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": { "message": { "description": "Required unless template is tickets", "type": [ "string", "null" ] }, "template": { "type": "string", "enum": [ "custom", "tickets", "payment_reminder", "event_reminder" ] }, "filter": { "type": "object", "properties": { "status": { "description": "any, paid, unpaid, checked_in, not_checked_in…", "type": [ "string", "null" ] }, "attendeeIds": { "type": "array", "items": { "type": "string" }, "description": "Ids" }, "registrationIds": { "type": "array", "items": { "type": "string" }, "description": "Ids" }, "allocationGroupId": { "description": "People in one room or group", "type": [ "string", "null" ] }, "name": { "type": [ "string", "null" ] }, "email": { "type": [ "string", "null" ] }, "phone": { "type": [ "string", "null" ] }, "audience": { "description": "Sponsors of the event instead", "type": "string", "enum": [ "sponsors" ] } }, "additionalProperties": {} }, "dryRun": { "type": [ "boolean", "null" ] }, "kind": { "type": "string", "enum": [ "update", "news" ], "description": "update: about something they booked (always sent). news: needs their news consent" }, "promoEventId": { "type": [ "string", "null" ] }, "scheduledAt": { "type": "string", "description": "Date and time (ISO 8601)" } }, "required": [ "scheduledAt" ], "additionalProperties": {} } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "message": { "type": "string" }, "job": { "type": "object", "properties": {}, "additionalProperties": {} } }, "required": [ "message", "job" ], "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" } } } } } } }, "/broadcasts/email/preview": { "post": { "tags": [ "Messaging" ], "summary": "Who an email broadcast would reach", "description": "**Who:** Supervisors and admins.", "operationId": "postBroadcastsEmailPreview", "security": [ { "bearerAuth": [] } ], "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "userIds": { "description": "Chosen accounts", "type": "array", "items": { "type": "string" } }, "emails": { "description": "Typed-in addresses, separated by commas or new lines", "type": [ "string", "null" ] }, "eventId": { "description": "Everyone registered for this event", "type": [ "string", "null" ] }, "kind": { "description": "Default news", "type": "string", "enum": [ "update", "news" ] } }, "additionalProperties": {} } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "eventId": { "type": [ "string", "null" ] }, "kind": { "type": [ "string", "null" ] }, "matched": { "type": "number" }, "skipped": { "description": "Left out: no news consent", "type": [ "number", "null" ] }, "recipients": { "description": "The first 20", "type": "array", "items": { "type": "object", "properties": {}, "additionalProperties": {} } }, "queued": { "type": [ "number", "null" ] }, "template": { "type": [ "string", "null" ] }, "sent": { "type": [ "number", "null" ] }, "event": { "anyOf": [ { "type": "object", "properties": {}, "additionalProperties": {} }, { "type": "null" } ] }, "placeholders": { "type": "array", "items": { "type": "string" } } }, "required": [ "matched" ], "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" } } } } } } }, "/broadcasts/email/send": { "post": { "tags": [ "Messaging" ], "summary": "Send an email broadcast", "description": "To campuses, events, roles or listed people; news consent is checked.\n\n**Who:** Supervisors and admins.", "operationId": "postBroadcastsEmailSend", "security": [ { "bearerAuth": [] } ], "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "userIds": { "description": "Chosen accounts", "type": "array", "items": { "type": "string" } }, "emails": { "description": "Typed-in addresses, separated by commas or new lines", "type": [ "string", "null" ] }, "eventId": { "description": "Everyone registered for this event", "type": [ "string", "null" ] }, "kind": { "description": "Default news", "type": "string", "enum": [ "update", "news" ] }, "subject": { "type": "string" }, "html": { "type": [ "string", "null" ] }, "text": { "type": [ "string", "null" ] } }, "required": [ "subject" ], "additionalProperties": {} } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "eventId": { "type": [ "string", "null" ] }, "kind": { "type": [ "string", "null" ] }, "matched": { "type": "number" }, "skipped": { "description": "Left out: no news consent", "type": [ "number", "null" ] }, "recipients": { "description": "The first 20", "type": "array", "items": { "type": "object", "properties": {}, "additionalProperties": {} } }, "queued": { "type": [ "number", "null" ] }, "template": { "type": [ "string", "null" ] }, "sent": { "type": [ "number", "null" ] } }, "required": [ "matched" ], "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" } } } } } } }, "/broadcasts/email/schedule": { "post": { "tags": [ "Messaging" ], "summary": "Schedule an email broadcast", "description": "**Who:** Supervisors and admins.", "operationId": "postBroadcastsEmailSchedule", "security": [ { "bearerAuth": [] } ], "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "userIds": { "description": "Chosen accounts", "type": "array", "items": { "type": "string" } }, "emails": { "description": "Typed-in addresses, separated by commas or new lines", "type": [ "string", "null" ] }, "eventId": { "description": "Everyone registered for this event", "type": [ "string", "null" ] }, "kind": { "description": "Default news", "type": "string", "enum": [ "update", "news" ] }, "subject": { "type": "string" }, "html": { "type": [ "string", "null" ] }, "text": { "type": [ "string", "null" ] }, "scheduledAt": { "type": "string", "description": "Date and time (ISO 8601)" } }, "required": [ "subject", "scheduledAt" ], "additionalProperties": {} } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "message": { "type": "string" }, "job": { "type": "object", "properties": {}, "additionalProperties": {} } }, "required": [ "message", "job" ], "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" } } } } } } }, "/broadcasts/whatsapp/preview": { "post": { "tags": [ "Messaging" ], "summary": "Who a WhatsApp broadcast would reach", "description": "**Who:** Supervisors and admins.", "operationId": "postBroadcastsWhatsappPreview", "security": [ { "bearerAuth": [] } ], "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "userIds": { "description": "Chosen accounts", "type": "array", "items": { "type": "string" } }, "phones": { "description": "Typed-in numbers, separated by commas or new lines", "type": [ "string", "null" ] }, "eventId": { "description": "Everyone registered for this event", "type": [ "string", "null" ] }, "kind": { "description": "Default news", "type": "string", "enum": [ "update", "news" ] } }, "additionalProperties": {} } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "eventId": { "type": [ "string", "null" ] }, "kind": { "type": [ "string", "null" ] }, "matched": { "type": "number" }, "skipped": { "description": "Left out: no news consent", "type": [ "number", "null" ] }, "recipients": { "description": "The first 20", "type": "array", "items": { "type": "object", "properties": {}, "additionalProperties": {} } }, "queued": { "type": [ "number", "null" ] }, "template": { "type": [ "string", "null" ] }, "sent": { "type": [ "number", "null" ] }, "event": { "anyOf": [ { "type": "object", "properties": {}, "additionalProperties": {} }, { "type": "null" } ] }, "placeholders": { "type": "array", "items": { "type": "string" } } }, "required": [ "matched" ], "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" } } } } } } }, "/broadcasts/whatsapp/send": { "post": { "tags": [ "Messaging" ], "summary": "Send a WhatsApp broadcast", "description": "To campuses, events, roles or listed people; news consent is checked.\n\n**Who:** Supervisors and admins.", "operationId": "postBroadcastsWhatsappSend", "security": [ { "bearerAuth": [] } ], "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "userIds": { "description": "Chosen accounts", "type": "array", "items": { "type": "string" } }, "phones": { "description": "Typed-in numbers, separated by commas or new lines", "type": [ "string", "null" ] }, "eventId": { "description": "Everyone registered for this event", "type": [ "string", "null" ] }, "kind": { "description": "Default news", "type": "string", "enum": [ "update", "news" ] }, "message": { "type": "string" } }, "required": [ "message" ], "additionalProperties": {} } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "eventId": { "type": [ "string", "null" ] }, "kind": { "type": [ "string", "null" ] }, "matched": { "type": "number" }, "skipped": { "description": "Left out: no news consent", "type": [ "number", "null" ] }, "recipients": { "description": "The first 20", "type": "array", "items": { "type": "object", "properties": {}, "additionalProperties": {} } }, "queued": { "type": [ "number", "null" ] }, "template": { "type": [ "string", "null" ] }, "sent": { "type": [ "number", "null" ] } }, "required": [ "matched" ], "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" } } } } } } }, "/broadcasts/whatsapp/schedule": { "post": { "tags": [ "Messaging" ], "summary": "Schedule a WhatsApp broadcast", "description": "**Who:** Supervisors and admins.", "operationId": "postBroadcastsWhatsappSchedule", "security": [ { "bearerAuth": [] } ], "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "userIds": { "description": "Chosen accounts", "type": "array", "items": { "type": "string" } }, "phones": { "description": "Typed-in numbers, separated by commas or new lines", "type": [ "string", "null" ] }, "eventId": { "description": "Everyone registered for this event", "type": [ "string", "null" ] }, "kind": { "description": "Default news", "type": "string", "enum": [ "update", "news" ] }, "message": { "type": "string" }, "scheduledAt": { "type": "string", "description": "Date and time (ISO 8601)" } }, "required": [ "message", "scheduledAt" ], "additionalProperties": {} } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "message": { "type": "string" }, "job": { "type": "object", "properties": {}, "additionalProperties": {} } }, "required": [ "message", "job" ], "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" } } } } } } }, "/scheduled-messages": { "get": { "tags": [ "Messaging" ], "summary": "Scheduled emails and WhatsApps", "description": "**Who:** Supervisors and admins.", "operationId": "getScheduled-messages", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "status", "in": "query", "required": false, "description": "Only this status", "schema": { "type": "string", "maxLength": 4000 } }, { "name": "eventId", "in": "query", "required": false, "description": "Only this event", "schema": { "type": "string", "maxLength": 4000 } }, { "name": "channel", "in": "query", "required": false, "description": "email or whatsapp", "schema": { "type": "string", "maxLength": 4000 } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "jobs": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "kind": { "type": "string", "description": "broadcast or attendees" }, "eventId": { "type": [ "string", "null" ] }, "broadcast": { "type": "boolean" }, "channel": { "anyOf": [ { "type": "string", "enum": [ "email", "whatsapp" ] }, { "type": "string" } ] }, "recipient": { "type": [ "string", "null" ] }, "scheduledAt": { "type": "string", "description": "Date and time (ISO 8601)" }, "createdAt": { "type": "string", "description": "Date and time (ISO 8601)" }, "status": { "type": "string", "description": "queued, sent, failed, cancelled" }, "attempts": { "type": "number" }, "sentAt": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "lastError": { "type": [ "string", "null" ] }, "subject": { "type": "string" }, "html": { "type": "string" }, "text": { "type": "string" }, "message": { "type": "string" }, "hasHtml": { "type": "boolean" }, "hasText": { "type": "boolean" } }, "required": [ "id", "kind", "broadcast", "channel", "scheduledAt", "createdAt", "status", "attempts", "subject", "html", "text", "message", "hasHtml", "hasText" ], "additionalProperties": {} } } }, "required": [ "jobs" ], "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" } } } } } } }, "/scheduled-messages/{id}": { "patch": { "tags": [ "Messaging" ], "summary": "Change a scheduled message", "description": "**Who:** Supervisors and admins.", "operationId": "patchScheduled-messagesId", "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": { "scheduledAt": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "subject": { "type": [ "string", "null" ] }, "html": { "type": [ "string", "null" ] }, "text": { "type": [ "string", "null" ] }, "message": { "description": "WhatsApp", "type": [ "string", "null" ] } }, "additionalProperties": {} } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "message": { "type": "string" }, "job": { "type": "object", "properties": { "id": { "type": "string" }, "kind": { "type": "string", "description": "broadcast or attendees" }, "eventId": { "type": [ "string", "null" ] }, "broadcast": { "type": "boolean" }, "channel": { "anyOf": [ { "type": "string", "enum": [ "email", "whatsapp" ] }, { "type": "string" } ] }, "recipient": { "type": [ "string", "null" ] }, "scheduledAt": { "type": "string", "description": "Date and time (ISO 8601)" }, "createdAt": { "type": "string", "description": "Date and time (ISO 8601)" }, "status": { "type": "string", "description": "queued, sent, failed, cancelled" }, "attempts": { "type": "number" }, "sentAt": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "lastError": { "type": [ "string", "null" ] }, "subject": { "type": "string" }, "html": { "type": "string" }, "text": { "type": "string" }, "message": { "type": "string" }, "hasHtml": { "type": "boolean" }, "hasText": { "type": "boolean" } }, "required": [ "id", "kind", "broadcast", "channel", "scheduledAt", "createdAt", "status", "attempts", "subject", "html", "text", "message", "hasHtml", "hasText" ], "additionalProperties": {} } }, "required": [ "message", "job" ], "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": [ "Messaging" ], "summary": "Cancel a scheduled message", "description": "**Who:** Supervisors and admins.", "operationId": "deleteScheduled-messagesId", "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" } } } } } } }, "/automations/schedule": { "post": { "tags": [ "Messaging" ], "summary": "Schedule an event's reminder messages", "description": "**Who:** Supervisors and admins.", "operationId": "postAutomationsSchedule", "security": [ { "bearerAuth": [] } ], "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "eventId": { "type": "string" }, "jobs": { "minItems": 1, "type": "array", "items": { "type": "object", "properties": { "scheduledAt": { "type": "string", "description": "Date and time (ISO 8601)" }, "subject": { "type": "string" }, "html": { "type": [ "string", "null" ] }, "text": { "type": [ "string", "null" ] }, "audience": { "type": "string", "enum": [ "sponsors" ] }, "promoEventId": { "type": [ "string", "null" ] } }, "required": [ "scheduledAt", "subject" ], "additionalProperties": {} } } }, "required": [ "eventId", "jobs" ], "additionalProperties": {} } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "message": { "type": "string" }, "jobs": { "type": "array", "items": { "type": "object", "properties": {}, "additionalProperties": {} } } }, "required": [ "message", "jobs" ], "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" } } } } } } }, "/whatsapp/config": { "get": { "tags": [ "WhatsApp" ], "summary": "The WhatsApp connection settings", "description": "**Who:** Admins only.", "operationId": "getWhatsappConfig", "security": [ { "bearerAuth": [] } ], "parameters": [], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "tokenMasked": { "type": "string" }, "instanceId": { "type": "string" }, "hasToken": { "type": "boolean" }, "hasInstance": { "type": "boolean" }, "configured": { "type": "boolean" }, "webhookUrl": { "type": [ "string", "null" ] } }, "required": [ "tokenMasked", "instanceId", "hasToken", "hasInstance", "configured" ], "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" } } } } } }, "put": { "tags": [ "WhatsApp" ], "summary": "Change the WhatsApp connection settings", "description": "**Who:** Admins only.", "operationId": "putWhatsappConfig", "security": [ { "bearerAuth": [] } ], "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "token": { "type": [ "string", "null" ] }, "instanceId": { "type": [ "string", "null" ] } }, "additionalProperties": {} } } } }, "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" } } } } } } }, "/whatsapp/instance": { "post": { "tags": [ "WhatsApp" ], "summary": "Create the WhatsApp instance", "description": "**Who:** Admins only.", "operationId": "postWhatsappInstance", "security": [ { "bearerAuth": [] } ], "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "name": { "type": [ "string", "null" ] } }, "additionalProperties": {} } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "message": { "type": "string" } }, "required": [ "message" ], "additionalProperties": {}, "description": "Plus what the WhatsApp service answered" } }, "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" } } } } } }, "delete": { "tags": [ "WhatsApp" ], "summary": "Delete the WhatsApp instance", "description": "**Who:** Admins only.", "operationId": "deleteWhatsappInstance", "security": [ { "bearerAuth": [] } ], "parameters": [], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "message": { "type": "string" } }, "required": [ "message" ], "additionalProperties": {}, "description": "Plus what the WhatsApp service answered" } }, "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" } } } } } } }, "/whatsapp/status": { "get": { "tags": [ "WhatsApp" ], "summary": "Is WhatsApp connected?", "description": "**Who:** Admins only.", "operationId": "getWhatsappStatus", "security": [ { "bearerAuth": [] } ], "parameters": [], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": {}, "additionalProperties": {}, "description": "The WhatsApp service's status answer" } }, "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" } } } } } } }, "/whatsapp/qr": { "get": { "tags": [ "WhatsApp" ], "summary": "The QR code to link a phone", "description": "**Who:** Admins only.", "operationId": "getWhatsappQr", "security": [ { "bearerAuth": [] } ], "parameters": [], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": {}, "additionalProperties": {}, "description": "The WhatsApp service's answer, with the QR code image" } }, "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" } } } } } } }, "/whatsapp/request-code": { "post": { "tags": [ "WhatsApp" ], "summary": "Link a phone with a code instead", "description": "**Who:** Admins only.", "operationId": "postWhatsappRequest-code", "security": [ { "bearerAuth": [] } ], "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "phoneNumber": { "type": "string" } }, "required": [ "phoneNumber" ], "additionalProperties": {} } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": {}, "additionalProperties": {}, "description": "The WhatsApp service's answer" } }, "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" } } } } } } }, "/whatsapp/logout": { "post": { "tags": [ "WhatsApp" ], "summary": "Unlink the phone", "description": "**Who:** Admins only.", "operationId": "postWhatsappLogout", "security": [ { "bearerAuth": [] } ], "parameters": [], "requestBody": { "required": true, "description": "No body needed: send an empty object.", "content": { "application/json": { "schema": { "type": "object", "properties": {}, "additionalProperties": {} } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": {}, "additionalProperties": {}, "description": "The WhatsApp service's answer" } }, "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" } } } } } } }, "/whatsapp/start": { "post": { "tags": [ "WhatsApp" ], "summary": "Start the WhatsApp session", "description": "**Who:** Admins only.", "operationId": "postWhatsappStart", "security": [ { "bearerAuth": [] } ], "parameters": [], "requestBody": { "required": true, "description": "No body needed: send an empty object.", "content": { "application/json": { "schema": { "type": "object", "properties": {}, "additionalProperties": {} } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": {}, "additionalProperties": {}, "description": "The WhatsApp service's answer" } }, "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" } } } } } } }, "/whatsapp/restart": { "post": { "tags": [ "WhatsApp" ], "summary": "Restart the WhatsApp session", "description": "**Who:** Admins only.", "operationId": "postWhatsappRestart", "security": [ { "bearerAuth": [] } ], "parameters": [], "requestBody": { "required": true, "description": "No body needed: send an empty object.", "content": { "application/json": { "schema": { "type": "object", "properties": {}, "additionalProperties": {} } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": {}, "additionalProperties": {}, "description": "The WhatsApp service's answer" } }, "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" } } } } } } }, "/banner": { "get": { "tags": [ "Site" ], "summary": "The site-wide banner", "description": "**Who:** Anyone.", "operationId": "getBanner", "parameters": [], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "message": { "type": "string" }, "type": { "type": "string", "description": "info, warning, success, error" }, "liveFrom": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "liveTill": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] } }, "required": [ "message", "type" ], "additionalProperties": {} } }, "required": [ "data" ], "additionalProperties": false } } } } } }, "put": { "tags": [ "Site" ], "summary": "Set the site-wide banner", "description": "**Who:** Supervisors and admins.", "operationId": "putBanner", "security": [ { "bearerAuth": [] } ], "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string" }, "type": { "type": "string", "description": "info, warning, success, error" }, "liveFrom": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "liveTill": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] } }, "additionalProperties": {}, "description": "An empty message takes the banner down" } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "message": { "type": "string" }, "type": { "type": "string", "description": "info, warning, success, error" }, "liveFrom": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "liveTill": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] } }, "required": [ "message", "type" ], "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" } } } } } } }, "/saved-filters": { "get": { "tags": [ "Me" ], "summary": "My saved filters", "description": "For one list page (`page`).\n\n**Who:** Staff, supervisors and admins.", "operationId": "getSaved-filters", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "page", "in": "query", "required": false, "description": "Page number, from 1", "schema": { "type": "string", "maxLength": 4000 } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "page": { "type": "string", "description": "The list page it belongs to" }, "name": { "type": "string" }, "params": { "type": "object", "properties": {}, "additionalProperties": {}, "description": "The filters" }, "isDefault": { "type": "boolean" }, "updatedAt": { "type": "string", "description": "Date and time (ISO 8601)" } }, "required": [ "id", "page", "name", "params", "isDefault", "updatedAt" ], "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": [ "Me" ], "summary": "Save a filter", "description": "By name (replaces one with the same name); up to 30 per page.\n\n**Who:** Staff, supervisors and admins.", "operationId": "postSaved-filters", "security": [ { "bearerAuth": [] } ], "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "page": { "type": "string" }, "name": { "type": "string" }, "params": { "type": "object", "properties": {}, "additionalProperties": {} }, "isDefault": { "type": [ "boolean", "null" ] } }, "required": [ "page", "name", "params" ], "additionalProperties": {} } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "id": { "type": "string" }, "page": { "type": "string", "description": "The list page it belongs to" }, "name": { "type": "string" }, "params": { "type": "object", "properties": {}, "additionalProperties": {}, "description": "The filters" }, "isDefault": { "type": "boolean" }, "updatedAt": { "type": "string", "description": "Date and time (ISO 8601)" } }, "required": [ "id", "page", "name", "params", "isDefault", "updatedAt" ], "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" } } } } } } }, "/saved-filters/{id}": { "put": { "tags": [ "Me" ], "summary": "Change a saved filter", "description": "**Who:** Staff, supervisors and admins.", "operationId": "putSaved-filtersId", "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", "null" ] }, "params": { "type": "object", "properties": {}, "additionalProperties": {} }, "isDefault": { "type": [ "boolean", "null" ] } }, "additionalProperties": {} } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "id": { "type": "string" }, "page": { "type": "string", "description": "The list page it belongs to" }, "name": { "type": "string" }, "params": { "type": "object", "properties": {}, "additionalProperties": {}, "description": "The filters" }, "isDefault": { "type": "boolean" }, "updatedAt": { "type": "string", "description": "Date and time (ISO 8601)" } }, "required": [ "id", "page", "name", "params", "isDefault", "updatedAt" ], "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": [ "Me" ], "summary": "Delete a saved filter", "description": "**Who:** Staff, supervisors and admins.", "operationId": "deleteSaved-filtersId", "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": { "ok": { "type": "boolean", "const": true } }, "required": [ "ok" ], "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" } } } } } } }, "/dashboard/today": { "get": { "tags": [ "Dashboard" ], "summary": "Today at a glance", "description": "**Who:** Staff, supervisors and admins.", "operationId": "getDashboardToday", "security": [ { "bearerAuth": [] } ], "parameters": [], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "events": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "title": { "type": "string" }, "startsAt": { "type": "string", "description": "Date and time (ISO 8601)" }, "endsAt": { "type": "string", "description": "Date and time (ISO 8601)" }, "sessionLabel": { "type": [ "string", "null" ] }, "places": { "type": "number" }, "checkedIn": { "type": "number" } }, "required": [ "id", "title", "startsAt", "endsAt", "places", "checkedIn" ], "additionalProperties": {} }, "description": "Today's events with places and check-ins" }, "money": { "anyOf": [ { "type": "object", "properties": { "today": { "type": "number", "description": "Rand" }, "todayCount": { "type": "number" }, "week": { "type": "number", "description": "Rand" } }, "required": [ "today", "todayCount", "week" ], "additionalProperties": {} }, { "type": "null" } ] }, "pending": { "type": "array", "items": { "type": "object", "properties": { "key": { "type": "string" }, "label": { "type": "string" }, "count": { "type": "number" }, "href": { "type": "string" }, "tone": { "type": [ "string", "null" ] } }, "required": [ "key", "label", "count", "href" ], "additionalProperties": {} }, "description": "What's waiting for you" } }, "required": [ "events", "pending" ], "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" } } } } } } }, "/dashboard/search": { "get": { "tags": [ "Dashboard" ], "summary": "Search people, registrations and events", "description": "**Who:** Staff, supervisors and admins.", "operationId": "getDashboardSearch", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "q", "in": "query", "required": false, "description": "Text to search for", "schema": { "type": "string", "maxLength": 4000 } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "results": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string", "description": "event, payment, person, registration" }, "id": { "type": "string" }, "title": { "type": "string" }, "subtitle": { "type": [ "string", "null" ] }, "href": { "type": [ "string", "null" ] } }, "required": [ "type", "id", "title" ], "additionalProperties": {} } } }, "required": [ "results" ], "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" } } } } } } }, "/stats/staff": { "get": { "tags": [ "Dashboard" ], "summary": "Staff dashboard numbers", "description": "**Who:** Staff, supervisors and admins.", "operationId": "getStatsStaff", "security": [ { "bearerAuth": [] } ], "parameters": [], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "scanStats": { "type": "object", "properties": { "totalToday": { "type": "number" }, "myToday": { "type": "number" }, "lastHour": { "type": "number" }, "byStaff": { "type": "array", "items": { "type": "object", "properties": {}, "additionalProperties": {} } } }, "additionalProperties": {} }, "recentScans": { "type": "array", "items": { "type": "object", "properties": {}, "additionalProperties": {} } } }, "required": [ "scanStats", "recentScans" ], "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" } } } } } } }, "/stats/supervisor": { "get": { "tags": [ "Dashboard" ], "summary": "Supervisor dashboard numbers", "description": "**Who:** Supervisors and admins.", "operationId": "getStatsSupervisor", "security": [ { "bearerAuth": [] } ], "parameters": [], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "scanStats": { "type": "object", "properties": { "totalToday": { "type": "number" }, "myToday": { "type": "number" }, "lastHour": { "type": "number" }, "byStaff": { "type": "array", "items": { "type": "object", "properties": {}, "additionalProperties": {} } } }, "additionalProperties": {} }, "recentScans": { "type": "array", "items": { "type": "object", "properties": {}, "additionalProperties": {} } }, "paymentStats": { "type": "object", "properties": {}, "additionalProperties": {} }, "activeEventsCount": { "type": "number" } }, "required": [ "scanStats", "recentScans", "paymentStats", "activeEventsCount" ], "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" } } } } } } }, "/stats/admin": { "get": { "tags": [ "Dashboard" ], "summary": "Admin dashboard numbers", "description": "**Who:** Admins only.", "operationId": "getStatsAdmin", "security": [ { "bearerAuth": [] } ], "parameters": [], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "scanStats": { "type": "object", "properties": { "totalToday": { "type": "number" }, "myToday": { "type": "number" }, "lastHour": { "type": "number" }, "byStaff": { "type": "array", "items": { "type": "object", "properties": {}, "additionalProperties": {} } } }, "additionalProperties": {} }, "recentScans": { "type": "array", "items": { "type": "object", "properties": {}, "additionalProperties": {} } }, "paymentStats": { "type": "object", "properties": {}, "additionalProperties": {} }, "activeEventsCount": { "type": "number" } }, "required": [ "scanStats", "recentScans", "paymentStats", "activeEventsCount" ], "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" } } } } } } }, "/stats/overview": { "get": { "tags": [ "Dashboard" ], "summary": "Overview numbers", "description": "**Who:** Supervisors and admins.", "operationId": "getStatsOverview", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "from", "in": "query", "required": false, "description": "On or after (ISO date or date-time)", "schema": { "type": "string", "maxLength": 4000 } }, { "name": "to", "in": "query", "required": false, "description": "On or before (ISO date or date-time)", "schema": { "type": "string", "maxLength": 4000 } }, { "name": "campus", "in": "query", "required": false, "description": "Campus id or slug (`all` for every campus)", "schema": { "type": "string", "maxLength": 4000 } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "funnel": { "anyOf": [ { "type": "object", "properties": {}, "additionalProperties": {} }, { "type": "null" } ] }, "activeEvents": { "type": "number" }, "registrations": { "type": "object", "properties": { "thisMonth": { "type": "number" }, "lastMonth": { "type": "number" }, "pctChange": { "type": [ "number", "null" ] } }, "required": [ "thisMonth", "lastMonth" ], "additionalProperties": {} }, "ticketsSold": { "type": "object", "properties": { "thisMonth": { "type": "number" }, "lastMonth": { "type": "number" }, "pctChange": { "type": [ "number", "null" ] } }, "required": [ "thisMonth", "lastMonth" ], "additionalProperties": {} }, "revenue": { "type": "object", "properties": { "thisMonth": { "type": "number" }, "lastMonth": { "type": "number" }, "pctChange": { "type": [ "number", "null" ] } }, "required": [ "thisMonth", "lastMonth" ], "additionalProperties": {} }, "donations": { "type": "object", "properties": { "thisMonth": { "type": "number" }, "lastMonth": { "type": "number" }, "pctChange": { "type": [ "number", "null" ] } }, "required": [ "thisMonth", "lastMonth" ], "additionalProperties": {} }, "trend": { "type": "array", "items": { "type": "object", "properties": { "date": { "type": "string" }, "revenue": { "type": "number", "description": "Rand" } }, "required": [ "date", "revenue" ], "additionalProperties": {} } }, "topEvents": { "type": "array", "items": { "type": "object", "properties": { "eventId": { "type": "string" }, "title": { "type": "string" }, "revenue": { "type": "number", "description": "Rand" }, "registrations": { "type": "number" }, "ticketsSold": { "type": "number" } }, "required": [ "eventId", "title", "revenue", "registrations", "ticketsSold" ], "additionalProperties": {} } } }, "required": [ "activeEvents", "registrations", "ticketsSold", "revenue", "donations", "trend", "topEvents" ], "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" } } } } } } }, "/analytics/track": { "post": { "tags": [ "Dashboard" ], "summary": "Record a step on the way to registering", "description": "**Who:** Anyone.", "operationId": "postAnalyticsTrack", "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "sessionId": { "type": "string", "description": "The browser's analytics id" }, "eventId": { "type": "string" }, "stage": { "type": "string", "enum": [ "view", "start", "submit", "paid" ] }, "source": { "description": "Where they came from", "type": [ "string", "null" ] } }, "required": [ "sessionId", "eventId", "stage" ], "additionalProperties": {} } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "null", "description": "Always 204, no content" } }, "required": [ "data" ], "additionalProperties": false } } } }, "400": { "description": "Validation failed (VALIDATION_FAILED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/analytics/funnel": { "get": { "tags": [ "Dashboard" ], "summary": "How many get from viewing to paying", "description": "**Who:** Supervisors and admins.", "operationId": "getAnalyticsFunnel", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "eventIds", "in": "query", "required": false, "description": "These events (comma-separated ids)", "schema": { "type": "string", "maxLength": 4000 } }, { "name": "eventId", "in": "query", "required": false, "description": "Only this event", "schema": { "type": "string", "maxLength": 4000 } }, { "name": "from", "in": "query", "required": false, "description": "On or after (ISO date or date-time)", "schema": { "type": "string", "maxLength": 4000 } }, { "name": "to", "in": "query", "required": false, "description": "On or before (ISO date or date-time)", "schema": { "type": "string", "maxLength": 4000 } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "perEvent": { "type": "array", "items": { "type": "object", "properties": {}, "additionalProperties": {} }, "description": "The same for each event" } }, "required": [ "perEvent" ], "additionalProperties": {}, "description": "Counts per stage (view, start, submit, paid), sources and devices, and per ticket" } }, "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" } } } } } } }, "/reports/pdf": { "post": { "tags": [ "Reports" ], "summary": "A report as a PDF", "description": "The report's rows and columns in the body.\n\n**Who:** Any signed-in person.", "operationId": "postReportsPdf", "security": [ { "bearerAuth": [] } ], "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "title": { "type": "string" }, "subtitle": { "type": [ "string", "null" ] }, "kind": { "type": "string", "enum": [ "table", "layered" ] }, "table": { "description": "kind table", "type": "object", "properties": { "columns": { "type": "array", "items": { "type": "string" } }, "rows": { "type": "array", "items": { "type": "array", "items": {} } } }, "required": [ "columns", "rows" ], "additionalProperties": {} }, "layered": { "description": "kind layered: titled sections, each with its rows", "type": "object", "properties": { "header": { "type": [ "string", "null" ] }, "sections": { "type": "array", "items": { "type": "object", "properties": {}, "additionalProperties": {} } } }, "required": [ "sections" ], "additionalProperties": {} }, "orientation": { "type": "string", "enum": [ "portrait", "landscape" ] }, "stats": { "description": "Figures shown above the table", "type": "array", "items": { "type": "object", "properties": {}, "additionalProperties": {} } }, "chart": { "type": "object", "properties": {}, "additionalProperties": {} }, "note": { "type": [ "string", "null" ] }, "extraTables": { "type": "array", "items": { "type": "object", "properties": {}, "additionalProperties": {} } } }, "required": [ "title", "kind" ], "additionalProperties": {} } } } }, "responses": { "200": { "description": "The file", "content": { "application/pdf": { "schema": { "type": "string" } } } }, "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" } } } } } } }, "/reports/excel": { "post": { "tags": [ "Reports" ], "summary": "A report as an Excel file", "description": "**Who:** Any signed-in person.", "operationId": "postReportsExcel", "security": [ { "bearerAuth": [] } ], "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "title": { "type": "string" }, "subtitle": { "type": [ "string", "null" ] }, "kind": { "type": "string", "enum": [ "table", "layered" ] }, "table": { "description": "kind table", "type": "object", "properties": { "columns": { "type": "array", "items": { "type": "string" } }, "rows": { "type": "array", "items": { "type": "array", "items": {} } } }, "required": [ "columns", "rows" ], "additionalProperties": {} }, "layered": { "description": "kind layered: titled sections, each with its rows", "type": "object", "properties": { "header": { "type": [ "string", "null" ] }, "sections": { "type": "array", "items": { "type": "object", "properties": {}, "additionalProperties": {} } } }, "required": [ "sections" ], "additionalProperties": {} }, "orientation": { "type": "string", "enum": [ "portrait", "landscape" ] }, "stats": { "description": "Figures shown above the table", "type": "array", "items": { "type": "object", "properties": {}, "additionalProperties": {} } }, "chart": { "type": "object", "properties": {}, "additionalProperties": {} }, "note": { "type": [ "string", "null" ] }, "extraTables": { "type": "array", "items": { "type": "object", "properties": {}, "additionalProperties": {} } } }, "required": [ "title", "kind" ], "additionalProperties": {} } } } }, "responses": { "200": { "description": "The file", "content": { "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": { "schema": { "type": "string" } } } }, "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" } } } } } } }, "/reports/email": { "post": { "tags": [ "Reports" ], "summary": "Email a report as a PDF", "description": "**Who:** Any signed-in person.", "operationId": "postReportsEmail", "security": [ { "bearerAuth": [] } ], "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "title": { "type": "string" }, "subtitle": { "type": [ "string", "null" ] }, "kind": { "type": "string", "enum": [ "table", "layered" ] }, "table": { "description": "kind table", "type": "object", "properties": { "columns": { "type": "array", "items": { "type": "string" } }, "rows": { "type": "array", "items": { "type": "array", "items": {} } } }, "required": [ "columns", "rows" ], "additionalProperties": {} }, "layered": { "description": "kind layered: titled sections, each with its rows", "type": "object", "properties": { "header": { "type": [ "string", "null" ] }, "sections": { "type": "array", "items": { "type": "object", "properties": {}, "additionalProperties": {} } } }, "required": [ "sections" ], "additionalProperties": {} }, "orientation": { "type": "string", "enum": [ "portrait", "landscape" ] }, "stats": { "description": "Figures shown above the table", "type": "array", "items": { "type": "object", "properties": {}, "additionalProperties": {} } }, "chart": { "type": "object", "properties": {}, "additionalProperties": {} }, "note": { "type": [ "string", "null" ] }, "extraTables": { "type": "array", "items": { "type": "object", "properties": {}, "additionalProperties": {} } }, "subject": { "type": [ "string", "null" ] }, "body": { "description": "Text of the email", "type": [ "string", "null" ] } }, "required": [ "title", "kind" ], "additionalProperties": {} } } } }, "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" } } } } } } }, "/reports/whatsapp": { "post": { "tags": [ "Reports" ], "summary": "WhatsApp a report as a PDF", "description": "**Who:** Any signed-in person.", "operationId": "postReportsWhatsapp", "security": [ { "bearerAuth": [] } ], "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "title": { "type": "string" }, "subtitle": { "type": [ "string", "null" ] }, "kind": { "type": "string", "enum": [ "table", "layered" ] }, "table": { "description": "kind table", "type": "object", "properties": { "columns": { "type": "array", "items": { "type": "string" } }, "rows": { "type": "array", "items": { "type": "array", "items": {} } } }, "required": [ "columns", "rows" ], "additionalProperties": {} }, "layered": { "description": "kind layered: titled sections, each with its rows", "type": "object", "properties": { "header": { "type": [ "string", "null" ] }, "sections": { "type": "array", "items": { "type": "object", "properties": {}, "additionalProperties": {} } } }, "required": [ "sections" ], "additionalProperties": {} }, "orientation": { "type": "string", "enum": [ "portrait", "landscape" ] }, "stats": { "description": "Figures shown above the table", "type": "array", "items": { "type": "object", "properties": {}, "additionalProperties": {} } }, "chart": { "type": "object", "properties": {}, "additionalProperties": {} }, "note": { "type": [ "string", "null" ] }, "extraTables": { "type": "array", "items": { "type": "object", "properties": {}, "additionalProperties": {} } }, "caption": { "type": [ "string", "null" ] } }, "required": [ "title", "kind" ], "additionalProperties": {} } } } }, "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" } } } } } } }, "/me/privacy": { "get": { "tags": [ "Privacy" ], "summary": "My privacy settings", "description": "News consent, open requests, and whether there's a privacy notice to accept.\n\n**Who:** Any signed-in person.", "operationId": "getMePrivacy", "security": [ { "bearerAuth": [] } ], "parameters": [], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "news": { "type": "object", "properties": { "email": { "type": "boolean" }, "whatsapp": { "type": "boolean" } }, "required": [ "email", "whatsapp" ], "additionalProperties": {} }, "newsAskedAt": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "canWhatsApp": { "type": "boolean" }, "notificationPreference": { "type": [ "string", "null" ] }, "history": { "type": "array", "items": { "type": "object", "properties": {}, "additionalProperties": {} }, "description": "Every change to my news consent" }, "requests": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "type": { "type": "string", "enum": [ "access", "correction", "deletion" ] }, "status": { "type": "string", "enum": [ "open", "completed", "rejected", "cancelled" ] }, "userId": { "type": [ "string", "null" ] }, "name": { "type": "string" }, "email": { "type": "string" }, "details": { "type": [ "string", "null" ] }, "response": { "type": [ "string", "null" ] }, "dueAt": { "description": "30 days after it was made", "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "closedAt": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "createdAt": { "type": "string", "description": "Date and time (ISO 8601)" } }, "required": [ "id", "type", "status", "createdAt" ], "additionalProperties": {} } } }, "required": [ "news", "canWhatsApp", "history", "requests" ], "additionalProperties": {} } }, "required": [ "data" ], "additionalProperties": false } } } }, "401": { "description": "Not signed in (UNAUTHENTICATED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/me/privacy/news": { "put": { "tags": [ "Privacy" ], "summary": "Choose whether to get news", "description": "**Who:** Any signed-in person.", "operationId": "putMePrivacyNews", "security": [ { "bearerAuth": [] } ], "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "email": { "type": [ "boolean", "null" ] }, "whatsapp": { "type": [ "boolean", "null" ] }, "source": { "description": "Where it was changed, for the consent log", "type": [ "string", "null" ] } }, "additionalProperties": {} } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "news": { "type": "object", "properties": { "email": { "type": "boolean" }, "whatsapp": { "type": "boolean" } }, "required": [ "email", "whatsapp" ], "additionalProperties": {} }, "newsAskedAt": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] } }, "required": [ "news" ], "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" } } } } } } }, "/me/privacy/export": { "get": { "tags": [ "Privacy" ], "summary": "Download everything held about me", "description": "`format=pdf` or JSON (the default).\n\n**Who:** Any signed-in person.", "operationId": "getMePrivacyExport", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "format", "in": "query", "required": false, "description": "File type, e.g. `pdf` or `xlsx`", "schema": { "type": "string", "maxLength": 4000 } } ], "responses": { "200": { "description": "The file", "content": { "application/json": { "schema": { "type": "string" } } } }, "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/privacy/requests": { "post": { "tags": [ "Privacy" ], "summary": "Ask for my data to be corrected or deleted", "description": "**Who:** Any signed-in person.", "operationId": "postMePrivacyRequests", "security": [ { "bearerAuth": [] } ], "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "correction", "deletion" ] }, "details": { "description": "A correction: what to change", "type": [ "string", "null" ] }, "password": { "description": "A deletion: closes the account too", "type": [ "string", "null" ] } }, "required": [ "type" ], "additionalProperties": {} } } } }, "responses": { "201": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "request": { "type": "object", "properties": { "id": { "type": "string" }, "type": { "type": "string", "enum": [ "access", "correction", "deletion" ] }, "status": { "type": "string", "enum": [ "open", "completed", "rejected", "cancelled" ] }, "userId": { "type": [ "string", "null" ] }, "name": { "type": "string" }, "email": { "type": "string" }, "details": { "type": [ "string", "null" ] }, "response": { "type": [ "string", "null" ] }, "dueAt": { "description": "30 days after it was made", "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "closedAt": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "createdAt": { "type": "string", "description": "Date and time (ISO 8601)" } }, "required": [ "id", "type", "status", "createdAt" ], "additionalProperties": {} }, "message": { "type": "string" } }, "required": [ "request", "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" } } } } } } }, "/me/privacy/notice/accept": { "post": { "tags": [ "Privacy" ], "summary": "Accept the privacy notice", "description": "**Who:** Any signed-in person.", "operationId": "postMePrivacyNoticeAccept", "security": [ { "bearerAuth": [] } ], "parameters": [], "requestBody": { "required": true, "description": "No body needed: send an empty object.", "content": { "application/json": { "schema": { "type": "object", "properties": {}, "additionalProperties": {} } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "version": { "type": "number", "description": "The version accepted" } }, "required": [ "version" ], "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" } } } } } } }, "/privacy/notice": { "get": { "tags": [ "Privacy" ], "summary": "The published privacy notice", "description": "**Who:** Anyone.", "operationId": "getPrivacyNotice", "parameters": [ { "name": "version", "in": "query", "required": false, "description": "A version number (default: the current one)", "schema": { "type": "string", "maxLength": 4000 } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "version": { "type": "number", "description": "0: the built-in text" }, "builtIn": { "type": [ "boolean", "null" ] }, "current": { "type": [ "boolean", "null" ] }, "publishedAt": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "effectiveDate": { "type": [ "string", "null" ] }, "changeSummary": { "type": [ "string", "null" ] }, "sections": { "type": "array", "items": { "type": "object", "properties": {}, "additionalProperties": {} }, "description": "Rendered sections" }, "versions": { "type": "array", "items": { "type": "object", "properties": {}, "additionalProperties": {} }, "description": "Every published version" } }, "required": [ "version", "sections", "versions" ], "additionalProperties": {} } }, "required": [ "data" ], "additionalProperties": false } } } }, "400": { "description": "Validation failed (VALIDATION_FAILED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/unsubscribe/{token}": { "get": { "tags": [ "Privacy" ], "summary": "What an unsubscribe link is for", "description": "The token in the link is the credential.\n\n**Who:** Anyone.", "operationId": "getUnsubscribeToken", "parameters": [ { "name": "token", "in": "path", "required": true, "description": "The token from the link (it is the credential)", "schema": { "type": "string", "minLength": 1, "maxLength": 500 } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "kind": { "type": "string", "enum": [ "account", "address" ] }, "email": { "description": "Partly hidden", "type": [ "string", "null" ] }, "hasPhone": { "type": [ "boolean", "null" ] }, "news": { "type": "object", "properties": { "email": { "type": "boolean" }, "whatsapp": { "type": "boolean" } }, "required": [ "email", "whatsapp" ], "additionalProperties": {} }, "address": { "description": "kind address: the email or phone, partly hidden", "type": [ "string", "null" ] } }, "required": [ "kind" ], "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" } } } } } }, "post": { "tags": [ "Privacy" ], "summary": "Unsubscribe with a link", "description": "**Who:** Anyone.", "operationId": "postUnsubscribeToken", "parameters": [ { "name": "token", "in": "path", "required": true, "description": "The token from the link (it is the credential)", "schema": { "type": "string", "minLength": 1, "maxLength": 500 } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "channels": { "description": "Default: the link's channel", "type": "array", "items": { "type": "string", "enum": [ "email", "whatsapp" ] } } }, "additionalProperties": {} } } } }, "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" } } } }, "404": { "description": "Not found (NOT_FOUND)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/privacy/requests": { "get": { "tags": [ "Privacy" ], "summary": "Data requests", "description": "`status=open` (default), `closed` or `all`.\n\n**Who:** Admins only.", "operationId": "getPrivacyRequests", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "status", "in": "query", "required": false, "description": "Only this status", "schema": { "type": "string", "maxLength": 4000 } }, { "name": "search", "in": "query", "required": false, "description": "Text to search for", "schema": { "type": "string", "maxLength": 4000 } }, { "name": "page", "in": "query", "required": false, "description": "Page number, from 1", "schema": { "type": "string", "maxLength": 4000 } }, { "name": "limit", "in": "query", "required": false, "description": "How many per page", "schema": { "type": "string", "maxLength": 4000 } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "requests": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "type": { "type": "string", "enum": [ "access", "correction", "deletion" ] }, "status": { "type": "string", "enum": [ "open", "completed", "rejected", "cancelled" ] }, "userId": { "type": [ "string", "null" ] }, "name": { "type": "string" }, "email": { "type": "string" }, "details": { "type": [ "string", "null" ] }, "response": { "type": [ "string", "null" ] }, "dueAt": { "description": "30 days after it was made", "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "closedAt": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "createdAt": { "type": "string", "description": "Date and time (ISO 8601)" }, "overdue": { "type": [ "boolean", "null" ] }, "blockers": { "description": "Upcoming registrations that stop a deletion", "type": "array", "items": { "type": "object", "properties": {}, "additionalProperties": {} } } }, "required": [ "id", "type", "status", "createdAt" ], "additionalProperties": {} } }, "openCount": { "type": "number" }, "total": { "type": "number" }, "page": { "type": "number" }, "limit": { "type": "number" }, "pages": { "type": "number" } }, "required": [ "requests", "openCount", "total", "page", "limit", "pages" ], "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" } } } } } } }, "/privacy/requests/{id}/complete": { "post": { "tags": [ "Privacy" ], "summary": "Mark a data request done", "description": "**Who:** Admins only.", "operationId": "postPrivacyRequestsIdComplete", "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": { "response": { "description": "Emailed to them; needed for a correction", "type": [ "string", "null" ] } }, "additionalProperties": {} } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "request": { "type": "object", "properties": { "id": { "type": "string" }, "type": { "type": "string", "enum": [ "access", "correction", "deletion" ] }, "status": { "type": "string", "enum": [ "open", "completed", "rejected", "cancelled" ] }, "userId": { "type": [ "string", "null" ] }, "name": { "type": "string" }, "email": { "type": "string" }, "details": { "type": [ "string", "null" ] }, "response": { "type": [ "string", "null" ] }, "dueAt": { "description": "30 days after it was made", "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "closedAt": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "createdAt": { "type": "string", "description": "Date and time (ISO 8601)" } }, "required": [ "id", "type", "status", "createdAt" ], "additionalProperties": {} }, "anonymised": { "description": "A deletion: what was removed", "anyOf": [ { "type": "object", "properties": {}, "additionalProperties": {} }, { "type": "null" } ] } }, "required": [ "request" ], "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" } } } } } } }, "/privacy/requests/{id}/reject": { "post": { "tags": [ "Privacy" ], "summary": "Turn down a data request", "description": "**Who:** Admins only.", "operationId": "postPrivacyRequestsIdReject", "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": { "response": { "type": "string", "description": "The reason, emailed to them" }, "cancelled": { "description": "They withdrew it", "type": [ "boolean", "null" ] } }, "required": [ "response" ], "additionalProperties": {} } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "request": { "type": "object", "properties": { "id": { "type": "string" }, "type": { "type": "string", "enum": [ "access", "correction", "deletion" ] }, "status": { "type": "string", "enum": [ "open", "completed", "rejected", "cancelled" ] }, "userId": { "type": [ "string", "null" ] }, "name": { "type": "string" }, "email": { "type": "string" }, "details": { "type": [ "string", "null" ] }, "response": { "type": [ "string", "null" ] }, "dueAt": { "description": "30 days after it was made", "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "closedAt": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "createdAt": { "type": "string", "description": "Date and time (ISO 8601)" } }, "required": [ "id", "type", "status", "createdAt" ], "additionalProperties": {} } }, "required": [ "request" ], "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" } } } } } } }, "/privacy/notice/draft": { "get": { "tags": [ "Privacy" ], "summary": "The privacy notice being drafted", "description": "**Who:** Admins only.", "operationId": "getPrivacyNoticeDraft", "security": [ { "bearerAuth": [] } ], "parameters": [], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "sections": { "type": "array", "items": { "type": "object", "properties": { "key": { "type": "string" }, "title": { "type": "string" }, "body": { "type": "string", "description": "Text; {placeholders} are filled in" } }, "required": [ "title", "body" ], "additionalProperties": {} } }, "isDraft": { "type": [ "boolean", "null" ] }, "rendered": { "type": "array", "items": { "type": "object", "properties": {}, "additionalProperties": {} }, "description": "The sections with placeholders filled in" }, "placeholders": { "type": "array", "items": { "type": "string" }, "description": "The placeholders the text can use" }, "versions": { "type": "array", "items": { "type": "object", "properties": {}, "additionalProperties": {} }, "description": "Published versions" }, "builtIn": { "type": "array", "items": { "type": "object", "properties": { "key": { "type": "string" }, "title": { "type": "string" }, "body": { "type": "string", "description": "Text; {placeholders} are filled in" } }, "required": [ "title", "body" ], "additionalProperties": {} } }, "builtInUpdates": { "type": "array", "items": { "type": "object", "properties": {}, "additionalProperties": {} }, "description": "Changes to the built-in text not reviewed yet" } }, "required": [ "sections", "rendered", "placeholders", "versions", "builtIn", "builtInUpdates" ], "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" } } } } } }, "put": { "tags": [ "Privacy" ], "summary": "Save the draft notice", "description": "**Who:** Admins only.", "operationId": "putPrivacyNoticeDraft", "security": [ { "bearerAuth": [] } ], "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "sections": { "type": "array", "items": { "type": "object", "properties": { "key": { "type": "string" }, "title": { "type": "string" }, "body": { "type": "string", "description": "Text; {placeholders} are filled in" } }, "required": [ "title", "body" ], "additionalProperties": {} } } }, "required": [ "sections" ], "additionalProperties": {} } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "sections": { "type": "array", "items": { "type": "object", "properties": { "key": { "type": "string" }, "title": { "type": "string" }, "body": { "type": "string", "description": "Text; {placeholders} are filled in" } }, "required": [ "title", "body" ], "additionalProperties": {} } }, "rendered": { "type": "array", "items": { "type": "object", "properties": {}, "additionalProperties": {} } }, "isDraft": { "type": "boolean", "const": true }, "savedAt": { "type": "string", "description": "Date and time (ISO 8601)" } }, "required": [ "sections", "rendered", "isDraft", "savedAt" ], "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" } } } } } }, "delete": { "tags": [ "Privacy" ], "summary": "Throw the draft away", "description": "**Who:** Admins only.", "operationId": "deletePrivacyNoticeDraft", "security": [ { "bearerAuth": [] } ], "parameters": [], "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 } } } }, "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" } } } } } } }, "/privacy/notice/publish": { "post": { "tags": [ "Privacy" ], "summary": "Publish the draft notice", "description": "Everyone is asked to accept it at their next sign-in.\n\n**Who:** Admins only.", "operationId": "postPrivacyNoticePublish", "security": [ { "bearerAuth": [] } ], "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "sections": { "type": "array", "items": { "type": "object", "properties": { "key": { "type": "string" }, "title": { "type": "string" }, "body": { "type": "string", "description": "Text; {placeholders} are filled in" } }, "required": [ "title", "body" ], "additionalProperties": {} } }, "changeSummary": { "type": "string", "description": "Shown to people asked to accept it" }, "requiresAcceptance": { "type": [ "boolean", "null" ] } }, "required": [ "changeSummary" ], "additionalProperties": {} } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "version": { "type": "number" }, "publishedAt": { "type": "string", "description": "Date and time (ISO 8601)" }, "requiresAcceptance": { "type": "boolean" } }, "required": [ "version", "publishedAt", "requiresAcceptance" ], "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" } } } } } } }, "/privacy/notice/builtin-reviewed": { "post": { "tags": [ "Privacy" ], "summary": "Mark the built-in notice as reviewed", "description": "**Who:** Admins only.", "operationId": "postPrivacyNoticeBuiltin-reviewed", "security": [ { "bearerAuth": [] } ], "parameters": [], "requestBody": { "required": true, "description": "No body needed: send an empty object.", "content": { "application/json": { "schema": { "type": "object", "properties": {}, "additionalProperties": {} } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "builtInUpdates": { "type": "array", "items": { "type": "object", "properties": {}, "additionalProperties": {} } } }, "required": [ "builtInUpdates" ], "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" } } } } } } }, "/privacy/operators": { "get": { "tags": [ "Privacy" ], "summary": "Who processes personal information for the church", "description": "**Who:** Admins only.", "operationId": "getPrivacyOperators", "security": [ { "bearerAuth": [] } ], "parameters": [], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string" }, "purpose": { "type": "string", "description": "What they do for the church" }, "dataShared": { "type": [ "string", "null" ] }, "location": { "description": "Country the data is kept in", "type": [ "string", "null" ] }, "website": { "type": [ "string", "null" ] }, "active": { "type": "boolean" }, "order": { "type": "number" }, "id": { "type": "string" }, "createdAt": { "type": "string", "description": "Date and time (ISO 8601)" }, "updatedAt": { "type": "string", "description": "Date and time (ISO 8601)" } }, "required": [ "name", "purpose", "active", "order", "id", "createdAt", "updatedAt" ], "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": [ "Privacy" ], "summary": "Add an operator", "description": "**Who:** Admins only.", "operationId": "postPrivacyOperators", "security": [ { "bearerAuth": [] } ], "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "name": { "type": "string" }, "purpose": { "type": "string", "description": "What they do for the church" }, "dataShared": { "type": [ "string", "null" ] }, "location": { "description": "Country the data is kept in", "type": [ "string", "null" ] }, "website": { "type": [ "string", "null" ] }, "active": { "type": [ "boolean", "null" ] }, "order": { "type": [ "number", "null" ] } }, "required": [ "name", "purpose" ], "additionalProperties": {} } } } }, "responses": { "201": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "name": { "type": "string" }, "purpose": { "type": "string", "description": "What they do for the church" }, "dataShared": { "type": [ "string", "null" ] }, "location": { "description": "Country the data is kept in", "type": [ "string", "null" ] }, "website": { "type": [ "string", "null" ] }, "active": { "type": "boolean" }, "order": { "type": "number" }, "id": { "type": "string" }, "createdAt": { "type": "string", "description": "Date and time (ISO 8601)" }, "updatedAt": { "type": "string", "description": "Date and time (ISO 8601)" } }, "required": [ "name", "purpose", "active", "order", "id", "createdAt", "updatedAt" ], "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" } } } } } } }, "/privacy/operators/{id}": { "put": { "tags": [ "Privacy" ], "summary": "Change an operator", "description": "**Who:** Admins only.", "operationId": "putPrivacyOperatorsId", "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" }, "purpose": { "type": "string", "description": "What they do for the church" }, "dataShared": { "type": [ "string", "null" ] }, "location": { "description": "Country the data is kept in", "type": [ "string", "null" ] }, "website": { "type": [ "string", "null" ] }, "active": { "type": [ "boolean", "null" ] }, "order": { "type": [ "number", "null" ] } }, "additionalProperties": {} } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "name": { "type": "string" }, "purpose": { "type": "string", "description": "What they do for the church" }, "dataShared": { "type": [ "string", "null" ] }, "location": { "description": "Country the data is kept in", "type": [ "string", "null" ] }, "website": { "type": [ "string", "null" ] }, "active": { "type": "boolean" }, "order": { "type": "number" }, "id": { "type": "string" }, "createdAt": { "type": "string", "description": "Date and time (ISO 8601)" }, "updatedAt": { "type": "string", "description": "Date and time (ISO 8601)" } }, "required": [ "name", "purpose", "active", "order", "id", "createdAt", "updatedAt" ], "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": [ "Privacy" ], "summary": "Remove an operator", "description": "**Who:** Admins only.", "operationId": "deletePrivacyOperatorsId", "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" } } } } } } }, "/privacy/consent-log": { "get": { "tags": [ "Privacy" ], "summary": "Consent given and withdrawn", "description": "**Who:** Admins only.", "operationId": "getPrivacyConsent-log", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "type", "in": "query", "required": false, "description": "Which kind", "schema": { "type": "string", "maxLength": 4000 } }, { "name": "page", "in": "query", "required": false, "description": "Page number, from 1", "schema": { "type": "string", "maxLength": 4000 } }, { "name": "q", "in": "query", "required": false, "description": "Text to search for", "schema": { "type": "string", "maxLength": 4000 } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "total": { "type": "number" }, "pageSize": { "type": "number" }, "rows": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "at": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "name": { "type": [ "string", "null" ] } }, "required": [ "id" ], "additionalProperties": {} } } }, "required": [ "total", "pageSize", "rows" ], "additionalProperties": {}, "description": "`type` news: email, channel, granted, source, ip; notice: email, version, source, ip; parental: child, event, status, signedName" } }, "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" } } } } } } }, "/privacy/access-log": { "get": { "tags": [ "Privacy" ], "summary": "Who looked at sensitive information", "description": "**Who:** Admins only.", "operationId": "getPrivacyAccess-log", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "page", "in": "query", "required": false, "description": "Page number, from 1", "schema": { "type": "string", "maxLength": 4000 } }, { "name": "action", "in": "query", "required": false, "description": "Only this action", "schema": { "type": "string", "maxLength": 4000 } }, { "name": "sensitive", "in": "query", "required": false, "description": "`true`: only access to sensitive information", "schema": { "type": "string", "maxLength": 4000 } }, { "name": "actorId", "in": "query", "required": false, "description": "Only things this person did", "schema": { "type": "string", "maxLength": 4000 } }, { "name": "from", "in": "query", "required": false, "description": "On or after (ISO date or date-time)", "schema": { "type": "string", "maxLength": 4000 } }, { "name": "to", "in": "query", "required": false, "description": "On or before (ISO date or date-time)", "schema": { "type": "string", "maxLength": 4000 } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "total": { "type": "number" }, "pageSize": { "type": "number" }, "rows": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "at": { "type": "string", "description": "Date and time (ISO 8601)" }, "actor": { "type": "string" }, "actorRole": { "type": [ "string", "null" ] }, "action": { "type": "string" }, "what": { "type": [ "string", "null" ] }, "records": { "type": [ "number", "null" ] }, "eventId": { "type": [ "string", "null" ] }, "ip": { "type": [ "string", "null" ] }, "sensitive": { "type": "boolean" } }, "required": [ "id", "at", "actor", "action", "sensitive" ], "additionalProperties": {} } }, "actions": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "string" }, "description": "Every action, with its label" }, "actors": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" } }, "required": [ "id", "name" ], "additionalProperties": {} } } }, "required": [ "total", "pageSize", "rows", "actions", "actors" ], "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" } } } } } } }, "/privacy/readiness": { "get": { "tags": [ "Privacy" ], "summary": "POPIA checklist", "description": "**Who:** Admins only.", "operationId": "getPrivacyReadiness", "security": [ { "bearerAuth": [] } ], "parameters": [], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "score": { "type": "number", "description": "%" }, "passed": { "type": "number" }, "total": { "type": "number" }, "checks": { "type": "array", "items": { "type": "object", "properties": { "key": { "type": "string" }, "label": { "type": "string" }, "ok": { "type": "boolean" }, "detail": { "type": [ "string", "null" ] }, "href": { "type": [ "string", "null" ] }, "applies": { "type": "boolean" } }, "required": [ "key", "label", "ok", "applies" ], "additionalProperties": {} } } }, "required": [ "score", "passed", "total", "checks" ], "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" } } } } } } }, "/privacy/retention": { "get": { "tags": [ "Privacy" ], "summary": "How long information is kept", "description": "**Who:** Admins only.", "operationId": "getPrivacyRetention", "security": [ { "bearerAuth": [] } ], "parameters": [], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "policies": { "type": "object", "properties": {}, "additionalProperties": {}, "description": "Per kind of information: how long it is kept" }, "definitions": { "type": "object", "properties": {}, "additionalProperties": {} }, "preview": { "type": "object", "properties": {}, "additionalProperties": {}, "description": "What the rules would remove now" }, "lastRun": { "anyOf": [ { "type": "object", "properties": {}, "additionalProperties": {} }, { "type": "null" } ] }, "related": { "type": "object", "properties": { "medicalDays": { "type": "number" }, "backupCount": { "type": "number" }, "analyticsDays": { "type": "number" } }, "required": [ "medicalDays", "backupCount", "analyticsDays" ], "additionalProperties": {} } }, "required": [ "policies", "definitions", "preview", "related" ], "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" } } } } } }, "put": { "tags": [ "Privacy" ], "summary": "Change how long information is kept", "description": "**Who:** Admins only.", "operationId": "putPrivacyRetention", "security": [ { "bearerAuth": [] } ], "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "policies": { "type": "object", "properties": {}, "additionalProperties": {}, "description": "Per kind of information: { enabled, months }" } }, "required": [ "policies" ], "additionalProperties": {} } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "policies": { "type": "object", "properties": {}, "additionalProperties": {}, "description": "Per kind of information: how long it is kept" }, "definitions": { "type": "object", "properties": {}, "additionalProperties": {} }, "preview": { "type": "object", "properties": {}, "additionalProperties": {}, "description": "What the rules would remove now" }, "lastRun": { "anyOf": [ { "type": "object", "properties": {}, "additionalProperties": {} }, { "type": "null" } ] }, "related": { "type": "object", "properties": { "medicalDays": { "type": "number" }, "backupCount": { "type": "number" }, "analyticsDays": { "type": "number" } }, "required": [ "medicalDays", "backupCount", "analyticsDays" ], "additionalProperties": {} } }, "required": [ "policies", "definitions", "preview", "related" ], "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" } } } } } } }, "/privacy/retention/run": { "post": { "tags": [ "Privacy" ], "summary": "Apply the retention rules now", "description": "**Who:** Admins only.", "operationId": "postPrivacyRetentionRun", "security": [ { "bearerAuth": [] } ], "parameters": [], "requestBody": { "required": true, "description": "No body needed: send an empty object.", "content": { "application/json": { "schema": { "type": "object", "properties": {}, "additionalProperties": {} } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "result": { "type": "object", "properties": {}, "additionalProperties": {}, "description": "What was removed or anonymised" }, "state": { "type": "object", "properties": { "policies": { "type": "object", "properties": {}, "additionalProperties": {}, "description": "Per kind of information: how long it is kept" }, "definitions": { "type": "object", "properties": {}, "additionalProperties": {} }, "preview": { "type": "object", "properties": {}, "additionalProperties": {}, "description": "What the rules would remove now" }, "lastRun": { "anyOf": [ { "type": "object", "properties": {}, "additionalProperties": {} }, { "type": "null" } ] }, "related": { "type": "object", "properties": { "medicalDays": { "type": "number" }, "backupCount": { "type": "number" }, "analyticsDays": { "type": "number" } }, "required": [ "medicalDays", "backupCount", "analyticsDays" ], "additionalProperties": {} } }, "required": [ "policies", "definitions", "preview", "related" ], "additionalProperties": {} } }, "required": [ "result", "state" ], "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" } } } } } } }, "/privacy/breaches": { "get": { "tags": [ "Privacy" ], "summary": "Recorded data breaches", "description": "**Who:** Admins only.", "operationId": "getPrivacyBreaches", "security": [ { "bearerAuth": [] } ], "parameters": [], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "array", "items": { "type": "object", "properties": { "title": { "type": "string" }, "description": { "type": "string" }, "dataAffected": { "type": "string" }, "peopleAffected": { "type": [ "number", "string", "null" ] }, "whoAffected": { "type": [ "string", "null" ] }, "consequences": { "type": [ "string", "null" ] }, "actionsTaken": { "type": [ "string", "null" ] }, "adviceToPeople": { "type": [ "string", "null" ] }, "causedBy": { "type": [ "string", "null" ] }, "status": { "type": "string" }, "discoveredAt": { "type": "string", "description": "Date and time (ISO 8601)" }, "occurredAt": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "regulatorNotifiedAt": { "description": "When the Information Regulator was told", "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "peopleNotifiedAt": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "id": { "type": "string" }, "createdAt": { "type": "string", "description": "Date and time (ISO 8601)" }, "updatedAt": { "type": "string", "description": "Date and time (ISO 8601)" }, "createdBy": { "anyOf": [ { "type": "object", "properties": { "name": { "type": "string" } }, "required": [ "name" ], "additionalProperties": {} }, { "type": "null" } ] } }, "required": [ "title", "description", "dataAffected", "status", "discoveredAt", "id", "createdAt", "updatedAt" ], "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": [ "Privacy" ], "summary": "Record a data breach", "description": "**Who:** Admins only.", "operationId": "postPrivacyBreaches", "security": [ { "bearerAuth": [] } ], "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "title": { "type": "string" }, "description": { "type": "string" }, "dataAffected": { "type": "string" }, "peopleAffected": { "type": [ "number", "string", "null" ] }, "whoAffected": { "type": [ "string", "null" ] }, "consequences": { "type": [ "string", "null" ] }, "actionsTaken": { "type": [ "string", "null" ] }, "adviceToPeople": { "type": [ "string", "null" ] }, "causedBy": { "type": [ "string", "null" ] }, "status": { "description": "open or closed", "type": [ "string", "null" ] }, "discoveredAt": { "type": "string", "description": "Date and time (ISO 8601)" }, "occurredAt": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "regulatorNotifiedAt": { "description": "When the Information Regulator was told", "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "peopleNotifiedAt": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] } }, "required": [ "title", "description", "dataAffected", "discoveredAt" ], "additionalProperties": {} } } } }, "responses": { "201": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "title": { "type": "string" }, "description": { "type": "string" }, "dataAffected": { "type": "string" }, "peopleAffected": { "type": [ "number", "string", "null" ] }, "whoAffected": { "type": [ "string", "null" ] }, "consequences": { "type": [ "string", "null" ] }, "actionsTaken": { "type": [ "string", "null" ] }, "adviceToPeople": { "type": [ "string", "null" ] }, "causedBy": { "type": [ "string", "null" ] }, "status": { "type": "string" }, "discoveredAt": { "type": "string", "description": "Date and time (ISO 8601)" }, "occurredAt": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "regulatorNotifiedAt": { "description": "When the Information Regulator was told", "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "peopleNotifiedAt": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "id": { "type": "string" }, "createdAt": { "type": "string", "description": "Date and time (ISO 8601)" }, "updatedAt": { "type": "string", "description": "Date and time (ISO 8601)" }, "createdBy": { "anyOf": [ { "type": "object", "properties": { "name": { "type": "string" } }, "required": [ "name" ], "additionalProperties": {} }, { "type": "null" } ] } }, "required": [ "title", "description", "dataAffected", "status", "discoveredAt", "id", "createdAt", "updatedAt" ], "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" } } } } } } }, "/privacy/breaches/{id}": { "put": { "tags": [ "Privacy" ], "summary": "Update a data breach", "description": "**Who:** Admins only.", "operationId": "putPrivacyBreachesId", "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" }, "description": { "type": "string" }, "dataAffected": { "type": "string" }, "peopleAffected": { "type": [ "number", "string", "null" ] }, "whoAffected": { "type": [ "string", "null" ] }, "consequences": { "type": [ "string", "null" ] }, "actionsTaken": { "type": [ "string", "null" ] }, "adviceToPeople": { "type": [ "string", "null" ] }, "causedBy": { "type": [ "string", "null" ] }, "status": { "description": "open or closed", "type": [ "string", "null" ] }, "discoveredAt": { "type": "string", "description": "Date and time (ISO 8601)" }, "occurredAt": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "regulatorNotifiedAt": { "description": "When the Information Regulator was told", "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "peopleNotifiedAt": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] } }, "additionalProperties": {} } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "title": { "type": "string" }, "description": { "type": "string" }, "dataAffected": { "type": "string" }, "peopleAffected": { "type": [ "number", "string", "null" ] }, "whoAffected": { "type": [ "string", "null" ] }, "consequences": { "type": [ "string", "null" ] }, "actionsTaken": { "type": [ "string", "null" ] }, "adviceToPeople": { "type": [ "string", "null" ] }, "causedBy": { "type": [ "string", "null" ] }, "status": { "type": "string" }, "discoveredAt": { "type": "string", "description": "Date and time (ISO 8601)" }, "occurredAt": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "regulatorNotifiedAt": { "description": "When the Information Regulator was told", "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "peopleNotifiedAt": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "id": { "type": "string" }, "createdAt": { "type": "string", "description": "Date and time (ISO 8601)" }, "updatedAt": { "type": "string", "description": "Date and time (ISO 8601)" }, "createdBy": { "anyOf": [ { "type": "object", "properties": { "name": { "type": "string" } }, "required": [ "name" ], "additionalProperties": {} }, { "type": "null" } ] } }, "required": [ "title", "description", "dataAffected", "status", "discoveredAt", "id", "createdAt", "updatedAt" ], "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" } } } } } } }, "/admin/audit-log": { "get": { "tags": [ "Admin" ], "summary": "The audit log", "description": "**Who:** Admins only.", "operationId": "getAdminAudit-log", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "page", "in": "query", "required": false, "description": "Page number, from 1", "schema": { "type": "string", "maxLength": 4000 } }, { "name": "limit", "in": "query", "required": false, "description": "How many per page", "schema": { "type": "string", "maxLength": 4000 } }, { "name": "actorId", "in": "query", "required": false, "description": "Only things this person did", "schema": { "type": "string", "maxLength": 4000 } }, { "name": "action", "in": "query", "required": false, "description": "Only this action", "schema": { "type": "string", "maxLength": 4000 } }, { "name": "role", "in": "query", "required": false, "description": "admin, supervisor, staff or user", "schema": { "type": "string", "maxLength": 4000 } }, { "name": "from", "in": "query", "required": false, "description": "On or after (ISO date or date-time)", "schema": { "type": "string", "maxLength": 4000 } }, { "name": "to", "in": "query", "required": false, "description": "On or before (ISO date or date-time)", "schema": { "type": "string", "maxLength": 4000 } }, { "name": "search", "in": "query", "required": false, "description": "Text to search for", "schema": { "type": "string", "maxLength": 4000 } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "rows": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "action": { "type": "string" }, "actorRole": { "type": [ "string", "null" ] }, "targetType": { "type": [ "string", "null" ] }, "targetId": { "type": [ "string", "null" ] }, "metadata": { "anyOf": [ { "type": "object", "properties": {}, "additionalProperties": {} }, { "type": "null" } ] }, "ip": { "type": [ "string", "null" ] }, "createdAt": { "type": "string", "description": "Date and time (ISO 8601)" }, "actor": { "anyOf": [ { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "email": { "type": [ "string", "null" ] } }, "required": [ "name" ], "additionalProperties": {} }, { "type": "null" } ] } }, "required": [ "id", "action", "createdAt" ], "additionalProperties": {} } }, "total": { "type": "number" }, "page": { "type": "number" }, "limit": { "type": "number" } }, "required": [ "rows", "total", "page", "limit" ], "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" } } } } } } }, "/admin/jobs": { "get": { "tags": [ "Admin" ], "summary": "Background jobs", "description": "**Who:** Admins only.", "operationId": "getAdminJobs", "security": [ { "bearerAuth": [] } ], "parameters": [], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "mode": { "type": "string", "description": "on, off or timers" }, "timezone": { "type": "string" }, "jobs": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string" }, "label": { "type": "string" }, "cron": { "type": [ "string", "null" ] }, "enabled": { "type": "boolean" }, "envFlag": { "type": [ "string", "null" ] }, "nextRun": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "recent": { "type": "array", "items": { "type": "object", "properties": {}, "additionalProperties": {} }, "description": "Recent runs" } }, "required": [ "name", "label", "enabled", "recent" ], "additionalProperties": {} } } }, "required": [ "mode", "timezone", "jobs" ], "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" } } } } } } }, "/admin/jobs/{name}/run": { "post": { "tags": [ "Admin" ], "summary": "Run a background job now", "description": "**Who:** Admins only.", "operationId": "postAdminJobsNameRun", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "name", "in": "path", "required": true, "description": "The name", "schema": { "type": "string", "minLength": 1, "maxLength": 100 } } ], "requestBody": { "required": true, "description": "No body needed: send an empty object.", "content": { "application/json": { "schema": { "type": "object", "properties": {}, "additionalProperties": {} } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "queued": { "type": "boolean" }, "id": { "type": [ "string", "null" ] }, "output": { "description": "When it ran straight away" } }, "required": [ "queued" ], "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" } } } } } } }, "/admin/impersonation-sessions": { "get": { "tags": [ "Admin" ], "summary": "Times admins viewed the site as someone else", "description": "**Who:** Admins only.", "operationId": "getAdminImpersonation-sessions", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "limit", "in": "query", "required": false, "description": "How many per page", "schema": { "type": "string", "maxLength": 4000 } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "reason": { "type": [ "string", "null" ] }, "startedAt": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "endedAt": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "expiresAt": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "admin": { "anyOf": [ { "type": "object", "properties": { "name": { "type": "string" }, "email": { "type": [ "string", "null" ] } }, "required": [ "name" ], "additionalProperties": {} }, { "type": "null" } ] }, "target": { "anyOf": [ { "type": "object", "properties": { "name": { "type": "string" }, "email": { "type": [ "string", "null" ] } }, "required": [ "name" ], "additionalProperties": {} }, { "type": "null" } ] }, "requests": { "type": "array", "items": { "type": "object", "properties": { "method": { "type": "string" }, "path": { "type": "string" }, "blocked": { "type": "boolean" }, "createdAt": { "type": "string", "description": "Date and time (ISO 8601)" } }, "required": [ "method", "path", "blocked", "createdAt" ], "additionalProperties": {} }, "description": "What they did (up to 500)" } }, "required": [ "id", "requests" ], "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" } } } } } } }, "/admin/impersonate/{userId}": { "post": { "tags": [ "Admin" ], "summary": "View the site as someone (read-only)", "description": "Answers a token for a read-only session, logged.\n\n**Who:** Admins only.", "operationId": "postAdminImpersonateUserId", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "userId", "in": "path", "required": true, "description": "The person's id", "schema": { "type": "string", "minLength": 1, "maxLength": 64 } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "reason": { "type": "string", "description": "Why — kept in the log" } }, "required": [ "reason" ], "additionalProperties": {} } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "token": { "type": "string", "description": "A read-only sign-in token" }, "session": { "type": "object", "properties": { "id": { "type": "string" }, "expiresAt": { "type": "string", "description": "Date and time (ISO 8601)" }, "target": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "email": { "type": "string" }, "role": { "type": "string" } }, "required": [ "id", "name", "email", "role" ], "additionalProperties": {} } }, "required": [ "id", "expiresAt", "target" ], "additionalProperties": {} } }, "required": [ "token", "session" ], "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" } } } } } } }, "/me/impersonation": { "get": { "tags": [ "Admin" ], "summary": "The viewing-as session I'm in, if any", "description": "**Who:** Any signed-in person.", "operationId": "getMeImpersonation", "security": [ { "bearerAuth": [] } ], "parameters": [], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "anyOf": [ { "type": "object", "properties": { "id": { "type": "string" }, "expiresAt": { "type": "string", "description": "Date and time (ISO 8601)" }, "target": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "email": { "type": [ "string", "null" ] } }, "required": [ "name" ], "additionalProperties": {} } }, "required": [ "id", "expiresAt", "target" ], "additionalProperties": {} }, { "type": "null" } ] } }, "required": [ "data" ], "additionalProperties": false } } } }, "401": { "description": "Not signed in (UNAUTHENTICATED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/me/impersonation/end": { "post": { "tags": [ "Admin" ], "summary": "Stop viewing as someone", "description": "**Who:** Any signed-in person.", "operationId": "postMeImpersonationEnd", "security": [ { "bearerAuth": [] } ], "parameters": [], "requestBody": { "required": true, "description": "No body needed: send an empty object.", "content": { "application/json": { "schema": { "type": "object", "properties": {}, "additionalProperties": {} } } } }, "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" } } } } } } }, "/me/impersonation/log": { "post": { "tags": [ "Admin" ], "summary": "Record a page viewed while viewing as someone", "description": "**Who:** Any signed-in person.", "operationId": "postMeImpersonationLog", "security": [ { "bearerAuth": [] } ], "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "path": { "type": "string" } }, "required": [ "path" ], "additionalProperties": {} } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "null", "description": "Always 204, no content" } }, "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" } } } } } } }, "/settings": { "get": { "tags": [ "Site" ], "summary": "Public site settings", "description": "Name, branding, contact details and what's switched on.\n\n**Who:** Anyone.", "operationId": "getSettings", "parameters": [], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "string" }, "description": "Setting key → value: name, logo, colours, contact details, what's switched on" } }, "required": [ "data" ], "additionalProperties": false } } } } } }, "put": { "tags": [ "Site" ], "summary": "Change settings", "description": "**Who:** Admins only.", "operationId": "putSettings", "security": [ { "bearerAuth": [] } ], "parameters": [], "requestBody": { "required": true, "description": "No body needed: send an empty object.", "content": { "application/json": { "schema": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {}, "description": "Setting key → new value" } } } }, "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" } } } } } } }, "/settings/all": { "get": { "tags": [ "Site" ], "summary": "Every setting", "description": "Admins. Secrets are masked.\n\n**Who:** Admins only.", "operationId": "getSettingsAll", "security": [ { "bearerAuth": [] } ], "parameters": [], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {}, "description": "Setting key → value; secrets masked" } }, "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" } } } } } } }, "/settings/test-smtp": { "post": { "tags": [ "Site" ], "summary": "Send a test email", "description": "**Who:** Admins only.", "operationId": "postSettingsTest-smtp", "security": [ { "bearerAuth": [] } ], "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "host": { "type": [ "string", "null" ] }, "port": { "type": [ "number", "string" ] }, "secure": { "type": [ "boolean", "string" ] }, "user": { "type": [ "string", "null" ] }, "pass": { "type": [ "string", "null" ] }, "from": { "type": [ "string", "null" ] } }, "additionalProperties": {}, "description": "Unsaved SMTP details to try (default: the saved ones)" } } } }, "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" } } } } } } }, "/setup/needed": { "get": { "tags": [ "Site" ], "summary": "Does the site still need setting up?", "description": "**Who:** Anyone.", "operationId": "getSetupNeeded", "parameters": [], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "needsSetup": { "type": "boolean" } }, "required": [ "needsSetup" ], "additionalProperties": {} } }, "required": [ "data" ], "additionalProperties": false } } } } } } }, "/setup/register": { "post": { "tags": [ "Site" ], "summary": "Create the first admin", "description": "Only while no account exists.\n\n**Who:** Anyone.", "operationId": "postSetupRegister", "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "adminName": { "type": "string" }, "adminEmail": { "type": "string" }, "adminPassword": { "type": "string", "description": "At least 8 characters" } }, "required": [ "adminName", "adminEmail", "adminPassword" ], "additionalProperties": {} } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "token": { "type": "string" }, "name": { "type": "string" }, "email": { "type": "string" } }, "required": [ "token", "name", "email" ], "additionalProperties": {} } }, "required": [ "data" ], "additionalProperties": false } } } }, "400": { "description": "Validation failed (VALIDATION_FAILED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/setup": { "post": { "tags": [ "Site" ], "summary": "Finish first-run set-up", "description": "**Who:** Admins only.", "operationId": "postSetup", "security": [ { "bearerAuth": [] } ], "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "settings": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {}, "description": "Setting key → value" } }, "required": [ "settings" ], "additionalProperties": {} } } } }, "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" } } } } } } }, "/hub/status": { "get": { "tags": [ "Site" ], "summary": "The connection to the provider's Hub", "description": "**Who:** Admins only.", "operationId": "getHubStatus", "security": [ { "bearerAuth": [] } ], "parameters": [], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "state": { "type": "string", "description": "active, grace, suspended, revoked, none…" }, "readOnly": { "type": "boolean" }, "daysLeft": { "type": [ "number", "null" ] }, "endsAt": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "graceEndsAt": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "licence": { "anyOf": [ { "type": "object", "properties": { "customer": { "type": [ "string", "null" ] }, "plan": { "type": [ "string", "null" ] }, "status": { "type": [ "string", "null" ] }, "licenceExpiresAt": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "graceDays": { "type": [ "number", "null" ] }, "issuedAt": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "validUntil": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "limits": { "type": "object", "properties": {}, "additionalProperties": {} } }, "required": [ "limits" ], "additionalProperties": {} }, { "type": "null" } ] }, "connected": { "type": "boolean" }, "keyConfigured": { "type": "boolean" }, "hubUrl": { "type": [ "string", "null" ] }, "lastHeartbeatAt": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "lastError": { "type": [ "string", "null" ] }, "version": { "type": "string", "description": "This site's version" }, "latestVersion": { "type": [ "string", "null" ] }, "updateAvailable": { "type": "boolean" }, "urgentUpdate": { "type": "boolean" }, "updateSnoozed": { "type": [ "boolean", "null" ] }, "releases": { "description": "What's new in each version since this one", "type": "array", "items": { "type": "object", "properties": {}, "additionalProperties": {} } }, "updateRequest": { "anyOf": [ { "type": "object", "properties": {}, "additionalProperties": {} }, { "type": "null" } ] }, "notices": { "type": "array", "items": { "type": "object", "properties": {}, "additionalProperties": {} } } }, "required": [ "state", "readOnly", "connected", "keyConfigured", "version", "updateAvailable", "urgentUpdate" ], "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" } } } } } } }, "/hub/connect": { "post": { "tags": [ "Site" ], "summary": "Connect to the Hub", "description": "**Who:** Admins only.", "operationId": "postHubConnect", "security": [ { "bearerAuth": [] } ], "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "licenceKey": { "type": "string" } }, "required": [ "licenceKey" ], "additionalProperties": {} } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "state": { "type": "string", "description": "active, grace, suspended, revoked, none…" }, "readOnly": { "type": "boolean" }, "daysLeft": { "type": [ "number", "null" ] }, "endsAt": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "graceEndsAt": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "licence": { "anyOf": [ { "type": "object", "properties": { "customer": { "type": [ "string", "null" ] }, "plan": { "type": [ "string", "null" ] }, "status": { "type": [ "string", "null" ] }, "licenceExpiresAt": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "graceDays": { "type": [ "number", "null" ] }, "issuedAt": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "validUntil": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "limits": { "type": "object", "properties": {}, "additionalProperties": {} } }, "required": [ "limits" ], "additionalProperties": {} }, { "type": "null" } ] }, "connected": { "type": "boolean" }, "keyConfigured": { "type": "boolean" }, "hubUrl": { "type": [ "string", "null" ] }, "lastHeartbeatAt": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "lastError": { "type": [ "string", "null" ] }, "version": { "type": "string", "description": "This site's version" }, "latestVersion": { "type": [ "string", "null" ] }, "updateAvailable": { "type": "boolean" }, "urgentUpdate": { "type": "boolean" }, "updateSnoozed": { "type": [ "boolean", "null" ] }, "releases": { "description": "What's new in each version since this one", "type": "array", "items": { "type": "object", "properties": {}, "additionalProperties": {} } }, "updateRequest": { "anyOf": [ { "type": "object", "properties": {}, "additionalProperties": {} }, { "type": "null" } ] }, "notices": { "type": "array", "items": { "type": "object", "properties": {}, "additionalProperties": {} } } }, "required": [ "state", "readOnly", "connected", "keyConfigured", "version", "updateAvailable", "urgentUpdate" ], "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" } } } } } } }, "/hub/heartbeat": { "post": { "tags": [ "Site" ], "summary": "Check in with the Hub now", "description": "**Who:** Admins only.", "operationId": "postHubHeartbeat", "security": [ { "bearerAuth": [] } ], "parameters": [], "requestBody": { "required": true, "description": "No body needed: send an empty object.", "content": { "application/json": { "schema": { "type": "object", "properties": {}, "additionalProperties": {} } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "state": { "type": "string", "description": "active, grace, suspended, revoked, none…" }, "readOnly": { "type": "boolean" }, "daysLeft": { "type": [ "number", "null" ] }, "endsAt": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "graceEndsAt": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "licence": { "anyOf": [ { "type": "object", "properties": { "customer": { "type": [ "string", "null" ] }, "plan": { "type": [ "string", "null" ] }, "status": { "type": [ "string", "null" ] }, "licenceExpiresAt": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "graceDays": { "type": [ "number", "null" ] }, "issuedAt": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "validUntil": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "limits": { "type": "object", "properties": {}, "additionalProperties": {} } }, "required": [ "limits" ], "additionalProperties": {} }, { "type": "null" } ] }, "connected": { "type": "boolean" }, "keyConfigured": { "type": "boolean" }, "hubUrl": { "type": [ "string", "null" ] }, "lastHeartbeatAt": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "lastError": { "type": [ "string", "null" ] }, "version": { "type": "string", "description": "This site's version" }, "latestVersion": { "type": [ "string", "null" ] }, "updateAvailable": { "type": "boolean" }, "urgentUpdate": { "type": "boolean" }, "updateSnoozed": { "type": [ "boolean", "null" ] }, "releases": { "description": "What's new in each version since this one", "type": "array", "items": { "type": "object", "properties": {}, "additionalProperties": {} } }, "updateRequest": { "anyOf": [ { "type": "object", "properties": {}, "additionalProperties": {} }, { "type": "null" } ] }, "notices": { "type": "array", "items": { "type": "object", "properties": {}, "additionalProperties": {} } } }, "required": [ "state", "readOnly", "connected", "keyConfigured", "version", "updateAvailable", "urgentUpdate" ], "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" } } } } } } }, "/hub/update-request": { "post": { "tags": [ "Site" ], "summary": "Ask for the update to be installed", "description": "**Who:** Admins only.", "operationId": "postHubUpdate-request", "security": [ { "bearerAuth": [] } ], "parameters": [], "requestBody": { "required": true, "description": "No body needed: send an empty object.", "content": { "application/json": { "schema": { "type": "object", "properties": {}, "additionalProperties": {} } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "state": { "type": "string", "description": "active, grace, suspended, revoked, none…" }, "readOnly": { "type": "boolean" }, "daysLeft": { "type": [ "number", "null" ] }, "endsAt": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "graceEndsAt": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "licence": { "anyOf": [ { "type": "object", "properties": { "customer": { "type": [ "string", "null" ] }, "plan": { "type": [ "string", "null" ] }, "status": { "type": [ "string", "null" ] }, "licenceExpiresAt": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "graceDays": { "type": [ "number", "null" ] }, "issuedAt": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "validUntil": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "limits": { "type": "object", "properties": {}, "additionalProperties": {} } }, "required": [ "limits" ], "additionalProperties": {} }, { "type": "null" } ] }, "connected": { "type": "boolean" }, "keyConfigured": { "type": "boolean" }, "hubUrl": { "type": [ "string", "null" ] }, "lastHeartbeatAt": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "lastError": { "type": [ "string", "null" ] }, "version": { "type": "string", "description": "This site's version" }, "latestVersion": { "type": [ "string", "null" ] }, "updateAvailable": { "type": "boolean" }, "urgentUpdate": { "type": "boolean" }, "updateSnoozed": { "type": [ "boolean", "null" ] }, "releases": { "description": "What's new in each version since this one", "type": "array", "items": { "type": "object", "properties": {}, "additionalProperties": {} } }, "updateRequest": { "anyOf": [ { "type": "object", "properties": {}, "additionalProperties": {} }, { "type": "null" } ] }, "notices": { "type": "array", "items": { "type": "object", "properties": {}, "additionalProperties": {} } } }, "required": [ "state", "readOnly", "connected", "keyConfigured", "version", "updateAvailable", "urgentUpdate" ], "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" } } } } } } }, "/hub/update-request/cancel": { "post": { "tags": [ "Site" ], "summary": "Withdraw the update request", "description": "**Who:** Admins only.", "operationId": "postHubUpdate-requestCancel", "security": [ { "bearerAuth": [] } ], "parameters": [], "requestBody": { "required": true, "description": "No body needed: send an empty object.", "content": { "application/json": { "schema": { "type": "object", "properties": {}, "additionalProperties": {} } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "state": { "type": "string", "description": "active, grace, suspended, revoked, none…" }, "readOnly": { "type": "boolean" }, "daysLeft": { "type": [ "number", "null" ] }, "endsAt": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "graceEndsAt": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "licence": { "anyOf": [ { "type": "object", "properties": { "customer": { "type": [ "string", "null" ] }, "plan": { "type": [ "string", "null" ] }, "status": { "type": [ "string", "null" ] }, "licenceExpiresAt": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "graceDays": { "type": [ "number", "null" ] }, "issuedAt": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "validUntil": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "limits": { "type": "object", "properties": {}, "additionalProperties": {} } }, "required": [ "limits" ], "additionalProperties": {} }, { "type": "null" } ] }, "connected": { "type": "boolean" }, "keyConfigured": { "type": "boolean" }, "hubUrl": { "type": [ "string", "null" ] }, "lastHeartbeatAt": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "lastError": { "type": [ "string", "null" ] }, "version": { "type": "string", "description": "This site's version" }, "latestVersion": { "type": [ "string", "null" ] }, "updateAvailable": { "type": "boolean" }, "urgentUpdate": { "type": "boolean" }, "updateSnoozed": { "type": [ "boolean", "null" ] }, "releases": { "description": "What's new in each version since this one", "type": "array", "items": { "type": "object", "properties": {}, "additionalProperties": {} } }, "updateRequest": { "anyOf": [ { "type": "object", "properties": {}, "additionalProperties": {} }, { "type": "null" } ] }, "notices": { "type": "array", "items": { "type": "object", "properties": {}, "additionalProperties": {} } } }, "required": [ "state", "readOnly", "connected", "keyConfigured", "version", "updateAvailable", "urgentUpdate" ], "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" } } } } } } }, "/hub/update-snooze": { "post": { "tags": [ "Site" ], "summary": "Remind me about the update later", "description": "**Who:** Admins only.", "operationId": "postHubUpdate-snooze", "security": [ { "bearerAuth": [] } ], "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "snooze": { "description": "false: stop putting it off", "type": [ "boolean", "null" ] } }, "additionalProperties": {} } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "state": { "type": "string", "description": "active, grace, suspended, revoked, none…" }, "readOnly": { "type": "boolean" }, "daysLeft": { "type": [ "number", "null" ] }, "endsAt": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "graceEndsAt": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "licence": { "anyOf": [ { "type": "object", "properties": { "customer": { "type": [ "string", "null" ] }, "plan": { "type": [ "string", "null" ] }, "status": { "type": [ "string", "null" ] }, "licenceExpiresAt": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "graceDays": { "type": [ "number", "null" ] }, "issuedAt": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "validUntil": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "limits": { "type": "object", "properties": {}, "additionalProperties": {} } }, "required": [ "limits" ], "additionalProperties": {} }, { "type": "null" } ] }, "connected": { "type": "boolean" }, "keyConfigured": { "type": "boolean" }, "hubUrl": { "type": [ "string", "null" ] }, "lastHeartbeatAt": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "lastError": { "type": [ "string", "null" ] }, "version": { "type": "string", "description": "This site's version" }, "latestVersion": { "type": [ "string", "null" ] }, "updateAvailable": { "type": "boolean" }, "urgentUpdate": { "type": "boolean" }, "updateSnoozed": { "type": [ "boolean", "null" ] }, "releases": { "description": "What's new in each version since this one", "type": "array", "items": { "type": "object", "properties": {}, "additionalProperties": {} } }, "updateRequest": { "anyOf": [ { "type": "object", "properties": {}, "additionalProperties": {} }, { "type": "null" } ] }, "notices": { "type": "array", "items": { "type": "object", "properties": {}, "additionalProperties": {} } } }, "required": [ "state", "readOnly", "connected", "keyConfigured", "version", "updateAvailable", "urgentUpdate" ], "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" } } } } } } }, "/hub/notices": { "get": { "tags": [ "Site" ], "summary": "Notices from the provider", "description": "**Who:** Supervisors and admins.", "operationId": "getHubNotices", "security": [ { "bearerAuth": [] } ], "parameters": [], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "level": { "type": "string", "description": "info, warning, critical" }, "title": { "type": "string" }, "message": { "type": "string" }, "startsAt": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "endsAt": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "updatedAt": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] } }, "required": [ "id", "level", "title", "message" ], "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" } } } } } } }, "/outbound-webhooks": { "get": { "tags": [ "Webhooks" ], "summary": "Webhooks the site sends", "description": "**Who:** Admins only.", "operationId": "getOutbound-webhooks", "security": [ { "bearerAuth": [] } ], "parameters": [], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "eventTypes": { "type": "array", "items": { "type": "object", "properties": {}, "additionalProperties": {} }, "description": "Every event type, with an example body" }, "keepDays": { "type": "number", "description": "How long deliveries are kept" }, "endpoints": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "url": { "type": "string" }, "events": { "type": "array", "items": { "type": "string" }, "description": "Event types it gets" }, "isActive": { "type": "boolean" }, "operatorId": { "description": "Its entry in the operator register", "type": [ "string", "null" ] }, "lastSuccessAt": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "lastFailureAt": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "createdAt": { "type": "string", "description": "Date and time (ISO 8601)" }, "lastWeek": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "number" }, "description": "Status → deliveries in the last 7 days" } }, "required": [ "id", "name", "url", "events", "isActive", "createdAt", "lastWeek" ], "additionalProperties": {} } } }, "required": [ "eventTypes", "keepDays", "endpoints" ], "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": [ "Webhooks" ], "summary": "Add a webhook", "description": "Answers its signing secret once.\n\n**Who:** Admins only.", "operationId": "postOutbound-webhooks", "security": [ { "bearerAuth": [] } ], "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "name": { "type": "string" }, "url": { "type": "string", "description": "https:// address" }, "events": { "type": "array", "items": { "type": "string" } } }, "required": [ "name", "url", "events" ], "additionalProperties": {} } } } }, "responses": { "201": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "url": { "type": "string" }, "events": { "type": "array", "items": { "type": "string" }, "description": "Event types it gets" }, "isActive": { "type": "boolean" }, "operatorId": { "description": "Its entry in the operator register", "type": [ "string", "null" ] }, "lastSuccessAt": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "lastFailureAt": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "createdAt": { "type": "string", "description": "Date and time (ISO 8601)" }, "secret": { "type": "string", "description": "For checking signatures — shown only now" } }, "required": [ "id", "name", "url", "events", "isActive", "createdAt", "secret" ], "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" } } } } } } }, "/outbound-webhook-deliveries/{id}/resend": { "post": { "tags": [ "Webhooks" ], "summary": "Send a delivery again", "description": "**Who:** Admins only.", "operationId": "postOutbound-webhook-deliveriesIdResend", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "id", "in": "path", "required": true, "description": "The id", "schema": { "type": "string", "minLength": 1, "maxLength": 64 } } ], "requestBody": { "required": true, "description": "No body needed: send an empty object.", "content": { "application/json": { "schema": { "type": "object", "properties": {}, "additionalProperties": {} } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "status": { "description": "succeeded, failed, retrying…", "type": [ "string", "null" ] }, "statusCode": { "type": [ "number", "null" ] }, "error": { "type": [ "string", "null" ] } }, "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" } } } } } } }, "/outbound-webhooks/{id}": { "patch": { "tags": [ "Webhooks" ], "summary": "Change a webhook", "description": "**Who:** Admins only.", "operationId": "patchOutbound-webhooksId", "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", "null" ] }, "url": { "type": [ "string", "null" ] }, "events": { "type": "array", "items": { "type": "string" } }, "isActive": { "type": [ "boolean", "null" ] } }, "additionalProperties": {} } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "url": { "type": "string" }, "events": { "type": "array", "items": { "type": "string" }, "description": "Event types it gets" }, "isActive": { "type": "boolean" }, "operatorId": { "description": "Its entry in the operator register", "type": [ "string", "null" ] }, "lastSuccessAt": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "lastFailureAt": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "createdAt": { "type": "string", "description": "Date and time (ISO 8601)" } }, "required": [ "id", "name", "url", "events", "isActive", "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" } } } }, "404": { "description": "Not found (NOT_FOUND)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } }, "delete": { "tags": [ "Webhooks" ], "summary": "Remove a webhook", "description": "**Who:** Admins only.", "operationId": "deleteOutbound-webhooksId", "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": { "ok": { "type": "boolean", "const": true } }, "required": [ "ok" ], "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" } } } } } } }, "/outbound-webhooks/{id}/rotate-secret": { "post": { "tags": [ "Webhooks" ], "summary": "Give a webhook a new signing secret", "description": "**Who:** Admins only.", "operationId": "postOutbound-webhooksIdRotate-secret", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "id", "in": "path", "required": true, "description": "The id", "schema": { "type": "string", "minLength": 1, "maxLength": 64 } } ], "requestBody": { "required": true, "description": "No body needed: send an empty object.", "content": { "application/json": { "schema": { "type": "object", "properties": {}, "additionalProperties": {} } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "secret": { "type": "string", "description": "Shown only now; the old one stops working" } }, "required": [ "secret" ], "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" } } } } } } }, "/outbound-webhooks/{id}/test": { "post": { "tags": [ "Webhooks" ], "summary": "Send a test delivery", "description": "**Who:** Admins only.", "operationId": "postOutbound-webhooksIdTest", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "id", "in": "path", "required": true, "description": "The id", "schema": { "type": "string", "minLength": 1, "maxLength": 64 } } ], "requestBody": { "required": true, "description": "No body needed: send an empty object.", "content": { "application/json": { "schema": { "type": "object", "properties": {}, "additionalProperties": {} } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "status": { "description": "succeeded, failed, retrying…", "type": [ "string", "null" ] }, "statusCode": { "type": [ "number", "null" ] }, "error": { "type": [ "string", "null" ] } }, "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" } } } } } } }, "/outbound-webhooks/{id}/deliveries": { "get": { "tags": [ "Webhooks" ], "summary": "A webhook's recent deliveries", "description": "**Who:** Admins only.", "operationId": "getOutbound-webhooksIdDeliveries", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "id", "in": "path", "required": true, "description": "The id", "schema": { "type": "string", "minLength": 1, "maxLength": 64 } }, { "name": "page", "in": "query", "required": false, "description": "Page number, from 1", "schema": { "type": "string", "maxLength": 4000 } }, { "name": "limit", "in": "query", "required": false, "description": "How many per page", "schema": { "type": "string", "maxLength": 4000 } }, { "name": "status", "in": "query", "required": false, "description": "Only this status", "schema": { "type": "string", "maxLength": 4000 } }, { "name": "before", "in": "query", "required": false, "description": "Older than (ISO date-time), for the next page", "schema": { "type": "string", "maxLength": 4000 } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "eventId": { "type": "string" }, "type": { "type": "string", "description": "The event type" }, "payload": {}, "status": { "type": "string", "description": "pending, sending, retrying, succeeded, failed" }, "attempts": { "type": "number" }, "nextAttemptAt": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] }, "lastStatusCode": { "type": [ "number", "null" ] }, "lastError": { "type": [ "string", "null" ] }, "createdAt": { "type": "string", "description": "Date and time (ISO 8601)" }, "deliveredAt": { "anyOf": [ { "type": "string", "description": "Date and time (ISO 8601)" }, { "type": "null" } ] } }, "required": [ "id", "eventId", "type", "payload", "status", "attempts", "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" } } } }, "404": { "description": "Not found (NOT_FOUND)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/backups": { "get": { "tags": [ "Admin" ], "summary": "Database backups", "description": "**Who:** Admins only.", "operationId": "getBackups", "security": [ { "bearerAuth": [] } ], "parameters": [], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "array", "items": { "type": "object", "properties": { "filename": { "type": "string" }, "size": { "type": "number", "description": "Bytes" }, "createdAt": { "type": "string", "description": "Date and time (ISO 8601)" } }, "required": [ "filename", "size", "createdAt" ], "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" } } } } } } }, "/backups/run": { "post": { "tags": [ "Admin" ], "summary": "Back up the database now", "description": "**Who:** Admins only.", "operationId": "postBackupsRun", "security": [ { "bearerAuth": [] } ], "parameters": [], "requestBody": { "required": true, "description": "No body needed: send an empty object.", "content": { "application/json": { "schema": { "type": "object", "properties": {}, "additionalProperties": {} } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": {}, "additionalProperties": {}, "description": "The backup made" } }, "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" } } } } } } }, "/backups/{filename}/download": { "get": { "tags": [ "Admin" ], "summary": "Download a backup", "description": "**Who:** Admins only.", "operationId": "getBackupsFilenameDownload", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "filename", "in": "path", "required": true, "description": "The file name", "schema": { "type": "string", "minLength": 1, "maxLength": 200 } } ], "responses": { "200": { "description": "The file", "content": { "application/octet-stream": { "schema": { "type": "string" } } } }, "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" } } } } } } }, "/payments/yoco/config": { "get": { "tags": [ "Payments" ], "summary": "Yoco settings", "description": "Keys are masked.\n\n**Who:** Admins only.", "operationId": "getPaymentsYocoConfig", "security": [ { "bearerAuth": [] } ], "parameters": [], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "secretKeyMasked": { "type": "string" }, "secretKeySource": { "description": "settings or env", "type": [ "string", "null" ] }, "mode": { "description": "test or live", "type": [ "string", "null" ] }, "webhookSecretMasked": { "type": "string" }, "webhookSecretSource": { "type": [ "string", "null" ] }, "webhookId": { "type": "string" }, "webhookUrl": { "type": "string" }, "configured": { "type": "boolean" } }, "required": [ "secretKeyMasked", "webhookSecretMasked", "webhookId", "webhookUrl", "configured" ], "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" } } } } } }, "put": { "tags": [ "Payments" ], "summary": "Change Yoco settings", "description": "**Who:** Admins only.", "operationId": "putPaymentsYocoConfig", "security": [ { "bearerAuth": [] } ], "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "secretKey": { "description": "sk_test_… or sk_live_…", "type": [ "string", "null" ] }, "webhookSecret": { "description": "whsec_…", "type": [ "string", "null" ] } }, "additionalProperties": {} } } } }, "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" } } } } } } }, "/payments/yoco/webhooks": { "get": { "tags": [ "Payments" ], "summary": "Webhooks registered with Yoco", "description": "**Who:** Admins only.", "operationId": "getPaymentsYocoWebhooks", "security": [ { "bearerAuth": [] } ], "parameters": [], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "webhooks": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": [ "string", "null" ] }, "url": { "type": "string" }, "mode": { "type": [ "string", "null" ] }, "isActive": { "type": "boolean" }, "pointsHere": { "type": "boolean" } }, "required": [ "id", "url", "isActive", "pointsHere" ], "additionalProperties": {} } }, "defaultUrl": { "type": "string" } }, "required": [ "webhooks", "defaultUrl" ], "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": [ "Payments" ], "summary": "Register a webhook with Yoco", "description": "**Who:** Admins only.", "operationId": "postPaymentsYocoWebhooks", "security": [ { "bearerAuth": [] } ], "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "name": { "type": [ "string", "null" ] }, "url": { "description": "Default: this site's webhook address", "type": [ "string", "null" ] } }, "additionalProperties": {} } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "message": { "type": "string" }, "webhook": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": [ "string", "null" ] }, "url": { "type": "string" }, "mode": { "type": [ "string", "null" ] } }, "required": [ "id", "url" ], "additionalProperties": {} }, "webhookSecretMasked": { "type": "string" } }, "required": [ "message", "webhook", "webhookSecretMasked" ], "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" } } } } } } }, "/payments/yoco/webhooks/{id}": { "delete": { "tags": [ "Payments" ], "summary": "Remove a webhook from Yoco", "description": "**Who:** Admins only.", "operationId": "deletePaymentsYocoWebhooksId", "security": [ { "bearerAuth": [] } ], "parameters": [ { "name": "id", "in": "path", "required": true, "description": "The id", "schema": { "type": "string", "minLength": 1, "maxLength": 200 } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "message": { "type": "string" }, "clearedSecret": { "type": "boolean" } }, "required": [ "message", "clearedSecret" ], "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" } } } } } } }, "/payments/payfast/config": { "get": { "tags": [ "Payments" ], "summary": "PayFast settings", "description": "The passphrase is masked.\n\n**Who:** Admins only.", "operationId": "getPaymentsPayfastConfig", "security": [ { "bearerAuth": [] } ], "parameters": [], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "merchantId": { "type": "string" }, "merchantKey": { "type": "string" }, "passphraseMasked": { "type": "string" }, "hasPassphrase": { "type": "boolean" }, "mode": { "type": "string", "enum": [ "sandbox", "live" ] }, "notifyUrl": { "type": "string" }, "notifyUrlProblem": { "description": "Why PayFast couldn't reach it", "type": [ "string", "null" ] }, "configured": { "type": "boolean" } }, "required": [ "merchantId", "merchantKey", "passphraseMasked", "hasPassphrase", "mode", "notifyUrl", "configured" ], "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" } } } } } }, "put": { "tags": [ "Payments" ], "summary": "Change PayFast settings", "description": "**Who:** Admins only.", "operationId": "putPaymentsPayfastConfig", "security": [ { "bearerAuth": [] } ], "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "merchantId": { "type": [ "string", "null" ] }, "merchantKey": { "type": [ "string", "null" ] }, "passphrase": { "description": "At most 32 characters", "type": [ "string", "null" ] }, "mode": { "type": "string", "enum": [ "sandbox", "live" ] } }, "additionalProperties": {} } } } }, "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" } } } } } } }, "/payments/payfast/test": { "post": { "tags": [ "Payments" ], "summary": "Check the PayFast details work", "description": "**Who:** Admins only.", "operationId": "postPaymentsPayfastTest", "security": [ { "bearerAuth": [] } ], "parameters": [], "requestBody": { "required": true, "description": "No body needed: send an empty object.", "content": { "application/json": { "schema": { "type": "object", "properties": {}, "additionalProperties": {} } } } }, "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" } } } } } } }, "/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" } } } } } } }, "/ai/status": { "get": { "tags": [ "AI" ], "summary": "Whether to show the AI buttons", "description": "Hidden when `enabled` is false; shown but disabled when `capReached` (until `renewsOn`, or until the allowance is raised). Cached for a minute; every AI call refreshes it.\n\n**Who:** Supervisors and admins.", "operationId": "getAiStatus", "security": [ { "bearerAuth": [] } ], "parameters": [], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "enabled": { "type": "boolean", "description": "false: hide the AI buttons (the licence has no AI, or the site isn't connected to the Hub)" }, "capReached": { "type": "boolean", "description": "true: show the buttons disabled until `renewsOn`" }, "available": { "type": "boolean", "description": "false: the Hub couldn't be reached just now" }, "usedPercent": { "type": "number", "description": "How much of this month's allowance is used (0–100)" }, "usedInputTokens": { "anyOf": [ { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, { "type": "null" } ], "description": "Input tokens used this month by all the church's products (null from a Hub before 2.0.1)" }, "usedOutputTokens": { "anyOf": [ { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, { "type": "null" } ], "description": "Output tokens used this month" }, "capInputTokens": { "anyOf": [ { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, { "type": "null" } ], "description": "About how many input tokens the monthly allowance holds, if half of it went on input (an estimate: cached prompts cost less)" }, "capOutputTokens": { "anyOf": [ { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, { "type": "null" } ], "description": "About how many output tokens the allowance holds, if half of it went on output" }, "renewsOn": { "description": "YYYY-MM-DD", "type": [ "string", "null" ] }, "helpers": { "type": "object", "properties": { "draft_event": { "type": "boolean" }, "summarise_report": { "type": "boolean" }, "draft_message": { "type": "boolean" }, "summarise_feedback": { "type": "boolean" }, "improve_text": { "type": "boolean" } }, "required": [ "draft_event", "summarise_report", "draft_message", "summarise_feedback", "improve_text" ], "additionalProperties": false, "description": "Each helper switched on or off in Site settings → AI" } }, "required": [ "enabled", "capReached", "available", "usedPercent", "usedInputTokens", "usedOutputTokens", "capInputTokens", "capOutputTokens", "renewsOn", "helpers" ], "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" } } } } } } }, "/ai/usage": { "get": { "tags": [ "AI" ], "summary": "AI use this month", "description": "For Site settings → AI: the allowance, this site's switches, and this month's use per person, per helper and per day.\n\n**Who:** Admins only.", "operationId": "getAiUsage", "security": [ { "bearerAuth": [] } ], "parameters": [], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "status": { "type": "object", "properties": { "enabled": { "type": "boolean", "description": "false: hide the AI buttons (the licence has no AI, or the site isn't connected to the Hub)" }, "capReached": { "type": "boolean", "description": "true: show the buttons disabled until `renewsOn`" }, "available": { "type": "boolean", "description": "false: the Hub couldn't be reached just now" }, "usedPercent": { "type": "number", "description": "How much of this month's allowance is used (0–100)" }, "usedInputTokens": { "anyOf": [ { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, { "type": "null" } ], "description": "Input tokens used this month by all the church's products (null from a Hub before 2.0.1)" }, "usedOutputTokens": { "anyOf": [ { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, { "type": "null" } ], "description": "Output tokens used this month" }, "capInputTokens": { "anyOf": [ { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, { "type": "null" } ], "description": "About how many input tokens the monthly allowance holds, if half of it went on input (an estimate: cached prompts cost less)" }, "capOutputTokens": { "anyOf": [ { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, { "type": "null" } ], "description": "About how many output tokens the allowance holds, if half of it went on output" }, "renewsOn": { "description": "YYYY-MM-DD", "type": [ "string", "null" ] }, "helpers": { "type": "object", "properties": { "draft_event": { "type": "boolean" }, "summarise_report": { "type": "boolean" }, "draft_message": { "type": "boolean" }, "summarise_feedback": { "type": "boolean" }, "improve_text": { "type": "boolean" } }, "required": [ "draft_event", "summarise_report", "draft_message", "summarise_feedback", "improve_text" ], "additionalProperties": false, "description": "Each helper switched on or off in Site settings → AI" } }, "required": [ "enabled", "capReached", "available", "usedPercent", "usedInputTokens", "usedOutputTokens", "capInputTokens", "capOutputTokens", "renewsOn", "helpers" ], "additionalProperties": false }, "settings": { "type": "object", "properties": { "helpers": { "type": "object", "properties": { "draft_event": { "type": "boolean" }, "summarise_report": { "type": "boolean" }, "draft_message": { "type": "boolean" }, "summarise_feedback": { "type": "boolean" }, "improve_text": { "type": "boolean" } }, "required": [ "draft_event", "summarise_report", "draft_message", "summarise_feedback", "improve_text" ], "additionalProperties": false }, "dailyLimitPerPerson": { "type": "integer", "minimum": 0, "maximum": 1000, "description": "0 = no limit" } }, "required": [ "helpers", "dailyLimitPerPerson" ], "additionalProperties": false }, "people": { "type": "array", "items": { "type": "object", "properties": { "uses": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, "inputTokens": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, "outputTokens": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, "userId": { "type": [ "string", "null" ] }, "name": { "type": "string" } }, "required": [ "uses", "inputTokens", "outputTokens", "userId", "name" ], "additionalProperties": false } }, "helpers": { "type": "array", "items": { "type": "object", "properties": { "uses": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, "inputTokens": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, "outputTokens": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, "helper": { "type": "string" } }, "required": [ "uses", "inputTokens", "outputTokens", "helper" ], "additionalProperties": false } }, "days": { "type": "array", "items": { "type": "object", "properties": { "uses": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, "inputTokens": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, "outputTokens": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, "day": { "type": "string" } }, "required": [ "uses", "inputTokens", "outputTokens", "day" ], "additionalProperties": false } } }, "required": [ "status", "settings", "people", "helpers", "days" ], "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" } } } } } } }, "/ai/settings": { "put": { "tags": [ "AI" ], "summary": "Switch helpers on or off, and set a daily limit", "description": "**Who:** Admins only.", "operationId": "putAiSettings", "security": [ { "bearerAuth": [] } ], "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "helpers": { "type": "object", "properties": { "draft_event": { "type": "boolean" }, "summarise_report": { "type": "boolean" }, "draft_message": { "type": "boolean" }, "summarise_feedback": { "type": "boolean" }, "improve_text": { "type": "boolean" } } }, "dailyLimitPerPerson": { "type": "integer", "minimum": 0, "maximum": 1000 } } } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "helpers": { "type": "object", "properties": { "draft_event": { "type": "boolean" }, "summarise_report": { "type": "boolean" }, "draft_message": { "type": "boolean" }, "summarise_feedback": { "type": "boolean" }, "improve_text": { "type": "boolean" } }, "required": [ "draft_event", "summarise_report", "draft_message", "summarise_feedback", "improve_text" ], "additionalProperties": false }, "dailyLimitPerPerson": { "type": "integer", "minimum": 0, "maximum": 1000, "description": "0 = no limit" } }, "required": [ "helpers", "dailyLimitPerPerson" ], "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" } } } } } } }, "/ai/draft-event": { "post": { "tags": [ "AI" ], "summary": "Draft an event from a description", "description": "Fills in the event form from the organiser's notes. `warnings` are checked in code (a weekday that doesn't match its date, costs that a full event can't cover); `draft.checks` are the AI's own. Goes through the Cross Events Hub, which counts it against the site's monthly AI allowance. Errors carry a `reason`: AI_OFF, AI_HELPER_OFF, AI_CAP_REACHED, AI_DAILY_LIMIT, AI_REFUSED, AI_INCOMPLETE, AI_UNAVAILABLE.\n\n**Who:** Supervisors and admins.", "operationId": "postAiDraft-event", "security": [ { "bearerAuth": [] } ], "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "notes": { "type": "string", "minLength": 10, "maxLength": 4000 } }, "required": [ "notes" ] } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "output": { "type": "object", "properties": { "draft": { "type": "object", "properties": { "title": { "type": "string" }, "summary": { "type": "string" }, "description": { "type": "string" }, "startDate": { "type": "string" }, "startTime": { "type": "string" }, "endDate": { "type": "string" }, "endTime": { "type": "string" }, "location": { "type": "string" }, "capacity": { "type": "number" }, "needsParentalConsent": { "type": "boolean" }, "ageGroup": { "type": "string" }, "ticketOptions": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string" }, "priceRand": { "type": "number" }, "description": { "type": "string" }, "earlyBirdPriceRand": { "type": "number" }, "earlyBirdUntil": { "type": "string" } }, "required": [ "name", "priceRand", "description", "earlyBirdPriceRand", "earlyBirdUntil" ], "additionalProperties": false } }, "sessions": { "type": "array", "items": { "type": "object", "properties": { "date": { "type": "string" }, "startTime": { "type": "string" }, "endTime": { "type": "string" }, "label": { "type": "string" } }, "required": [ "date", "startTime", "endTime", "label" ], "additionalProperties": false } }, "costs": { "type": "array", "items": { "type": "object", "properties": { "item": { "type": "string" }, "basis": { "type": "string" }, "amountRand": { "type": "number" } }, "required": [ "item", "basis", "amountRand" ], "additionalProperties": false } }, "checks": { "type": "array", "items": { "type": "string" } } }, "required": [ "title", "summary", "description", "startDate", "startTime", "endDate", "endTime", "location", "capacity", "needsParentalConsent", "ageGroup", "ticketOptions", "sessions", "costs", "checks" ], "additionalProperties": false }, "warnings": { "type": "array", "items": { "type": "string" } }, "totalCostRand": { "type": "number" }, "breakEvenPlaces": { "type": [ "number", "null" ] } }, "required": [ "draft", "warnings", "totalCostRand", "breakEvenPlaces" ], "additionalProperties": false }, "status": { "type": "object", "properties": { "enabled": { "type": "boolean", "description": "false: hide the AI buttons (the licence has no AI, or the site isn't connected to the Hub)" }, "capReached": { "type": "boolean", "description": "true: show the buttons disabled until `renewsOn`" }, "available": { "type": "boolean", "description": "false: the Hub couldn't be reached just now" }, "usedPercent": { "type": "number", "description": "How much of this month's allowance is used (0–100)" }, "usedInputTokens": { "anyOf": [ { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, { "type": "null" } ], "description": "Input tokens used this month by all the church's products (null from a Hub before 2.0.1)" }, "usedOutputTokens": { "anyOf": [ { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, { "type": "null" } ], "description": "Output tokens used this month" }, "capInputTokens": { "anyOf": [ { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, { "type": "null" } ], "description": "About how many input tokens the monthly allowance holds, if half of it went on input (an estimate: cached prompts cost less)" }, "capOutputTokens": { "anyOf": [ { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, { "type": "null" } ], "description": "About how many output tokens the allowance holds, if half of it went on output" }, "renewsOn": { "description": "YYYY-MM-DD", "type": [ "string", "null" ] }, "helpers": { "type": "object", "properties": { "draft_event": { "type": "boolean" }, "summarise_report": { "type": "boolean" }, "draft_message": { "type": "boolean" }, "summarise_feedback": { "type": "boolean" }, "improve_text": { "type": "boolean" } }, "required": [ "draft_event", "summarise_report", "draft_message", "summarise_feedback", "improve_text" ], "additionalProperties": false, "description": "Each helper switched on or off in Site settings → AI" } }, "required": [ "enabled", "capReached", "available", "usedPercent", "usedInputTokens", "usedOutputTokens", "capInputTokens", "capOutputTokens", "renewsOn", "helpers" ], "additionalProperties": false } }, "required": [ "output", "status" ], "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" } } } } } } }, "/ai/summarise-report": { "post": { "tags": [ "AI" ], "summary": "Summarise a report", "description": "A few plain-language insights on a report. Reports without people in them (seriesComparison, regTypes, usage, revenue, regStatus, donations, funnel, discounts, cashup, financeReport, profitReport) are sent as they are on screen; reports that list people (payments, attendees, revenueDetailed, masterOrders, cashupAudit, consentStatus, feedbackSummary, medicalList) only as anonymised totals: a column that would carry a person (name, email, notes, …) is refused with `AI_REPORT_HAS_PEOPLE`, and each one is recorded in the access log. Goes through the Cross Events Hub, which counts it against the site's monthly AI allowance. Errors carry a `reason`: AI_OFF, AI_HELPER_OFF, AI_CAP_REACHED, AI_DAILY_LIMIT, AI_REFUSED, AI_INCOMPLETE, AI_UNAVAILABLE.\n\n**Who:** Supervisors and admins.", "operationId": "postAiSummarise-report", "security": [ { "bearerAuth": [] } ], "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "reportKey": { "type": "string", "enum": [ "seriesComparison", "regTypes", "usage", "revenue", "regStatus", "donations", "funnel", "discounts", "cashup", "financeReport", "profitReport", "payments", "attendees", "revenueDetailed", "masterOrders", "cashupAudit", "consentStatus", "feedbackSummary", "medicalList" ] }, "title": { "type": "string", "maxLength": 300 }, "subtitle": { "type": "string", "maxLength": 500 }, "stats": { "maxItems": 40, "type": "array", "items": { "type": "object", "properties": { "label": { "type": "string", "maxLength": 200 }, "value": { "anyOf": [ { "type": "string", "maxLength": 200 }, { "type": "number" } ] } }, "required": [ "label", "value" ] } }, "columns": { "maxItems": 40, "type": "array", "items": { "type": "string", "maxLength": 200 } }, "rows": { "maxItems": 5000, "type": "array", "items": { "type": "array", "items": { "anyOf": [ { "type": "string", "maxLength": 500 }, { "type": "number" }, { "type": "null" } ] } } } }, "required": [ "reportKey", "title", "columns", "rows" ] } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "output": { "type": "object", "properties": { "headline": { "type": "string" }, "insights": { "type": "array", "items": { "type": "object", "properties": { "title": { "type": "string" }, "detail": { "type": "string" } }, "required": [ "title", "detail" ], "additionalProperties": false } }, "watchOut": { "type": "array", "items": { "type": "string" } } }, "required": [ "headline", "insights", "watchOut" ], "additionalProperties": false }, "status": { "type": "object", "properties": { "enabled": { "type": "boolean", "description": "false: hide the AI buttons (the licence has no AI, or the site isn't connected to the Hub)" }, "capReached": { "type": "boolean", "description": "true: show the buttons disabled until `renewsOn`" }, "available": { "type": "boolean", "description": "false: the Hub couldn't be reached just now" }, "usedPercent": { "type": "number", "description": "How much of this month's allowance is used (0–100)" }, "usedInputTokens": { "anyOf": [ { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, { "type": "null" } ], "description": "Input tokens used this month by all the church's products (null from a Hub before 2.0.1)" }, "usedOutputTokens": { "anyOf": [ { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, { "type": "null" } ], "description": "Output tokens used this month" }, "capInputTokens": { "anyOf": [ { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, { "type": "null" } ], "description": "About how many input tokens the monthly allowance holds, if half of it went on input (an estimate: cached prompts cost less)" }, "capOutputTokens": { "anyOf": [ { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, { "type": "null" } ], "description": "About how many output tokens the allowance holds, if half of it went on output" }, "renewsOn": { "description": "YYYY-MM-DD", "type": [ "string", "null" ] }, "helpers": { "type": "object", "properties": { "draft_event": { "type": "boolean" }, "summarise_report": { "type": "boolean" }, "draft_message": { "type": "boolean" }, "summarise_feedback": { "type": "boolean" }, "improve_text": { "type": "boolean" } }, "required": [ "draft_event", "summarise_report", "draft_message", "summarise_feedback", "improve_text" ], "additionalProperties": false, "description": "Each helper switched on or off in Site settings → AI" } }, "required": [ "enabled", "capReached", "available", "usedPercent", "usedInputTokens", "usedOutputTokens", "capInputTokens", "capOutputTokens", "renewsOn", "helpers" ], "additionalProperties": false } }, "required": [ "output", "status" ], "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" } } } } } } }, "/ai/draft-message": { "post": { "tags": [ "AI" ], "summary": "Draft an email or WhatsApp message", "description": "Turns a short note into a message, using {{name}} and the event placeholders. With `eventId`, the event's title, start and place are given to the AI as facts. Goes through the Cross Events Hub, which counts it against the site's monthly AI allowance. Errors carry a `reason`: AI_OFF, AI_HELPER_OFF, AI_CAP_REACHED, AI_DAILY_LIMIT, AI_REFUSED, AI_INCOMPLETE, AI_UNAVAILABLE.\n\n**Who:** Supervisors and admins.", "operationId": "postAiDraft-message", "security": [ { "bearerAuth": [] } ], "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "channel": { "type": "string", "enum": [ "email", "whatsapp" ] }, "note": { "type": "string", "minLength": 3, "maxLength": 3000 }, "eventId": { "type": "string", "minLength": 1, "maxLength": 64 } }, "required": [ "channel", "note" ] } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "output": { "type": "object", "properties": { "subject": { "type": "string" }, "body": { "type": "string" } }, "required": [ "subject", "body" ], "additionalProperties": false }, "status": { "type": "object", "properties": { "enabled": { "type": "boolean", "description": "false: hide the AI buttons (the licence has no AI, or the site isn't connected to the Hub)" }, "capReached": { "type": "boolean", "description": "true: show the buttons disabled until `renewsOn`" }, "available": { "type": "boolean", "description": "false: the Hub couldn't be reached just now" }, "usedPercent": { "type": "number", "description": "How much of this month's allowance is used (0–100)" }, "usedInputTokens": { "anyOf": [ { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, { "type": "null" } ], "description": "Input tokens used this month by all the church's products (null from a Hub before 2.0.1)" }, "usedOutputTokens": { "anyOf": [ { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, { "type": "null" } ], "description": "Output tokens used this month" }, "capInputTokens": { "anyOf": [ { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, { "type": "null" } ], "description": "About how many input tokens the monthly allowance holds, if half of it went on input (an estimate: cached prompts cost less)" }, "capOutputTokens": { "anyOf": [ { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, { "type": "null" } ], "description": "About how many output tokens the allowance holds, if half of it went on output" }, "renewsOn": { "description": "YYYY-MM-DD", "type": [ "string", "null" ] }, "helpers": { "type": "object", "properties": { "draft_event": { "type": "boolean" }, "summarise_report": { "type": "boolean" }, "draft_message": { "type": "boolean" }, "summarise_feedback": { "type": "boolean" }, "improve_text": { "type": "boolean" } }, "required": [ "draft_event", "summarise_report", "draft_message", "summarise_feedback", "improve_text" ], "additionalProperties": false, "description": "Each helper switched on or off in Site settings → AI" } }, "required": [ "enabled", "capReached", "available", "usedPercent", "usedInputTokens", "usedOutputTokens", "capInputTokens", "capOutputTokens", "renewsOn", "helpers" ], "additionalProperties": false } }, "required": [ "output", "status" ], "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" } } } } } } }, "/ai/summarise-feedback": { "post": { "tags": [ "AI" ], "summary": "Summarise an event's feedback", "description": "Themes, what people liked, what to improve and suggestions, from the event's feedback. Sent without who answered; contact details in comments are kept back. Recorded in the access log. Goes through the Cross Events Hub, which counts it against the site's monthly AI allowance. Errors carry a `reason`: AI_OFF, AI_HELPER_OFF, AI_CAP_REACHED, AI_DAILY_LIMIT, AI_REFUSED, AI_INCOMPLETE, AI_UNAVAILABLE.\n\n**Who:** Supervisors and admins.", "operationId": "postAiSummarise-feedback", "security": [ { "bearerAuth": [] } ], "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "eventId": { "type": "string", "minLength": 1, "maxLength": 64 } }, "required": [ "eventId" ] } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "output": { "type": "object", "properties": { "overall": { "type": "string" }, "liked": { "type": "array", "items": { "type": "object", "properties": { "theme": { "type": "string" }, "mentions": { "type": "number" } }, "required": [ "theme", "mentions" ], "additionalProperties": false } }, "improve": { "type": "array", "items": { "type": "object", "properties": { "theme": { "type": "string" }, "mentions": { "type": "number" } }, "required": [ "theme", "mentions" ], "additionalProperties": false } }, "quotes": { "type": "array", "items": { "type": "string" } }, "nextTime": { "type": "array", "items": { "type": "string" } }, "responses": { "type": "number" } }, "required": [ "overall", "liked", "improve", "quotes", "nextTime", "responses" ], "additionalProperties": false }, "status": { "type": "object", "properties": { "enabled": { "type": "boolean", "description": "false: hide the AI buttons (the licence has no AI, or the site isn't connected to the Hub)" }, "capReached": { "type": "boolean", "description": "true: show the buttons disabled until `renewsOn`" }, "available": { "type": "boolean", "description": "false: the Hub couldn't be reached just now" }, "usedPercent": { "type": "number", "description": "How much of this month's allowance is used (0–100)" }, "usedInputTokens": { "anyOf": [ { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, { "type": "null" } ], "description": "Input tokens used this month by all the church's products (null from a Hub before 2.0.1)" }, "usedOutputTokens": { "anyOf": [ { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, { "type": "null" } ], "description": "Output tokens used this month" }, "capInputTokens": { "anyOf": [ { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, { "type": "null" } ], "description": "About how many input tokens the monthly allowance holds, if half of it went on input (an estimate: cached prompts cost less)" }, "capOutputTokens": { "anyOf": [ { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, { "type": "null" } ], "description": "About how many output tokens the allowance holds, if half of it went on output" }, "renewsOn": { "description": "YYYY-MM-DD", "type": [ "string", "null" ] }, "helpers": { "type": "object", "properties": { "draft_event": { "type": "boolean" }, "summarise_report": { "type": "boolean" }, "draft_message": { "type": "boolean" }, "summarise_feedback": { "type": "boolean" }, "improve_text": { "type": "boolean" } }, "required": [ "draft_event", "summarise_report", "draft_message", "summarise_feedback", "improve_text" ], "additionalProperties": false, "description": "Each helper switched on or off in Site settings → AI" } }, "required": [ "enabled", "capReached", "available", "usedPercent", "usedInputTokens", "usedOutputTokens", "capInputTokens", "capOutputTokens", "renewsOn", "helpers" ], "additionalProperties": false } }, "required": [ "output", "status" ], "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" } } } } } } }, "/ai/improve-text": { "post": { "tags": [ "AI" ], "summary": "Improve a piece of text", "description": "Fixes spelling and grammar and makes it clearer (`improve`), shorter (`shorter`) or only fixes mistakes (`fix`), keeping every fact. Goes through the Cross Events Hub, which counts it against the site's monthly AI allowance. Errors carry a `reason`: AI_OFF, AI_HELPER_OFF, AI_CAP_REACHED, AI_DAILY_LIMIT, AI_REFUSED, AI_INCOMPLETE, AI_UNAVAILABLE.\n\n**Who:** Supervisors and admins.", "operationId": "postAiImprove-text", "security": [ { "bearerAuth": [] } ], "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "text": { "type": "string", "minLength": 3, "maxLength": 8000 }, "mode": { "default": "improve", "type": "string", "enum": [ "improve", "shorter", "fix" ] }, "where": { "default": "description", "type": "string", "enum": [ "description", "banner", "message" ] } }, "required": [ "text" ] } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "output": { "type": "object", "properties": { "text": { "type": "string" }, "changes": { "type": "array", "items": { "type": "string" } } }, "required": [ "text", "changes" ], "additionalProperties": false }, "status": { "type": "object", "properties": { "enabled": { "type": "boolean", "description": "false: hide the AI buttons (the licence has no AI, or the site isn't connected to the Hub)" }, "capReached": { "type": "boolean", "description": "true: show the buttons disabled until `renewsOn`" }, "available": { "type": "boolean", "description": "false: the Hub couldn't be reached just now" }, "usedPercent": { "type": "number", "description": "How much of this month's allowance is used (0–100)" }, "usedInputTokens": { "anyOf": [ { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, { "type": "null" } ], "description": "Input tokens used this month by all the church's products (null from a Hub before 2.0.1)" }, "usedOutputTokens": { "anyOf": [ { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, { "type": "null" } ], "description": "Output tokens used this month" }, "capInputTokens": { "anyOf": [ { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, { "type": "null" } ], "description": "About how many input tokens the monthly allowance holds, if half of it went on input (an estimate: cached prompts cost less)" }, "capOutputTokens": { "anyOf": [ { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, { "type": "null" } ], "description": "About how many output tokens the allowance holds, if half of it went on output" }, "renewsOn": { "description": "YYYY-MM-DD", "type": [ "string", "null" ] }, "helpers": { "type": "object", "properties": { "draft_event": { "type": "boolean" }, "summarise_report": { "type": "boolean" }, "draft_message": { "type": "boolean" }, "summarise_feedback": { "type": "boolean" }, "improve_text": { "type": "boolean" } }, "required": [ "draft_event", "summarise_report", "draft_message", "summarise_feedback", "improve_text" ], "additionalProperties": false, "description": "Each helper switched on or off in Site settings → AI" } }, "required": [ "enabled", "capReached", "available", "usedPercent", "usedInputTokens", "usedOutputTokens", "capInputTokens", "capOutputTokens", "renewsOn", "helpers" ], "additionalProperties": false } }, "required": [ "output", "status" ], "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" } } } } } } }, "/feedback": { "get": { "tags": [ "Feedback" ], "summary": "Every event with a feedback form", "description": "Newest event first, with how many were asked and answered, and the average star rating.\n\n**Who:** Supervisors and admins.", "operationId": "getFeedback", "security": [ { "bearerAuth": [] } ], "parameters": [], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "array", "items": { "type": "object", "properties": { "event": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 64 }, "title": { "type": "string" }, "startDate": {}, "endDate": {} }, "required": [ "id", "title", "startDate", "endDate" ], "additionalProperties": false }, "status": { "type": "string", "enum": [ "sent", "scheduled", "not_scheduled" ], "description": "sent, scheduled (a send time is set) or not_scheduled" }, "sendAt": { "anyOf": [ {}, { "type": "null" } ] }, "sentAt": { "anyOf": [ {}, { "type": "null" } ] }, "anonymous": { "type": "boolean" }, "invited": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, "answered": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, "responseRate": { "description": "%", "type": [ "number", "null" ] }, "averageRating": { "description": "Every star rating on the form, 1–5", "type": [ "number", "null" ] }, "lastReminderAt": { "anyOf": [ {}, { "type": "null" } ] } }, "required": [ "event", "status", "sendAt", "sentAt", "anonymous", "invited", "answered", "responseRate", "averageRating", "lastReminderAt" ], "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" } } } } } } }, "/events/{id}/feedback/results": { "get": { "tags": [ "Feedback" ], "summary": "An event's feedback: results, responses and who was asked", "description": "On an anonymous form, responses have no name and `people` is null. Opening a named form's answers is recorded in the access log.\n\n**Who:** Supervisors and admins.", "operationId": "getEventsIdFeedbackResults", "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": { "event": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 64 }, "title": { "type": "string" }, "startDate": {}, "endDate": {} }, "required": [ "id", "title", "startDate", "endDate" ], "additionalProperties": false }, "form": { "type": "object", "properties": { "status": { "type": "string", "enum": [ "sent", "scheduled", "not_scheduled" ], "description": "sent, scheduled (a send time is set) or not_scheduled" }, "sendAt": { "anyOf": [ {}, { "type": "null" } ] }, "sentAt": { "anyOf": [ {}, { "type": "null" } ] }, "audience": { "type": "string", "enum": [ "checked_in", "all" ] }, "anonymous": { "type": "boolean" }, "intro": { "type": [ "string", "null" ] }, "autoReminderAt": { "anyOf": [ {}, { "type": "null" } ], "description": "When the automatic reminder goes (3 days after sending)" }, "autoReminderSent": { "type": "boolean" } }, "required": [ "status", "sendAt", "sentAt", "audience", "anonymous", "intro", "autoReminderAt", "autoReminderSent" ], "additionalProperties": false }, "counts": { "type": "object", "properties": { "invited": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, "answered": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, "notAnswered": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, "responseRate": { "type": [ "number", "null" ] }, "canRemind": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991, "description": "Not answered, and not sent the form or a reminder in the last 24 hours" }, "remindedRecently": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, "waiting": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991, "description": "Would get the form but haven't been sent it yet (e.g. checked in after it went out)" } }, "required": [ "invited", "answered", "notAnswered", "responseRate", "canRemind", "remindedRecently", "waiting" ], "additionalProperties": false }, "averageRating": { "type": [ "number", "null" ] }, "questions": { "type": "array", "items": { "type": "object", "properties": { "fieldId": { "type": "string", "minLength": 1, "maxLength": 64 }, "type": { "type": "string" }, "label": { "type": "string" }, "answered": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, "average": { "type": [ "number", "null" ] }, "distribution": { "type": "array", "items": { "type": "object", "properties": { "label": { "type": "string" }, "value": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 } }, "required": [ "label", "value" ], "additionalProperties": false } }, "counts": { "type": "array", "items": { "type": "object", "properties": { "label": { "type": "string" }, "value": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 } }, "required": [ "label", "value" ], "additionalProperties": false } }, "texts": { "type": "array", "items": { "type": "object", "properties": { "value": { "type": "string" }, "name": { "type": "string" } }, "required": [ "value" ], "additionalProperties": false } } }, "required": [ "fieldId", "type", "label", "answered" ], "additionalProperties": false } }, "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": false } }, "responses": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 64 }, "createdAt": {}, "name": { "type": [ "string", "null" ] }, "answers": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "string" }, "description": "Question id → answer" } }, "required": [ "id", "createdAt", "name", "answers" ], "additionalProperties": false } }, "people": { "anyOf": [ { "type": "array", "items": { "type": "object", "properties": { "userId": { "type": "string", "minLength": 1, "maxLength": 64 }, "name": { "type": "string" }, "email": { "type": [ "string", "null" ] }, "phoneNumber": { "type": [ "string", "null" ] }, "sentAt": {}, "remindedAt": { "anyOf": [ {}, { "type": "null" } ] }, "reminderCount": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, "respondedAt": { "anyOf": [ {}, { "type": "null" } ] }, "canRemind": { "type": "boolean" } }, "required": [ "userId", "name", "email", "phoneNumber", "sentAt", "remindedAt", "reminderCount", "respondedAt", "canRemind" ], "additionalProperties": false } }, { "type": "null" } ] } }, "required": [ "event", "form", "counts", "averageRating", "questions", "fields", "responses", "people" ], "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}/feedback/remind": { "post": { "tags": [ "Feedback" ], "summary": "Remind people who haven't answered", "description": "A fresh link to everyone who hasn't answered, or to `userIds` (named forms only). Nobody is sent the form or a reminder twice within 24 hours. Without `userIds` it also sends the form to anyone who has become eligible since it went out. Answers straight away; the emails go out in the background.\n\n**Who:** Supervisors and admins.", "operationId": "postEventsIdFeedbackRemind", "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": { "description": "Only these people (named forms)", "anyOf": [ { "maxItems": 1000, "type": "array", "items": { "type": "string", "minLength": 1, "maxLength": 64 } }, { "type": "null" } ] } } } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "reminded": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991, "description": "Being reminded" }, "newlyInvited": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991, "description": "Being sent the form for the first time" }, "skipped": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, "queued": { "type": "boolean", "description": "Emails are going out in the background" }, "message": { "type": "string" } }, "required": [ "reminded", "newlyInvited", "skipped", "queued", "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" } } } } } } } }, "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", "UNAVAILABLE", "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" } } } } } } } }