From ceff8efc34981e622be67c1b7f43645af6b91967 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 24 Nov 2026 15:58:40 +0000 Subject: [PATCH 1/3] Document Add to Calendar email settings on Event Formats CP-7734: send_add_to_calendar_email, allow_guests_to_cancel and cancellation_guest_status_id on create, edit and get Event Format, and the Invited then Cancelled default when guest_status_ids is left out. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01F1a5xrhQAT8SFMXyszw6XB --- openapi.yaml | 38 +++++++++++++++++++++++++++++++++++++- server.js | 14 ++++++++++---- 2 files changed, 47 insertions(+), 5 deletions(-) diff --git a/openapi.yaml b/openapi.yaml index a2a94a1..d5a8673 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -9681,7 +9681,15 @@ paths: description: | Creates an Event Format (Event Category in the API), as **Create Event Format** on the Manage Event Formats page does. Only an **Organisation Admin** of `charity_id` may create one. - Send `guest_status_ids` (the Guest Statuses its events use, in order). + Send `guest_status_ids` (the Guest Statuses its events use, in order). If you leave it out, the + new Event Format gets the organisation's Invited then Cancelled Guest Statuses, where it has them. + + **Add to Calendar email** (all optional): + - `send_add_to_calendar_email`: email each guest (Contact) added to an event of this format, so + they can add it to their calendar. The organisation must have email messaging turned on. + - `allow_guests_to_cancel`: let guests cancel from that email. + - `cancellation_guest_status_id`: the Guest Status a guest who cancels is moved to. Required + when `allow_guests_to_cancel` is true, and must be one of `guest_status_ids`. **Appointment settings** (all optional): - `appointment_type`: `one_to_one`, `group`, or `null` for "Not an appointment" (the default). @@ -9713,6 +9721,9 @@ paths: default_length_minutes: 60 preparation_minutes: 30 debrief_minutes: 30 + send_add_to_calendar_email: true + allow_guests_to_cancel: true + cancellation_guest_status_id: 56 responses: "201": description: The Event Format was created @@ -9808,6 +9819,11 @@ paths: Changes an Event Format's settings, as **Edit** on the Manage Event Formats page does. Only the settings you send change. Only an **Organisation Admin** of its organisation may edit it. + **Add to Calendar email** (all optional): `send_add_to_calendar_email`, `allow_guests_to_cancel` + and `cancellation_guest_status_id`, as on Create. The Guest Status used for cancellations must + stay one of the Event Format's Guest Statuses, so remove it from `guest_status_ids` only after + turning `allow_guests_to_cancel` off. + **Appointment settings** (all optional): - `appointment_type`: `one_to_one`, `group`, or `null` for "Not an appointment" (the default). One-to-one appointments have one guest. @@ -31504,6 +31520,16 @@ components: minimum: 0 maximum: 1440 description: Debrief time a colleague needs after each appointment. Default 0. + send_add_to_calendar_email: + type: boolean + description: Send an 'Add to Calendar' email to each guest (Contact) added to an event of this format. Can only be turned on while the organisation has email messaging turned on. Default false. + allow_guests_to_cancel: + type: boolean + description: Let guests cancel from the 'Add to Calendar' email. Only kept while send_add_to_calendar_email is true. Default false. + cancellation_guest_status_id: + type: integer + nullable: true + description: The Guest Status a guest who cancels is moved to. Required when allow_guests_to_cancel is true, and must be one of the Event Format's own Guest Statuses. null when guests can't cancel. EventFormatDetail: type: object @@ -31565,6 +31591,16 @@ components: minimum: 0 maximum: 1440 description: Debrief time a colleague needs after each appointment. Default 0. + send_add_to_calendar_email: + type: boolean + description: Sends an 'Add to Calendar' email to each guest added to an event of this format + allow_guests_to_cancel: + type: boolean + description: Guests can cancel from the 'Add to Calendar' email + cancellation_guest_status_id: + type: integer + nullable: true + description: The Guest Status a guest who cancels is moved to guest_statuses: type: array items: diff --git a/server.js b/server.js index 1434156..f072e0d 100644 --- a/server.js +++ b/server.js @@ -4654,7 +4654,7 @@ function buildDocsPage() { ${endpointCard("POST", "/event_categories", "Create an Event Format", true, [ { name: "charity_id", in: "body", type: "integer", required: true, desc: "The Organisation the Event Format belongs to" }, { name: "name", in: "body", type: "string", required: true, desc: "Name, e.g. Therapy session" }, - { name: "guest_status_ids", in: "body", type: "integer[]", required: false, desc: "The organisation's Guest Statuses its events use, in order" }, + { name: "guest_status_ids", in: "body", type: "integer[]", required: false, desc: "The organisation's Guest Statuses its events use, in order. If left out, a new Event Format gets Invited then Cancelled" }, { name: "attendance_form_id", in: "body", type: "integer", required: false, desc: "The Survey (Story Category) used to record attendance, or null" }, { name: "survey_kiosk_enabled", in: "body", type: "boolean", required: false, desc: "Self Check-in" }, { name: "survey_kiosk_registration_enabled", in: "body", type: "boolean", required: false, desc: "Let new people register at Self Check-in" }, @@ -4669,7 +4669,10 @@ function buildDocsPage() { { name: "appointment_type", in: "body", type: "string", required: false, desc: "one_to_one, group, or null for Not an appointment" }, { name: "default_length_minutes", in: "body", type: "integer", required: false, desc: "Usual length, in 5-minute steps up to 1440, or null" }, { name: "preparation_minutes", in: "body", type: "integer", required: false, desc: "Preparation time before each appointment, 0–1440 (default 0)" }, - { name: "debrief_minutes", in: "body", type: "integer", required: false, desc: "Debrief time after each appointment, 0–1440 (default 0)" } + { name: "debrief_minutes", in: "body", type: "integer", required: false, desc: "Debrief time after each appointment, 0–1440 (default 0)" }, + { name: "send_add_to_calendar_email", in: "body", type: "boolean", required: false, desc: "Send an 'Add to Calendar' email to each guest added to an event of this format. Needs the organisation's email messaging turned on" }, + { name: "allow_guests_to_cancel", in: "body", type: "boolean", required: false, desc: "Let guests cancel from that email. Only kept while send_add_to_calendar_email is true" }, + { name: "cancellation_guest_status_id", in: "body", type: "integer", required: false, desc: "The Guest Status a guest who cancels is moved to: one of the Event Format's own. Required when allow_guests_to_cancel is true" } ], [ { code: "201", cls: "response-2xx", desc: "Created — returns the Event Format with its settings" }, { code: "403", cls: "response-4xx", desc: "Not an Organisation Admin of charity_id" }, @@ -4678,7 +4681,7 @@ function buildDocsPage() { ${endpointCard("GET", "/event_categories/{id}", "Get an Event Format", true, [ { name: "id", in: "path", type: "integer", required: true, desc: "Event Format (Event Category) ID" } ], [ - { code: "200", cls: "response-2xx", desc: "The Event Format with its settings, Guest Statuses, project_ids and appointment settings" }, + { code: "200", cls: "response-2xx", desc: "The Event Format with its settings, Guest Statuses, project_ids, appointment settings and Add to Calendar email settings" }, { code: "403", cls: "response-4xx", desc: "Not an Organisation Admin of the owning organisation" }, { code: "404", cls: "response-4xx", desc: "Not found, or belongs to an organisation you are not in" } ])} @@ -4700,7 +4703,10 @@ function buildDocsPage() { { name: "appointment_type", in: "body", type: "string", required: false, desc: "one_to_one, group, or null for Not an appointment" }, { name: "default_length_minutes", in: "body", type: "integer", required: false, desc: "Usual length, in 5-minute steps up to 1440, or null" }, { name: "preparation_minutes", in: "body", type: "integer", required: false, desc: "Preparation time before each appointment, 0–1440 (default 0)" }, - { name: "debrief_minutes", in: "body", type: "integer", required: false, desc: "Debrief time after each appointment, 0–1440 (default 0)" } + { name: "debrief_minutes", in: "body", type: "integer", required: false, desc: "Debrief time after each appointment, 0–1440 (default 0)" }, + { name: "send_add_to_calendar_email", in: "body", type: "boolean", required: false, desc: "Send an 'Add to Calendar' email to each guest added to an event of this format. Needs the organisation's email messaging turned on" }, + { name: "allow_guests_to_cancel", in: "body", type: "boolean", required: false, desc: "Let guests cancel from that email. Only kept while send_add_to_calendar_email is true" }, + { name: "cancellation_guest_status_id", in: "body", type: "integer", required: false, desc: "The Guest Status a guest who cancels is moved to: one of the Event Format's own. Required when allow_guests_to_cancel is true" } ], [ { code: "200", cls: "response-2xx", desc: "Edited — only the settings sent change" }, { code: "403", cls: "response-4xx", desc: "Not an Organisation Admin of the owning organisation" }, From afe651495bb55512fe33cdf02353f27cf2db35d6 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 24 Nov 2026 20:46:18 +0000 Subject: [PATCH 2/3] Document a guest's Add to Calendar links endpoint CP-7734: GET /events/{id}/guests/{contact_id}/calendar_links. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01F1a5xrhQAT8SFMXyszw6XB --- openapi.yaml | 65 ++++++++++++++++++++++++++++++++++++++++++++++++++++ server.js | 7 ++++++ 2 files changed, 72 insertions(+) diff --git a/openapi.yaml b/openapi.yaml index 5591cc7..554332c 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -11376,6 +11376,46 @@ paths: "422": $ref: '#/components/responses/UnprocessableEntityList' + /events/{id}/guests/{contact_id}/calendar_links: + get: + tags: [Events] + summary: Get a guest's Add to Calendar links + operationId: getEventGuestCalendarLinks + description: | + The links a guest (Contact) uses to put the event in their own calendar, the same ones + their Personal Portal and the Add to Calendar email give them: Google Calendar, Outlook.com + and Microsoft 365 links that open a new, filled-in event, and an .ics file for Apple Calendar + and any other calendar app. `cancel_url` is the page where the guest can cancel their booking, + or null when the event's Event Format doesn't let guests cancel. + + The `.ics` and cancel links work without signing in and belong to this one guest, so send them + only to that guest. Anyone who can open the event page can get them. A Contact who isn't a + guest of the event returns `404`. + security: [{tokenAuth: []}] + parameters: + - $ref: '#/components/parameters/ResourceId' + - { name: contact_id, in: path, required: true, schema: { type: integer }, description: "The guest's Contact (beneficiary) id" } + responses: + "200": + description: The guest's calendar links + content: + application/json: + schema: { $ref: '#/components/schemas/EventGuestCalendarLinks' } + example: + event_id: 881 + contact_id: 5521 + google_calendar_url: "https://calendar.google.com/calendar/render?action=TEMPLATE&dates=20300108T180000Z%2F20300108T200000Z&text=Pottery+taster" + outlook_url: "https://outlook.live.com/calendar/0/action/compose?path=%2Fcalendar%2Faction%2Fcompose&rru=addevent&subject=Pottery+taster" + office365_url: "https://outlook.office.com/calendar/0/action/compose?path=%2Fcalendar%2Faction%2Fcompose&rru=addevent&subject=Pottery+taster" + ics_url: "https://www.makerble.com/event-bookings/eyJfcmFpbHMi...--abc123/calendar.ics" + cancel_url: "https://www.makerble.com/event-bookings/eyJfcmFpbHMi...--abc123" + "401": + $ref: '#/components/responses/Unauthorized' + "403": + $ref: '#/components/responses/ForbiddenError' + "404": + $ref: '#/components/responses/NotFound' + /events/{id}/staff: get: tags: [Events] @@ -31550,6 +31590,31 @@ components: nullable: true description: The Guest Status a guest who cancels is moved to. Required when allow_guests_to_cancel is true, and must be one of the Event Format's own Guest Statuses. null when guests can't cancel. + EventGuestCalendarLinks: + type: object + description: A guest's Add to Calendar links (CP-7734). + properties: + event_id: + type: integer + contact_id: + type: integer + google_calendar_url: + type: string + description: Opens a new Google Calendar event with this event's name, times and location filled in + outlook_url: + type: string + description: The same for Outlook.com + office365_url: + type: string + description: The same for Microsoft 365 (Outlook on the web for work or school accounts) + ics_url: + type: string + description: The event as an .ics file, for Apple Calendar and other calendar apps. Works without signing in, for this guest only. + cancel_url: + type: string + nullable: true + description: The page where the guest can cancel, or null when the Event Format doesn't let guests cancel. Works without signing in, for this guest only. + EventFormatDetail: type: object description: One Event Format (Event Category in the API) with its settings. diff --git a/server.js b/server.js index 142eda9..c87ff4a 100644 --- a/server.js +++ b/server.js @@ -4470,6 +4470,13 @@ function buildDocsPage() { { code: "200", cls: "response-2xx", desc: "event_id and guests_count" }, { code: "422", cls: "response-4xx", desc: "Not a guest of this event" } ])} + ${endpointCard("GET", "/events/{id}/guests/{contact_id}/calendar_links", "Get a guest's Add to Calendar links", true, [ + { name: "id", in: "path", type: "integer", required: true, desc: "Event ID" }, + { name: "contact_id", in: "path", type: "integer", required: true, desc: "The guest's Contact (beneficiary) ID" } + ], [ + { code: "200", cls: "response-2xx", desc: "google_calendar_url, outlook_url, office365_url, ics_url and cancel_url (null when the Event Format doesn't let guests cancel). The .ics and cancel links work without signing in, for this guest only" }, + { code: "404", cls: "response-4xx", desc: "Not a guest of this event, or an event you can't see" } + ])} ${endpointCard("GET", "/events/{id}/staff", "List an event's Event Managers and Workers", true, [ { name: "id", in: "path", type: "integer", required: true, desc: "Event ID" }, { name: "page / per_page", type: "integer", required: false, desc: "Pagination" } From a1184c457d03d393a74b5740ab15f161a9752482 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 24 Nov 2026 20:49:52 +0000 Subject: [PATCH 3/3] Document your notification settings endpoints CP-7734: GET and PATCH /users/notification_settings. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01F1a5xrhQAT8SFMXyszw6XB --- openapi.yaml | 76 ++++++++++++++++++++++++++++++++++++++++++++++++++++ server.js | 9 +++++++ 2 files changed, 85 insertions(+) diff --git a/openapi.yaml b/openapi.yaml index 554332c..b89c192 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -645,6 +645,64 @@ paths: "422": $ref: '#/components/responses/UnprocessableEntity' + /users/notification_settings: + get: + tags: [Users] + summary: Get your notification settings + operationId: getUserNotificationSettings + description: | + Your own email notification settings, as on the **Notifications** tab of **User Settings**: + each setting's `key`, its `label` as the tab shows it, and whether it is `enabled`. Settings you + have never changed show their default. There is no user id: you can only see your own. + security: [{tokenAuth: []}] + responses: + "200": + description: Your notification settings + content: + application/json: + schema: { $ref: '#/components/schemas/UserNotificationSettings' } + example: + data: + - { key: event_guest_cancelled, label: When an event guest cancels, enabled: true } + - { key: someone_tags_me, label: Someone tags me, enabled: true } + "401": + $ref: '#/components/responses/Unauthorized' + patch: + tags: [Users] + summary: Change your notification settings + operationId: updateUserNotificationSettings + description: | + Turns your own email notifications on or off, as ticking or unticking them on the + **Notifications** tab of **User Settings** does. Only the settings you send change. For example, + `event_guest_cancelled: false` stops the email you get when a guest at one of your events + cancels. An unknown key, or a value that isn't true or false, returns `422` and changes nothing. + security: [{tokenAuth: []}] + requestBody: + required: true + content: + application/json: + schema: + type: object + required: [settings] + properties: + settings: + type: object + description: Setting keys (from GET) and true or false + additionalProperties: { type: boolean } + example: + settings: + event_guest_cancelled: false + responses: + "200": + description: All your notification settings, after the change + content: + application/json: + schema: { $ref: '#/components/schemas/UserNotificationSettings' } + "401": + $ref: '#/components/responses/Unauthorized' + "422": + $ref: '#/components/responses/UnprocessableEntityList' + /users/{id}: get: tags: [Users] @@ -31615,6 +31673,24 @@ components: nullable: true description: The page where the guest can cancel, or null when the Event Format doesn't let guests cancel. Works without signing in, for this guest only. + UserNotificationSettings: + type: object + description: A user's own email notification settings (CP-7734). + properties: + data: + type: array + items: + type: object + properties: + key: + type: string + description: The setting, e.g. event_guest_cancelled + label: + type: string + description: The setting as the Notifications tab of User Settings shows it + enabled: + type: boolean + EventFormatDetail: type: object description: One Event Format (Event Category in the API) with its settings. diff --git a/server.js b/server.js index c87ff4a..1bec0d9 100644 --- a/server.js +++ b/server.js @@ -1717,6 +1717,15 @@ function buildDocsPage() { { code: "200", cls: "response-2xx", desc: "Paginated list of Users" }, { code: "401", cls: "response-4xx", desc: "Not authenticated" } ])} + ${endpointCard("GET", "/users/notification_settings", "Get your notification settings", true, [], [ + { code: "200", cls: "response-2xx", desc: "data: each setting's key, its label on the Notifications tab of User Settings, and enabled" } + ])} + ${endpointCard("PATCH", "/users/notification_settings", "Change your notification settings", true, [ + { name: "settings", in: "body", type: "object", required: true, desc: "Setting keys and true or false, e.g. {\"event_guest_cancelled\": false}. Only those sent change" } + ], [ + { code: "200", cls: "response-2xx", desc: "All your notification settings, after the change" }, + { code: "422", cls: "response-4xx", desc: "An unknown setting, or a value that isn't true or false. Nothing changes" } + ])} ${endpointCard("GET", "/users/{id}", "Get a single User", true, [ { name: "id", in: "path", type: "integer", required: true, desc: "User ID" } ], [