From 7f018707379fdbb4d7b5cc22a76a9502a1d8e3a7 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 22 Oct 2026 14:39:12 +0000 Subject: [PATCH] Document Event Catalogue endpoints (CP-8843) List, get, create and edit Event Catalogues, and get and change who in a project can see one on the Contacts' Portal, in openapi.yaml and as endpoint cards. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01Kb53VjmH6L7V4rP11W22KD --- openapi.yaml | 353 +++++++++++++++++++++++++++++++++++++++++++++++++++ server.js | 66 ++++++++++ 2 files changed, 419 insertions(+) diff --git a/openapi.yaml b/openapi.yaml index cfa8fdf..7df0109 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -231,6 +231,8 @@ tags: ever added to a Project through one of its Outcomes. - name: Event Formats description: Event Categories — templates for an organisation's events (e.g. Workshops, Classes, Meetings) + - name: Event Catalogues + description: Public, bookable lists of an organisation's upcoming events, and who can see them on the Contacts' Portal - name: Webhooks description: | HTTPS endpoints an Organisation's admins register to receive signed events when @@ -4055,6 +4057,259 @@ paths: "404": $ref: '#/components/responses/NotFound' + /event_catalogues: + get: + tags: [Event Catalogues] + summary: List an organisation's Event Catalogues + operationId: listEventCatalogues + description: | + Lists an organisation's Event Catalogues, as on the Manage Event Catalogues page. An Event + Catalogue is a public, bookable list of the organisation's upcoming events, chosen by its + filters, at its `public_url` (which can also be embedded on a website). Contacts can also + see a catalogue on their Contacts' Portal, if the project allows it (see **Get who can see + an Event Catalogue in a project**). + + Organisation Admins, Organisation Reporters and Project Managers of the organisation's + projects can list them; anyone else in the organisation gets `403`. + security: [{tokenAuth: []}] + parameters: + - name: charity_id + in: query + required: true + schema: + type: integer + description: The Organisation (Charity) + - $ref: '#/components/parameters/Page' + - $ref: '#/components/parameters/PerPage' + - $ref: '#/components/parameters/LastSyncDatetime' + responses: + "200": + description: Paginated list of Event Catalogues, by name + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedEventCatalogues' + "401": + $ref: '#/components/responses/Unauthorized' + "403": + $ref: '#/components/responses/EventCatalogueForbidden' + "404": + $ref: '#/components/responses/NotFound' + post: + tags: [Event Catalogues] + summary: Create an Event Catalogue + operationId: createEventCatalogue + description: | + Creates an Event Catalogue, as **New Event Catalogue** on the Manage Event Catalogues page + does. Organisation Admins and Project Managers of the organisation's projects may. + + A catalogue only ever shows events that haven't started yet, that have a Signup Page and + whose listing is turned on, and that match `filters`. With no filters it shows every such + event in the organisation. + security: [{tokenAuth: []}] + requestBody: + required: true + content: + application/json: + schema: + type: object + required: [charity_id, name] + properties: + charity_id: + type: integer + name: + type: string + filters: + $ref: '#/components/schemas/EventCatalogueFilters' + example: + charity_id: 123 + name: "Drop-ins" + filters: + project_ids: [301] + event_category_ids: [4530] + responses: + "201": + description: The Event Catalogue was created + content: + application/json: + schema: + $ref: '#/components/schemas/EventCatalogueDetail' + "401": + $ref: '#/components/responses/Unauthorized' + "403": + $ref: '#/components/responses/EventCatalogueForbidden' + "404": + $ref: '#/components/responses/NotFound' + "422": + $ref: '#/components/responses/UnprocessableEntityList' + + /event_catalogues/{id}: + get: + tags: [Event Catalogues] + summary: Get an Event Catalogue + operationId: getEventCatalogue + description: | + Reads one Event Catalogue, with `upcoming_events_count`, the number of events its public + page shows now. Same permissions as **List an organisation's Event Catalogues**; a + catalogue of an organisation you are not in returns `404`. + security: [{tokenAuth: []}] + parameters: + - $ref: '#/components/parameters/ResourceId' + responses: + "200": + description: The Event Catalogue + content: + application/json: + schema: + $ref: '#/components/schemas/EventCatalogueDetail' + example: + id: 77 + name: "Drop-ins" + charity_id: 123 + filters: + project_ids: [301] + public_url: "https://makerble.com/events-catalogue/Zx9s1Qk2vB7nT4pR" + created_at: "2026-10-22T12:00:00.000Z" + updated_at: "2026-10-22T12:00:00.000Z" + upcoming_events_count: 9 + "401": + $ref: '#/components/responses/Unauthorized' + "403": + $ref: '#/components/responses/EventCatalogueForbidden' + "404": + $ref: '#/components/responses/NotFound' + patch: + tags: [Event Catalogues] + summary: Edit an Event Catalogue + operationId: updateEventCatalogue + description: | + Renames an Event Catalogue or replaces its filters. Give only what changes; `filters`, + when given, replaces them all. Its `public_url` stays the same. Same permissions as + **Create an Event Catalogue**. + security: [{tokenAuth: []}] + parameters: + - $ref: '#/components/parameters/ResourceId' + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + name: + type: string + filters: + $ref: '#/components/schemas/EventCatalogueFilters' + example: + name: "Evening drop-ins" + responses: + "200": + description: The Event Catalogue was changed + content: + application/json: + schema: + $ref: '#/components/schemas/EventCatalogueDetail' + "401": + $ref: '#/components/responses/Unauthorized' + "403": + $ref: '#/components/responses/EventCatalogueForbidden' + "404": + $ref: '#/components/responses/NotFound' + "422": + $ref: '#/components/responses/UnprocessableEntityList' + + /event_catalogues/{id}/projects/{project_id}/access: + get: + tags: [Event Catalogues] + summary: Get who can see an Event Catalogue in a project + operationId: getEventCatalogueAccess + description: | + Says which of a project's Contacts can see an Event Catalogue on their Contacts' Portal, as + the project's Event Catalogues page shows it: `every_enrolled` (every Contact currently + Enrolled in the project) or `specific` (only the Contacts in `contact_ids`). Project + Managers and Reporters of the project, and the organisation's Admins and Reporters, may + read it. A catalogue that doesn't show the project's events, or isn't the project's + organisation's, returns `404`. + security: [{tokenAuth: []}] + parameters: + - $ref: '#/components/parameters/ResourceId' + - name: project_id + in: path + required: true + schema: + type: integer + responses: + "200": + description: Who can see the catalogue + content: + application/json: + schema: + $ref: '#/components/schemas/EventCatalogueAccess' + example: + event_catalogue_id: 77 + project_id: 301 + mode: specific + contact_ids: [9001, 9002] + "401": + $ref: '#/components/responses/Unauthorized' + "403": + $ref: '#/components/responses/EventCatalogueForbidden' + "404": + $ref: '#/components/responses/NotFound' + patch: + tags: [Event Catalogues] + summary: Change who can see an Event Catalogue in a project + operationId: updateEventCatalogueAccess + description: | + Changes who in a project can see an Event Catalogue on the Contacts' Portal. Only the + project's Project Managers and the organisation's Admins may. Switching to + `every_enrolled` drops the ticked Contacts. Contacts can only be ticked under `specific`, + and must be in the project. + security: [{tokenAuth: []}] + parameters: + - $ref: '#/components/parameters/ResourceId' + - name: project_id + in: path + required: true + schema: + type: integer + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + mode: + type: string + enum: [every_enrolled, specific] + add_contact_ids: + type: array + items: + type: integer + remove_contact_ids: + type: array + items: + type: integer + example: + mode: specific + add_contact_ids: [9001] + responses: + "200": + description: Who can now see the catalogue + content: + application/json: + schema: + $ref: '#/components/schemas/EventCatalogueAccess' + "401": + $ref: '#/components/responses/Unauthorized' + "403": + $ref: '#/components/responses/EventCatalogueForbidden' + "404": + $ref: '#/components/responses/NotFound' + "422": + $ref: '#/components/responses/UnprocessableEntityList' + /library/search: get: tags: [Library] @@ -6955,6 +7210,14 @@ components: description: Also include Indicators from the public library shared by all organisations (default false) responses: + EventCatalogueForbidden: + description: You don't have permission for this organisation's or project's Event Catalogues + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + example: + error: "You don't have permission to manage this organisation's Event Catalogues." EventFormatAdminOnly: description: You are not an Organisation Admin of the organisation that owns the Event Format content: @@ -10767,6 +11030,96 @@ components: type: string enum: [added, already_added, removed] + EventCatalogueFilters: + type: object + description: Which upcoming events the catalogue shows. Every filter given must match. + properties: + project_ids: + type: array + items: + type: integer + event_category_ids: + type: array + items: + type: integer + description: Event Formats + user_ids: + type: array + items: + type: integer + description: Events these users are Event Managers or Workers of + beneficiary_ids: + type: array + items: + type: integer + description: Events these Contacts are guests of + event_types: + type: array + items: + type: string + enum: [one-off, master, subsequent] + date_from: + type: string + nullable: true + description: A date range, "DD/MM/YYYY - DD/MM/YYYY" + + EventCatalogue: + type: object + description: An Event Catalogue, a public, bookable list of an organisation's upcoming events. + properties: + id: + type: integer + name: + type: string + charity_id: + type: integer + filters: + $ref: '#/components/schemas/EventCatalogueFilters' + public_url: + type: string + description: The public page people book from, which can also be embedded on a website + created_at: + type: string + format: date-time + updated_at: + type: string + format: date-time + + EventCatalogueDetail: + allOf: + - $ref: '#/components/schemas/EventCatalogue' + - type: object + properties: + upcoming_events_count: + type: integer + description: How many events its public page shows now + + PaginatedEventCatalogues: + allOf: + - $ref: '#/components/schemas/PaginationEnvelope' + - type: object + properties: + data: + type: array + items: + $ref: '#/components/schemas/EventCatalogue' + + EventCatalogueAccess: + type: object + properties: + event_catalogue_id: + type: integer + project_id: + type: integer + mode: + type: string + enum: [every_enrolled, specific] + contact_ids: + type: array + description: The Contacts ticked, under specific + items: + type: integer + PaginatedEventFormats: allOf: - $ref: '#/components/schemas/PaginationEnvelope' diff --git a/server.js b/server.js index be4a5e7..9252ab7 100644 --- a/server.js +++ b/server.js @@ -954,6 +954,7 @@ function buildDocsPage() { GETEvents GETEvent Formats + GETEvent Catalogues + +
+
Events
+

