From e304ceefb3b0e41780bcb1089f946a23e8cd670d Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 24 Nov 2026 01:41:36 +0000 Subject: [PATCH] Document the onboarding endpoints (CP-9305) POST /organisations/{organisation_id}/onboarding_journeys, GET /onboarding_journeys/{id} and GET /onboarding_extras, in openapi.yaml and as endpoint cards on the docs page. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01F1a5xppHqUrg9goQSbszXs --- openapi.yaml | 182 +++++++++++++++++++++++++++++++++++++++++++++++++++ server.js | 38 +++++++++++ 2 files changed, 220 insertions(+) diff --git a/openapi.yaml b/openapi.yaml index 120828e..dab0ab7 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -357,6 +357,12 @@ tags: Seats per Colleague: which seat each colleague holds on each of an Organisation's current Contracts, and changing one. A colleague's roles decide the lowest seat (Billing Role) they need on Role-based Pricing. Only the Organisation's admins can change seats. + - name: Onboarding + description: | + Setting up an area of work (a programme or service) for an Organisation, as the onboarding + journey does after an Organisation is created: workspaces with a Toolkit installed, extra + workspaces such as Referrals or Volunteers, and a Checklist (participant journey) for the + area's contacts. Charity Editors and Charity Reporters of the Organisation can use it. - name: Setup guide description: | An Organisation's Setup guide: the main things to set up in Makerble, how far each has got, @@ -18718,6 +18724,167 @@ paths: "404": $ref: '#/components/responses/NotFound' + /organisations/{organisation_id}/onboarding_journeys: + parameters: + - $ref: '#/components/parameters/OrganisationId' + post: + tags: [Onboarding] + summary: Set up an area of work from a Toolkit + description: | + Sets up an area of work as the onboarding journey's "Start from a toolkit designed for an + organisation like mine" path does, with the same checks: one workspace (Project) per name in + `workspace_names` with the Toolkit installed, one workspace per extra in `extra_ids` with that + extra's Project Type (see GET /onboarding_extras), and a Checklist that every contact in the + area's workspaces gets. + + `spacing` says how the area is split into workspaces: `facilitator` (one per coach, mentor or + practitioner), `site` (one per location), `cohort` (one per intake of a group or class) or + `single` (one workspace, named after the area of work when `workspace_names` is empty). Up to + 50 workspace names of up to 100 characters each. `toolkit_id` must be a listed Toolkit. + + The workspaces are made in the background, so this answers 202 with `status: building`. Ask + GET /onboarding_journeys/{id} until `status` is `completed` (then `workspace_ids` and + `checklist_id` are filled in) or `failed` (nothing was made). Needs a Charity Editor or Charity + Reporter of the Organisation. + operationId: createOnboardingJourney + security: [{tokenAuth: []}] + requestBody: + required: true + content: + application/json: + schema: + type: object + required: [area_of_work, toolkit_id, spacing] + properties: + area_of_work: + type: string + maxLength: 100 + toolkit_id: + type: integer + spacing: + type: string + enum: [facilitator, site, cohort, single] + workspace_names: + type: array + maxItems: 50 + items: + type: string + maxLength: 100 + extra_ids: + type: array + items: + type: integer + example: + area_of_work: Youth mentoring + toolkit_id: 62 + spacing: site + workspace_names: [Leeds, York] + extra_ids: [1, 4] + responses: + "202": + description: The set-up, building in the background + content: + application/json: + schema: + $ref: '#/components/schemas/OnboardingJourney' + example: + id: 318 + organisation_id: 42 + area_of_work: Youth mentoring + toolkit_id: 62 + spacing: site + workspace_names: [Leeds, York] + extra_ids: [1, 4] + status: building + workspace_ids: [] + checklist_id: null + created_at: "2026-11-24T10:15:00Z" + completed_at: null + "401": + $ref: '#/components/responses/Unauthorized' + "403": + $ref: '#/components/responses/Forbidden' + "404": + $ref: '#/components/responses/NotFound' + "422": + $ref: '#/components/responses/UnprocessableEntity' + /onboarding_journeys/{id}: + parameters: + - name: id + in: path + required: true + description: The set-up's id, from POST /organisations/{organisation_id}/onboarding_journeys. + schema: + type: integer + get: + tags: [Onboarding] + summary: Get an area of work set-up + description: | + How a set-up is going: `status` is `building`, `completed` or `failed`. Once completed, + `workspace_ids` lists the workspaces (Projects) it made, the area's own first, then the + extras', and `checklist_id` is its Checklist. Only the person who set it up can see it. + operationId: getOnboardingJourney + security: [{tokenAuth: []}] + responses: + "200": + description: The set-up + content: + application/json: + schema: + $ref: '#/components/schemas/OnboardingJourney' + example: + id: 318 + organisation_id: 42 + area_of_work: Youth mentoring + toolkit_id: 62 + spacing: site + workspace_names: [Leeds, York] + extra_ids: [1, 4] + status: completed + workspace_ids: [901, 902, 903, 904] + checklist_id: 77 + created_at: "2026-11-24T10:15:00Z" + completed_at: "2026-11-24T10:15:20Z" + "401": + $ref: '#/components/responses/Unauthorized' + "404": + $ref: '#/components/responses/NotFound' + /onboarding_extras: + get: + tags: [Onboarding] + summary: List the extra workspaces an area of work can have + description: | + The extras offered on the onboarding journey's Add extras step, in order: Referrals, Parents, + Referees, Volunteers, Fundraising and any others Makerble offers. Each one makes a workspace + with its own Project Type. Pass their ids as `extra_ids` when setting up an area of work. + operationId: listOnboardingExtras + security: [{tokenAuth: []}] + parameters: + - $ref: '#/components/parameters/Page' + - $ref: '#/components/parameters/PerPage' + responses: + "200": + description: The extras offered + content: + application/json: + example: + page: 1 + page_size: 2 + page_count: 1 + total_count: 2 + data: + - id: 1 + name: Referrals + description: Take in referrals from other organisations and professionals. + project_type_id: 12 + project_type_name: Referrals + - id: 4 + name: Volunteers + description: Recruit, support and keep track of your volunteers. + project_type_id: null + project_type_name: null + "401": + $ref: '#/components/responses/Unauthorized' /organisations/{organisation_id}/setup_guide: parameters: - $ref: '#/components/parameters/OrganisationId' @@ -21320,6 +21487,21 @@ components: error: "Webhooks are not turned on for this organisation" schemas: + OnboardingJourney: + type: object + properties: + id: {type: integer} + organisation_id: {type: integer} + area_of_work: {type: string} + toolkit_id: {type: integer, nullable: true} + spacing: {type: string, enum: [facilitator, site, cohort, single], nullable: true} + workspace_names: {type: array, items: {type: string}} + extra_ids: {type: array, items: {type: integer}} + status: {type: string, enum: [in_progress, exited, building, failed, completed]} + workspace_ids: {type: array, items: {type: integer}} + checklist_id: {type: integer, nullable: true} + created_at: {type: string, format: date-time} + completed_at: {type: string, format: date-time, nullable: true} SetupGuide: type: object properties: diff --git a/server.js b/server.js index 3e084ac..9305e4c 100644 --- a/server.js +++ b/server.js @@ -991,6 +991,7 @@ function buildDocsPage() { POSTAI assistant link GETSeats GETUsage + POSTOnboarding GETSetup guide POSTAnnouncements POSTWishlist @@ -5067,6 +5068,43 @@ function buildDocsPage() { + +
+
Organisation
+