Event Catalogues

+
+

An Event Catalogue is a public page listing an organisation's upcoming events that people can book onto, at its public_url, which can also be embedded on a website. It shows only events that haven't started, have a Signup Page and have their listing turned on, narrowed by its filters. Organisation Admins, Organisation Reporters and Project Managers can list and read catalogues; Organisation Admins and Project Managers can create and edit them.

+

Contacts can also see a catalogue on their Contacts' Portal. Each project decides who: every Contact enrolled in the project, or only the Contacts ticked. The project's Project Managers and the organisation's Admins can change it.

+
+
+ ${endpointCard("GET", "/event_catalogues", "List an organisation's Event Catalogues", true, [ + { name: "charity_id", type: "integer", required: true, desc: "The Organisation ID" }, + { name: "page", type: "integer", required: false, desc: "Page number" }, + { name: "per_page", type: "integer", required: false, desc: "Records per page" }, + { name: "last_synced_datetime", type: "string", required: false, desc: "ISO 8601 incremental sync" } + ], [ + { code: "200", cls: "response-2xx", desc: "Paginated list by name — each with filters and public_url" }, + { code: "403", cls: "response-4xx", desc: "You can't see this organisation's catalogues" }, + { code: "404", cls: "response-4xx", desc: "Organisation not found, or you are not in it" } + ])} + ${endpointCard("GET", "/event_catalogues/{id}", "Get an Event Catalogue", true, [ + { name: "id", in: "path", type: "integer", required: true, desc: "Event Catalogue ID" } + ], [ + { code: "200", cls: "response-2xx", desc: "The catalogue, with upcoming_events_count" }, + { code: "403", cls: "response-4xx", desc: "You can't see this organisation's catalogues" }, + { code: "404", cls: "response-4xx", desc: "Not found, or belongs to an organisation you are not in" } + ])} + ${endpointCard("POST", "/event_catalogues", "Create an Event Catalogue", true, [ + { name: "charity_id", type: "integer", required: true, desc: "The Organisation that will own it" }, + { name: "name", type: "string", required: true, desc: "e.g. Drop-ins" }, + { name: "filters", type: "object", required: false, desc: "project_ids, event_category_ids, user_ids, beneficiary_ids, event_types, date_from" } + ], [ + { code: "201", cls: "response-2xx", desc: "Created — returns the catalogue with its public_url" }, + { code: "403", cls: "response-4xx", desc: "Not an Organisation Admin or Project Manager" }, + { code: "422", cls: "response-4xx", desc: "errors lists every problem" } + ])} + ${endpointCard("PATCH", "/event_catalogues/{id}", "Edit an Event Catalogue", true, [ + { name: "id", in: "path", type: "integer", required: true, desc: "Event Catalogue ID" }, + { name: "name", type: "string", required: false, desc: "Give only what changes" }, + { name: "filters", type: "object", required: false, desc: "Replaces all its filters" } + ], [ + { code: "200", cls: "response-2xx", desc: "Updated — the public_url stays the same" }, + { code: "403", cls: "response-4xx", desc: "Not an Organisation Admin or Project Manager" }, + { code: "404", cls: "response-4xx", desc: "Not found, or belongs to an organisation you are not in" } + ])} + ${endpointCard("GET", "/event_catalogues/{id}/projects/{project_id}/access", "Get who can see an Event Catalogue in a project", true, [ + { name: "id", in: "path", type: "integer", required: true, desc: "Event Catalogue ID" }, + { name: "project_id", in: "path", type: "integer", required: true, desc: "Project ID" } + ], [ + { code: "200", cls: "response-2xx", desc: "mode (every_enrolled or specific) and the ticked contact_ids" }, + { code: "404", cls: "response-4xx", desc: "Not found, or the catalogue doesn't show this project's events" } + ])} + ${endpointCard("PATCH", "/event_catalogues/{id}/projects/{project_id}/access", "Change who can see an Event Catalogue in a project", true, [ + { name: "id", in: "path", type: "integer", required: true, desc: "Event Catalogue ID" }, + { name: "project_id", in: "path", type: "integer", required: true, desc: "Project ID" }, + { name: "mode", type: "string", required: false, desc: "every_enrolled (drops the ticks) or specific" }, + { name: "add_contact_ids", type: "array", required: false, desc: "Contacts in the project to tick, under specific" }, + { name: "remove_contact_ids", type: "array", required: false, desc: "Contacts to untick" } + ], [ + { code: "200", cls: "response-2xx", desc: "Who can now see it" }, + { code: "403", cls: "response-4xx", desc: "Not a Project Manager of the project or an Organisation Admin" }, + { code: "422", cls: "response-4xx", desc: "e.g. a Contact who isn't in the project, or ticks under every_enrolled" } + ])} +
+
+
Integrations