Onboarding

+
+

Set up an area of work (a programme or service) for an Organisation, as the onboarding journey does after an Organisation is created: one workspace per name with a Toolkit installed, extra workspaces such as Referrals or Volunteers, each with its own Project Type, and a Checklist (participant journey) that every contact in the area's workspaces gets.

+

spacing says how the area is split into workspaces: facilitator, site, cohort or single. The workspaces are made in the background: POST answers 202 with status: building; ask GET until it is completed or failed. Charity Editors and Charity Reporters of the Organisation can use it.

+
+
+ ${endpointCard("POST", "/organisations/{organisation_id}/onboarding_journeys", "Set up an area of work from a Toolkit", true, [ + { name: "organisation_id", in: "path", type: "integer", required: true, desc: "The Organisation (Charity) ID" }, + { name: "area_of_work", in: "body", type: "string", required: true, desc: "The area of work's name, up to 100 characters" }, + { name: "toolkit_id", in: "body", type: "integer", required: true, desc: "A listed Toolkit, installed into each of the area's workspaces" }, + { name: "spacing", in: "body", type: "string", required: true, desc: "facilitator, site, cohort or single" }, + { name: "workspace_names", in: "body", type: "array", required: false, desc: "One name per workspace, up to 50. For single, the area of work's name when empty" }, + { name: "extra_ids", in: "body", type: "array", required: false, desc: "Extras from GET /onboarding_extras" } + ], [ + { code: "202", cls: "response-2xx", desc: "The set-up, with status building" }, + { code: "403", cls: "response-4xx", desc: "Not a Charity Editor or Charity Reporter of this Organisation" }, + { code: "404", cls: "response-4xx", desc: "No such Organisation" }, + { code: "422", cls: "response-4xx", desc: "A missing name, unknown spacing, unlisted Toolkit or too many workspaces; nothing is saved" } + ])} + ${endpointCard("GET", "/onboarding_journeys/{id}", "Get an area of work set-up", true, [ + { name: "id", in: "path", type: "integer", required: true, desc: "The set-up's ID" } + ], [ + { code: "200", cls: "response-2xx", desc: "status (building, completed or failed), the answers, and once completed workspace_ids and checklist_id" }, + { code: "404", cls: "response-4xx", desc: "No such set-up, or someone else's" } + ])} + ${endpointCard("GET", "/onboarding_extras", "List the extra workspaces an area of work can have", true, [ + { name: "page", in: "query", type: "integer", required: false, desc: "Page number (default 1)" }, + { name: "per_page", in: "query", type: "integer", required: false, desc: "Records per page (default 10, max 200)" } + ], [ + { code: "200", cls: "response-2xx", desc: "page, page_size, page_count, total_count and data: each extra's id, name, description, project_type_id and project_type_name" } + ])} +
+
+
Organisation