From 6f6634a02b7726469d5ca0a07fdaed355397284e Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 5 Oct 2026 09:42:32 +0000 Subject: [PATCH 01/15] Document story_category_ids on story_category_response Rename the Survey filter to story_category_ids and describe the accepted ID list formats, the story_category_id alias and the access filtering. Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_017EknMb1u3jr8AEMujZxjZu --- openapi.yaml | 16 ++++++++++------ server.js | 4 ++-- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/openapi.yaml b/openapi.yaml index 4ead4ba..51f183b 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -965,16 +965,20 @@ paths: parameters: - $ref: '#/components/parameters/Page' - $ref: '#/components/parameters/PerPage' - - name: story_category_id + - name: story_category_ids in: query schema: - type: integer - description: Filter by a specific Survey - - name: "project_ids[]" + type: string + description: >- + Filter by one or more Surveys (Story Categories). Accepts a JSON array (`[1,2]`), a repeated + array parameter (`story_category_ids[]=1&story_category_ids[]=2`), a comma-separated list (`1,2`) + or a single ID. Only Surveys the authenticated user can access are returned; any others are + ignored. `story_category_id` is also accepted as an alias. + - name: project_ids in: query schema: - type: integer - description: Filter by Project ID (repeat for multiple) + type: string + description: Filter by one or more Project IDs. Accepts the same formats as `story_category_ids`. - name: start_date in: query schema: diff --git a/server.js b/server.js index 123e3ff..a7884aa 100644 --- a/server.js +++ b/server.js @@ -1349,8 +1349,8 @@ function buildDocsPage() {

Use story_indicator_beneficiaries for indicator responses, story_changes for metric totals, and custom_fields for survey text/date/time fields.

For binary indicators: include binray_indicator_value: "on" if ticked — omit the record entirely if not ticked. Activity Changes cannot be tagged to individual Contacts.`)} ${endpointCard("GET", "/stories/story_category_response", "Get Stories with full survey response detail", true, [ - { name: "story_category_id", type: "integer", required: false, desc: "Filter by Survey" }, - { name: "project_ids[]", type: "integer", required: false, desc: "Filter by Project ID (repeat for multiple)" }, + { name: "story_category_ids", type: "string", required: false, desc: "Filter by one or more Surveys. Accepts a JSON array, repeated story_category_ids[] params, a comma-separated list or a single ID. Only Surveys you can access are returned. story_category_id is accepted as an alias" }, + { name: "project_ids", type: "string", required: false, desc: "Filter by one or more Project IDs. Same formats as story_category_ids" }, { name: "start_date", type: "string", required: false, desc: "YYYY-MM-DD — stories on or after this date" }, { name: "end_date", type: "string", required: false, desc: "YYYY-MM-DD — stories on or before this date" } ], [{ code: "200", cls: "response-2xx", desc: "Stories enriched with named Indicators, Changes, and Custom Field values — ideal for reporting" }])} From aa9c39cecec603329789c3e5035e67dd4985be67 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 11 Oct 2026 18:42:54 +0000 Subject: [PATCH 02/15] Document connecting an app with OAuth 2.0 (CP-8727) Add the OAuth 2.0 authorisation code flow for connected apps: an oauth2 security scheme (offered alongside tokenAuth on the operations connected apps can call), a "Connecting an app with OAuth 2.0" section, and POST /oauth/token and /oauth/revoke, which live at the site root rather than /api/v2. Add the same section and endpoint cards to the hand-written docs page. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01AELZRxYpR5ytpy4ZGTu8Td --- openapi.yaml | 180 +++++++++++++++++++++++++++++++++++++++++++-------- server.js | 47 ++++++++++++++ 2 files changed, 201 insertions(+), 26 deletions(-) diff --git a/openapi.yaml b/openapi.yaml index 8a699a0..a809a6d 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -22,6 +22,22 @@ info: > **Multi-user integrations:** If activity must be attributed to specific users, authenticate separately per user. A single Organisation Admin token is acceptable when attribution to one admin is sufficient. + ## Connecting an app with OAuth 2.0 + Apps published for other people to use, such as marketplace connectors, connect with OAuth 2.0 instead of asking for a password. The user signs in to Makerble, chooses which of their organisations (Charities) the app may use, and selects **Allow**. The app then calls the API as that user, limited to that organisation. + + 1. **Get a client ID and secret.** Makerble registers client applications; email [api-key-request@makerble.com](mailto:api-key-request@makerble.com) with your app's name and its exact redirect URI (https only). There is no self-service registration. + 2. **Send the user to** `GET https://makerble.com/oauth/authorize?response_type=code&client_id=…&redirect_uri=…&scope=api&state=…`. Makerble shows the consent screen, then redirects to your redirect URI with `?code=…&state=…`, or `?error=access_denied` if the user cancels. A redirect URI that isn't registered for your app is refused without redirecting. + 3. **Exchange the code** at `POST https://makerble.com/oauth/token` with `grant_type=authorization_code`. The code works once and expires after 10 minutes. + 4. **Call the API** with `Authorization: Bearer `. Don't send `X-User-Email`/`X-User-Token` as well. Tokens are only read from the `Authorization` header. + 5. **Refresh** at `POST https://makerble.com/oauth/token` with `grant_type=refresh_token`. Access tokens last 1 hour. Refresh tokens don't expire, but each refresh returns a new refresh token: always store the latest one. + + | Situation | Response | + |---|---| + | Token expired, revoked, or the user is no longer in the connected organisation | `401 {"error":"invalid_token"}` | + | Endpoint not yet available to connected apps | `403 {"error":"not_available_to_connected_apps"}` | + + A connected app sees only the organisation the user chose, with that user's permissions there. It can call the operations that list `oauth2` under Security; more are added as they are reviewed. Users and Organisation Admins can disconnect an app at any time from **Settings → Connected Apps**, and it stops working straight away. The scope is always `api`. + ## Creating Users via the API `POST /users` requires a separate API Key (`auth_code`). Request one at [api-key-request@makerble.com](mailto:api-key-request@makerble.com). @@ -184,12 +200,111 @@ paths: "401": $ref: '#/components/responses/Unauthorized' + /oauth/token: + servers: + - url: https://makerble.com + description: Production (OAuth endpoints are not under /api/v2) + - url: https://staging.makerble.com + description: Staging + post: + tags: [Authentication] + summary: Exchange an authorisation code, or refresh an access token (OAuth 2.0) + description: | + For apps connected with OAuth 2.0. Exchange the `code` from the consent screen for an + access token and refresh token, or swap a refresh token for a new pair. Authenticate + the app with `client_id` and `client_secret` in the body, or with HTTP Basic auth. + Access tokens last 1 hour (`expires_in: 3600`). Each refresh returns a new refresh + token; store the latest one. + operationId: createOauthToken + requestBody: + required: true + content: + application/x-www-form-urlencoded: + schema: + type: object + required: [grant_type, client_id, client_secret] + properties: + grant_type: + type: string + enum: [authorization_code, refresh_token] + code: + type: string + description: Required for `authorization_code`. Works once; expires after 10 minutes. + redirect_uri: + type: string + description: Required for `authorization_code`; must match the one used on `/oauth/authorize`. + refresh_token: + type: string + description: Required for `refresh_token`. + client_id: + type: string + client_secret: + type: string + example: + grant_type: authorization_code + code: "Zx1...code" + redirect_uri: https://global.consent.azure-apim.net/redirect + client_id: "your-client-id" + client_secret: "your-client-secret" + responses: + "200": + description: Tokens issued + content: + application/json: + example: + access_token: "kq3...access" + token_type: Bearer + expires_in: 3600 + refresh_token: "9Lm...refresh" + scope: api + created_at: 1791726153 + "400": + description: Invalid, expired or already-used code or refresh token (`{"error":"invalid_grant"}`) + "401": + description: Unknown client or wrong client secret (`{"error":"invalid_client"}`) + + /oauth/revoke: + servers: + - url: https://makerble.com + description: Production (OAuth endpoints are not under /api/v2) + - url: https://staging.makerble.com + description: Staging + post: + tags: [Authentication] + summary: Revoke an access or refresh token (OAuth 2.0) + description: | + For apps connected with OAuth 2.0, e.g. when the user disconnects from inside your app. + Revoking either token of a pair stops both working. Always returns 200, even for an + unknown token. + operationId: revokeOauthToken + requestBody: + required: true + content: + application/x-www-form-urlencoded: + schema: + type: object + required: [token, client_id, client_secret] + properties: + token: + type: string + client_id: + type: string + client_secret: + type: string + example: + token: "9Lm...refresh" + client_id: "your-client-id" + client_secret: "your-client-secret" + responses: + "200": + description: Token revoked (or already invalid) + /users: get: tags: [Users] summary: List all Users operationId: listUsers - security: [{tokenAuth: []}] + security: [{tokenAuth: []}, {oauth2: [api]}] parameters: - $ref: '#/components/parameters/Page' - $ref: '#/components/parameters/PerPage' @@ -284,7 +399,7 @@ paths: tags: [Users] summary: Get a single User operationId: getUser - security: [{tokenAuth: []}] + security: [{tokenAuth: []}, {oauth2: [api]}] parameters: - $ref: '#/components/parameters/ResourceId' responses: @@ -305,7 +420,7 @@ paths: summary: Get user permissions description: Returns the authenticated user's permissions across all Projects and Organisations. operationId: getUserPermissions - security: [{tokenAuth: []}] + security: [{tokenAuth: []}, {oauth2: [api]}] responses: "200": description: Permissions object @@ -394,7 +509,7 @@ paths: summary: Get a single Organisation description: Returns a single Charity (Organisation). Each Charity owns one or more Projects. operationId: getCharity - security: [{tokenAuth: []}] + security: [{tokenAuth: []}, {oauth2: [api]}] parameters: - $ref: '#/components/parameters/ResourceId' responses: @@ -424,7 +539,7 @@ paths: | Reporter | `reporter` | Changemaker | Create Stories | | Observer | `observer` | Analyst | Read-only | operationId: listProjects - security: [{tokenAuth: []}] + security: [{tokenAuth: []}, {oauth2: [api]}] parameters: - $ref: '#/components/parameters/Page' - $ref: '#/components/parameters/PerPage' @@ -444,7 +559,7 @@ paths: tags: [Projects] summary: Get a single Project operationId: getProject - security: [{tokenAuth: []}] + security: [{tokenAuth: []}, {oauth2: [api]}] parameters: - $ref: '#/components/parameters/ResourceId' responses: @@ -594,7 +709,7 @@ paths: Returns all Contacts visible to the authenticated user. Filter by `charity_id` or `project_id`. Response includes `custom_fields` defined by the Beneficiary Category. operationId: listBeneficiaries - security: [{tokenAuth: []}] + security: [{tokenAuth: []}, {oauth2: [api]}] parameters: - $ref: '#/components/parameters/Page' - $ref: '#/components/parameters/PerPage' @@ -686,7 +801,7 @@ paths: summary: Get advanced custom fields for all Beneficiaries description: Returns the per-record custom field values for all Beneficiaries. operationId: listBeneficiaryAdvancedCustomFields - security: [{tokenAuth: []}] + security: [{tokenAuth: []}, {oauth2: [api]}] parameters: - $ref: '#/components/parameters/Page' - $ref: '#/components/parameters/PerPage' @@ -707,7 +822,7 @@ paths: summary: Get Impact Box data (Progress Trackers per Contact) description: Aggregated metric progress per Beneficiary — the data shown in the Progress Trackers box on a Contact Profile page. operationId: getBeneficiaryImpactBoxData - security: [{tokenAuth: []}] + security: [{tokenAuth: []}, {oauth2: [api]}] parameters: - $ref: '#/components/parameters/Page' - $ref: '#/components/parameters/PerPage' @@ -731,7 +846,7 @@ paths: authenticated user can see are included. Use project_ids to narrow the results to specific projects; it can never widen them to projects the user cannot see. operationId: listProjectBeneficiaries - security: [{tokenAuth: []}] + security: [{tokenAuth: []}, {oauth2: [api]}] parameters: - name: project_ids in: query @@ -765,7 +880,7 @@ paths: tags: [Beneficiary Categories] summary: List all Beneficiary Categories (Contact Bio Forms) operationId: listBeneficiaryCategories - security: [{tokenAuth: []}] + security: [{tokenAuth: []}, {oauth2: [api]}] parameters: - $ref: '#/components/parameters/Page' - $ref: '#/components/parameters/PerPage' @@ -785,7 +900,7 @@ paths: tags: [Beneficiary Categories] summary: Get a single Beneficiary Category operationId: getBeneficiaryCategory - security: [{tokenAuth: []}] + security: [{tokenAuth: []}, {oauth2: [api]}] parameters: - $ref: '#/components/parameters/ResourceId' responses: @@ -805,7 +920,7 @@ paths: tags: [Beneficiary Categories] summary: Get current active fields for Beneficiary Categories operationId: getBeneficiaryCategoryCurrentFields - security: [{tokenAuth: []}] + security: [{tokenAuth: []}, {oauth2: [api]}] responses: "200": description: Current field definitions @@ -848,7 +963,7 @@ paths: summary: List all Beneficiary Types description: Returns the four types — Person (1), Organisation (2), Animal (3), Object (4). The ID is required when creating a Beneficiary. operationId: listBeneficiaryTypes - security: [{tokenAuth: []}] + security: [{tokenAuth: []}, {oauth2: [api]}] parameters: - $ref: '#/components/parameters/Page' - $ref: '#/components/parameters/PerPage' @@ -889,7 +1004,7 @@ paths: tags: [Beneficiary Types] summary: List Beneficiary Type–Category associations operationId: listBeneficiaryTypesCategories - security: [{tokenAuth: []}] + security: [{tokenAuth: []}, {oauth2: [api]}] parameters: - $ref: '#/components/parameters/Page' - $ref: '#/components/parameters/PerPage' @@ -1207,7 +1322,7 @@ paths: summary: Get verdict scores for a Survey Campaign description: Verdict scores grouped by Beneficiary for a specific Survey within a Project. operationId: getStoryCategoryVerdicts - security: [{tokenAuth: []}] + security: [{tokenAuth: []}, {oauth2: [api]}] parameters: - name: id in: path @@ -1239,7 +1354,7 @@ paths: tags: [Project Story Categories] summary: List all Survey Campaigns (Project Story Categories) operationId: listProjectStoryCategories - security: [{tokenAuth: []}] + security: [{tokenAuth: []}, {oauth2: [api]}] parameters: - $ref: '#/components/parameters/Page' - $ref: '#/components/parameters/PerPage' @@ -1443,7 +1558,7 @@ paths: 2. **Story Change Beneficiary** — tagged via a Participation Change 3. **Story Indicator Beneficiary** — tagged via an Indicator response operationId: listStoryBeneficiaries - security: [{tokenAuth: []}] + security: [{tokenAuth: []}, {oauth2: [api]}] parameters: - $ref: '#/components/parameters/Page' - $ref: '#/components/parameters/PerPage' @@ -1494,7 +1609,7 @@ paths: summary: List Story Change Beneficiaries description: Per-Beneficiary Participation Change records. Only applies to Participation type Changes. operationId: listStoryChangeBeneficiaries - security: [{tokenAuth: []}] + security: [{tokenAuth: []}, {oauth2: [api]}] parameters: - $ref: '#/components/parameters/Page' - $ref: '#/components/parameters/PerPage' @@ -1540,7 +1655,7 @@ paths: summary: List Story Indicator Beneficiaries description: Per-Beneficiary indicator responses. Each record = one Contact's answer to one Indicator in one Story. operationId: listStoryIndicatorBeneficiaries - security: [{tokenAuth: []}] + security: [{tokenAuth: []}, {oauth2: [api]}] parameters: - $ref: '#/components/parameters/Page' - $ref: '#/components/parameters/PerPage' @@ -1565,7 +1680,7 @@ paths: summary: List all Cases description: Each Case is linked to one Beneficiary and one Project. operationId: listCases - security: [{tokenAuth: []}] + security: [{tokenAuth: []}, {oauth2: [api]}] parameters: - $ref: '#/components/parameters/Page' - $ref: '#/components/parameters/PerPage' @@ -1622,7 +1737,7 @@ paths: tags: [Cases] summary: List Project–Beneficiary–Case associations operationId: listProjectsBeneficiariesCases - security: [{tokenAuth: []}] + security: [{tokenAuth: []}, {oauth2: [api]}] parameters: - $ref: '#/components/parameters/Page' - $ref: '#/components/parameters/PerPage' @@ -1646,7 +1761,7 @@ paths: Supported field types: Text (short/long) · Number · Date & time · Time · Attachment · Select · Tickbox operationId: listCustomFieldCategories - security: [{tokenAuth: []}] + security: [{tokenAuth: []}, {oauth2: [api]}] parameters: - $ref: '#/components/parameters/Page' - $ref: '#/components/parameters/PerPage' @@ -1954,7 +2069,7 @@ paths: this response does **not** include `submission_credential` — that bearer token is only issued to the offline device itself. operationId: getReferralLinkDetailDefinition - security: [{tokenAuth: []}] + security: [{tokenAuth: []}, {oauth2: [api]}] parameters: - $ref: '#/components/parameters/ResourceId' responses: @@ -2035,7 +2150,7 @@ paths: is still added to any project. The `error` gives the reason and the counts. - Default Event Formats (Appointments, Classes, Conferences, Gatherings, Meetings, Other Events, Sessions, Workshops) can be deleted under the same rules. - security: [{tokenAuth: []}] + security: [{tokenAuth: []}, {oauth2: [api]}] parameters: - $ref: '#/components/parameters/ResourceId' responses: @@ -2567,7 +2682,7 @@ paths: `kind_counts` gives the number of files of each kind for the same filters, ignoring `kind` — the counts on the File type buttons. operationId: listMediaItems - security: [{tokenAuth: []}] + security: [{tokenAuth: []}, {oauth2: [api]}] parameters: - name: charity_id in: query @@ -2737,6 +2852,19 @@ components: description: | Long-lived token from `POST /users/sign_in`. Does not expire. Must be accompanied by `X-User-Email` header. + oauth2: + type: oauth2 + description: | + OAuth 2.0 authorisation code flow for connected apps. The token is limited to the + organisation the user chose on the consent screen, with that user's permissions. + See "Connecting an app with OAuth 2.0" above. + flows: + authorizationCode: + authorizationUrl: https://makerble.com/oauth/authorize + tokenUrl: https://makerble.com/oauth/token + refreshUrl: https://makerble.com/oauth/token + scopes: + api: The same access as the user who connected the app, in the organisation they chose submissionBearerAuth: type: http scheme: bearer diff --git a/server.js b/server.js index 662302f..6e7def4 100644 --- a/server.js +++ b/server.js @@ -1000,6 +1000,53 @@ function buildDocsPage() { + +

Connecting an app with OAuth 2.0

+
+

Apps published for other people to use, such as marketplace connectors, connect with OAuth 2.0 instead of asking for a password. The user signs in to Makerble, chooses which of their organisations the app may use, and selects Allow. The app then calls the API as that user, limited to that organisation.

+
    +
  1. Get a client ID and secret. Makerble registers client applications: email api-key-request@makerble.com with your app's name and its exact redirect URI (https only).
  2. +
  3. Send the user to https://makerble.com/oauth/authorize?response_type=code&client_id=…&redirect_uri=…&scope=api&state=…. After the consent screen, Makerble redirects to your redirect URI with ?code=…&state=…, or ?error=access_denied if the user cancels.
  4. +
  5. Exchange the code at POST https://makerble.com/oauth/token. It works once and expires after 10 minutes.
  6. +
  7. Call the API with Authorization: Bearer <access_token> instead of the X-User-* headers.
  8. +
  9. Refresh when the access token expires (after 1 hour). Refresh tokens don't expire, but each refresh returns a new one: always store the latest.
  10. +
+
+ + + + + + + +
SituationResponse
Token expired or revoked, or the user is no longer in the connected organisation401 {"error":"invalid_token"}
Endpoint not yet available to connected apps403 {"error":"not_available_to_connected_apps"}
+ +
+ ℹ + A connected app sees only the organisation the user chose, with that user's permissions there. Endpoints that accept it list oauth2 under Security in the OpenAPI spec; more are added as they are reviewed. Users and Organisation Admins can disconnect an app at any time from Settings → Connected Apps, and it stops working straight away. +
+ +
+ ${endpointCard("POST", "/oauth/token", "Exchange a code, or refresh a token (OAuth 2.0)", false, [ + { name: "grant_type", in: "body", required: true, desc: "authorization_code or refresh_token" }, + { name: "code", in: "body", desc: "For authorization_code: the code from the redirect" }, + { name: "redirect_uri", in: "body", desc: "For authorization_code: the same redirect URI used on /oauth/authorize" }, + { name: "refresh_token", in: "body", desc: "For refresh_token: the latest refresh token" }, + { name: "client_id", in: "body", required: true, desc: "Your app's client ID" }, + { name: "client_secret", in: "body", required: true, desc: "Your app's client secret (or send both with HTTP Basic auth)" }, + ], [ + { code: 200, cls: "response-2xx", desc: "access_token, token_type: Bearer, expires_in: 3600, refresh_token, scope: api" }, + { code: 400, cls: "response-4xx", desc: "invalid_grant: the code or refresh token is invalid, expired or already used" }, + { code: 401, cls: "response-4xx", desc: "invalid_client: unknown client or wrong secret" }, + ], "

Sent to https://makerble.com/oauth/token, not under /api/v2. Body is form-urlencoded.

")} + ${endpointCard("POST", "/oauth/revoke", "Revoke a token (OAuth 2.0)", false, [ + { name: "token", in: "body", required: true, desc: "An access or refresh token. Revoking either stops both working" }, + { name: "client_id", in: "body", required: true, desc: "Your app's client ID" }, + { name: "client_secret", in: "body", required: true, desc: "Your app's client secret" }, + ], [ + { code: 200, cls: "response-2xx", desc: "Revoked, or already invalid" }, + ], "

Sent to https://makerble.com/oauth/revoke, not under /api/v2. Use it when the user disconnects from inside your app.

")} +
From 29d971fe1f64eb15002a4c94456feca6da7987bd Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 12 Oct 2026 13:10:39 +0000 Subject: [PATCH 03/15] Document GET /health with commit, built_at and environment The Rails API's health check now reports which build is running so testers can tell when a deploy is live. Add the endpoint to openapi.yaml and a card to the hand-written docs page. CP-8752 Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01J2XSr3SPzDwwagQz7oF86h --- openapi.yaml | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++ server.js | 18 +++++++++++++++++ 2 files changed, 74 insertions(+) diff --git a/openapi.yaml b/openapi.yaml index 8a699a0..69a7dc5 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -144,6 +144,8 @@ tags: Contacts to reach. - name: Event Formats description: Event Categories — templates for an organisation's events (e.g. Workshops, Classes, Meetings) + - name: Health + description: Whether the service is up, and which build of it is running paths: @@ -2727,6 +2729,60 @@ paths: "404": $ref: '#/components/responses/NotFound' + /health: + get: + tags: [Health] + summary: Check the service is up and which build is running + operationId: getHealth + description: | + Reports whether the service and its database are answering, and which build + is running. No sign-in is needed: send no `X-User-Email` / `X-User-Token`. + + Use `commit` to tell when a new release is live: after a deploy finishes it + changes to the new build's commit, and `uptime_seconds` starts again from a + small number. `commit` and `built_at` are `null` when the build didn't record + them. Always answers `200` while the service is running; check `database` + to see whether the database is reachable. + security: [] + responses: + "200": + description: The service is running + content: + application/json: + schema: + type: object + required: [status, database, commit, built_at, environment] + properties: + status: + type: string + enum: [ok] + description: Always `ok` when the service answers + database: + type: boolean + description: Whether the database answered a trivial query + uptime_seconds: + type: integer + description: Seconds since the running app started + commit: + type: string + nullable: true + description: Full git commit SHA the running build was made from + built_at: + type: string + format: date-time + nullable: true + description: When the running build was made, ISO 8601 in UTC + environment: + type: string + description: Which environment answered, e.g. `production`, `pre-production`, `qa`, `preview` + example: + status: ok + database: true + uptime_seconds: 312 + commit: "0123456789abcdef0123456789abcdef01234567" + built_at: "2026-10-12T13:05:09Z" + environment: production + components: securitySchemes: diff --git a/server.js b/server.js index 662302f..cf03e12 100644 --- a/server.js +++ b/server.js @@ -905,6 +905,10 @@ function buildDocsPage() { GETRatio Sets GETCase Forms + @@ -1680,6 +1684,20 @@ function buildDocsPage() { + +
+
Service
+

Health

+
+

Checks that the service and its database are answering, and reports which build is running. No sign-in is needed. After a release, commit changes to the new build's commit and uptime_seconds starts again from a small number, so you can tell when the new version is live.

+
+
+ ${endpointCard("GET", "/health", "Check the service is up and which build is running", false, [], [ + { code: "200", cls: "response-2xx", desc: "status, database (true/false), uptime_seconds, commit (git SHA or null), built_at (ISO 8601 UTC or null) and environment" } + ])} +
+
+ From 40ad2935cb961f94a5080dcb5ff04a1a968a1f92 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 23 Nov 2026 14:15:18 +0000 Subject: [PATCH 04/15] Port api-docs draft #18: webhook subscriptions by automation platforms (CP-8728) Applied by hand onto current main because the draft was stacked on the already-merged CP-8585-webhooks branch. Drops the stray openapi.yaml.orig the draft had committed. --- openapi.yaml | 49 ++++++++++++++++++++++++++++++++++++++++--------- server.js | 18 +++++++++++------- 2 files changed, 51 insertions(+), 16 deletions(-) diff --git a/openapi.yaml b/openapi.yaml index 9f1c5cc..1727d55 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -18350,8 +18350,14 @@ paths: summary: Register a webhook endpoint description: | Starts sending the chosen events to an HTTPS URL. Leave out `event_types` to send every - event. An Organisation can have at most 10 endpoints. The response includes the signing - `secret`, which is shown only this once. + event, or give one event for a trigger that fires on that event only. An Organisation can + have at most 10 endpoints added this way, and separately at most 100 created by automation + platforms such as Power Automate (one per flow). The response includes the signing `secret`, + which is shown only this once, and a `Location` header with the endpoint's full address: + send `DELETE` to it to unsubscribe. + + Power Automate flows can't check the signature themselves. They rely instead on the callback + address being secret, which Microsoft generates for each flow. operationId: createWebhookEndpoint security: [{tokenAuth: []}] requestBody: @@ -18369,6 +18375,12 @@ paths: responses: "201": description: Endpoint created, with its secret + headers: + Location: + description: Full address of the new endpoint, e.g. `https://app.makerble.com/api/v2/webhook_endpoints/42` + schema: + type: string + format: uri content: application/json: schema: @@ -18440,18 +18452,19 @@ paths: delete: tags: [Webhooks] summary: Delete a webhook endpoint - description: Deletes the endpoint and its delivery log. Makerble stops sending to it at once. + description: | + Deletes the endpoint and its delivery log. Makerble stops sending to it at once. Deleting is + idempotent: an endpoint that is already deleted, or that the user can't see, also answers + `204`, so an automation platform can unsubscribe safely more than once. operationId: deleteWebhookEndpoint security: [{tokenAuth: []}] responses: "204": - description: Deleted + description: Deleted, or already gone "401": $ref: '#/components/responses/Unauthorized' "403": $ref: '#/components/responses/WebhooksNotTurnedOn' - "404": - $ref: '#/components/responses/NotFound' /webhook_endpoints/{id}/rotate_secret: parameters: @@ -19132,13 +19145,22 @@ components: example: error: forbidden WebhooksNotTurnedOn: - description: Webhooks are not turned on for this Organisation yet + description: | + The user is a member of the Organisation but not an Organisation Admin, or webhooks are not + turned on for the Organisation yet. `error` says which, in words that can be shown to the + user. For a request from an automation platform such as Power Automate, the first reads + "Only an Organisation Admin can create Makerble triggers". content: application/json: schema: $ref: '#/components/schemas/Error' - example: - error: "Webhooks are not turned on for this organisation" + examples: + notAnAdmin: + value: + error: "Only an Organisation Admin can manage Webhooks" + notTurnedOn: + value: + error: "Webhooks are not turned on for this organisation" schemas: SetupGuide: @@ -27602,6 +27624,15 @@ components: active: type: boolean description: false while paused + source: + type: string + enum: [manual, power_automate, zapier, dynamics] + readOnly: true + description: | + Who created the endpoint: `manual` for one added by hand on the Webhooks page or through + this API, otherwise the automation platform's connector. Set by Makerble from the + connected app (OAuth client) that made the request; it can't be sent or changed. A + connected app may list, get, create and delete endpoints, in its connected Organisation only. disabled_at: type: string format: date-time diff --git a/server.js b/server.js index 0aad52e..eaa2e74 100644 --- a/server.js +++ b/server.js @@ -4406,7 +4406,8 @@ function buildDocsPage() {
Integrations

Webhooks

-

Instead of polling, an Organisation's admins can register webhook endpoints: HTTPS URLs that Makerble sends a signed JSON POST to when records change. Only the Organisation's admins can manage them, and only once an admin has ticked Turn on Webhooks in the Organisation's Settings (Preferences) page; until then these endpoints answer 403.

+

Instead of polling, an Organisation's admins can register webhook endpoints: HTTPS URLs that Makerble sends a signed JSON POST to when records change. Only the Organisation's admins can manage them, and only once an admin has ticked Turn on Webhooks in the Organisation's Settings (Preferences) page; until then these endpoints answer 403. A colleague who is not an Organisation Admin also gets 403, with an error message that can be shown to them as it is.

+

Automation platforms: a connector such as the Power Automate one creates an endpoint for each flow with a Makerble trigger, usually for one event, and deletes it when the flow is deleted. The create response's Location header is the endpoint's full address to send that DELETE to, and deleting is idempotent (204 again if it has already gone). Such endpoints have a source of power_automate, zapier or dynamics, set by Makerble from the connected app (an OAuth connection, which may list, get, create and delete webhook endpoints in the one Organisation it was connected to), and their own limit of 100 per Organisation, separate from the 10 added by hand (source: manual). Power Automate flows can't check the signature themselves; they rely on the callback address being secret, which Microsoft generates for each flow.

Events: contact.created, contact.updated (with changed_fields), story.created (about 30 seconds after the Story is posted, so survey answers are included; drafts are not sent), story.updated (including a draft being published), project.created, project.updated (update events are sent about 10 seconds after the change, so several saves of one change arrive as one event), import.completed (once per finished spreadsheet import; its rows send no events of their own) and webhook.test. The data of a Contact, Story or Project event is the same JSON as GET /beneficiaries/{id}, GET /stories/{id} or GET /projects/{id}, as the record is when the request is sent. A changed dropdown answer on a Contact sends contact.updated with custom_fields.<dropdown title> in changed_fields.

Removal and membership events: contact.deleted (id, deleted_at; no personal data), contact.merged (kept_contact_id, merged_contact_ids, merged_at; no contact.deleted is sent for a merged Contact), contact.restored (the full Contact, when a deleted Contact is restored or a merge undone), story.deleted (id, project_id, contact_ids, deleted_at), project.deleted (id, name, deleted_at), and project.contact_added / project.contact_removed (project_id, project_name, contact_id, contact_state). Their data is recorded when the event happens. Webhooks created before these events existed receive them only once an admin ticks them. Once an endpoint has 100 events waiting, further ones are spaced out at 5 a second, so a bulk action on thousands of records may take some minutes to arrive in full.

Envelope: { "id": "evt_…", "event": "contact.updated", "occurred_at": "2026-10-04T09:15:00Z", "charity_id": 123, "changed_fields": ["name"], "data": { … } }. Headers: X-Makerble-Event, X-Makerble-Delivery (the id), User-Agent: Makerble-Webhooks/1 and X-Makerble-Signature: t=<unix time>,v1=<signature>.

@@ -4425,8 +4426,8 @@ function buildDocsPage() { { name: "last_synced_datetime", type: "string", required: false, desc: "ISO 8601 incremental sync" } ], [ { code: "200", cls: "response-2xx", desc: "Paginated list of endpoints, without secrets" }, - { code: "403", cls: "response-4xx", desc: "Webhooks are not turned on for this Organisation" }, - { code: "404", cls: "response-4xx", desc: "Not an admin of this Organisation" } + { code: "403", cls: "response-4xx", desc: "Not an Organisation Admin, or Webhooks are not turned on for this Organisation" }, + { code: "404", cls: "response-4xx", desc: "Not a member of this Organisation" } ])} ${endpointCard("POST", "/webhook_endpoints", "Register a webhook endpoint", true, [ { name: "webhook_endpoint[charity_id]", in: "body", type: "integer", required: true, desc: "The Organisation ID" }, @@ -4434,14 +4435,16 @@ function buildDocsPage() { { name: "webhook_endpoint[description]", in: "body", type: "string", required: false, desc: "What it is for" }, { name: "webhook_endpoint[event_types]", in: "body", type: "array", required: false, desc: "Events to send (default: all)" } ], [ - { code: "201", cls: "response-2xx", desc: "Created — includes the secret, shown only this once" }, - { code: "422", cls: "response-4xx", desc: "Invalid URL or events, or the Organisation already has 10 endpoints" } + { code: "201", cls: "response-2xx", desc: "Created — includes the secret, shown only this once. The Location header is the endpoint's full address" }, + { code: "403", cls: "response-4xx", desc: "Not an Organisation Admin, or Webhooks are not turned on for this Organisation" }, + { code: "422", cls: "response-4xx", desc: "Invalid URL or events, or the Organisation already has 10 endpoints (100 from automation platforms)" } ])} ${endpointCard("GET", "/webhook_endpoints/{id}", "Get a webhook endpoint", true, [ { name: "id", in: "path", type: "integer", required: true, desc: "Endpoint ID" } ], [ { code: "200", cls: "response-2xx", desc: "The endpoint, without its secret" }, - { code: "404", cls: "response-4xx", desc: "Not found, or not an admin of its Organisation" } + { code: "403", cls: "response-4xx", desc: "Not an Organisation Admin of its Organisation" }, + { code: "404", cls: "response-4xx", desc: "Not found, or not a member of its Organisation" } ])} ${endpointCard("PATCH", "/webhook_endpoints/{id}", "Change, pause or resume a webhook endpoint", true, [ { name: "id", in: "path", type: "integer", required: true, desc: "Endpoint ID" }, @@ -4454,7 +4457,8 @@ function buildDocsPage() { ${endpointCard("DELETE", "/webhook_endpoints/{id}", "Delete a webhook endpoint", true, [ { name: "id", in: "path", type: "integer", required: true, desc: "Endpoint ID" } ], [ - { code: "204", cls: "response-2xx", desc: "Deleted, with its delivery log" } + { code: "204", cls: "response-2xx", desc: "Deleted, with its delivery log, or already gone" }, + { code: "403", cls: "response-4xx", desc: "Not an Organisation Admin of its Organisation" } ])} ${endpointCard("POST", "/webhook_endpoints/{id}/rotate_secret", "Rotate a webhook endpoint's secret", true, [ { name: "id", in: "path", type: "integer", required: true, desc: "Endpoint ID" } From e1fb0713e71b382aeba2f8b36709105f57e87927 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 23 Nov 2026 14:15:46 +0000 Subject: [PATCH 05/15] Port api-docs draft #45: Survey Campaign hide_unanswered_questions (CP-8831) --- openapi.yaml | 6 ++++++ server.js | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/openapi.yaml b/openapi.yaml index c9dd4b5..2ec5ebc 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -24427,6 +24427,12 @@ components: When true, a Contact who opens their personal survey link (Survey Invitation) without signing in can press Save & Finish Later and come back to the same link to finish. Unfinished responses are deleted 30 days after they were last saved. + hide_unanswered_questions: + type: boolean + description: >- + "Hide unanswered questions when viewing the story" on the Survey Campaign Settings page. When true, + viewing one contact's response (for example on their profile timeline) leaves out the questions they + did not answer. Read-only through the API. is_stopped: type: boolean display_intro_message: diff --git a/server.js b/server.js index 7435cb8..6619091 100644 --- a/server.js +++ b/server.js @@ -2208,7 +2208,7 @@ function buildDocsPage() { ${endpointCard("GET", "/project_story_categories", "List Survey Campaigns", true, [ { name: "page", type: "integer", required: false, desc: "Page number" }, { name: "per_page", type: "integer", required: false, desc: "Records per page" } - ], [{ code: "200", cls: "response-2xx", desc: "Surveys deployed to specific Projects" }])} + ], [{ code: "200", cls: "response-2xx", desc: "Surveys deployed to specific Projects, with their display settings (including hide_unanswered_questions and allow_respondent_finish_later)" }])} ${endpointCard("PATCH", "/project_story_categories/{id}", "Change a Survey Campaign's settings", true, [ { name: "id", in: "path", type: "integer", required: true, desc: "Survey Campaign (Project Story Category) ID" }, { name: "force_interval", in: "body", type: "boolean", required: true, desc: "\"Force colleagues to select an interval\": when true and the campaign has Waves, every story, survey invitation, shared link and automation for it must name an interval" } From df7d9fb67158793d93db2c352d146d316f3c9108 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 23 Nov 2026 14:16:31 +0000 Subject: [PATCH 06/15] Port api-docs draft #55: add an Event Format to a project, or remove it (CP-8843) Get, create and edit were already documented on main, so only the two project endpoints, EventFormatProject and EventFormatAdminOnly are added, taken from the Rails repo's contract-tested copy of the spec. --- openapi.yaml | 113 +++++++++++++++++++++++++++++++++++++++++++++++++++ server.js | 18 ++++++++ 2 files changed, 131 insertions(+) diff --git a/openapi.yaml b/openapi.yaml index 2ec5ebc..0f525aa 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -9276,6 +9276,99 @@ paths: $ref: '#/components/schemas/Error' example: error: "This Event Format can't be deleted because it has 3 events. Delete or move those events first. This Event Format can't be deleted because it is added to 2 projects. Remove it from those projects first." + /event_categories/{id}/projects: + post: + tags: [Event Formats] + summary: Add an Event Format to a project + operationId: addEventFormatToProject + description: | + Adds an Event Format (Event Category in the API) to a project, so the project's events can + use it, as **Add to projects** on the Manage Event Formats page does. It also turns events + on for the project. Adding one that is already added does nothing and returns `200`. + + - Only an **Organisation Admin** of the organisation that owns the Event Format may (`403`). + - The project must be in the same organisation (`422`). An Event Format or project in an + organisation you are not a member of returns `404`. + security: [{tokenAuth: []}] + parameters: + - $ref: '#/components/parameters/ResourceId' + requestBody: + required: true + content: + application/json: + schema: + type: object + required: [project_id] + properties: + project_id: + type: integer + example: + project_id: 301 + responses: + "201": + description: Added + content: + application/json: + schema: + $ref: '#/components/schemas/EventFormatProject' + example: + event_category_id: 4530 + project_id: 301 + status: added + "200": + description: It was already added + content: + application/json: + schema: + $ref: '#/components/schemas/EventFormatProject' + "401": + $ref: '#/components/responses/Unauthorized' + "403": + $ref: '#/components/responses/EventFormatAdminOnly' + "404": + $ref: '#/components/responses/NotFound' + "422": + description: The project isn't in the Event Format's organisation + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + example: + error: "That project isn't in the Event Format's organisation." + /event_categories/{id}/projects/{project_id}: + delete: + tags: [Event Formats] + summary: Remove an Event Format from a project + operationId: removeEventFormatFromProject + description: | + Takes an Event Format off a project, so new events in the project can't use it. Events + that already use it keep it. Same permissions as **Add an Event Format to a project**; + an Event Format that isn't added to the project returns `404`. + security: [{tokenAuth: []}] + parameters: + - $ref: '#/components/parameters/ResourceId' + - name: project_id + in: path + required: true + schema: + type: integer + responses: + "200": + description: Removed + content: + application/json: + schema: + $ref: '#/components/schemas/EventFormatProject' + example: + event_category_id: 4530 + project_id: 301 + status: removed + "401": + $ref: '#/components/responses/Unauthorized' + "403": + $ref: '#/components/responses/EventFormatAdminOnly' + "404": + $ref: '#/components/responses/NotFound' /events: get: @@ -19053,6 +19146,15 @@ components: description: Also include Indicators or Outcomes from the public library shared by all organisations (default false) responses: + + EventFormatAdminOnly: + description: You are not an Organisation Admin of the organisation that owns the Event Format + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + example: + error: "Only an Organisation Admin can manage Event Formats." SetupGuideForbidden: description: You aren't an Organisation Admin of this Organisation, or its Setup guide is switched off content: @@ -28124,6 +28226,17 @@ components: type: string format: date-time + EventFormatProject: + type: object + properties: + event_category_id: + type: integer + project_id: + type: integer + status: + type: string + enum: [added, already_added, removed] + PaginatedEventFormats: allOf: - $ref: '#/components/schemas/PaginationEnvelope' diff --git a/server.js b/server.js index 6619091..5828c02 100644 --- a/server.js +++ b/server.js @@ -4281,6 +4281,24 @@ function buildDocsPage() { { code: "404", cls: "response-4xx", desc: "Not found, or belongs to an organisation you are not in" }, { code: "422", cls: "response-4xx", desc: "A setting is invalid, e.g. a length not in 5-minute steps" } ])} + ${endpointCard("POST", "/event_categories/{id}/projects", "Add an Event Format to a project", true, [ + { name: "id", in: "path", type: "integer", required: true, desc: "Event Format (Event Category) ID" }, + { name: "project_id", type: "integer", required: true, desc: "A project in the same organisation; adding one also turns events on for it" } + ], [ + { code: "201", cls: "response-2xx", desc: "Added — status: added" }, + { code: "200", cls: "response-2xx", desc: "It was already added — status: already_added" }, + { code: "403", cls: "response-4xx", desc: "Not an Organisation Admin of the owning organisation" }, + { code: "404", cls: "response-4xx", desc: "Event Format or project not found, or in an organisation you are not in" }, + { code: "422", cls: "response-4xx", desc: "The project isn't in the Event Format's organisation" } + ])} + ${endpointCard("DELETE", "/event_categories/{id}/projects/{project_id}", "Remove an Event Format from a project", true, [ + { name: "id", in: "path", type: "integer", required: true, desc: "Event Format (Event Category) ID" }, + { name: "project_id", in: "path", type: "integer", required: true, desc: "Project ID" } + ], [ + { code: "200", cls: "response-2xx", desc: "Removed — status: removed. Events already using it keep it" }, + { code: "403", cls: "response-4xx", desc: "Not an Organisation Admin of the owning organisation" }, + { code: "404", cls: "response-4xx", desc: "Not found, or the Event Format isn't added to the project" } + ])} ${endpointCard("DELETE", "/event_categories/{id}", "Delete an Event Format", true, [ { name: "id", in: "path", type: "integer", required: true, desc: "Event Format (Event Category) ID" } ], [ From d5fb07912fae3caf2d29f7d02c5a9d0db64153d9 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 23 Nov 2026 14:16:55 +0000 Subject: [PATCH 07/15] Port api-docs draft #65: Formula Tracker results endpoints (CP-8515) --- openapi.yaml | 226 +++++++++++++++++++++++++++++++++++++++++++++++++++ server.js | 24 ++++++ 2 files changed, 250 insertions(+) diff --git a/openapi.yaml b/openapi.yaml index 0f525aa..bbdefcd 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -15470,6 +15470,119 @@ paths: "422": $ref: '#/components/responses/UnprocessableEntity' + /formula_trackers/{id}/projects/{project_id}/results: + get: + tags: [Formula Trackers] + summary: Get a Formula Tracker's result on a Project + description: | + A Formula Tracker's result on a Project's Results Canvas: what its card shows, and what its popup + opens. The tracker must be on the Project. + + Each timeframe is worked out from that timeframe's own tracker numbers, so a Year to Date + percentage is the Year to Date numerator ÷ the Year to Date denominator, never an average of the + periods. `number` is null, and `display_value` is "–", when a tracker the formula uses has no + result or it divides by 0 (the canvas says "Not enough data to work this out yet"). + `display_value` is the result as the canvas shows it, from the tracker's display format, decimal + places and unit label. + + `result_kind` `additive` (only + and − of trackers that add up) adds up across periods. + `snapshot` (× ÷ or a number) is read as of `as_of`: the window's last day, or today while that is + still to come. `target` is the deadline targets dated in the window, added up (for a snapshot, + the one on its last day), or else the one-off target, or null. + + `trackers` lists each tracker the formula uses with its number for the window; `formula` writes + the formula out in words and `formula_with_values` with those numbers in place. + + When the formula only adds Workflow Trackers that count items (`itemised: true`, e.g. External + referrals + Internal referrals), `data` lists one page of the items counted, newest first. An item + the user may not see is counted in `hidden_count` for that page but never listed. Otherwise `data` + is empty and the counts are 0. Requires the same rights as viewing that Results Canvas. + operationId: getFormulaTrackerProjectResults + security: [{tokenAuth: []}] + parameters: + - $ref: '#/components/parameters/ResourceId' + - $ref: '#/components/parameters/CohortTrackerProjectId' + - $ref: '#/components/parameters/CohortTrackerTimeframe' + - $ref: '#/components/parameters/CohortTrackerAsOf' + - $ref: '#/components/parameters/Page' + - $ref: '#/components/parameters/PerPage' + responses: + "200": + description: The result and the trackers behind it + content: + application/json: + schema: + $ref: '#/components/schemas/FormulaTrackerResult' + example: + formula_tracker_id: 12 + name: "% of children receiving support" + project_id: 34 + timeframe: year_to_date + starts_on: "2026-01-01" + ends_on: "2026-12-31" + result_kind: snapshot + as_of: "2026-10-13" + display_format: percentage + decimal_places: 1 + unit: percentage + number: 50 + display_value: "50.0%" + target: 60 + formula: "% of children receiving support = Children supported ÷ Children flagged × 100" + formula_with_values: "4 ÷ 8 × 100" + trackers: + - { type: Change, id: 81, name: Children supported, type_name: Engagement tracker, unit: count, number: 4 } + - { type: Change, id: 82, name: Children flagged, type_name: Engagement tracker, unit: count, number: 8 } + itemised: false + page: 1 + page_size: 0 + page_count: 0 + total_count: 0 + hidden_count: 0 + data: [] + "401": + $ref: '#/components/responses/Unauthorized' + "403": + description: The user can't see this Project's Results Canvas + "404": + $ref: '#/components/responses/NotFound' + "422": + $ref: '#/components/responses/UnprocessableEntity' + + /formula_trackers/{id}/albums/{bundle_id}/results: + get: + tags: [Formula Trackers] + summary: Get a Formula Tracker's result on an Album + description: | + As for a Project, with each tracker the formula uses worked out on the Album as a whole (its open + Projects together) before the formula is applied, so an Album percentage is the Album's numerator + ÷ the Album's denominator, not the Projects' percentages added up. The tracker must be on one of + the Album's Projects. Requires rights to see the Album. + operationId: getFormulaTrackerAlbumResults + security: [{tokenAuth: []}] + parameters: + - $ref: '#/components/parameters/ResourceId' + - $ref: '#/components/parameters/CohortTrackerAlbumId' + - $ref: '#/components/parameters/CohortTrackerTimeframe' + - $ref: '#/components/parameters/CohortTrackerAsOf' + - $ref: '#/components/parameters/Page' + - $ref: '#/components/parameters/PerPage' + responses: + "200": + description: The result and the trackers behind it + content: + application/json: + schema: + $ref: '#/components/schemas/FormulaTrackerResult' + "401": + $ref: '#/components/responses/Unauthorized' + "403": + description: The user can't see this Album + "404": + $ref: '#/components/responses/NotFound' + "422": + $ref: '#/components/responses/UnprocessableEntity' + /workflow_trackers: get: tags: [Workflow Trackers] @@ -27222,6 +27335,119 @@ components: type: integer description: Required when creating + FormulaTrackerResult: + type: object + properties: + formula_tracker_id: + type: integer + name: + type: string + project_id: + type: integer + description: Present for a Project's result + album_id: + type: integer + description: Present for an Album's result + timeframe: + type: string + enum: [period, year_to_date, all_time] + starts_on: + type: string + format: date + nullable: true + description: Null when the window runs from the start + ends_on: + type: string + format: date + result_kind: + type: string + enum: [additive, snapshot] + as_of: + type: string + format: date + nullable: true + description: For a snapshot, the date it is read at + display_format: + type: string + enum: [number, percentage] + decimal_places: + type: integer + unit: + type: string + description: '"percentage", the unit label (e.g. "h per child"), or "count"' + number: + type: number + nullable: true + description: Null when a tracker the formula uses has no result, or it divides by 0 + display_value: + type: string + description: The result as the Results Canvas shows it, e.g. "37.5%" or "2.4 h per child"; "–" when number is null + target: + type: number + nullable: true + formula: + type: string + description: e.g. "Referrals completed = External referrals + Internal referrals" + formula_with_values: + type: string + description: The formula with each tracker's number in place, e.g. "2 + 3"; "–" for a tracker with no number + trackers: + type: array + items: + type: object + properties: + type: + type: string + description: Change, Indicator, CohortTracker, WorkflowTracker, FilteredMetric or FormulaTracker + id: + type: integer + name: + type: string + type_name: + type: string + description: e.g. "Engagement tracker" or "Workflow Tracker" + unit: + type: string + number: + type: number + nullable: true + itemised: + type: boolean + description: Whether the formula only adds Workflow Trackers that count items, so data lists them + page: + type: integer + page_size: + type: integer + page_count: + type: integer + total_count: + type: integer + description: Every item counted, when itemised; otherwise 0 + hidden_count: + type: integer + description: How many more on this page are counted but not listed, because the user can't see them + data: + type: array + items: + type: object + properties: + contact_id: + type: integer + contact_name: + type: string + detail: + type: string + nullable: true + project_id: + type: integer + nullable: true + case_id: + type: integer + nullable: true + happened_at: + type: string + format: date-time + FormulaTrackerTimeframeResults: type: object description: Each timeframe's result; null where it can't be worked out (e.g. dividing by 0) diff --git a/server.js b/server.js index 5828c02..59fd84b 100644 --- a/server.js +++ b/server.js @@ -3801,6 +3801,30 @@ function buildDocsPage() { { code: "200", cls: "response-2xx", desc: "Targets saved" }, { code: "403", cls: "response-4xx", desc: "Can't edit the Album's targets" } ])} + ${endpointCard("GET", "/formula_trackers/{id}/projects/{project_id}/results", "Get a Formula Tracker's result on a Project", true, [ + { name: "project_id", in: "path", type: "integer", required: true, desc: "Project ID" }, + { name: "timeframe", type: "string", required: false, desc: "period, year_to_date or all_time (default). Each timeframe is worked out from its own tracker numbers, so Year to Date of a percentage is Year to Date numerator ÷ Year to Date denominator" }, + { name: "as_of", type: "date", required: false, desc: "The deadline the window ends on (default: the next Target Deadline, or today)" }, + { name: "page", type: "integer", required: false, desc: "Page of items, when the formula adds trackers that count items" }, + { name: "per_page", type: "integer", required: false, desc: "Items per page (default 10, max 200)" } + ], [ + { code: "200", cls: "response-2xx", desc: "{number, display_value, target, result_kind, as_of, starts_on, ends_on, formula, formula_with_values, trackers: [{type, id, name, type_name, unit, number}], itemised, page, page_size, page_count, total_count, hidden_count, data}. number is null and display_value is \"–\" when there isn't enough data (a tracker has no result, or it divides by 0). When itemised, data lists the items counted, newest first; items you may not see are counted in hidden_count, never listed" }, + { code: "403", cls: "response-4xx", desc: "Can't see the Project's Results Canvas" }, + { code: "404", cls: "response-4xx", desc: "The tracker isn't on the Project" }, + { code: "422", cls: "response-4xx", desc: "Unknown timeframe or bad date" } + ])} + ${endpointCard("GET", "/formula_trackers/{id}/albums/{bundle_id}/results", "Get a Formula Tracker's result on an Album", true, [ + { name: "bundle_id", in: "path", type: "integer", required: true, desc: "Album ID" }, + { name: "timeframe", type: "string", required: false, desc: "period, year_to_date or all_time (default)" }, + { name: "as_of", type: "date", required: false, desc: "The deadline the window ends on" }, + { name: "page", type: "integer", required: false, desc: "Page of items" }, + { name: "per_page", type: "integer", required: false, desc: "Items per page (default 10, max 200)" } + ], [ + { code: "200", cls: "response-2xx", desc: "As for a Project. Each tracker is worked out on the Album as a whole, then the formula, so an Album percentage is the Album's numerator ÷ the Album's denominator" }, + { code: "403", cls: "response-4xx", desc: "Can't see the Album" }, + { code: "404", cls: "response-4xx", desc: "The tracker isn't on any of the Album's Projects" }, + { code: "422", cls: "response-4xx", desc: "Unknown timeframe or bad date" } + ])} ${endpointCard("DELETE", "/formula_trackers/{id}/projects/{project_id}", "Remove a Formula Tracker from a Project", true, [], [ { code: "204", cls: "response-2xx", desc: "Removed" }, { code: "404", cls: "response-4xx", desc: "Not on the Project" } From b7bddfd6fa9251c29c1119f4b3e11afba3d1ee28 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 23 Nov 2026 14:17:08 +0000 Subject: [PATCH 08/15] Port api-docs draft #115: Audio Notes endpoints (CP-8327) --- openapi.yaml | 294 +++++++++++++++++++++++++++++++++++++++++++++++++++ server.js | 50 +++++++++ 2 files changed, 344 insertions(+) diff --git a/openapi.yaml b/openapi.yaml index bbdefcd..545c21f 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -228,6 +228,10 @@ tags: description: Contact Bio Forms — field schemas for creating and editing Beneficiary records - name: Beneficiary Types description: The four contact types — Person, Organisation, Animal, Object + - name: Audio Notes + description: | + AI AudioNotes (CaseNotes): audio recordings of a conversation with a Contact (Beneficiary) or + of an Event session, which Makerble transcribes and summarises into a draft survey response. - name: Cases description: Cases linked to a Beneficiary and a Project - name: Stories @@ -7174,6 +7178,203 @@ paths: "401": $ref: '#/components/responses/Unauthorized' + /case_notes: + get: + tags: [Audio Notes] + summary: List Audio Notes + description: | + The Audio Notes (CaseNotes) the user may see on the **Audio Notes** page, newest first: + every one in the Organisations (Charities) they are an admin (Charity Editor) of and the + Projects they are a Project Editor of, plus the ones they recorded themselves. Each is a + CaseNote (`note_type: case_note`, about one Contact) or a SessionNote + (`note_type: session_note`, about an Event). Get one to read its transcript and summary. + operationId: listCaseNotes + security: [{tokenAuth: []}] + parameters: + - name: charity_id + in: query + schema: + type: integer + description: Only Audio Notes in this Organisation (Charity) + - name: project_id + in: query + schema: + type: integer + description: Only Audio Notes in this Project + - name: beneficiary_id + in: query + schema: + type: integer + description: Only CaseNotes about this Contact (Beneficiary) + - name: event_id + in: query + schema: + type: integer + description: Only SessionNotes about this Event + - name: note_type + in: query + schema: + type: string + enum: [case_note, session_note] + - $ref: '#/components/parameters/Page' + - $ref: '#/components/parameters/PerPage' + - $ref: '#/components/parameters/LastSyncDatetime' + responses: + "200": + description: Paginated list of Audio Notes + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedCaseNotes' + "401": + $ref: '#/components/responses/Unauthorized' + + post: + tags: [Audio Notes] + summary: Attach an audio file as a new Audio Note + description: | + Creates an Audio Note (CaseNote) from an audio file, as the **New AudioNote** popup on the Audio + Notes page does. Send it as `multipart/form-data`. Makerble then transcribes and summarises it + and writes a draft survey response, the same as for a recording made in Makerble; poll + **Get an Audio Note** until `status` is `completed`. The note's `source` is `manual` and its + `platform` is `api`. + + Choose an Organisation (Charity) with AI AudioNotes turned on and one of its running Projects + the user is a member of. For a `case_note` give a Contact (Beneficiary) in that Project whom + the user may see. For a `session_note` the `event_id` is optional; it must be an Event in that + Project that the user is an Event Manager or Event Worker of (a Project or Organisation admin + may choose any of the Project's Events). The file must be MP3, M4A, MP4, WAV, WEBM, OGG, OGA, + AAC or FLAC audio, up to 200 MB. + operationId: createCaseNote + security: [{tokenAuth: []}] + requestBody: + required: true + content: + multipart/form-data: + schema: + type: object + required: [charity_id, project_id, note_type, audio_file] + properties: + charity_id: + type: integer + project_id: + type: integer + note_type: + type: string + enum: [case_note, session_note] + beneficiary_id: + type: integer + description: Required for a `case_note` + event_id: + type: integer + description: Optional, for a `session_note` + audio_file: + type: string + format: binary + example: + charity_id: 913 + project_id: 2201 + note_type: case_note + beneficiary_id: 50412 + audio_file: "(binary) session.mp3" + responses: + "201": + description: The Audio Note, queued for transcription + content: + application/json: + schema: + $ref: '#/components/schemas/CaseNoteDetail' + "401": + $ref: '#/components/responses/Unauthorized' + "422": + description: A choice was missing or not allowed, or the file is not a supported audio file + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + example: + error: "Choose a contact." + "503": + description: The audio file could not be stored; nothing was created + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + + /case_notes/{id}: + parameters: + - $ref: '#/components/parameters/ResourceId' + get: + tags: [Audio Notes] + summary: Get an Audio Note + description: | + One Audio Note (CaseNote) with its transcript and AI summary, if the user may see it on the + **Audio Notes** page (otherwise `404`). + operationId: getCaseNote + security: [{tokenAuth: []}] + responses: + "200": + description: The Audio Note + content: + application/json: + schema: + $ref: '#/components/schemas/CaseNoteDetail' + "401": + $ref: '#/components/responses/Unauthorized' + "404": + $ref: '#/components/responses/NotFound' + + /case_notes/{id}/recording: + parameters: + - $ref: '#/components/parameters/ResourceId' + delete: + tags: [Audio Notes] + summary: Delete an Audio Note's recording + description: | + Deletes the audio recording of an Audio Note (CaseNote), for example to meet a privacy request, + as **Delete Recording** does on the Audio Note page. The note itself is kept, with its transcript, + summary and draft or saved survey response; `has_recording` becomes false and `audio_deleted_at` + is set. This cannot be undone. Only the Organisation's admins (Charity Editors) and Makerble + System Access admins may do this (`403`), and only once the note has finished processing + (`status` is `completed` or `failed`; otherwise `422`). Deleting an already deleted recording + returns the note unchanged. `503` means the recording could not be removed from storage and + nothing was changed: try again. + operationId: deleteCaseNoteRecording + security: [{tokenAuth: []}] + responses: + "200": + description: The Audio Note, without its recording + content: + application/json: + schema: + $ref: '#/components/schemas/CaseNoteDetail' + "401": + $ref: '#/components/responses/Unauthorized' + "403": + description: The user is not an admin of the Audio Note's Organisation + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + example: + error: "Only an organisation admin can delete a recording." + "404": + $ref: '#/components/responses/NotFound' + "422": + description: The Audio Note is still being processed + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + example: + error: "The recording can be deleted once it has been transcribed." + "503": + description: The recording could not be removed from storage; nothing was changed + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /cases: get: tags: [Cases] @@ -29430,6 +29631,99 @@ components: items: $ref: '#/components/schemas/ApiKey' + CaseNote: + type: object + properties: + id: + type: integer + charity_id: + type: integer + project_id: + type: integer + user_id: + type: integer + description: The colleague who recorded it + user_name: + type: string + nullable: true + note_type: + type: string + enum: [case_note, session_note] + description: "`case_note` is about one Contact (Beneficiary); `session_note` is about an Event" + status: + type: string + enum: [queued, recording, transcribing, completed, failed, stitching, summarizing] + beneficiary_id: + type: integer + nullable: true + beneficiary_name: + type: string + nullable: true + event_id: + type: integer + nullable: true + draft_story_id: + type: integer + nullable: true + description: The draft survey response written from the summary, once there is one + story_id: + type: integer + nullable: true + description: The survey response (Story) saved from that draft + started_at: + type: string + format: date-time + duration_seconds: + type: integer + nullable: true + source: + type: string + enum: [product, manual] + description: "`product` when recorded in Makerble, `manual` when an audio file was attached" + platform: + type: string + enum: [desktop_web, mobile_web, api] + nullable: true + description: Where it was started; null for Audio Notes made before this was recorded + has_recording: + type: boolean + description: false once the recording has been deleted, or before it is uploaded + audio_deleted_at: + type: string + format: date-time + nullable: true + description: When the recording was deleted, if it has been + created_at: + type: string + format: date-time + updated_at: + type: string + format: date-time + + CaseNoteDetail: + allOf: + - $ref: '#/components/schemas/CaseNote' + - type: object + properties: + transcript: + type: string + nullable: true + description: "The transcript, one paragraph per speaker turn (Speaker A: ...)" + summary: + type: string + nullable: true + description: The AI summary + + PaginatedCaseNotes: + allOf: + - $ref: '#/components/schemas/PaginationEnvelope' + - type: object + properties: + data: + type: array + items: + $ref: '#/components/schemas/CaseNote' + PaginatedWebhookEndpoints: allOf: - $ref: '#/components/schemas/PaginationEnvelope' diff --git a/server.js b/server.js index 59fd84b..5f4d86b 100644 --- a/server.js +++ b/server.js @@ -932,6 +932,7 @@ function buildDocsPage() { POSTContacts GETContact Bio Forms POSTCases + POSTAudio Notes
+ +
+
Core resource
+

Audio Notes

+
+

AI AudioNotes (CaseNotes in the API) are audio recordings of a conversation with one Contact (note_type: case_note) or of an Event session (note_type: session_note). Makerble transcribes and summarises each one, then writes a draft survey response from the summary for a colleague to check and save. These endpoints return the same Audio Notes the user sees on the Audio Notes page: every one in the Organisations they are an admin of and the Projects they are a Project Editor of, plus the ones they recorded themselves.

+

source is product for a recording made in Makerble and manual for an attached audio file. platform is desktop_web, mobile_web or api, and null for notes made before it was recorded.

+
+
+ ${endpointCard("GET", "/case_notes", "List Audio Notes", true, [ + { name: "charity_id", type: "integer", required: false, desc: "Only Audio Notes in this Organisation" }, + { name: "project_id", type: "integer", required: false, desc: "Only Audio Notes in this Project" }, + { name: "beneficiary_id", type: "integer", required: false, desc: "Only CaseNotes about this Contact" }, + { name: "event_id", type: "integer", required: false, desc: "Only SessionNotes about this Event" }, + { name: "note_type", type: "string", required: false, desc: "case_note or session_note" }, + { name: "page", type: "integer", required: false, desc: "Page number" }, + { name: "per_page", type: "integer", required: false, desc: "Records per page (default 10, max 200)" }, + { name: "last_synced_datetime", type: "string", required: false, desc: "ISO 8601 incremental sync" } + ], [{ code: "200", cls: "response-2xx", desc: "Paginated list of Audio Notes, newest first" }])} + ${endpointCard("GET", "/case_notes/{id}", "Get an Audio Note", true, [ + { name: "id", type: "integer", required: true, in: "path", desc: "Audio Note (CaseNote) ID" } + ], [ + { code: "200", cls: "response-2xx", desc: "The Audio Note with its transcript and summary" }, + { code: "404", cls: "response-4xx", desc: "Not found, or not one the user may see" } + ])} + ${endpointCard("POST", "/case_notes", "Attach an audio file as a new Audio Note", true, [ + { name: "charity_id", type: "integer", required: true, in: "form", desc: "An Organisation with AI AudioNotes turned on" }, + { name: "project_id", type: "integer", required: true, in: "form", desc: "One of its running Projects the user is a member of" }, + { name: "note_type", type: "string", required: true, in: "form", desc: "case_note or session_note" }, + { name: "beneficiary_id", type: "integer", required: false, in: "form", desc: "Required for a case_note: a Contact in the Project the user may see" }, + { name: "event_id", type: "integer", required: false, in: "form", desc: "Optional for a session_note: an Event in the Project the user manages or works on" }, + { name: "audio_file", type: "file", required: true, in: "form", desc: "MP3, M4A, MP4, WAV, WEBM, OGG, OGA, AAC or FLAC, up to 200 MB" } + ], [ + { code: "201", cls: "response-2xx", desc: "Created and queued for transcription" }, + { code: "422", cls: "response-4xx", desc: "A choice is missing or not allowed, or the file is not supported audio" }, + { code: "503", cls: "response-5xx", desc: "The file could not be stored; nothing was created" } + ], "Send as multipart/form-data, then poll GET /case_notes/{id} until status is completed.")} + ${endpointCard("DELETE", "/case_notes/{id}/recording", "Delete an Audio Note's recording", true, [ + { name: "id", type: "integer", required: true, in: "path", desc: "Audio Note (CaseNote) ID" } + ], [ + { code: "200", cls: "response-2xx", desc: "The Audio Note, with has_recording: false" }, + { code: "403", cls: "response-4xx", desc: "Only the Organisation's admins may delete a recording" }, + { code: "404", cls: "response-4xx", desc: "Not found, or not one the user may see" }, + { code: "422", cls: "response-4xx", desc: "Still being transcribed" }, + { code: "503", cls: "response-5xx", desc: "Could not be removed from storage; nothing changed" } + ], "Keeps the note, its transcript, summary and survey response. Cannot be undone.")} +
+
+
Surveys & Stories
From cf5c368dbc698377c4c6e6e685850142168ba178 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 23 Nov 2026 14:17:37 +0000 Subject: [PATCH 09/15] Port api-docs draft #110: add matching Contacts as event guests, and bulk action progress (CP-8956) --- openapi.yaml | 155 +++++++++++++++++++++++++++++++++++++++++++++++++-- server.js | 26 ++++++--- 2 files changed, 168 insertions(+), 13 deletions(-) diff --git a/openapi.yaml b/openapi.yaml index 545c21f..5ef2807 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -4858,6 +4858,51 @@ paths: $ref: '#/components/responses/Unauthorized' "404": $ref: '#/components/responses/NotFound' + /beneficiaries/bulk_actions/{id}: + get: + tags: [Beneficiaries] + summary: Get the progress of a bulk action on Contacts + description: | + The progress of any change to many Contacts at once, such as adding everyone matching + `filter_data` as an event's guests (`POST /events/{id}/guests`). Only the user who started + it can see it. `action_name` says which change it is (e.g. `add_to_event`, + `move_through_projects`). `status` is `pending`, `running`, `completed`, `failed` or + `undone`; `processed_count` of `total_count` Contacts have been reached so far, and `summary` + is filled in once it has finished. + operationId: getBeneficiaryBulkAction + security: [{tokenAuth: []}] + parameters: + - name: id + in: path + required: true + schema: { type: integer } + responses: + "200": + description: The bulk action's progress + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/BeneficiaryBulkAction' + - type: object + properties: + action_name: + type: string + description: Which change this is, e.g. add_to_event or move_through_projects + example: + id: 52 + status: running + total_count: 812 + processed_count: 240 + changed_count: 231 + skip_counts: { not_in_project: 9 } + background: true + summary: null + action_name: add_to_event + "401": + $ref: '#/components/responses/Unauthorized' + "404": + $ref: '#/components/responses/NotFound' /project_beneficiaries: get: tags: [Beneficiaries] @@ -10413,6 +10458,21 @@ paths: Roles for guests. A fixed guest limit is respected. For an event in a recurring series, `apply_to: this_and_upcoming_events` adds them to the later events too. Anyone who can open the event page can add guests. + + **Adding everyone who matches the Manage Contacts filters.** Instead of `contact_ids`, give + `filter_data` (the Manage Contacts filters, e.g. `{"beneficiary_state_ids": ["1"]}`; `{}` + for every Contact the user can see), leaving out `excluded_ids`. `project_id` is a shortcut + for the Project filter. This is **Add to › An event** for the Contacts selected on Manage + Contacts. Each Contact is added in turn, and those that can't be added are skipped and + counted in `skip_counts` rather than refusing the whole request: + - `headline_only`: the user only has Headline Only Access to them; + - `not_in_project`: they aren't in the event's project; + - `event_full`: the event's guest limit has been reached; + - `requirements_not_met`: they don't meet the Guest Status's requirements. + Contacts already on the event keep their Guest Status. Up to 50 Contacts are added + straight away (`200`); more run in the background (`202`), and + `GET /beneficiaries/bulk_actions/{id}` reports the progress. `filter_data` adds guests to + this event only, and can't be combined with `contact_ids` or `event_role_id`. security: [{tokenAuth: []}] parameters: - $ref: '#/components/parameters/ResourceId' @@ -10422,22 +10482,65 @@ paths: application/json: schema: type: object - required: [contact_ids] properties: - contact_ids: { type: array, items: { type: integer } } + contact_ids: + type: array + items: { type: integer } + description: The Contacts to add. Leave out to use filter_data instead. + filter_data: + type: object + additionalProperties: true + description: Manage Contacts filters selecting the Contacts to add, used instead of contact_ids + excluded_ids: + type: array + items: { type: integer } + description: With filter_data, Contacts matching the filters to leave out + project_id: + type: integer + description: With filter_data, a shortcut for the Project filter (Contacts in this Project) guest_status_id: { type: integer } event_role_id: { type: integer } apply_to: { type: string, enum: [this_event, this_and_upcoming_events], default: this_event } - example: - contact_ids: [5501, 5502] - guest_status_id: 12 - event_role_id: 4 + examples: + contacts: + summary: Named Contacts + value: + contact_ids: [5501, 5502] + guest_status_id: 12 + event_role_id: 4 + matching: + summary: Everyone matching the Manage Contacts filters + value: + filter_data: { beneficiary_state_ids: ["1"] } + excluded_ids: [5503] + guest_status_id: 12 responses: + "200": + description: filter_data was given and the matching Contacts were added straight away (50 or fewer) + content: + application/json: + schema: { $ref: '#/components/schemas/EventGuestsBulkAdd' } + example: + id: 51 + status: completed + total_count: 8 + processed_count: 8 + changed_count: 6 + skip_counts: { not_in_project: 1 } + background: false + summary: "6 contacts changed. 1 skipped: 1 because they aren't in Youth Mentoring, the event's project." + event_id: 2201 + guests_count: 14 "201": description: The guests were added content: application/json: schema: { $ref: '#/components/schemas/EventGuestCount' } + "202": + description: filter_data was given and more than 50 Contacts match, so they are added in the background. Poll GET /beneficiaries/bulk_actions/{id}. + content: + application/json: + schema: { $ref: '#/components/schemas/EventGuestsBulkAdd' } "401": $ref: '#/components/responses/Unauthorized' "403": @@ -22502,6 +22605,46 @@ components: event_id: { type: integer } guests_count: { type: integer } + BeneficiaryBulkAction: + type: object + description: A change to many Contacts at once, and how far it has got + properties: + id: + type: integer + status: + type: string + enum: [pending, running, completed, failed, undone] + total_count: + type: integer + description: Contacts it will try to change (the selection, less Headline Only Contacts) + processed_count: + type: integer + description: Contacts reached so far + changed_count: + type: integer + description: Contacts it changed + skip_counts: + type: object + additionalProperties: { type: integer } + description: Skipped Contacts by reason, e.g. headline_only, not_in_project or error + background: + type: boolean + description: True when it runs in the background (more than 50 Contacts) + summary: + type: string + nullable: true + description: The finished message, e.g. "6 contacts changed. 1 skipped …"; null until it has finished + + EventGuestsBulkAdd: + allOf: + - $ref: '#/components/schemas/BeneficiaryBulkAction' + - type: object + properties: + event_id: { type: integer } + guests_count: + type: integer + description: The event's guests now (while it runs in the background, so far) + EventStaffMember: type: object required: [user_id, name, roles, event_role] diff --git a/server.js b/server.js index 5f4d86b..7d9b113 100644 --- a/server.js +++ b/server.js @@ -1905,6 +1905,13 @@ function buildDocsPage() { { code: "401", cls: "response-4xx", desc: "Not authenticated" }, { code: "404", cls: "response-4xx", desc: "Not found, or started by someone else" } ], "Only the user who started the move can see it.")} + ${endpointCard("GET", "/beneficiaries/bulk_actions/{id}", "Get the progress of a bulk action on Contacts", true, [ + { name: "id", in: "path", type: "integer", required: true, desc: "The id returned by a bulk change, e.g. POST /events/{id}/guests with filter_data" } + ], [ + { code: "200", cls: "response-2xx", desc: "action_name (e.g. add_to_event, move_through_projects), status (pending, running, completed, failed or undone), processed_count of total_count, changed_count, skip_counts, and summary once finished" }, + { code: "401", cls: "response-4xx", desc: "Not authenticated" }, + { code: "404", cls: "response-4xx", desc: "Not found, or started by someone else" } + ], "Works for any change to many Contacts at once. Only the user who started it can see it.")} ${endpointCard("POST", "/beneficiaries/bulk_groups", "Add many Contacts to Groups, or take them out of Groups", true, [ { name: "add_ids", in: "body", type: "integer[]", required: false, desc: "Groups to add every Contact to, from GET /groups" }, { name: "remove_ids", in: "body", type: "integer[]", required: false, desc: "Groups to take every Contact out of. Give at least one of add_ids and remove_ids, and never the same Group in both" }, @@ -4121,14 +4128,19 @@ function buildDocsPage() { { code: "403", cls: "response-4xx", desc: "You may not see this event" } ])} ${endpointCard("POST", "/events/{id}/guests", "Add guests to an event", true, [ - { name: "contact_ids", type: "array", required: true, desc: "Contacts in the event's project" }, + { name: "contact_ids", type: "array", required: false, desc: "Contacts in the event's project. Leave out to choose them with filter_data" }, + { name: "filter_data", type: "object", required: false, desc: "Instead of contact_ids: everyone matching the Manage Contacts filters, e.g. {\"beneficiary_state_ids\": [\"1\"]}" }, + { name: "excluded_ids", type: "integer[]", required: false, desc: "With filter_data: Contacts matching the filters to leave out" }, + { name: "project_id", type: "integer", required: false, desc: "With filter_data: shortcut for the Contacts in this Project" }, { name: "guest_status_id", type: "integer", required: false, desc: "One of the Event Format's Guest Statuses; its requirements are checked" }, - { name: "event_role_id", type: "integer", required: false, desc: "One of the Event Format's Event Roles for guests" }, - { name: "apply_to", type: "string", required: false, desc: "this_event (default) or this_and_upcoming_events" } - ], [ - { code: "201", cls: "response-2xx", desc: "event_id and guests_count" }, - { code: "422", cls: "response-4xx", desc: "Every problem: Contacts outside the project, an unmet requirement, a full event..." } - ])} + { name: "event_role_id", type: "integer", required: false, desc: "One of the Event Format's Event Roles for guests (contact_ids only)" }, + { name: "apply_to", type: "string", required: false, desc: "this_event (default) or this_and_upcoming_events (contact_ids only)" } + ], [ + { code: "200", cls: "response-2xx", desc: "filter_data, up to 50 Contacts added straight away: id, status, changed_count, skip_counts, summary, event_id and guests_count" }, + { code: "201", cls: "response-2xx", desc: "contact_ids: event_id and guests_count" }, + { code: "202", cls: "response-2xx", desc: "filter_data, more than 50 Contacts: added in the background. Poll GET /beneficiaries/bulk_actions/{id} with the id" }, + { code: "422", cls: "response-4xx", desc: "Every problem: Contacts outside the project, an unmet requirement, a full event... (contact_ids), or a Guest Status not on the Event Format" } + ], "With contact_ids all the Contacts are added or none are. With filter_data (Add to › An event for the Contacts selected on Manage Contacts) each Contact is added in turn, and those that can't be are skipped and counted in skip_counts: headline_only, not_in_project, event_full, requirements_not_met. Contacts already on the event keep their Guest Status.")} ${endpointCard("PATCH", "/events/{id}/guests/{contact_id}", "Change a guest's Guest Status or Event Role", true, [ { name: "guest_status_id", type: "integer", required: false, desc: "New Guest Status; its requirements are checked" }, { name: "event_role_id", type: "integer | null", required: false, desc: "New Event Role, or null to clear it" } From d8c547aef32892da2d69afd138aad3081a967b42 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 23 Nov 2026 14:17:58 +0000 Subject: [PATCH 10/15] Port api-docs drafts #111 and #114: bulk Checklists and relationships (CP-8956) GET /relationship_categories and RelationshipCategory were already on main, so only the two bulk endpoints and their cards are added. --- openapi.yaml | 187 +++++++++++++++++++++++++++++++++++++++++++++++++++ server.js | 29 ++++++++ 2 files changed, 216 insertions(+) diff --git a/openapi.yaml b/openapi.yaml index 5ef2807..c42721f 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -4903,6 +4903,193 @@ paths: $ref: '#/components/responses/Unauthorized' "404": $ref: '#/components/responses/NotFound' + /beneficiaries/bulk_checklists: + post: + tags: [Beneficiaries] + summary: Start a Checklist for many Contacts at once + description: | + Starts a Checklist for many Contacts (Beneficiaries) in one request. This is **Add to › A + Checklist** for the Contacts selected on the Manage Contacts page. Each Contact is started + the same way as Add a Checklist on their profile, and actions their records already prove + done are marked done straight away. + + **Which Checklist.** `checklist_id` and `project_id`: a Checklist the project lets colleagues + add by hand, through that project. Organisation Editors and Reporters may use any open + project; other users only projects they are an Editor or Reporter of. Anything else is + refused with `422`. + + **Which Contacts.** Either `beneficiary_ids` (at most 500), or everyone matching + `filter_data` (the Manage Contacts filters) leaving out `excluded_ids`. With `filter_data`, + `project_id` also narrows the filters to Contacts in that project, since anyone outside it + would be skipped anyway. + + **Skipped Contacts** are counted in `skip_counts`: `headline_only` (the user only has + Headline Only Access to them), `not_in_project` (they aren't in the project), `not_allowed` + (the Checklist can't be started for them). A Contact who already has the Checklist keeps + their progress and isn't counted as changed. + + Up to 50 Contacts are started straight away (`200`); more run in the background (`202`), and + `GET /beneficiaries/bulk_actions/{id}` reports the progress. `charity_id` may be left out when + the user belongs to one organisation. + operationId: startChecklistForBeneficiaries + security: [{tokenAuth: []}] + requestBody: + required: true + content: + application/json: + schema: + type: object + required: [checklist_id, project_id] + properties: + charity_id: + type: integer + description: The organisation whose Contacts to start it for + checklist_id: + type: integer + description: The Checklist to start + project_id: + type: integer + description: The project it is started through (one that lets colleagues add it by hand) + beneficiary_ids: + type: array + maxItems: 500 + items: { type: integer } + description: The Contacts, at most 500. Leave out to use filter_data instead. + filter_data: + type: object + additionalProperties: true + description: Manage Contacts filters selecting the Contacts, used when beneficiary_ids is left out + excluded_ids: + type: array + items: { type: integer } + description: Contacts matching the filters to leave out + example: + charity_id: 12 + checklist_id: 31 + project_id: 572 + beneficiary_ids: [160498, 160499, 160500] + responses: + "200": + description: The Checklist was started straight away (50 Contacts or fewer) + content: + application/json: + schema: { $ref: '#/components/schemas/BeneficiaryBulkAction' } + example: + id: 61 + status: completed + total_count: 10 + processed_count: 10 + changed_count: 7 + skip_counts: { not_in_project: 3 } + background: false + summary: "7 contacts changed. 3 skipped: 3 because they aren't in Youth Mentoring." + "202": + description: More than 50 Contacts, so it runs in the background. Poll GET /beneficiaries/bulk_actions/{id}. + content: + application/json: + schema: { $ref: '#/components/schemas/BeneficiaryBulkAction' } + "401": + $ref: '#/components/responses/Unauthorized' + "404": + $ref: '#/components/responses/NotFound' + "422": + $ref: '#/components/responses/UnprocessableEntityList' + /beneficiaries/bulk_relationships: + post: + tags: [Beneficiaries] + summary: Link many Contacts to one Contact with the same relationship + description: | + Gives many Contacts (Beneficiaries) the same relationship with one Contact, in one request. + This is **Add to › A relationship** for the Contacts selected on the Manage Contacts page, + e.g. making Oakfield School the School of every selected pupil. Each relationship is added + the same way as Add a Relationship on a Contact's profile, so it appears on both Contacts' + History. + + **Which relationship.** `relationship_category_id` is one of the organisation's + Relationship Categories (`GET /relationship_categories`), which has two sides, e.g. School & + Pupil. `related_contact_id` is the one Contact everyone is linked to, and + `related_contact_is` says which side that Contact takes: `parent` (the first title, School) + or `child` (the second, Pupil). Each selected Contact takes the other side. + + **Which Contacts.** Either `beneficiary_ids` (at most 500), or everyone matching + `filter_data` (the Manage Contacts filters) leaving out `excluded_ids`. + + **Skipped Contacts** are counted in `skip_counts`: `headline_only` (the user only has + Headline Only Access to them), `already_linked` (they already have that relationship with + that Contact), `same_contact` (the chosen Contact itself), `not_allowed` (the relationship + couldn't be saved for them). + + Up to 50 Contacts are linked straight away (`200`); more run in the background (`202`), and + `GET /beneficiaries/bulk_actions/{id}` reports the progress. `charity_id` may be left out when + the user belongs to one organisation. + operationId: linkBeneficiariesToContact + security: [{tokenAuth: []}] + requestBody: + required: true + content: + application/json: + schema: + type: object + required: [relationship_category_id, related_contact_id, related_contact_is] + properties: + charity_id: + type: integer + description: The organisation whose Contacts to link + relationship_category_id: + type: integer + description: One of the organisation's Relationship Categories + related_contact_id: + type: integer + description: The Contact every selected Contact is linked to + related_contact_is: + type: string + enum: [parent, child] + description: Which side of the category the related Contact takes; the selected Contacts take the other + beneficiary_ids: + type: array + maxItems: 500 + items: { type: integer } + description: The Contacts to link, at most 500. Leave out to use filter_data instead. + filter_data: + type: object + additionalProperties: true + description: Manage Contacts filters selecting the Contacts, used when beneficiary_ids is left out + excluded_ids: + type: array + items: { type: integer } + description: Contacts matching the filters to leave out + example: + charity_id: 12 + relationship_category_id: 8 + related_contact_id: 160400 + related_contact_is: parent + beneficiary_ids: [160498, 160499, 160500] + responses: + "200": + description: The Contacts were linked straight away (50 or fewer) + content: + application/json: + schema: { $ref: '#/components/schemas/BeneficiaryBulkAction' } + example: + id: 71 + status: completed + total_count: 5 + processed_count: 5 + changed_count: 5 + skip_counts: {} + background: false + summary: "5 contacts changed." + "202": + description: More than 50 Contacts, so they are linked in the background. Poll GET /beneficiaries/bulk_actions/{id}. + content: + application/json: + schema: { $ref: '#/components/schemas/BeneficiaryBulkAction' } + "401": + $ref: '#/components/responses/Unauthorized' + "404": + $ref: '#/components/responses/NotFound' + "422": + $ref: '#/components/responses/UnprocessableEntityList' /project_beneficiaries: get: tags: [Beneficiaries] diff --git a/server.js b/server.js index 7d9b113..bc0b266 100644 --- a/server.js +++ b/server.js @@ -1905,6 +1905,35 @@ function buildDocsPage() { { code: "401", cls: "response-4xx", desc: "Not authenticated" }, { code: "404", cls: "response-4xx", desc: "Not found, or started by someone else" } ], "Only the user who started the move can see it.")} + ${endpointCard("POST", "/beneficiaries/bulk_checklists", "Start a Checklist for many Contacts at once", true, [ + { name: "checklist_id", in: "body", type: "integer", required: true, desc: "The Checklist to start" }, + { name: "project_id", in: "body", type: "integer", required: true, desc: "The Project it is started through: one that lets colleagues add it by hand" }, + { name: "charity_id", in: "body", type: "integer", required: false, desc: "The organisation. Optional if you belong to only one" }, + { name: "beneficiary_ids", in: "body", type: "integer[]", required: false, desc: "The Contacts, at most 500. Leave out to choose them with filter_data" }, + { name: "filter_data", in: "body", type: "object", required: false, desc: "Manage Contacts filters choosing the Contacts" }, + { name: "excluded_ids", in: "body", type: "integer[]", required: false, desc: "Contacts matching the filters to leave out" } + ], [ + { code: "200", cls: "response-2xx", desc: "Up to 50 Contacts, started straight away: id, status, changed_count, skip_counts and summary" }, + { code: "202", cls: "response-2xx", desc: "More than 50 Contacts: started in the background. Poll GET /beneficiaries/bulk_actions/{id} with the id" }, + { code: "401", cls: "response-4xx", desc: "Not authenticated" }, + { code: "404", cls: "response-4xx", desc: "An organisation you aren't in" }, + { code: "422", cls: "response-4xx", desc: "A Checklist or Project you can't start it through, more than 500 beneficiary_ids, or no charity_id when you belong to several organisations" } + ], "Add to › A Checklist for the Contacts selected on the Manage Contacts page. Each Contact is started as Add a Checklist on their profile does, and steps their records already prove done are ticked off. Contacts outside the Project are skipped (skip_counts.not_in_project), as are those you only have Headline Only Access to (skip_counts.headline_only). Contacts who already have the Checklist keep their progress. Organisation Editors and Reporters may use any open Project; others only Projects they are an Editor or Reporter of.")} + ${endpointCard("POST", "/beneficiaries/bulk_relationships", "Link many Contacts to one Contact with the same relationship", true, [ + { name: "relationship_category_id", in: "body", type: "integer", required: true, desc: "One of the organisation's Relationship Categories (GET /relationship_categories)" }, + { name: "related_contact_id", in: "body", type: "integer", required: true, desc: "The Contact everyone is linked to" }, + { name: "related_contact_is", in: "body", type: "string", required: true, desc: "parent or child: which side of the category the related Contact takes. The selected Contacts take the other" }, + { name: "charity_id", in: "body", type: "integer", required: false, desc: "The organisation. Optional if you belong to only one" }, + { name: "beneficiary_ids", in: "body", type: "integer[]", required: false, desc: "The Contacts, at most 500. Leave out to choose them with filter_data" }, + { name: "filter_data", in: "body", type: "object", required: false, desc: "Manage Contacts filters choosing the Contacts" }, + { name: "excluded_ids", in: "body", type: "integer[]", required: false, desc: "Contacts matching the filters to leave out" } + ], [ + { code: "200", cls: "response-2xx", desc: "Up to 50 Contacts, linked straight away: id, status, changed_count, skip_counts and summary" }, + { code: "202", cls: "response-2xx", desc: "More than 50 Contacts: linked in the background. Poll GET /beneficiaries/bulk_actions/{id} with the id" }, + { code: "401", cls: "response-4xx", desc: "Not authenticated" }, + { code: "404", cls: "response-4xx", desc: "An organisation you aren't in" }, + { code: "422", cls: "response-4xx", desc: "Another organisation's category or Contact, an unknown side, more than 500 beneficiary_ids, or no charity_id when you belong to several organisations" } + ], "Add to › A relationship for the Contacts selected on the Manage Contacts page, e.g. making Oakfield School the School of every selected pupil. Each relationship is added as Add a Relationship on a Contact's profile does and appears on both Contacts' History. Skipped Contacts are counted in skip_counts: already_linked (they already have that relationship with that Contact), same_contact, headline_only and not_allowed.")} ${endpointCard("GET", "/beneficiaries/bulk_actions/{id}", "Get the progress of a bulk action on Contacts", true, [ { name: "id", in: "path", type: "integer", required: true, desc: "The id returned by a bulk change, e.g. POST /events/{id}/guests with filter_data" } ], [ From 3e9bc11d0bd05fe78aab4e57fb6dc3a8c2165360 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 23 Nov 2026 14:18:44 +0000 Subject: [PATCH 11/15] Port api-docs draft #60: contact_criteria on Workflow Trackers (CP-8520) --- openapi.yaml | 17 +++++++++++++++++ server.js | 6 +++--- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/openapi.yaml b/openapi.yaml index c42721f..085a786 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -27395,6 +27395,21 @@ components: items: type: string enum: [editor, reporter, observer] + contact_criteria: + $ref: '#/components/schemas/WorkflowTrackerContactCriteria' + + WorkflowTrackerContactCriteria: + type: object + description: >- + "Only count contacts who match": Contact Filters criteria, in the same shape as a Cohort Tracker's criteria + and a Saved Filter's, that a Contact must meet for their items to count. Matched on each Contact's current + details, so editing a Contact can change past results. {} counts every Contact. Keys a Contacts filter + doesn't read, and blank values, are dropped. + additionalProperties: true + example: + age_to: + year: "17" + beneficiary_types: ["3"] WorkflowTracker: type: object @@ -27431,6 +27446,8 @@ components: example: destinations: "except" project_ids: [4512] + contact_criteria: + $ref: '#/components/schemas/WorkflowTrackerContactCriteria' created_at: type: string format: date-time diff --git a/server.js b/server.js index bc0b266..ac041a3 100644 --- a/server.js +++ b/server.js @@ -3584,7 +3584,7 @@ function buildDocsPage() {
Impact framework

Workflow Trackers

-

A Workflow Tracker is a metric that counts records Makerble's own features create, rather than Contacts tagged in updates. Its source says what it counts: signpostings (Signpostings made from the Project, counted once whether they name the Organisation signposted to, the Person, or both; signpostings saved without a Project aren't counted anywhere), internal_referrals (Contacts in the Project who are added to another of the Organisation's Projects, dated by the Status in Projects history), cases_created (Cases created on the Project), cases_closed (each time one of those Cases is closed), cases_open (the Cases open at the end of each timeframe; always a snapshot) or time_spent (hours logged in Timesheets, to 1 decimal place: Task and Update Timesheets dated by their Update or by when the Task was done, and Event Timesheets dated by when the Event started, so time logged later lands in the period the work happened; Timesheets on draft Updates aren't counted; its unit is hours). count_mode is items (each signposting, referral, Case or closing; adds up across periods, except cases_open) or contacts (each Contact once; a snapshot). Confidential Cases are counted, but only listed to people who can see them. It is placed in an Impact Scorecard column like other metrics.

+

A Workflow Tracker is a metric that counts records Makerble's own features create, rather than Contacts tagged in updates. Its source says what it counts: signpostings (Signpostings made from the Project, counted once whether they name the Organisation signposted to, the Person, or both; signpostings saved without a Project aren't counted anywhere), internal_referrals (Contacts in the Project who are added to another of the Organisation's Projects, dated by the Status in Projects history), cases_created (Cases created on the Project), cases_closed (each time one of those Cases is closed), cases_open (the Cases open at the end of each timeframe; always a snapshot) or time_spent (hours logged in Timesheets, to 1 decimal place: Task and Update Timesheets dated by their Update or by when the Task was done, and Event Timesheets dated by when the Event started, so time logged later lands in the period the work happened; Timesheets on draft Updates aren't counted; its unit is hours). count_mode is items (each signposting, referral, Case or closing; adds up across periods, except cases_open) or contacts (each Contact once; a snapshot). Confidential Cases are counted, but only listed to people who can see them. It is placed in an Impact Scorecard column like other metrics. Set contact_criteria (\"Only count contacts who match\") to count only the items of Contacts who meet Contact Filters criteria, in the same shape as a Cohort Tracker's criteria; they are matched on each Contact's current details, so editing a Contact can change past results.

✓ @@ -3610,12 +3610,12 @@ function buildDocsPage() { { code: "200", cls: "response-2xx", desc: "results: {period, year_to_date, all_time} on the Project, and the latest records counted that the user may see, with hidden_count for the rest" }, { code: "404", cls: "response-4xx", desc: "The Project isn't the Organisation's" }, { code: "422", cls: "response-4xx", desc: "Unknown source or count_mode, or bad settings" } - ], "Body: charity_id, project_id, workflow_tracker: {source, count_mode, settings}. The Period ends at the Project's next deadline, or today when it has none ahead.")} + ], "Body: charity_id, project_id, workflow_tracker: {source, count_mode, settings, contact_criteria}. The Period ends at the Project's next deadline, or today when it has none ahead.")} ${endpointCard("POST", "/workflow_trackers", "Create a Workflow Tracker", true, [], [ { code: "201", cls: "response-2xx", desc: "Workflow Tracker created" }, { code: "403", cls: "response-4xx", desc: "Not an editor or reporter of the Organisation" }, { code: "422", cls: "response-4xx", desc: "Validation failed" } - ], "Body: workflow_tracker: {charity_id, name, description, source, count_mode, settings}. For internal_referrals, settings choose which Projects count as a referral: {destinations: \"any\"}, {destinations: \"only\", project_ids: [...]} or {destinations: \"except\", project_ids: [...]} (the default, with none listed). For the Cases sources, settings: {case_form_id: ...} counts only the Cases created with that Case Form; leave it out for any. For time_spent, settings: {kinds: [...], user_ids: [...], roles: [...]}: kinds are any of updates_and_tasks, event_staff (Event Workers and Event Managers) and event_guests (default the first two); user_ids and roles (editor: Organisation Admins and Project Managers, reporter: Changemakers, observer: Observers) count only those colleagues' time, and leave Event guests' time as it is. count_mode is always items.")} + ], "Body: workflow_tracker: {charity_id, name, description, source, count_mode, settings, contact_criteria}. contact_criteria (optional): Contact Filters criteria a Contact must meet for their items to count, e.g. {age_to: {year: \"17\"}}; {} counts every Contact. For internal_referrals, settings choose which Projects count as a referral: {destinations: \"any\"}, {destinations: \"only\", project_ids: [...]} or {destinations: \"except\", project_ids: [...]} (the default, with none listed). For the Cases sources, settings: {case_form_id: ...} counts only the Cases created with that Case Form; leave it out for any. For time_spent, settings: {kinds: [...], user_ids: [...], roles: [...]}: kinds are any of updates_and_tasks, event_staff (Event Workers and Event Managers) and event_guests (default the first two); user_ids and roles (editor: Organisation Admins and Project Managers, reporter: Changemakers, observer: Observers) count only those colleagues' time, and leave Event guests' time as it is. count_mode is always items.")} ${endpointCard("PATCH", "/workflow_trackers/{id}", "Update a Workflow Tracker", true, [ { name: "id", in: "path", type: "integer", required: true, desc: "Workflow Tracker ID" } ], [ From b96b3031d4bff49876cab98e0662e606868a4cef Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 23 Nov 2026 14:19:05 +0000 Subject: [PATCH 12/15] Port api-docs draft #64: add_colleague permissions and 403/404 (CP-8540) --- openapi.yaml | 23 ++++++++++++++++++++++- server.js | 6 ++++-- 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/openapi.yaml b/openapi.yaml index 085a786..3a85c2b 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -3874,7 +3874,16 @@ paths: post: tags: [Projects] summary: Add users to a Project - description: Grants roles on a Project. A user can hold Editor, Reporter, and Observer simultaneously. + description: | + Adds users to Projects' teams, as the Project's **Add Users** page does: as Project Managers (`editor_ids`), + Changemakers (`reporter_ids`) or Analysts (`observer_ids`). A user can hold more than one role. + + You must be a Project Manager of every listed Project, or an Organisation Admin of its Organisation. The users + must already be colleagues in the Project's Organisation, unless the Organisation's preference "Allow Project + Managers to add Makerble Users outside the organisation to their project" is on. + + The request is all or nothing: if any Project isn't found (404), isn't yours to manage (403) or any user can't + be added (422), nobody is added to any Project. operationId: addColleague security: [{tokenAuth: []}] requestBody: @@ -3914,6 +3923,10 @@ paths: description: Users added "401": $ref: '#/components/responses/Unauthorized' + "403": + $ref: '#/components/responses/AddColleagueForbidden' + "404": + $ref: '#/components/responses/NotFound' "422": $ref: '#/components/responses/UnprocessableEntity' @@ -19878,6 +19891,14 @@ components: example: success: false errors: "Permission denied." + AddColleagueForbidden: + description: You aren't a Project Manager of one of the listed Projects or an Organisation Admin of its Organisation. Nobody is added to any of them. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + example: + error: "You don't have permission to add users to project 619." UnprocessableEntity: description: Validation failed content: diff --git a/server.js b/server.js index ac041a3..df5d69e 100644 --- a/server.js +++ b/server.js @@ -1363,8 +1363,10 @@ function buildDocsPage() { ${endpointCard("POST", "/projects/add_colleague.json", "Add users to a Project", true, [], [ { code: "200", cls: "response-2xx", desc: "Users added successfully" }, { code: "401", cls: "response-4xx", desc: "Not authenticated" }, - { code: "422", cls: "response-4xx", desc: "Validation failed" } - ], "Grant one or more users a role on a Project. A user can hold Editor, Reporter, and Observer simultaneously. Pass user IDs in role_data[].editor_ids, reporter_ids, or observer_ids.")} + { code: "403", cls: "response-4xx", desc: "Not a Project Manager of one of the Projects or an Organisation Admin of its Organisation (e.g. a Changemaker)" }, + { code: "404", cls: "response-4xx", desc: "A Project wasn't found" }, + { code: "422", cls: "response-4xx", desc: "A user can't be added: not a colleague in the Project's Organisation" } + ], "Adds users to Projects' teams, as the Project's Add Users page does: as Project Managers (role_data[].editor_ids), Changemakers (reporter_ids) or Analysts (observer_ids). A user can hold more than one role. You must be a Project Manager of every listed Project or an Organisation Admin of its Organisation, and the users must already be colleagues in that Organisation unless its preference lets Project Managers add users from outside it. It's all or nothing: on any error nobody is added.")} ${endpointCard("POST", "/projects/bulk_status_change", "Close or reopen many Projects at once", true, [ { name: "status_action", type: "string", required: true, desc: "close or reopen" }, { name: "project_ids", type: "integer[]", required: true, desc: "The Projects to change, at most 200" }, From 891dd61fdb46bcd1427d14311cb69baa313c50c8 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 23 Nov 2026 14:20:24 +0000 Subject: [PATCH 13/15] Port api-docs drafts #56, #57 and #85: Event Catalogues, Contacts' Portal links and Explore pages (CP-8843, CP-8870) Paths and schemas are taken from the Rails repo's contract-tested copy of the spec, which also has the Explore Ideas, Impact Frameworks and Metrics pages added to #85 after it was opened. The nav links use the method classes with no inline style. --- openapi.yaml | 15170 +++++++++++++++++++++++++++---------------------- server.js | 259 + 2 files changed, 8641 insertions(+), 6788 deletions(-) diff --git a/openapi.yaml b/openapi.yaml index 3a85c2b..b826fb3 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -337,6 +337,10 @@ 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: Contacts' Portal + description: Each Contact's own link to the Contacts' Portal, where they book onto events from Event Catalogues - name: Formula Trackers description: | Metrics worked out from other trackers with + − × ÷, numbers and brackets, e.g. Referrals @@ -9815,6 +9819,368 @@ paths: $ref: '#/components/responses/EventFormatAdminOnly' "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' + /projects/{project_id}/portal_links: + get: + tags: [Contacts' Portal] + summary: List Contacts' Portal links in a project + operationId: listPortalLinks + description: | + Lists the project's Contacts who can see at least one Event Catalogue on the Contacts' + Portal, where Contacts book onto events, as the project's Portal Links page shows them: + whether each has a Portal link, when it was last sent and how, and whether they can be + sent it by email or SMS. The link itself is never returned, because it signs the Contact + in to their Portal. Project Managers and Reporters of the project, and the organisation's + Admins and Reporters, may read it. To give a Contact access, change who can see an Event + Catalogue in the project (`PATCH /event_catalogues/{id}/projects/{project_id}/access`). + security: [{tokenAuth: []}] + parameters: + - name: project_id + in: path + required: true + schema: + type: integer + - $ref: '#/components/parameters/Page' + - $ref: '#/components/parameters/PerPage' + responses: + "200": + description: One page of Contacts, by name + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedPortalLinks' + example: + page: 1 + page_size: 1 + page_count: 1 + total_count: 1 + data: + - contact_id: 9001 + name: Amara Diallo + link_status: active + last_sent_at: "2026-10-20T09:15:00Z" + last_sent_channel: email + can_email: true + can_sms: false + "401": + $ref: '#/components/responses/Unauthorized' + "403": + $ref: '#/components/responses/PortalLinksForbidden' + "404": + $ref: '#/components/responses/NotFound' + /projects/{project_id}/portal_links/send: + post: + tags: [Contacts' Portal] + summary: Send Contacts their Portal link + operationId: sendPortalLinks + description: | + Sends each Contact their own link to the Contacts' Portal by email or SMS, as the Send + button on the project's Portal Links page does, creating the link if they don't have one + yet. Every Contact must be in the project and able to see at least one of its Event + Catalogues; otherwise nothing is sent and the response says why. Contacts with no email + address (or, for SMS, no mobile number) are skipped and named in `skipped`. Only the + project's Project Managers and the organisation's Admins may send links. + security: [{tokenAuth: []}] + parameters: + - name: project_id + in: path + required: true + schema: + type: integer + requestBody: + required: true + content: + application/json: + schema: + type: object + required: [contact_ids, channel] + properties: + contact_ids: + type: array + items: + type: integer + channel: + type: string + enum: [email, sms] + example: + contact_ids: [9001, 9002] + channel: email + responses: + "200": + description: The links were queued to send + content: + application/json: + schema: + type: object + properties: + sent: + type: integer + description: How many Contacts were sent their link + skipped: + type: array + description: Names of the Contacts with no way to receive it + items: + type: string + example: + sent: 1 + skipped: [Ben Okafor] + "401": + $ref: '#/components/responses/Unauthorized' + "403": + $ref: '#/components/responses/PortalLinksForbidden' + "404": + $ref: '#/components/responses/NotFound' + "422": + $ref: '#/components/responses/UnprocessableEntityList' /events: get: @@ -11313,32 +11679,32 @@ paths: $ref: '#/components/responses/Unauthorized' "404": $ref: '#/components/responses/NotFound' - - /library/search: + /explore/report_templates: get: - tags: [Library] - summary: Search the library - operationId: searchLibrary + tags: [Explore] + summary: Explore Report Templates + operationId: listExploreReportTemplates description: | - Searches the reusable building blocks you may see: your organisation's own library, the - public library shared by every organisation, or both. Use it before making a new Survey, - Metric or List, so results keep adding up with those recorded against the original. + Lists the Report Templates in the Makerble® ImpactStore™, with the same search, filters, + counts and sort as the Explore Report Templates page. Every caller sees the same Report + Templates; `yours` and `in_your_library` depend on the caller's organisations. - - Every word of `query` must match the item's name or description. Surveys also match on - their question wording, Lists on their choices, and Metrics on their default question. - - `item_types` limits the search to some types (comma-separated): `survey` (Survey), - `metric` (Metric), `activity_tracker` (Activity or Attendance tracker), `outcome`, - `list` (List of answer choices), `unit`, `field`, `contact_form` (Contact Form), - `case_form` (Case Form), `impact_framework` (Impact Framework), `toolkit`, - `project_type` and `idea`. Default: every type. - - `source` is `organisation` (default), `public` or `both`. The public library holds items - approved for everyone; Makerble staff also see public items awaiting approval. Units and - Project Types belong to no organisation and are always included. - - `page` and `per_page` apply to each type, so a page holds up to `per_page` results of - each type. `total_count` adds up every type's matches and `page_count` is the page count - of the type with the most matches. - - Each result has `owner`: `your organisation`, `public library` or `Makerble`. Metrics also - have `metric_type` (`scale`, `value` or `binary`) and `choices`; Lists have `choices`. + - `query` matches the Report Template's name or description, or the label of who it's for + or its theme. + - The filters take option keys, as arrays (`theme[]=community`) or comma-separated + (`theme=community,governance`). Options in one filter combine with OR and filters + combine with AND: + - `recipient` (Who it's for): `funder`, `trustees`, `local_authority` (Commissioner or + contract), `corporate_partner`, `internal` + - `theme`: `children_and_young_people`, `community`, `employment`, `governance`, + `health_and_wellbeing`, `volunteering` + - `output` (Answer formats): `narrative`, `number`, `chart`. A Report Template matches + when any of its questions asks for that format. + - `facets` gives each filter's options with how many Report Templates each would return, + given the other filters already chosen. + - `sort` is `added` (in the most organisations' libraries first, the default), `new` or `az`. + - Add a Report Template to your organisation's library in the app with **Add to your + library** on Explore Report Templates. security: [{tokenAuth: []}] parameters: - name: query @@ -11346,613 +11712,535 @@ paths: required: false schema: type: string - example: agree disagree - description: Words to look for. Leave it out to list everything of the chosen types. - - name: item_types + example: end of grant + description: Words to look for in the Report Template's name, description, recipient or theme + - name: recipient in: query required: false schema: type: string - example: metric,list - description: Comma-separated item types to search (default every type) - - name: source + example: funder,trustees + description: Who it's for option keys, comma-separated or repeated as recipient[] + - name: theme in: query required: false schema: type: string - enum: [organisation, public, both] - default: organisation - description: Which library to search + example: community + description: Theme option keys, comma-separated or repeated as theme[] + - name: output + in: query + required: false + schema: + type: string + example: chart + description: Answer format option keys, comma-separated or repeated as output[] + - name: sort + in: query + required: false + schema: + type: string + enum: [added, new, az] + default: added + description: Most added, Newest, or A to Z - $ref: '#/components/parameters/Page' - $ref: '#/components/parameters/PerPage' - $ref: '#/components/parameters/LastSyncDatetime' responses: "200": - description: Matching items, up to `per_page` of each type + description: The listed Report Templates that match, and each filter's option counts content: application/json: schema: - $ref: '#/components/schemas/PaginatedLibrarySearch' + $ref: '#/components/schemas/PaginatedExploreReportTemplates' example: page: 1 - page_size: 2 + page_size: 1 page_count: 1 - total_count: 2 + total_count: 1 data: - - id: 812 - type: metric - name: Confidence - description: How confident the person feels about the future - owner: your organisation - metric_type: scale - choices: ["Strongly agree", "Agree", "Disagree", "Strongly disagree"] - - id: 97 - type: list - name: Agree – Disagree - description: null - owner: public library - choices: ["Strongly agree", "Agree", "Disagree", "Strongly disagree"] + - id: 18 + slug: annual-grant-report-to-a-funder + name: Annual Grant Report to a Funder + description: The yearly report most grant funders ask for. + recipient: funder + theme: community + question_count: 5 + answer_formats: [narrative, number, chart] + shared_by: Makerble® ImpactStore™ + libraries_count: 31 + yours: false + in_your_library: false + facets: + - key: recipient + label: Who it's for + options: + - value: funder + label: Funder + count: 1 + selected: true "401": $ref: '#/components/responses/Unauthorized' - "422": - description: An unknown `item_types` value or `source` - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - example: - error: "Unknown item type 'spreadsheet'. Use one of: survey, metric, activity_tracker, outcome, list, unit, field, contact_form, case_form, impact_framework, toolkit, project_type, idea" - - /library/{item_type}/{id}: + /explore/report_templates/{id}: get: - tags: [Library] - summary: Get a library item - operationId: getLibraryItem + tags: [Explore] + summary: Preview an Explore Report Template + operationId: getExploreReportTemplate description: | - Reads one library item in full, so it can be reused or copied. Use the `type` and `id` from - **Search the library**. Besides `id`, `type`, `name` and `owner`: - - - **survey**: `description`, `intervals` (its Shared Intervals in order), `question_grids` - (`{outcome_id, heading, questions}`), `scoring` (`{questions, verdicts}` when it is scored) and `questions` in - the order the Survey shows them. A question has `question` (its wording), `mandatory` and - `item` (the Metric, List, Field or Activity tracker behind it, with `metric_type`, `unit` - and `choices` where they apply), `by_interval` when it is reworded or hidden in an - Interval, and `display_if` (a list) and `skip_to` when it has those rules (see **Create a - Survey with its questions**). A section title is `{section, text}`. - - **metric**: `description`, `metric_type`, `default_question`, `unit`, `list` (with - `choices`), `success_direction` and `outcomes`. - - **list**: `choices` in order, each with `id`, `name` and `points`. - - **contact_form**: `fields`, shaped like a Survey's questions. **case_form**: `fields`, - each with `name`, `field_type`, `mandatory` and `choices`. - - **impact_framework**: `description` and `stages`, each with its `outcomes`, - `activity_trackers` and `metrics`. - - **toolkit**: `description` and `contents`, each with `type`, `id` and `name`. - - **activity_tracker**: `description`, `instruction`. **outcome**: `description`, `metrics`. - **unit**: `alignment`. **field**: `field_type`, and `capture_type` (`video`, `audio` or - `picture`) for a Video, Audio or Picture question. **project_type**: `strapline`, - `description`. **idea**: `description`. - - Linked Outcomes and Metrics are named only when you may see them. An item you may not see - returns `404`. + One Report Template listed on Explore Report Templates, as its Preview shows it: the fields + of **Explore Report Templates** plus `questions`, each with its `title` and the + `answer_formats` it asks for, in order. A Report Template that isn't in the ImpactStore is a 404. security: [{tokenAuth: []}] parameters: - - name: item_type + - name: id in: path required: true schema: - type: string - example: survey - description: The item's type, as in **Search the library** - - $ref: '#/components/parameters/ResourceId' + type: integer + example: 18 responses: "200": - description: The item + description: The Report Template's preview content: application/json: schema: - $ref: '#/components/schemas/LibraryItem' + $ref: '#/components/schemas/ExploreReportTemplatePreview' example: - id: 3051 - type: survey - name: Wellbeing check - owner: your organisation - description: Monthly check-in + id: 18 + slug: annual-grant-report-to-a-funder + name: Annual Grant Report to a Funder + description: The yearly report most grant funders ask for. + recipient: funder + theme: community + question_count: 2 + answer_formats: [narrative, number] + shared_by: Makerble® ImpactStore™ + libraries_count: 31 + yours: false + in_your_library: false questions: - - section: About you - text: A few questions about you - - question: How confident do you feel? - mandatory: true - item: - type: metric - id: 812 - name: Confidence - metric_type: scale - unit: null - choices: ["Strongly agree", "Agree", "Disagree", "Strongly disagree"] + - title: What did you set out to achieve? + answer_formats: [narrative] + - title: Who did you reach? + answer_formats: [number] "401": $ref: '#/components/responses/Unauthorized' "404": $ref: '#/components/responses/NotFound' - "422": - description: An unknown `item_type` + /explore/dropdowns: + get: + tags: [Explore] + summary: Explore Dropdowns + operationId: listExploreDropdowns + description: | + Lists the Dropdowns (answer-choice lists, Ratio Sets) shared to the Makerble® ImpactStore™ + and approved, with the same search, filters, counts and sort as the Explore Dropdowns page. + Every caller sees the same Dropdowns; `yours` depends on the caller's organisations. + + - `query` matches the Dropdown's title or any of its answer choices. + - The filters take option keys, as arrays (`theme[]=scales`) or comma-separated + (`theme=scales,demographics`). Options in one filter combine with OR and filters + combine with AND: + - `designed_for`: `surveys_and_trackers`, `forms` (bio, event and project forms) + - `choices` (Number of choices): `up_to_10`, `11_to_100`, `over_100` + - `theme`: `scales`, `demographics` + - `chip` is one of the page's Popular chips: `Scales`, `Demographics`, `Equality monitoring`. + - `facets` gives each filter's options with how many Dropdowns each would return, given the + other filters already chosen. + - `sort` is `added` (used in the most surveys, trackers and forms first, the default), `new` + or `az`. + - Copy a Dropdown into your organisation in the app with **Add to organisation** on Explore + Dropdowns. + security: [{tokenAuth: []}] + parameters: + - name: query + in: query + required: false + schema: + type: string + example: ethnicity + description: Words to look for in the Dropdown's title or answer choices + - name: designed_for + in: query + required: false + schema: + type: string + example: surveys_and_trackers + description: Designed for option keys, comma-separated or repeated as designed_for[] + - name: choices + in: query + required: false + schema: + type: string + example: up_to_10 + description: Number of choices option keys, comma-separated or repeated as choices[] + - name: theme + in: query + required: false + schema: + type: string + example: scales + description: Theme option keys, comma-separated or repeated as theme[] + - name: chip + in: query + required: false + schema: + type: string + enum: [Scales, Demographics, Equality monitoring] + description: One of the Popular chips + - name: sort + in: query + required: false + schema: + type: string + enum: [added, new, az] + default: added + description: Most added, Newest, or A to Z + - $ref: '#/components/parameters/Page' + - $ref: '#/components/parameters/PerPage' + - $ref: '#/components/parameters/LastSyncDatetime' + responses: + "200": + description: The listed Dropdowns that match, and each filter's option counts content: application/json: schema: - $ref: '#/components/schemas/Error' - - /library/{item_type}/{id}/usage: + $ref: '#/components/schemas/PaginatedExploreDropdowns' + example: + page: 1 + page_size: 1 + page_count: 1 + total_count: 1 + data: + - id: 87 + title: Agreement scale + choice_count: 5 + designed_for: [surveys_and_trackers] + themes: [scales] + shared_by: Makerble Templates + used_in_count: 42 + yours: false + facets: + - key: theme + label: Theme + options: + - value: scales + label: Scales + count: 1 + selected: true + "401": + $ref: '#/components/responses/Unauthorized' + /explore/dropdowns/{id}: get: - tags: [Library] - summary: See where a library item is used - operationId: getLibraryItemUsage + tags: [Explore] + summary: Preview an Explore Dropdown + operationId: getExploreDropdown description: | - Says whether anything depends on a library item before you change it. - - - `projects`: up to 50 projects you can see that use it, and `other_projects_count` for the rest. - - `records_count` and `last_used_at`: survey responses for a Survey; recorded values for a - Metric, Activity tracker, Outcome or List; Contacts for a Contact Form; Cases for a Case Form. - - `contained_in`: up to 50 Surveys, Contact Forms, Outcomes, Impact Frameworks, Metrics or - Toolkits that include it and that you may see. `contained_in_count` counts them all. - - `in_use` is true when any of these is above zero. - - Counts only: no records are returned. An item you may not see returns `404`. + One Dropdown listed on Explore Dropdowns: the fields of **Explore Dropdowns** plus every + one of its answer `choices`, in order. A Dropdown that isn't listed on Explore (not shared + or not approved) is a 404. security: [{tokenAuth: []}] parameters: - - name: item_type + - name: id in: path required: true schema: - type: string - example: metric - description: The item's type, as in **Search the library** - - $ref: '#/components/parameters/ResourceId' + type: integer + example: 87 responses: "200": - description: Where the item is used + description: The Dropdown and its answer choices content: application/json: schema: - $ref: '#/components/schemas/LibraryUsage' + $ref: '#/components/schemas/ExploreDropdownPreview' example: - id: 812 - type: metric - name: Confidence - projects: - - id: 4410 - name: Breakfast club - other_projects_count: 3 - records_count: 40 - last_used_at: "2026-10-14T09:12:00.000Z" - contained_in: - - type: survey - id: 3051 - name: Wellbeing check - contained_in_count: 1 - in_use: true + id: 87 + title: Agreement scale + choice_count: 5 + designed_for: [surveys_and_trackers] + themes: [scales] + shared_by: Makerble Templates + used_in_count: 42 + yours: false + choices: [Strongly disagree, Disagree, Not sure, Agree, Strongly agree] "401": $ref: '#/components/responses/Unauthorized' "404": $ref: '#/components/responses/NotFound' - "422": - description: An unknown `item_type` - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - - /lists: - post: - tags: [Library] - summary: Create a List - operationId: createList + /explore/impact_frameworks: + get: + tags: [Explore] + summary: Explore Impact Frameworks + operationId: listExploreImpactFrameworks description: | - Creates a List (a Ratio Set): the answer choices for a multiple-choice question or a scale - Metric, e.g. "Agree - Disagree". The choices keep the order you send, at most 50, each - different. The List stays private to your organisation. - - Search the library first (**Search the library**) and reuse a List that fits. If your - organisation or the public library already has a List with the same or a near-identical - name (ignoring case, spacing and punctuation), nothing is created and you get `409` with the - matches. Send `force: true` to create it anyway. Your organisation can never have two Lists - with exactly the same name, so that is a `409` even with `force`. + Lists the public, approved Impact Frameworks (Templates) in the Makerble® ImpactStore™, with + the same search, filters, counts and sort as the Explore Impact Frameworks page. Every caller + sees the same Impact Frameworks; `yours` depends on the caller's organisations. - Nothing is created unless everything is: a bad choice creates no List. + - `query` matches the Impact Framework's name or description. + - The filters take option keys, as arrays (`theme[]=inclusion`) or comma-separated + (`theme=inclusion,leadership`). Options in one filter combine with OR and filters + combine with AND: + - `theme`: `mental_health_and_wellbeing`, `children_and_young_people`, `employment_and_skills`, `community_and_culture`, `health`, `organisational`, `global_goals`, `inclusion`, `education_and_training`, `leadership` + - `set` (Part of a Framework Set): a platform-wide Framework Set's id, or `none` for + frameworks in no set. `facets` lists the sets. + - `size`: `up_to_5`, `6_to_10`, `over_10` outcomes + - `chip` is one of the page's Popular chips: `SDGs`, `Inclusion`, `Employment`, `Wellbeing`. + - `facets` gives each filter's options with how many Impact Frameworks each would return, + given the other filters already chosen. + - `sort` is `added` (on the most organisations' projects first, the default), `new` or `az`. + - Add an Impact Framework to projects in the app with **Add to projects** on Explore Impact + Frameworks. security: [{tokenAuth: []}] - requestBody: - required: true - content: - application/json: - schema: - type: object - required: [organisation_id, name, choices] - properties: - organisation_id: - type: integer - description: The organisation (Charity) that will own it; you must be one of its editors - name: - type: string - choices: - type: array - maxItems: 50 - items: - type: string - force: - $ref: '#/components/schemas/ForceCreate' - example: - organisation_id: 913 - name: "Agree - Disagree" - choices: ["Strongly agree", "Agree", "Neutral", "Disagree", "Strongly disagree"] + parameters: + - name: query + in: query + required: false + schema: + type: string + example: inclusion + description: Words to look for in the Impact Framework's name or description + - name: theme + in: query + required: false + schema: + type: string + example: global_goals + description: Theme option keys, comma-separated or repeated as theme[] + - name: set + in: query + required: false + schema: + type: string + example: none + description: Framework Set ids or none, comma-separated or repeated as set[] + - name: size + in: query + required: false + schema: + type: string + example: up_to_5 + description: Size option keys, comma-separated or repeated as size[] + - name: chip + in: query + required: false + schema: + type: string + enum: [SDGs, Inclusion, Employment, Wellbeing] + description: One of the Popular chips + - name: sort + in: query + required: false + schema: + type: string + enum: [added, new, az] + default: added + description: Most added, Newest, or A to Z + - $ref: '#/components/parameters/Page' + - $ref: '#/components/parameters/PerPage' + - $ref: '#/components/parameters/LastSyncDatetime' responses: - "201": - $ref: '#/components/responses/LibraryItemCreated' + "200": + description: The listed Impact Frameworks that match, and each filter's option counts + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedExploreImpactFrameworks' + example: + page: 1 + page_size: 1 + page_count: 1 + total_count: 1 + data: + - id: 301 + name: Quality Education + description: Outcomes for SDG 4. + themes: [global_goals, children_and_young_people] + framework_sets: + - id: 2 + name: UN Sustainable Development Goals + short_code: SDG 4 + outcome_count: 10 + progress_tracker_count: 3 + shared_by: Makerble Templates + libraries_count: 15 + yours: false + facets: + - key: size + label: Size + options: + - value: 6_to_10 + label: 6 to 10 outcomes + count: 1 + selected: true "401": $ref: '#/components/responses/Unauthorized' - "403": - $ref: '#/components/responses/LibraryCreateForbidden' - "404": - $ref: '#/components/responses/NotFound' - "409": - $ref: '#/components/responses/LibraryDuplicates' - "422": - $ref: '#/components/responses/UnprocessableEntity' - - /lists/{id}: - patch: - tags: [Library] - summary: Change a List - operationId: updateList + /explore/impact_frameworks/{id}: + get: + tags: [Explore] + summary: Preview an Explore Impact Framework + operationId: getExploreImpactFramework description: | - Renames a List (a Ratio Set) or changes its answer choices. Choices keep their place: the - first choice you send renames the first choice, and so on. Extra choices are added at the - end, and saved choices past the last one you send are removed. - - Every Metric and Survey that uses the List sees the change. Check where it is used first - (**See where a library item is used**), and create a new List instead when other Surveys use it. - You must be able to edit the List: its creator, or an editor of the organisation that owns - it. A List you can see but not edit is `403`; one you can't see is `404`. No choices, or - nothing to change, is `422`. + One Impact Framework listed on Explore Impact Frameworks, as its Preview shows it: the fields + of **Explore Impact Frameworks** plus `stages`, each stage of change with its `title` + (Activities, Engagement, Ability, Behaviour or Effect) and the outcomes and progress trackers + in it as `items`. An Impact Framework that isn't public and approved is a 404. security: [{tokenAuth: []}] parameters: - - $ref: '#/components/parameters/ResourceId' - requestBody: - required: true - content: - application/json: - schema: - type: object - properties: - name: - type: string - choices: - type: array - items: - type: string - description: Every choice, in order - example: - name: "Interview confidence scale" - choices: ["Very confident", "Quite confident", "Not very confident", "Not at all confident"] + - name: id + in: path + required: true + schema: + type: integer + example: 301 responses: "200": - $ref: '#/components/responses/LibraryItemUpdated' + description: The Impact Framework's preview + content: + application/json: + schema: + $ref: '#/components/schemas/ExploreImpactFrameworkPreview' + example: + id: 301 + name: Quality Education + description: Outcomes for SDG 4. + themes: [global_goals] + framework_sets: [] + outcome_count: 1 + progress_tracker_count: 1 + shared_by: Makerble Templates + libraries_count: 15 + yours: false + stages: + - title: Activities + items: [Sessions delivered] + - title: Behaviour (mid-term outcomes) + items: [Stays in school] "401": $ref: '#/components/responses/Unauthorized' - "403": - $ref: '#/components/responses/ForbiddenError' "404": $ref: '#/components/responses/NotFound' - "422": - $ref: '#/components/responses/UnprocessableEntity' - - /units: - post: - tags: [Library] - summary: Create a Unit - operationId: createUnit + /explore/ideas: + get: + tags: [Explore] + summary: Explore Ideas + operationId: listExploreIdeas description: | - Creates a Unit: the unit of measure shown beside a number answer, e.g. "hours" or "£". - Units are shared by every organisation, so only Makerble staff may create one; anyone else - gets `403` and should reuse an existing Unit. A Unit that already exists is never changed. - Near-identical names get `409`, as for **Create a List**. + Lists the approved Ideas (Tips) shared with everyone in the Makerble® ImpactStore™, with the + same search, filters, counts and sort as the Explore Ideas page. `shared_by`, `person` and + `yours` depend on the caller. + + - `query` matches the Idea's title or text. + - The filters take option keys, as arrays (`theme[]=leadership`) or comma-separated + (`theme=leadership,inclusion`). Options in one filter combine with OR and filters + combine with AND: + - `shared_by`: `anyone`, `colleagues` (colleagues in the caller's organisations and + projects, or the organisations themselves), `following` (people the caller follows), + `me` + - `theme`: `mental_health_and_wellbeing`, `children_and_young_people`, `employment_and_skills`, `community_and_culture`, `health`, `organisational`, `global_goals`, `inclusion`, `education_and_training`, `leadership` + - `audience`: `public_impact`, `personal`, `professional`, from the Idea's causes + - `person`: user ids of people who shared Ideas. Only the caller's colleagues, people + they follow and the caller count; any other id is ignored. + - `chip` is one of the page's Popular chips: `Community`, `Young people`, `Training`, + `Leadership`. + - `facets` gives each filter's options with how many Ideas each would return, given the + other filters already chosen. + - `sort` is `added` (saved to the most collections first, the default), `new` or `az`. + - Save an Idea to a collection in the app with **Save idea** on Explore Ideas. security: [{tokenAuth: []}] - requestBody: - required: true - content: - application/json: - schema: - type: object - required: [name, alignment] - properties: - name: - type: string - alignment: - type: string - enum: [left, right] - description: Which side of the number it goes, e.g. left for £10, right for 10 hours - force: - $ref: '#/components/schemas/ForceCreate' - example: - name: "sessions" - alignment: right + parameters: + - name: query + in: query + required: false + schema: + type: string + example: cohesion + description: Words to look for in the Idea's title or text + - name: shared_by + in: query + required: false + schema: + type: string + example: colleagues,following + description: Shared by option keys, comma-separated or repeated as shared_by[] + - name: theme + in: query + required: false + schema: + type: string + example: leadership + description: Theme option keys, comma-separated or repeated as theme[] + - name: audience + in: query + required: false + schema: + type: string + example: public_impact + description: Audience option keys, comma-separated or repeated as audience[] + - name: person + in: query + required: false + schema: + type: string + example: "1204" + description: User ids of people who shared Ideas, comma-separated or repeated as person[] + - name: chip + in: query + required: false + schema: + type: string + enum: [Community, Young people, Training, Leadership] + description: One of the Popular chips + - name: sort + in: query + required: false + schema: + type: string + enum: [added, new, az] + default: added + description: Most added, Newest, or A to Z + - $ref: '#/components/parameters/Page' + - $ref: '#/components/parameters/PerPage' + - $ref: '#/components/parameters/LastSyncDatetime' responses: - "201": - $ref: '#/components/responses/LibraryItemCreated' + "200": + description: The listed Ideas that match, and each filter's option counts + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedExploreIdeas' + example: + page: 1 + page_size: 1 + page_count: 1 + total_count: 1 + data: + - id: 77 + title: The Resident Leadership Pipeline + themes: [leadership, community_and_culture] + reading_minutes: 4 + shared_by: Northside Housing + saved_count: 14 + yours: false + facets: + - key: theme + label: Theme + options: + - value: leadership + label: Leadership + count: 1 + selected: true "401": $ref: '#/components/responses/Unauthorized' - "403": - $ref: '#/components/responses/LibraryCreateForbidden' - "409": - $ref: '#/components/responses/LibraryDuplicates' - "422": - $ref: '#/components/responses/UnprocessableEntity' - - /fields: - post: - tags: [Library] - summary: Create a Field - operationId: createField + /explore/ideas/{id}: + get: + tags: [Explore] + summary: Read an Explore Idea + operationId: getExploreIdea description: | - Creates a Field (a Custom Field): a question with a free answer rather than a Metric, e.g. - "Date of birth" (date) or "Postcode" (text), for a Survey or Contact Form. A `section_title` - Field is a heading with `section_text` under it; it isn't listed in the library, so the - response has only its `id`, `type`, `name` and `approved`. Fields are never shared in the - public library. Near-identical names get `409`, as for **Create a List**. - - **Video, Audio and Picture questions.** `video`, `audio` and `picture` create a Video, Audio - or Picture question for a Survey (Story Category): an Attachment Field that asks for that kind - of media, which the person answering can record or take there and then with their camera or - microphone, or attach from their device. It is stored and returned as `field_type: file` with - `capture_type` set to `video`, `audio` or `picture`, and its answers are uploaded files like any - other Attachment answer. - security: [{tokenAuth: []}] - requestBody: - required: true - content: - application/json: - schema: - type: object - required: [organisation_id, field_name, field_data_type] - properties: - organisation_id: - type: integer - description: The organisation (Charity) that will own it; you must be one of its editors - field_name: - type: string - field_data_type: - type: string - enum: [text, number, date, time, file, video, audio, picture, section_title, email_address, telephone, signature] - description: | - A Weekly availability field can only be made as part of a Contact Form (`POST /contact_forms`), not here. - The kind of answer. `file` is an Attachment for any file; `video`, `audio` and - `picture` ask for that kind of media (see above). - section_text: - type: string - description: For a section_title Field only - private: - type: boolean - description: True if only the organisation's staff may see the answers - force: - $ref: '#/components/schemas/ForceCreate' - examples: - text: - summary: A text Field - value: - organisation_id: 913 - field_name: "Postcode" - field_data_type: text - video: - summary: A Video question - value: - organisation_id: 913 - field_name: "Record a short video telling us what you learnt today" - field_data_type: video - responses: - "201": - $ref: '#/components/responses/LibraryItemCreated' - "401": - $ref: '#/components/responses/Unauthorized' - "403": - $ref: '#/components/responses/LibraryCreateForbidden' - "404": - $ref: '#/components/responses/NotFound' - "409": - $ref: '#/components/responses/LibraryDuplicates' - "422": - $ref: '#/components/responses/UnprocessableEntity' - - /surveys: - post: - tags: [Library, Story Categories] - summary: Create a Survey with its questions - operationId: createSurvey - description: | - Creates a Survey (Story Category) with all its questions, in the order given (at most 50). - Each question either reuses an item your organisation or the public library already has, by - id, or defines a new one: - - - `metric_id`, `field_id` or `activity_tracker_id`: reuse a Metric (Indicator), Field - (Custom Field) or Activity tracker (Change). Any id you can't see is `404`. - - `new_metric`: a new Metric, with `outcome_id` for the Outcome it measures. A scale - Metric needs `list_id` (an existing List) or `list` (a new List with its choices). - - `new_field`: a new Field; `section_title` makes a heading. - - Search the library first and reuse what fits: results recorded against a copy of a Metric - don't add up with the original. If a new Metric, List or Field has the same or a - near-identical name to one you could reuse, nothing is created and you get `409` with the - matches, each with the `question` it belongs to. Send `force: true` to create them anyway. - - Nothing is created unless everything is: an invalid question creates nothing, and the error - names it ("Question 3: ..."). The Survey and its new items stay private to your organisation - unless you are Makerble staff and send `approved: true`. - - **Surveys answered more than once.** Keep one Survey with the same Metrics and name its Shared - Intervals in `intervals`, e.g. `["Baseline", "Endpoint"]`, so Distance Travelled works. Each - question can then be reworded or hidden in them (Adjust When): - - - `by_interval`: entries `{interval, respondent, question}` to reword it, or - `{interval, respondent, hide: true}` to hide it. Leave out `interval` for every Interval and - `respondent` (`participant`, `colleague`, `observer` or `public`) for everyone. Where two - entries cover the same Interval and respondent, the one naming more wins; two naming the - same amount are `422`. - - `only_in_intervals`: show the question only in these Intervals. - - Projects the Survey is added to later use its Intervals. An Interval the Survey doesn't - have, or wording without `intervals`, is `422` and creates nothing. - - **Questions that only apply after a certain answer.** Questions are numbered by their place - in `questions`, counting section headings. - - - `display_if`: `{question, answers}` shows the question only when that earlier question is - answered with one of `answers` (Display If). A list of them shows it when any is met. - - `skip_to`: `[{answers, question}]` jumps forward, past the questions in between, to a later - question that isn't mandatory (Skip To). Each answer may appear in one entry only. - - The question whose answer decides must be a scale Metric, whose answers are its List: for - yes/no, use a scale Metric on a Yes - No List, not a binary Metric. A Survey can't skip to its - end. Anything else is `422`, naming the question. - - **Question Grids.** `question_grids: [{outcome_id, questions}]` shows scale questions that - measure one Outcome first and share one List as one table, headed by the Outcome's title. - Every scale question of that Outcome in the Survey must be in the grid, on the same List, and - grid questions can't have `display_if` or `skip_to`. Anything else is `422`, naming the grid. - - **Scoring and Verdicts.** A new scale Metric can have `points` for every answer on its List, - e.g. `{"Never": 0, "Often": 2}`. `scoring: {questions, verdicts}` adds up those questions' - points and names each band of totals (Verdicts), e.g. Low 0-4, Medium 5-9, High 10-15. - Only new Metrics can be given points: a reused Metric's points are shared by every Survey - using it, so a reused Metric can be scored only if it already has them. The bands must be - whole numbers covering every possible total with no gaps or overlaps; anything else is - `422`, naming the question or band. - security: [{tokenAuth: []}] - requestBody: - required: true - content: - application/json: - schema: - type: object - required: [organisation_id, name, questions] - properties: - organisation_id: - type: integer - description: The organisation (Charity) that will own it; you must be one of its editors - name: - type: string - description: - type: string - intro_message: - type: string - departments: - type: array - items: {type: string} - causes: - type: array - items: {type: string} - sub_causes: - type: array - items: {type: string} - scoring: - type: object - description: A scored Survey (Verdicts) - required: [questions, verdicts] - properties: - questions: - type: array - description: The numbers of the scale questions whose points add up - items: {type: integer} - verdicts: - type: array - description: The bands of totals, covering every possible total with no gaps or overlaps - items: - type: object - required: [name, from, to] - properties: - name: {type: string, example: Low} - from: {type: integer, example: 0} - to: {type: integer, example: 4} - description: {type: string} - question_grids: - type: array - description: Question Grids, each an Outcome and the numbers of the scale questions shown as one table under its title - items: - type: object - required: [outcome_id, questions] - properties: - outcome_id: - type: integer - questions: - type: array - minItems: 2 - items: {type: integer} - intervals: - type: array - maxItems: 10 - description: The Survey's Shared Intervals in order, when it is answered more than once - items: {type: string, maxLength: 255} - approved: - type: boolean - description: Makerble staff only - force: - $ref: '#/components/schemas/ForceCreate' - questions: - type: array - minItems: 1 - maxItems: 50 - items: - $ref: '#/components/schemas/SurveyDraftQuestion' - example: - organisation_id: 913 - name: "Job readiness check-in" - intervals: [Baseline, Endpoint] - questions: - - metric_id: 4412 - is_mandatory: true - by_interval: - - interval: Endpoint - question: "How confident do you feel about getting a job now, after the course?" - - new_metric: - name: "Job search hours" - metric_type: value - default_question: "How many hours did you spend looking for work this week?" - outcome_id: 3301 - - new_metric: - name: "Interview confidence" - metric_type: scale - default_question: "How confident do you feel about interviews?" - outcome_id: 3301 - list_id: 2210 - - new_field: - field_name: "Postcode" - field_data_type: text - responses: - "201": - $ref: '#/components/responses/LibraryItemCreated' - "401": - $ref: '#/components/responses/Unauthorized' - "403": - $ref: '#/components/responses/LibraryCreateForbidden' - "404": - $ref: '#/components/responses/NotFound' - "409": - $ref: '#/components/responses/LibraryDuplicates' - "422": - $ref: '#/components/responses/UnprocessableEntity' - - /surveys/{id}/projects: - post: - tags: [Library, Story Categories] - summary: Add a Survey to Projects - operationId: addSurveyToProjects - description: | - Adds a Survey (Story Category) to Projects, as **Add survey to project(s)** on a Survey's - page does, so people in those Projects can answer it and its results show there. - - - The Survey must be one you can see in your library: your organisation's own, or the - public library. Otherwise `404`. - - You must manage each Project, or be an Admin of its organisation. Otherwise `404`, - naming the Project. - - A closed Project, or one whose Project Category doesn't allow other Surveys, is `422`. - - Every Project is checked first, so if one is refused none is added. A Project that - already uses the Survey is left as it is and listed in `existing_project_ids`. + One Idea listed on Explore Ideas: the fields of **Explore Ideas** plus its `text`, without + formatting. An Idea that isn't approved and shared with everyone is a 404. security: [{tokenAuth: []}] parameters: - name: id @@ -11960,408 +12248,464 @@ paths: required: true schema: type: integer - description: The Survey's (Story Category's) id - requestBody: - required: true - content: - application/json: - schema: - type: object - required: [project_ids] - properties: - project_ids: - type: array - minItems: 1 - items: - type: integer - description: The Projects to add it to - example: - project_ids: [4021, 4022] + example: 77 responses: "200": - description: The Survey is in every Project given + description: The Idea and its text content: application/json: schema: - type: object - properties: - data: - type: object - properties: - survey_id: - type: integer - added_project_ids: - type: array - items: - type: integer - description: Projects the Survey was added to now - existing_project_ids: - type: array - items: - type: integer - description: Projects that already used it + $ref: '#/components/schemas/ExploreIdeaPreview' example: - data: - survey_id: 812 - added_project_ids: [4021] - existing_project_ids: [4022] + id: 77 + title: The Resident Leadership Pipeline + themes: [leadership] + reading_minutes: 1 + shared_by: Northside Housing + saved_count: 14 + yours: false + text: We grew resident leaders who now run three local groups. "401": $ref: '#/components/responses/Unauthorized' "404": $ref: '#/components/responses/NotFound' - "422": - $ref: '#/components/responses/UnprocessableEntity' - - /surveys/{id}: - patch: - tags: [Library, Story Categories] - summary: Change a Survey - operationId: updateSurvey - description: | - Changes a Survey's (Story Category's) name, description and intro message, as the Survey's - Edit page does. Send only what changes. You must be able to edit the Survey: an editor of the - organisation that owns it. - - A name your organisation already uses for another Survey (ignoring case) is `422`, naming - that Survey. A Survey you can see but not edit, such as another organisation's public - Survey, is `403`; one you can't see is `404`. + /explore/metrics: + get: + tags: [Explore] + summary: Explore Metrics + operationId: listExploreMetrics + description: | + Lists the published, approved metrics of the Makerble® ImpactStore™ across the stages of + change, with the same search, filters, counts and sort as the Explore Metrics page: + progress trackers (`kind` `change`: Activities and Engagement), outcome indicators (`kind` + `indicator`: Ability, Behaviour and Effect, taking the stage of the Outcome they sit under + when they have none of their own) and Financial Values (`kind` `financial_value`). Every + caller sees the same metrics; `yours` depends on the caller's organisations. + + - `query` matches the metric's name or description. + - The filters take option keys, as arrays (`stage[]=ability`) or comma-separated + (`stage=ability,behaviour`). Options in one filter combine with OR and filters + combine with AND: + - `stage` (Stage of change): `activities`, `engagement`, `ability`, `behaviour`, + `effect`, `financial_values` + - `answer_format`: `count` (progress tracker), `scale` (Choice tracker), `yes_no` + (Achievement tracker), `value` (Numerical tracker, and Financial Values) + - `audience`: `public_impact`, `personal`, `professional` + - `shared_by`: `makerble`, `others` + - `chip` is one of the page's Popular chips: `Wellbeing`, `Employment`, `Housing`, + `Attendance`, `SDGs`. + - `facets` gives each filter's options with how many metrics each would return, given the + other filters already chosen. + - `sort` is `added` (on the most organisations' projects first, the default), `new` or `az`. + - Add a tracker or indicator to a project in the app with **Add to a project** on Explore + Metrics; a Financial Value from Explore Financial Values. security: [{tokenAuth: []}] parameters: - - $ref: '#/components/parameters/ResourceId' - requestBody: - required: true - content: - application/json: - schema: - type: object - properties: - name: - type: string - description: - type: string - intro_message: - type: string - description: Shown to people before they start - example: - name: "Job readiness check-in" - intro_message: "This takes about two minutes." + - name: query + in: query + required: false + schema: + type: string + example: confidence + description: Words to look for in the metric's name or description + - name: stage + in: query + required: false + schema: + type: string + example: ability,behaviour + description: Stage of change option keys, comma-separated or repeated as stage[] + - name: answer_format + in: query + required: false + schema: + type: string + example: scale + description: Answer format option keys, comma-separated or repeated as answer_format[] + - name: audience + in: query + required: false + schema: + type: string + example: personal + description: Audience option keys, comma-separated or repeated as audience[] + - name: shared_by + in: query + required: false + schema: + type: string + example: makerble + description: Shared by option keys, comma-separated or repeated as shared_by[] + - name: chip + in: query + required: false + schema: + type: string + enum: [Wellbeing, Employment, Housing, Attendance, SDGs] + description: One of the Popular chips + - name: sort + in: query + required: false + schema: + type: string + enum: [added, new, az] + default: added + description: Most added, Newest, or A to Z + - $ref: '#/components/parameters/Page' + - $ref: '#/components/parameters/PerPage' + - $ref: '#/components/parameters/LastSyncDatetime' responses: "200": - $ref: '#/components/responses/LibraryItemUpdated' + description: The listed metrics that match, and each filter's option counts + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedExploreMetrics' + example: + page: 1 + page_size: 1 + page_count: 1 + total_count: 1 + data: + - kind: indicator + id: 5310 + name: Job satisfaction + stage: ability + whats_inside: 5-level scale + shared_by: Makerble + libraries_count: 21 + yours: false + facets: + - key: answer_format + label: Answer format + options: + - value: scale + label: Scale (Choice tracker) + count: 1 + selected: true "401": $ref: '#/components/responses/Unauthorized' - "403": - $ref: '#/components/responses/ForbiddenError' - "404": - $ref: '#/components/responses/NotFound' - "422": - $ref: '#/components/responses/UnprocessableEntity' - - /surveys/{id}/questions: - patch: - tags: [Library, Story Categories] - summary: Change a Survey's questions - operationId: updateSurveyQuestions + /explore/metrics/{kind}/{id}: + get: + tags: [Explore] + summary: Preview an Explore Metric + operationId: getExploreMetric description: | - Adds, removes, replaces and moves a Survey's questions, as the Survey's Edit page does. Send - the changes in order: each applies to the questions as the changes before it left them. - Question numbers are as **Get a library item** lists the Survey's questions, starting at 1. - - - `add`: `question`, and optionally `number` to put it at (default: the end). - - `remove`: `number`. The question is taken off the Survey; the Metric or Field behind it is kept. - - `replace`: `number` and `question`. - - `move`: `number` and `to`. - - A new question takes the same format as in **Create a Survey with its questions**: reuse a - Metric, Field or Activity tracker by id, or define `new_metric` or `new_field`. A new item - with the same or a near-identical name as one you could reuse is `422`; send `force: true` - only if none fits. - - Nothing is changed unless every change can be made. A bad change is `422` naming it, e.g. - "Change 2: there is no question 5". + One metric listed on Explore Metrics, as its Preview shows it: the fields of **Explore + Metrics** plus its `description`, `details` (its key facts by label, such as the Outcomes an + indicator sits under or a Financial Value's amount and source) and the `choices` of a scale + or yes-or-no indicator, in order. A metric that isn't published and approved is a 404. security: [{tokenAuth: []}] parameters: - - $ref: '#/components/parameters/ResourceId' - requestBody: - required: true - content: - application/json: - schema: - type: object - required: [changes] - properties: - changes: - type: array - items: - type: object - required: [action] - properties: - action: - type: string - enum: [add, remove, replace, move] - number: - type: integer - to: - type: integer - description: move only - question: - $ref: '#/components/schemas/SurveyDraftQuestion' - force: - $ref: '#/components/schemas/ForceCreate' - example: - changes: - - {action: add, number: 1, question: {metric_id: 14702, is_mandatory: true}} - - {action: remove, number: 3} - - {action: move, number: 2, to: 4} + - name: kind + in: path + required: true + schema: + type: string + enum: [change, indicator, financial_value] + example: indicator + - name: id + in: path + required: true + schema: + type: integer + example: 5310 responses: "200": - $ref: '#/components/responses/LibraryItemUpdated' + description: The metric's preview + content: + application/json: + schema: + $ref: '#/components/schemas/ExploreMetricPreview' + example: + kind: indicator + id: 5310 + name: Job satisfaction + stage: ability + whats_inside: 5-level scale + shared_by: Makerble + libraries_count: 21 + yours: false + description: How satisfied someone is with their job. + details: + Answer format: 5-level scale + Stage of change: Ability (short-term outcomes) + Sits under: Job satisfaction at follow-up + Shared by: Makerble + choices: [Very dissatisfied, Dissatisfied, Neither, Satisfied, Very satisfied] "401": $ref: '#/components/responses/Unauthorized' - "403": - $ref: '#/components/responses/ForbiddenError' "404": $ref: '#/components/responses/NotFound' - "422": - $ref: '#/components/responses/UnprocessableEntity' - /contact_forms: - post: - tags: [Library, Beneficiary Categories] - summary: Create a Contact Form with its fields - operationId: createContactForm + /library/search: + get: + tags: [Library] + summary: Search the library + operationId: searchLibrary description: | - Creates a Contact Form (Beneficiary Category): the form your organisation fills in about each - Contact of one kind, with its fields in the order given (at most 50). Each field either - reuses an item you can see by id (`field_id` for a Field, `list_id` for a List of answer - choices) or defines a new one (`new_field`, `new_list`). + Searches the reusable building blocks you may see: your organisation's own library, the + public library shared by every organisation, or both. Use it before making a new Survey, + Metric or List, so results keep adding up with those recorded against the original. - Only organisations that use Contact Forms can have one (otherwise `403`). Near-identical - names of new Fields and Lists get `409` with the matches, each with its `question`, unless - you send `force: true`. Nothing is created unless everything is. Only your organisation uses - the form unless you are Makerble staff and send `approved: true`. + - Every word of `query` must match the item's name or description. Surveys also match on + their question wording, Lists on their choices, and Metrics on their default question. + - `item_types` limits the search to some types (comma-separated): `survey` (Survey), + `metric` (Metric), `activity_tracker` (Activity or Attendance tracker), `outcome`, + `list` (List of answer choices), `unit`, `field`, `contact_form` (Contact Form), + `case_form` (Case Form), `impact_framework` (Impact Framework), `toolkit`, + `project_type` and `idea`. Default: every type. + - `source` is `organisation` (default), `public` or `both`. The public library holds items + approved for everyone; Makerble staff also see public items awaiting approval. Units and + Project Types belong to no organisation and are always included. + - `page` and `per_page` apply to each type, so a page holds up to `per_page` results of + each type. `total_count` adds up every type's matches and `page_count` is the page count + of the type with the most matches. + - Each result has `owner`: `your organisation`, `public library` or `Makerble`. Metrics also + have `metric_type` (`scale`, `value` or `binary`) and `choices`; Lists have `choices`. security: [{tokenAuth: []}] - requestBody: - required: true - content: - application/json: - schema: - type: object - required: [organisation_id, name, department, contact_role, questions] - properties: - organisation_id: - type: integer - description: The organisation (Charity) that will own it; you must be one of its editors - name: - type: string - department: - type: string - enum: [Personal, Professional, Public Impact] - contact_role: - type: string - description: What the Contacts are to the organisation, e.g. Participant - contact_type: - type: string - description: Person (default), Organisation, Animal or Object - approved: - type: boolean - description: Makerble staff only - force: - $ref: '#/components/schemas/ForceCreate' - questions: - type: array - minItems: 1 - maxItems: 50 - items: - $ref: '#/components/schemas/ContactFormDraftQuestion' - example: - organisation_id: 913 - name: "Young person registration" - department: Personal - contact_role: Participant - questions: - - field_id: 5120 - is_mandatory: true - - new_list: - name: "School year" - choices: ["Year 7", "Year 8", "Year 9"] - - new_field: - field_name: "Date of birth" - field_data_type: date + parameters: + - name: query + in: query + required: false + schema: + type: string + example: agree disagree + description: Words to look for. Leave it out to list everything of the chosen types. + - name: item_types + in: query + required: false + schema: + type: string + example: metric,list + description: Comma-separated item types to search (default every type) + - name: source + in: query + required: false + schema: + type: string + enum: [organisation, public, both] + default: organisation + description: Which library to search + - $ref: '#/components/parameters/Page' + - $ref: '#/components/parameters/PerPage' + - $ref: '#/components/parameters/LastSyncDatetime' responses: - "201": - $ref: '#/components/responses/LibraryItemCreated' + "200": + description: Matching items, up to `per_page` of each type + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedLibrarySearch' + example: + page: 1 + page_size: 2 + page_count: 1 + total_count: 2 + data: + - id: 812 + type: metric + name: Confidence + description: How confident the person feels about the future + owner: your organisation + metric_type: scale + choices: ["Strongly agree", "Agree", "Disagree", "Strongly disagree"] + - id: 97 + type: list + name: Agree – Disagree + description: null + owner: public library + choices: ["Strongly agree", "Agree", "Disagree", "Strongly disagree"] "401": $ref: '#/components/responses/Unauthorized' - "403": - $ref: '#/components/responses/LibraryCreateForbidden' - "404": - $ref: '#/components/responses/NotFound' - "409": - $ref: '#/components/responses/LibraryDuplicates' "422": - $ref: '#/components/responses/UnprocessableEntity' + description: An unknown `item_types` value or `source` + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + example: + error: "Unknown item type 'spreadsheet'. Use one of: survey, metric, activity_tracker, outcome, list, unit, field, contact_form, case_form, impact_framework, toolkit, project_type, idea" - /contact_forms/{id}/projects: - post: - tags: [Library, Beneficiary Categories] - summary: Add a Contact Form to projects - operationId: addContactFormToProjects + /library/{item_type}/{id}: + get: + tags: [Library] + summary: Get a library item + operationId: getLibraryItem description: | - Adds a Contact Form (Beneficiary Category) to projects, as **Add form to project** on a - Contact Form's page does, so staff in those projects use it when they add or edit Contacts. - - `use` says how each project uses it: `full` (the default) to create new Contacts and edit - existing ones, `create` to create new Contacts only, or `edit` to edit existing Contacts - only. Organisation Admins and Project Managers may then edit what it holds. Only the - project's Contact Form settings change. + Reads one library item in full, so it can be reused or copied. Use the `type` and `id` from + **Search the library**. Besides `id`, `type`, `name` and `owner`: - - Each project must belong to the form's organisation, and you must be able to change its - Project Preferences: an Organisation Admin, or the project's manager. Otherwise `404`, - naming the project. - - A form that doesn't exist is `404`; an organisation that doesn't use Contact Forms is `422`. + - **survey**: `description`, `intervals` (its Shared Intervals in order), `question_grids` + (`{outcome_id, heading, questions}`), `scoring` (`{questions, verdicts}` when it is scored) and `questions` in + the order the Survey shows them. A question has `question` (its wording), `mandatory` and + `item` (the Metric, List, Field or Activity tracker behind it, with `metric_type`, `unit` + and `choices` where they apply), `by_interval` when it is reworded or hidden in an + Interval, and `display_if` (a list) and `skip_to` when it has those rules (see **Create a + Survey with its questions**). A section title is `{section, text}`. + - **metric**: `description`, `metric_type`, `default_question`, `unit`, `list` (with + `choices`), `success_direction` and `outcomes`. + - **list**: `choices` in order, each with `id`, `name` and `points`. + - **contact_form**: `fields`, shaped like a Survey's questions. **case_form**: `fields`, + each with `name`, `field_type`, `mandatory` and `choices`. + - **impact_framework**: `description` and `stages`, each with its `outcomes`, + `activity_trackers` and `metrics`. + - **toolkit**: `description` and `contents`, each with `type`, `id` and `name`. + - **activity_tracker**: `description`, `instruction`. **outcome**: `description`, `metrics`. + **unit**: `alignment`. **field**: `field_type`, and `capture_type` (`video`, `audio` or + `picture`) for a Video, Audio or Picture question. **project_type**: `strapline`, + `description`. **idea**: `description`. - Every project is checked first, so if one is refused none is changed. A project that - already uses the form that way is left as it is and listed in `existing_project_ids`. + Linked Outcomes and Metrics are named only when you may see them. An item you may not see + returns `404`. security: [{tokenAuth: []}] parameters: - - name: id + - name: item_type in: path required: true schema: - type: integer - description: The Contact Form's (Beneficiary Category's) id - requestBody: - required: true - content: - application/json: - schema: - type: object - required: [project_ids] - properties: - project_ids: - type: array - minItems: 1 - items: - type: integer - description: The projects to add it to - use: - type: string - enum: [full, create, edit] - default: full - description: How the projects use it - example: - project_ids: [4021, 4022] - use: create + type: string + example: survey + description: The item's type, as in **Search the library** + - $ref: '#/components/parameters/ResourceId' responses: "200": - description: The form is in every project given + description: The item content: application/json: schema: - type: object - properties: - data: - type: object - properties: - contact_form_id: - type: integer - use: - type: string - enum: [full, create, edit] - added_project_ids: - type: array - items: - type: integer - description: Projects the form was added to now - existing_project_ids: - type: array - items: - type: integer - description: Projects that already used it that way + $ref: '#/components/schemas/LibraryItem' example: - data: - contact_form_id: 2391 - use: create - added_project_ids: [4021] - existing_project_ids: [4022] + id: 3051 + type: survey + name: Wellbeing check + owner: your organisation + description: Monthly check-in + questions: + - section: About you + text: A few questions about you + - question: How confident do you feel? + mandatory: true + item: + type: metric + id: 812 + name: Confidence + metric_type: scale + unit: null + choices: ["Strongly agree", "Agree", "Disagree", "Strongly disagree"] "401": $ref: '#/components/responses/Unauthorized' "404": $ref: '#/components/responses/NotFound' "422": - $ref: '#/components/responses/UnprocessableEntity' + description: An unknown `item_type` + content: + application/json: + schema: + $ref: '#/components/schemas/Error' - /impact_frameworks: - post: + /library/{item_type}/{id}/usage: + get: tags: [Library] - summary: Create an Impact Framework with its entries - operationId: createImpactFramework + summary: See where a library item is used + operationId: getLibraryItemUsage description: | - Creates an Impact Framework (Template), your organisation's theory of change, with its - entries in order. Each entry has a `stage` and exactly one item: + Says whether anything depends on a library item before you change it. - - `activity_tracker_id` or `new_activity_tracker` (an Activity or Attendance tracker, a - Change) in `Activity outputs` or `Participation outputs`; - - `outcome_id` or `new_outcome` in `Short-term outcomes`, `Medium-term outcomes` or - `Long-term outcomes`. An Outcome entry can also have `new_metrics`: new Metrics - (Indicators) that measure it. + - `projects`: up to 50 projects you can see that use it, and `other_projects_count` for the rest. + - `records_count` and `last_used_at`: survey responses for a Survey; recorded values for a + Metric, Activity tracker, Outcome or List; Contacts for a Contact Form; Cases for a Case Form. + - `contained_in`: up to 50 Surveys, Contact Forms, Outcomes, Impact Frameworks, Metrics or + Toolkits that include it and that you may see. `contained_in_count` counts them all. + - `in_use` is true when any of these is above zero. - At most 50 entries and new Metrics together. Near-identical names of new items get `409` - with the matches, each with its `entry`, unless you send `force: true`. Nothing is created - unless everything is, and an error names the entry. It stays private to your organisation - unless you are Makerble staff and send `approved: true`. + Counts only: no records are returned. An item you may not see returns `404`. security: [{tokenAuth: []}] - requestBody: - required: true - content: - application/json: - schema: - type: object - required: [organisation_id, name, entries] - properties: - organisation_id: - type: integer - description: The organisation (Charity) that will own it; you must be one of its editors - name: - type: string - description: - type: string - color: - type: string - causes: - type: array - items: {type: string} - department: + parameters: + - name: item_type + in: path + required: true + schema: + type: string + example: metric + description: The item's type, as in **Search the library** + - $ref: '#/components/parameters/ResourceId' + responses: + "200": + description: Where the item is used + content: + application/json: + schema: + $ref: '#/components/schemas/LibraryUsage' + example: + id: 812 + type: metric + name: Confidence + projects: + - id: 4410 + name: Breakfast club + other_projects_count: 3 + records_count: 40 + last_used_at: "2026-10-14T09:12:00.000Z" + contained_in: + - type: survey + id: 3051 + name: Wellbeing check + contained_in_count: 1 + in_use: true + "401": + $ref: '#/components/responses/Unauthorized' + "404": + $ref: '#/components/responses/NotFound' + "422": + description: An unknown `item_type` + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + + /lists: + post: + tags: [Library] + summary: Create a List + operationId: createList + description: | + Creates a List (a Ratio Set): the answer choices for a multiple-choice question or a scale + Metric, e.g. "Agree - Disagree". The choices keep the order you send, at most 50, each + different. The List stays private to your organisation. + + Search the library first (**Search the library**) and reuse a List that fits. If your + organisation or the public library already has a List with the same or a near-identical + name (ignoring case, spacing and punctuation), nothing is created and you get `409` with the + matches. Send `force: true` to create it anyway. Your organisation can never have two Lists + with exactly the same name, so that is a `409` even with `force`. + + Nothing is created unless everything is: a bad choice creates no List. + security: [{tokenAuth: []}] + requestBody: + required: true + content: + application/json: + schema: + type: object + required: [organisation_id, name, choices] + properties: + organisation_id: + type: integer + description: The organisation (Charity) that will own it; you must be one of its editors + name: type: string - approved: - type: boolean - description: Makerble staff only - force: - $ref: '#/components/schemas/ForceCreate' - entries: + choices: type: array - minItems: 1 maxItems: 50 items: - $ref: '#/components/schemas/ImpactFrameworkDraftEntry' + type: string + force: + $ref: '#/components/schemas/ForceCreate' example: organisation_id: 913 - name: "Youth employment" - entries: - - stage: Activity outputs - new_activity_tracker: - name: "Workshops delivered" - category: Education - - stage: Short-term outcomes - outcome_id: 3301 - new_metrics: - - name: "Job search hours" - metric_type: value - default_question: "How many hours did you spend looking for work this week?" - - stage: Long-term outcomes - new_outcome: - title: "In sustained work" + name: "Agree - Disagree" + choices: ["Strongly agree", "Agree", "Neutral", "Disagree", "Strongly disagree"] responses: "201": $ref: '#/components/responses/LibraryItemCreated' @@ -12376,587 +12720,550 @@ paths: "422": $ref: '#/components/responses/UnprocessableEntity' - /impact_frameworks/{id}/copy: - post: + /lists/{id}: + patch: tags: [Library] - summary: Copy an Impact Framework - operationId: copyImpactFramework + summary: Change a List + operationId: updateList description: | - Copies an Impact Framework (Template), as **Copy** on the Manage Impact Frameworks page does. - The copy is named `Copy of ` and keeps the original's stages, metrics (Activity and - Attendance trackers, Outcomes and the trackers placed on it), causes, description and colour, - but none of its projects: it is not added to any project. It is yours, private and unapproved, - in the original's organisation if you belong to it, otherwise among your own Impact Frameworks. + Renames a List (a Ratio Set) or changes its answer choices. Choices keep their place: the + first choice you send renames the first choice, and so on. Extra choices are added at the + end, and saved choices past the last one you send are removed. - You may copy your own Impact Frameworks, any of an organisation you belong to, the Theory of - Change of a project you edit, and approved ImpactStore frameworks. Any other id answers `404`. + Every Metric and Survey that uses the List sees the change. Check where it is used first + (**See where a library item is used**), and create a new List instead when other Surveys use it. + You must be able to edit the List: its creator, or an editor of the organisation that owns + it. A List you can see but not edit is `403`; one you can't see is `404`. No choices, or + nothing to change, is `422`. security: [{tokenAuth: []}] parameters: - - name: id - in: path - required: true - description: The id of the Impact Framework (Template) to copy - schema: - type: integer - example: 7174 + - $ref: '#/components/parameters/ResourceId' + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + name: + type: string + choices: + type: array + items: + type: string + description: Every choice, in order + example: + name: "Interview confidence scale" + choices: ["Very confident", "Quite confident", "Not very confident", "Not at all confident"] responses: - "201": - $ref: '#/components/responses/LibraryItemCreated' + "200": + $ref: '#/components/responses/LibraryItemUpdated' "401": $ref: '#/components/responses/Unauthorized' + "403": + $ref: '#/components/responses/ForbiddenError' "404": $ref: '#/components/responses/NotFound' "422": $ref: '#/components/responses/UnprocessableEntity' - /impact_frameworks/{id}/missing_metrics: - get: + /units: + post: tags: [Library] - summary: List an Impact Framework's metrics a Results Canvas can't show - operationId: listMissingFrameworkMetrics + summary: Create a Unit + operationId: createUnit description: | - When a project's or an album's Results Canvas is viewed through an Impact Framework (its **Metrics** - dropdown), it shows only the framework's metrics that are already used on the project. This lists - the rest: the framework's Activity and Attendance trackers (`Change`) and Outcomes (`Outcome`) that - aren't used on the project, or aren't used on one or more of the album's open projects. It is the - list the canvas's "metrics aren't shown" popup shows. + Creates a Unit: the unit of measure shown beside a number answer, e.g. "hours" or "£". + Units are shared by every organisation, so only Makerble staff may create one; anyone else + gets `403` and should reuse an existing Unit. A Unit that already exists is never changed. + Near-identical names get `409`, as for **Create a List**. + security: [{tokenAuth: []}] + requestBody: + required: true + content: + application/json: + schema: + type: object + required: [name, alignment] + properties: + name: + type: string + alignment: + type: string + enum: [left, right] + description: Which side of the number it goes, e.g. left for £10, right for 10 hours + force: + $ref: '#/components/schemas/ForceCreate' + example: + name: "sessions" + alignment: right + responses: + "201": + $ref: '#/components/responses/LibraryItemCreated' + "401": + $ref: '#/components/responses/Unauthorized' + "403": + $ref: '#/components/responses/LibraryCreateForbidden' + "409": + $ref: '#/components/responses/LibraryDuplicates' + "422": + $ref: '#/components/responses/UnprocessableEntity' - Each metric names the projects without it, and `can_add` says whether you may add it there. Add a - metric with [Add metric to](#add-metric-to): `POST - /metrics/{change|outcome}/{metric_id}/destinations/projects/{project_id}`. + /fields: + post: + tags: [Library] + summary: Create a Field + operationId: createField + description: | + Creates a Field (a Custom Field): a question with a free answer rather than a Metric, e.g. + "Date of birth" (date) or "Postcode" (text), for a Survey or Contact Form. A `section_title` + Field is a heading with `section_text` under it; it isn't listed in the library, so the + response has only its `id`, `type`, `name` and `approved`. Fields are never shared in the + public library. Near-identical names get `409`, as for **Create a List**. - Give `project_id` or `album_id`. The project must be one you can open, the album one you can view, - and the Impact Framework one the canvas's Metrics dropdown offers you (your organisation's or your - own). Anything else answers `404`. + **Video, Audio and Picture questions.** `video`, `audio` and `picture` create a Video, Audio + or Picture question for a Survey (Story Category): an Attachment Field that asks for that kind + of media, which the person answering can record or take there and then with their camera or + microphone, or attach from their device. It is stored and returned as `field_type: file` with + `capture_type` set to `video`, `audio` or `picture`, and its answers are uploaded files like any + other Attachment answer. security: [{tokenAuth: []}] - parameters: - - name: id - in: path - required: true - description: The id of the Impact Framework (Template) - schema: - type: integer - example: 7174 - - name: project_id - in: query - description: The project whose Results Canvas to check - schema: - type: integer - example: 2210 - - name: album_id - in: query - description: The album (Bundle) whose Results Canvas to check, instead of a project - schema: - type: integer - - $ref: '#/components/parameters/Page' - - $ref: '#/components/parameters/PerPage' - responses: - "200": - description: The missing metrics, in the framework's column order - content: - application/json: - schema: - type: object - properties: - impact_framework: - type: object - properties: - id: { type: integer } - name: { type: string } - project_id: { type: integer, nullable: true } - album_id: { type: integer, nullable: true } - page: { type: integer } - page_size: { type: integer } - page_count: { type: integer } - total_count: { type: integer } - data: - type: array - items: - type: object - properties: - metric_type: { type: string, enum: [Change, Outcome] } - metric_id: { type: integer } - name: { type: string } - stage: { type: string, description: The Impact Scorecard column the framework puts it in } - stage_id: { type: integer } - projects: - type: array - description: The projects that don't use the metric yet - items: - type: object - properties: - id: { type: integer } - name: { type: string } - can_add: { type: boolean, description: Whether you may add the metric to this project } - example: - impact_framework: { id: 7174, name: Bambanani ECD Logic Model } - project_id: null - album_id: 381 - page: 1 - page_size: 1 - page_count: 1 - total_count: 1 - data: - - metric_type: Outcome - metric_id: 5521 - name: Improved school readiness - stage: Short-term outcomes - stage_id: 3 - projects: - - { id: 2210, name: Bambanani 2026, can_add: true } - "401": - $ref: '#/components/responses/Unauthorized' - "404": - $ref: '#/components/responses/NotFound' - "422": - $ref: '#/components/responses/UnprocessableEntity' - - /impact_frameworks/{id}/additions: - get: - tags: [Library] - summary: List where an Impact Framework has been added - operationId: listImpactFrameworkAdditions - description: | - The Projects and other Impact Frameworks this Impact Framework (Template) has been added to, by - whom and when, as recorded by **Add to projects** and by **Add metrics from another project or - framework** on Edit metrics. Only Projects and frameworks of your organisations, and frameworks - you made, are listed. - - `project` is null when the receiving framework isn't a Project's Theory of Change. `added_by` is - null for additions made before Makerble recorded who added them. - security: [{tokenAuth: []}] - parameters: - - name: id - in: path - required: true - description: The id of the Impact Framework (Template) - schema: - type: integer - example: 7174 - - $ref: '#/components/parameters/Page' - - $ref: '#/components/parameters/PerPage' - - $ref: '#/components/parameters/LastSyncDatetime' - responses: - "200": - description: Where the framework has been added - content: - application/json: - schema: - type: object - properties: - page: {type: integer} - page_size: {type: integer} - page_count: {type: integer} - total_count: {type: integer} - data: - type: array - items: - type: object - properties: - id: {type: integer} - impact_framework_id: {type: integer} - receiving_framework: - type: object - properties: - id: {type: integer} - name: {type: string} - project: - type: object - nullable: true - properties: - id: {type: integer} - name: {type: string} - added_by: - type: object - nullable: true - properties: - id: {type: integer} - name: {type: string} - added_at: {type: string, format: date-time} - updated_at: {type: string, format: date-time} - example: - page: 1 - page_size: 1 - page_count: 1 - total_count: 1 - data: - - id: 31 - impact_framework_id: 7174 - receiving_framework: {id: 5549, name: Youth Club Theory of Change} - project: {id: 5427, name: Youth Club} - added_by: {id: 812, name: Sam Patel} - added_at: "2026-11-18T09:12:44.000Z" - updated_at: "2026-11-18T09:12:44.000Z" - "401": - $ref: '#/components/responses/Unauthorized' - "404": - $ref: '#/components/responses/NotFound' - post: - tags: [Library] - summary: Add an Impact Framework to projects or frameworks - operationId: addImpactFramework - description: | - Adds an Impact Framework's (Template's) metrics to Projects and to other Impact Frameworks, as the - **Add to projects** page and the **Add metrics from another project or framework** box on Edit - metrics do. Adding to a Project adds the metrics to that Project's own Theory of Change. - - The framework isn't copied: each metric goes into the same stage, a metric already there in that - stage is skipped, and the addition is recorded (see List where an Impact Framework has been added). - Adding the same framework again only adds metrics it has gained since. - - You must be able to edit each Project's or framework's metrics. One you can't edit, or that doesn't - exist, is listed in `refused` and the rest are still added. Give `project_ids`, `framework_ids` or both. - security: [{tokenAuth: []}] - parameters: - - name: id - in: path - required: true - description: The id of the Impact Framework (Template) whose metrics to add - schema: - type: integer - example: 7174 requestBody: required: true content: application/json: schema: type: object + required: [organisation_id, field_name, field_data_type] properties: - project_ids: - type: array - items: {type: integer} - description: Projects to add the metrics to - framework_ids: - type: array - items: {type: integer} - description: Other Impact Frameworks (Templates) to add the metrics to - example: - project_ids: [5427, 5428] - framework_ids: [1460] + organisation_id: + type: integer + description: The organisation (Charity) that will own it; you must be one of its editors + field_name: + type: string + field_data_type: + type: string + enum: [text, number, date, time, file, video, audio, picture, section_title, email_address, telephone, signature] + description: | + A Weekly availability field can only be made as part of a Contact Form (`POST /contact_forms`), not here. + The kind of answer. `file` is an Attachment for any file; `video`, `audio` and + `picture` ask for that kind of media (see above). + section_text: + type: string + description: For a section_title Field only + private: + type: boolean + description: True if only the organisation's staff may see the answers + force: + $ref: '#/components/schemas/ForceCreate' + examples: + text: + summary: A text Field + value: + organisation_id: 913 + field_name: "Postcode" + field_data_type: text + video: + summary: A Video question + value: + organisation_id: 913 + field_name: "Record a short video telling us what you learnt today" + field_data_type: video responses: "201": - description: What was added and what was refused - content: - application/json: - schema: - type: object - properties: - data: - type: object - properties: - impact_framework_id: {type: integer} - added: - type: array - items: - type: object - properties: - receiving_framework_id: {type: integer} - project_id: {type: integer, nullable: true} - refused: - type: array - items: - type: object - properties: - project_id: {type: integer} - framework_id: {type: integer} - error: - type: string - enum: [forbidden, not-found, same_framework, not_saved] - example: - data: - impact_framework_id: 7174 - added: - - {receiving_framework_id: 5549, project_id: 5427} - - {receiving_framework_id: 1460, project_id: null} - refused: - - {project_id: 5428, error: forbidden} + $ref: '#/components/responses/LibraryItemCreated' "401": $ref: '#/components/responses/Unauthorized' + "403": + $ref: '#/components/responses/LibraryCreateForbidden' "404": $ref: '#/components/responses/NotFound' + "409": + $ref: '#/components/responses/LibraryDuplicates' "422": $ref: '#/components/responses/UnprocessableEntity' - /referral_submissions: + /surveys: post: - tags: [Signup Pages] - summary: Sync a completed offline submission - description: | - The endpoint an offline device posts a completed Signup Page submission to, - once it regains connectivity. Reuses the exact same model methods the live, - online submission flow calls — there's no separate "offline" data path to - keep in sync with the online one. + tags: [Library, Story Categories] + summary: Create a Survey with its questions + operationId: createSurvey + description: | + Creates a Survey (Story Category) with all its questions, in the order given (at most 50). + Each question either reuses an item your organisation or the public library already has, by + id, or defines a new one: - **Authentication is a `ReferralLinkSubmissionCredential` bearer token** (the - `submission_credential.token` from the Form Definition), **not** the standard - `X-User-Email`/`X-User-Token` pair. Deactivating a Signup Page automatically - revokes its credential — there's no separate revoke action. + - `metric_id`, `field_id` or `activity_tracker_id`: reuse a Metric (Indicator), Field + (Custom Field) or Activity tracker (Change). Any id you can't see is `404`. + - `new_metric`: a new Metric, with `outcome_id` for the Outcome it measures. A scale + Metric needs `list_id` (an existing List) or `list` (a new List with its choices). + - `new_field`: a new Field; `section_title` makes a heading. - `primary` is used for a **structured** link (one primary person plus zero or - more `related_people`); `roles` is used instead for a **personalised** link - (one entry per person, no "primary" concept). Every `contact_form_answers` / - survey `answers` object is keyed by the field's `id` from the Form Definition, - never by name. See the Form Definition's Field object for the value shape - each `field_type` expects (Sub Ratio ids for dropdown/scale fields, digits-only - for `telephone`, base64-encoded payload for `media`/`file`, etc.). - operationId: createReferralSubmission - security: [{submissionBearerAuth: []}] + Search the library first and reuse what fits: results recorded against a copy of a Metric + don't add up with the original. If a new Metric, List or Field has the same or a + near-identical name to one you could reuse, nothing is created and you get `409` with the + matches, each with the `question` it belongs to. Send `force: true` to create them anyway. + + Nothing is created unless everything is: an invalid question creates nothing, and the error + names it ("Question 3: ..."). The Survey and its new items stay private to your organisation + unless you are Makerble staff and send `approved: true`. + + **Surveys answered more than once.** Keep one Survey with the same Metrics and name its Shared + Intervals in `intervals`, e.g. `["Baseline", "Endpoint"]`, so Distance Travelled works. Each + question can then be reworded or hidden in them (Adjust When): + + - `by_interval`: entries `{interval, respondent, question}` to reword it, or + `{interval, respondent, hide: true}` to hide it. Leave out `interval` for every Interval and + `respondent` (`participant`, `colleague`, `observer` or `public`) for everyone. Where two + entries cover the same Interval and respondent, the one naming more wins; two naming the + same amount are `422`. + - `only_in_intervals`: show the question only in these Intervals. + + Projects the Survey is added to later use its Intervals. An Interval the Survey doesn't + have, or wording without `intervals`, is `422` and creates nothing. + + **Questions that only apply after a certain answer.** Questions are numbered by their place + in `questions`, counting section headings. + + - `display_if`: `{question, answers}` shows the question only when that earlier question is + answered with one of `answers` (Display If). A list of them shows it when any is met. + - `skip_to`: `[{answers, question}]` jumps forward, past the questions in between, to a later + question that isn't mandatory (Skip To). Each answer may appear in one entry only. + + The question whose answer decides must be a scale Metric, whose answers are its List: for + yes/no, use a scale Metric on a Yes - No List, not a binary Metric. A Survey can't skip to its + end. Anything else is `422`, naming the question. + + **Question Grids.** `question_grids: [{outcome_id, questions}]` shows scale questions that + measure one Outcome first and share one List as one table, headed by the Outcome's title. + Every scale question of that Outcome in the Survey must be in the grid, on the same List, and + grid questions can't have `display_if` or `skip_to`. Anything else is `422`, naming the grid. + + **Scoring and Verdicts.** A new scale Metric can have `points` for every answer on its List, + e.g. `{"Never": 0, "Often": 2}`. `scoring: {questions, verdicts}` adds up those questions' + points and names each band of totals (Verdicts), e.g. Low 0-4, Medium 5-9, High 10-15. + Only new Metrics can be given points: a reused Metric's points are shared by every Survey + using it, so a reused Metric can be scored only if it already has them. The bands must be + whole numbers covering every possible total with no gaps or overlaps; anything else is + `422`, naming the question or band. + security: [{tokenAuth: []}] requestBody: required: true content: application/json: schema: - $ref: '#/components/schemas/ReferralSubmissionRequest' + type: object + required: [organisation_id, name, questions] + properties: + organisation_id: + type: integer + description: The organisation (Charity) that will own it; you must be one of its editors + name: + type: string + description: + type: string + intro_message: + type: string + departments: + type: array + items: {type: string} + causes: + type: array + items: {type: string} + sub_causes: + type: array + items: {type: string} + scoring: + type: object + description: A scored Survey (Verdicts) + required: [questions, verdicts] + properties: + questions: + type: array + description: The numbers of the scale questions whose points add up + items: {type: integer} + verdicts: + type: array + description: The bands of totals, covering every possible total with no gaps or overlaps + items: + type: object + required: [name, from, to] + properties: + name: {type: string, example: Low} + from: {type: integer, example: 0} + to: {type: integer, example: 4} + description: {type: string} + question_grids: + type: array + description: Question Grids, each an Outcome and the numbers of the scale questions shown as one table under its title + items: + type: object + required: [outcome_id, questions] + properties: + outcome_id: + type: integer + questions: + type: array + minItems: 2 + items: {type: integer} + intervals: + type: array + maxItems: 10 + description: The Survey's Shared Intervals in order, when it is answered more than once + items: {type: string, maxLength: 255} + approved: + type: boolean + description: Makerble staff only + force: + $ref: '#/components/schemas/ForceCreate' + questions: + type: array + minItems: 1 + maxItems: 50 + items: + $ref: '#/components/schemas/SurveyDraftQuestion' + example: + organisation_id: 913 + name: "Job readiness check-in" + intervals: [Baseline, Endpoint] + questions: + - metric_id: 4412 + is_mandatory: true + by_interval: + - interval: Endpoint + question: "How confident do you feel about getting a job now, after the course?" + - new_metric: + name: "Job search hours" + metric_type: value + default_question: "How many hours did you spend looking for work this week?" + outcome_id: 3301 + - new_metric: + name: "Interview confidence" + metric_type: scale + default_question: "How confident do you feel about interviews?" + outcome_id: 3301 + list_id: 2210 + - new_field: + field_name: "Postcode" + field_data_type: text responses: "201": - description: New submission processed - content: - application/json: - schema: - $ref: '#/components/schemas/ReferralSubmissionResponse' - "200": - description: This `idempotency_key` had already been processed — returns the original result, not a new one - content: - application/json: - schema: - $ref: '#/components/schemas/ReferralSubmissionResponse' + $ref: '#/components/responses/LibraryItemCreated' "401": - description: Token unknown, or the Signup Page has been deactivated since the token was issued - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - example: - error: "unauthorized" + $ref: '#/components/responses/Unauthorized' + "403": + $ref: '#/components/responses/LibraryCreateForbidden' + "404": + $ref: '#/components/responses/NotFound' + "409": + $ref: '#/components/responses/LibraryDuplicates' "422": - description: | - Either the contact form is a `CustomFieldCategory` ("advanced custom field") - form — unsupported by this endpoint — or a model validation failed. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - examples: - unsupportedContactForm: - value: { error: "unsupported-contact-form", detail: "..." } - invalidSubmission: - value: { error: "invalid-submission", detail: ["..."] } + $ref: '#/components/responses/UnprocessableEntity' - /suggested_merges: - get: - tags: [Suggested Merges] - summary: List Suggested Merges + /surveys/{id}/projects: + post: + tags: [Library, Story Categories] + summary: Add a Survey to Projects + operationId: addSurveyToProjects description: | - The Suggested Merges page (Contacts > Merge Contacts > Suggested Merges): sets of Contacts - that look like the same person. Only suggestions where the user can see every Contact are - returned: all the Organisation's Contacts for an Organisation Admin, the Contacts in their - Projects for a Project Admin. Requires permission to merge Contacts in the Organisation. - Sorted High match strength first, then newest. - operationId: listSuggestedMerges + Adds a Survey (Story Category) to Projects, as **Add survey to project(s)** on a Survey's + page does, so people in those Projects can answer it and its results show there. + + - The Survey must be one you can see in your library: your organisation's own, or the + public library. Otherwise `404`. + - You must manage each Project, or be an Admin of its organisation. Otherwise `404`, + naming the Project. + - A closed Project, or one whose Project Category doesn't allow other Surveys, is `422`. + + Every Project is checked first, so if one is refused none is added. A Project that + already uses the Survey is left as it is and listed in `existing_project_ids`. security: [{tokenAuth: []}] parameters: - - name: charity_id - in: query + - name: id + in: path required: true schema: type: integer - description: The Organisation (Charity) ID - - name: status - in: query - schema: - type: string - enum: [pending, merged, rejected, stale] - default: pending - description: "pending: waiting for review; rejected: marked Not duplicates; stale: a Contact was deleted" - - name: source - in: query - schema: - type: string - enum: [merge_rule, name_scan] - description: "merge_rule: from a Merge Rule in Suggest mode; name_scan: from similar names" - - name: beneficiary_id - in: query - schema: - type: integer - description: Only suggestions that include this Contact - - $ref: '#/components/parameters/Page' - - $ref: '#/components/parameters/PerPage' - - $ref: '#/components/parameters/LastSyncDatetime' + description: The Survey's (Story Category's) id + requestBody: + required: true + content: + application/json: + schema: + type: object + required: [project_ids] + properties: + project_ids: + type: array + minItems: 1 + items: + type: integer + description: The Projects to add it to + example: + project_ids: [4021, 4022] responses: "200": - description: Paginated list of Suggested Merges + description: The Survey is in every Project given content: application/json: + schema: + type: object + properties: + data: + type: object + properties: + survey_id: + type: integer + added_project_ids: + type: array + items: + type: integer + description: Projects the Survey was added to now + existing_project_ids: + type: array + items: + type: integer + description: Projects that already used it example: - page: 1 - page_size: 1 - page_count: 1 - total_count: 1 data: - - id: 42 - status: pending - source: merge_rule - merge_rule: { id: 7, name: Same email } - match_strength: high - matched_fields: [{ field_id: 31, field_name: email_address, value: grace@example.com, match_type: exact }] - contacts: - - { id: 101, name: Grace Mensah, created_at: "2026-09-02T10:15:00Z", created_by: { id: 5, name: Asha Patel } } - - { id: 188, name: Grace Mensah, created_at: "2026-10-21T08:02:00Z", created_by: null } - created_at: "2026-10-21T09:00:00Z" - updated_at: "2026-10-21T09:00:00Z" - reviewed_by: null - reviewed_at: null + survey_id: 812 + added_project_ids: [4021] + existing_project_ids: [4022] "401": $ref: '#/components/responses/Unauthorized' - "403": - description: The user can't merge Contacts in the Organisation "404": $ref: '#/components/responses/NotFound' "422": $ref: '#/components/responses/UnprocessableEntity' - /suggested_merges/{id}/merge: - post: - tags: [Suggested Merges] - summary: Merge a Suggested Merge + /surveys/{id}: + patch: + tags: [Library, Story Categories] + summary: Change a Survey + operationId: updateSurvey description: | - Merges the suggestion's Contacts into one, as pressing Merge in Compare does. The Contact - created first is kept unless `winner_id` names another of its Contacts. One merge request is - made per other Contact; they are merged within a few minutes and can be undone with Unmerge - on the Merge Contacts page. - operationId: mergeSuggestedMerge + Changes a Survey's (Story Category's) name, description and intro message, as the Survey's + Edit page does. Send only what changes. You must be able to edit the Survey: an editor of the + organisation that owns it. + + A name your organisation already uses for another Survey (ignoring case) is `422`, naming + that Survey. A Survey you can see but not edit, such as another organisation's public + Survey, is `403`; one you can't see is `404`. security: [{tokenAuth: []}] parameters: - - name: id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/ResourceId' requestBody: + required: true content: application/json: schema: type: object properties: - winner_id: - type: integer - description: The Contact to keep - example: { winner_id: 101 } - responses: - "202": - description: Merging has begun. Returns `suggested_merge` (now `merged`) and `merge_request_ids`. - "401": - $ref: '#/components/responses/Unauthorized' - "404": - $ref: '#/components/responses/NotFound' - "422": - description: "`{error}`: the Contact to keep isn't one of the suggestion's, or it has already been reviewed" - - /suggested_merges/{id}/reject: - post: - tags: [Suggested Merges] - summary: Mark a Suggested Merge as Not duplicates - description: | - Records that the Contacts are different people, as pressing Not duplicates does. The pair - is not suggested together again, from any source. - operationId: rejectSuggestedMerge - security: [{tokenAuth: []}] - parameters: - - name: id - in: path - required: true - schema: - type: integer + name: + type: string + description: + type: string + intro_message: + type: string + description: Shown to people before they start + example: + name: "Job readiness check-in" + intro_message: "This takes about two minutes." responses: "200": - description: Returns `suggested_merge`, now `rejected`, with `reviewed_by` and `reviewed_at` + $ref: '#/components/responses/LibraryItemUpdated' "401": $ref: '#/components/responses/Unauthorized' + "403": + $ref: '#/components/responses/ForbiddenError' "404": $ref: '#/components/responses/NotFound' "422": - description: "`{error}`: it has already been reviewed" + $ref: '#/components/responses/UnprocessableEntity' - /duplicate_contacts: - get: - tags: [Duplicate Contacts] - summary: Scan for duplicate Contacts + /surveys/{id}/questions: + patch: + tags: [Library, Story Categories] + summary: Change a Survey's questions + operationId: updateSurveyQuestions description: | - The Duplicate Contacts page: sets of Contacts that look like the same person. Only Contacts - the user could merge are scanned (all the Organisation's Contacts for an Organisation Admin, - the Contacts in their Projects for a Project Admin), and sets someone marked as Not - duplicates are left out. Requires permission to merge Contacts in the Organisation. + Adds, removes, replaces and moves a Survey's questions, as the Survey's Edit page does. Send + the changes in order: each applies to the questions as the changes before it left them. + Question numbers are as **Get a library item** lists the Survey's questions, starting at 1. - `match: similar` (the default) ignores titles (Mr, Mrs, Dr), capital letters, punctuation, - word order and small spelling differences. It runs in the background because a large - Organisation takes several seconds: while it runs the call answers 202 with - `status: running`; call again after `retry_after` seconds to get the sets. A finished scan - is reused for 10 minutes. `match: exact` finds only names spelt exactly the same and - answers straight away. + - `add`: `question`, and optionally `number` to put it at (default: the end). + - `remove`: `number`. The question is taken off the Survey; the Metric or Field behind it is kept. + - `replace`: `number` and `question`. + - `move`: `number` and `to`. - `match_strength` is `high` when the names are the same once normalised or the Contacts - share a date of birth, email or mobile, and `medium` otherwise. `reasons` are - `similar_name`, `same_name`, `same_date_of_birth`, `same_email` and `same_mobile`. - operationId: listDuplicateContacts + A new question takes the same format as in **Create a Survey with its questions**: reuse a + Metric, Field or Activity tracker by id, or define `new_metric` or `new_field`. A new item + with the same or a near-identical name as one you could reuse is `422`; send `force: true` + only if none fits. + + Nothing is changed unless every change can be made. A bad change is `422` naming it, e.g. + "Change 2: there is no question 5". security: [{tokenAuth: []}] parameters: - - name: charity_id - in: query - required: true - schema: - type: integer - description: The Organisation (Charity) ID - - name: match - in: query - schema: - type: string - enum: [similar, exact] - default: similar - description: "similar: names that look alike; exact: names spelt exactly the same" - - $ref: '#/components/parameters/Page' - - $ref: '#/components/parameters/PerPage' + - $ref: '#/components/parameters/ResourceId' + requestBody: + required: true + content: + application/json: + schema: + type: object + required: [changes] + properties: + changes: + type: array + items: + type: object + required: [action] + properties: + action: + type: string + enum: [add, remove, replace, move] + number: + type: integer + to: + type: integer + description: move only + question: + $ref: '#/components/schemas/SurveyDraftQuestion' + force: + $ref: '#/components/schemas/ForceCreate' + example: + changes: + - {action: add, number: 1, question: {metric_id: 14702, is_mandatory: true}} + - {action: remove, number: 3} + - {action: move, number: 2, to: 4} responses: "200": - description: Paginated list of sets of duplicate Contacts, High first - content: - application/json: - example: - page: 1 - page_size: 1 - page_count: 1 - total_count: 1 - match: similar - status: completed - scanned_at: "2026-10-28T09:00:00Z" - data: - - contacts: - - { id: 101, name: Jane Doe, created_at: "2026-09-02T10:15:00Z", created_by: { id: 5, name: Asha Patel } } - - { id: 188, name: Mrs Jane Doe, created_at: "2026-10-21T08:02:00Z", created_by: null } - match_strength: high - reasons: [similar_name, same_date_of_birth] - "202": - description: A similar-name scan is running; call again after `retry_after` seconds - content: - application/json: - example: { match: similar, status: running, retry_after: 5 } + $ref: '#/components/responses/LibraryItemUpdated' "401": $ref: '#/components/responses/Unauthorized' "403": - description: The user can't merge Contacts in the Organisation + $ref: '#/components/responses/ForbiddenError' "404": $ref: '#/components/responses/NotFound' "422": $ref: '#/components/responses/UnprocessableEntity' - /duplicate_contacts/not_duplicates: + /contact_forms: post: - tags: [Duplicate Contacts] - summary: Mark Contacts as Not duplicates + tags: [Library, Beneficiary Categories] + summary: Create a Contact Form with its fields + operationId: createContactForm description: | - Records that a set of Contacts are different people, as pressing Not duplicates on the - Duplicate Contacts page does. They are never suggested together again: not by the scan, - the background check of new Contacts or a Merge Rule. - operationId: markNotDuplicates + Creates a Contact Form (Beneficiary Category): the form your organisation fills in about each + Contact of one kind, with its fields in the order given (at most 50). Each field either + reuses an item you can see by id (`field_id` for a Field, `list_id` for a List of answer + choices) or defines a new one (`new_field`, `new_list`). + + Only organisations that use Contact Forms can have one (otherwise `403`). Near-identical + names of new Fields and Lists get `409` with the matches, each with its `question`, unless + you send `force: true`. Nothing is created unless everything is. Only your organisation uses + the form unless you are Makerble staff and send `approved: true`. security: [{tokenAuth: []}] requestBody: required: true @@ -12964,461 +13271,612 @@ paths: application/json: schema: type: object - required: [contact_ids] + required: [organisation_id, name, department, contact_role, questions] properties: - contact_ids: - type: array - items: { type: integer } - description: At least two Contacts - match_strength: + organisation_id: + type: integer + description: The organisation (Charity) that will own it; you must be one of its editors + name: type: string - enum: [high, medium] - example: { contact_ids: [101, 188], match_strength: high } + department: + type: string + enum: [Personal, Professional, Public Impact] + contact_role: + type: string + description: What the Contacts are to the organisation, e.g. Participant + contact_type: + type: string + description: Person (default), Organisation, Animal or Object + approved: + type: boolean + description: Makerble staff only + force: + $ref: '#/components/schemas/ForceCreate' + questions: + type: array + minItems: 1 + maxItems: 50 + items: + $ref: '#/components/schemas/ContactFormDraftQuestion' + example: + organisation_id: 913 + name: "Young person registration" + department: Personal + contact_role: Participant + questions: + - field_id: 5120 + is_mandatory: true + - new_list: + name: "School year" + choices: ["Year 7", "Year 8", "Year 9"] + - new_field: + field_name: "Date of birth" + field_data_type: date responses: - "200": - description: "`{contact_ids, message}`" + "201": + $ref: '#/components/responses/LibraryItemCreated' "401": $ref: '#/components/responses/Unauthorized' "403": - description: The user can't merge Contacts in the Organisation + $ref: '#/components/responses/LibraryCreateForbidden' "404": $ref: '#/components/responses/NotFound' + "409": + $ref: '#/components/responses/LibraryDuplicates' "422": - description: "`{error}`: fewer than two Contacts, or a Contact the user can't merge" + $ref: '#/components/responses/UnprocessableEntity' - /duplicate_contacts/merge: + /contact_forms/{id}/projects: post: - tags: [Duplicate Contacts] - summary: Merge a set of duplicate Contacts + tags: [Library, Beneficiary Categories] + summary: Add a Contact Form to projects + operationId: addContactFormToProjects description: | - Merges the Contacts into one, as Merge Selected Contacts on the Duplicate Contacts page - does. The Contact created first is kept unless `winner_id` names another of them. One merge - request is made per other Contact; they are merged within a few minutes and can be undone - with Unmerge on the Merge Contacts page. - operationId: mergeDuplicateContacts - security: [{tokenAuth: []}] - requestBody: - required: true - content: - application/json: - schema: - type: object - required: [contact_ids] - properties: - contact_ids: - type: array - items: { type: integer } - description: At least two Contacts - winner_id: - type: integer - description: The Contact to keep - example: { contact_ids: [101, 188], winner_id: 101 } - responses: - "202": - description: "Merging has begun: `{winner_id, merge_request_ids, message}`" - "401": - $ref: '#/components/responses/Unauthorized' - "403": - description: The user can't merge Contacts in the Organisation - "404": - $ref: '#/components/responses/NotFound' - "422": - description: "`{error}`: fewer than two Contacts, a Contact the user can't merge, or a Contact to keep that isn't one of them" + Adds a Contact Form (Beneficiary Category) to projects, as **Add form to project** on a + Contact Form's page does, so staff in those projects use it when they add or edit Contacts. - /duplicate_contacts/settings: - get: - tags: [Duplicate Contacts] - summary: Read "Suggest possible duplicates when contacts are created" - description: | - The setting on the Merge Contacts page. When it is on (the default), every Contact created - is compared with the Organisation's other Contacts each hour, and similar names appear in - Suggested Merges for someone to review. Requires permission to merge Contacts in the - Organisation. - operationId: getDuplicateContactSettings + `use` says how each project uses it: `full` (the default) to create new Contacts and edit + existing ones, `create` to create new Contacts only, or `edit` to edit existing Contacts + only. Organisation Admins and Project Managers may then edit what it holds. Only the + project's Contact Form settings change. + + - Each project must belong to the form's organisation, and you must be able to change its + Project Preferences: an Organisation Admin, or the project's manager. Otherwise `404`, + naming the project. + - A form that doesn't exist is `404`; an organisation that doesn't use Contact Forms is `422`. + + Every project is checked first, so if one is refused none is changed. A project that + already uses the form that way is left as it is and listed in `existing_project_ids`. security: [{tokenAuth: []}] parameters: - - name: charity_id - in: query + - name: id + in: path required: true schema: type: integer - description: The Organisation (Charity) ID - responses: - "200": - description: The setting - content: - application/json: - example: { charity_id: 12, suggest_on_create: true } - "401": - $ref: '#/components/responses/Unauthorized' - "403": - description: The user can't merge Contacts in the Organisation - "404": - $ref: '#/components/responses/NotFound' - patch: - tags: [Duplicate Contacts] - summary: Change "Suggest possible duplicates when contacts are created" - description: Turns the setting on or off. Requires an Organisation Admin (editor). - operationId: updateDuplicateContactSettings - security: [{tokenAuth: []}] + description: The Contact Form's (Beneficiary Category's) id requestBody: required: true content: application/json: schema: type: object - required: [charity_id, suggest_on_create] + required: [project_ids] properties: - charity_id: { type: integer } - suggest_on_create: { type: boolean } - example: { charity_id: 12, suggest_on_create: false } + project_ids: + type: array + minItems: 1 + items: + type: integer + description: The projects to add it to + use: + type: string + enum: [full, create, edit] + default: full + description: How the projects use it + example: + project_ids: [4021, 4022] + use: create responses: "200": - description: The setting, changed + description: The form is in every project given content: application/json: - example: { charity_id: 12, suggest_on_create: false } + schema: + type: object + properties: + data: + type: object + properties: + contact_form_id: + type: integer + use: + type: string + enum: [full, create, edit] + added_project_ids: + type: array + items: + type: integer + description: Projects the form was added to now + existing_project_ids: + type: array + items: + type: integer + description: Projects that already used it that way + example: + data: + contact_form_id: 2391 + use: create + added_project_ids: [4021] + existing_project_ids: [4022] "401": $ref: '#/components/responses/Unauthorized' - "403": - description: The user isn't an Organisation Admin "404": $ref: '#/components/responses/NotFound' "422": $ref: '#/components/responses/UnprocessableEntity' - /merge_rules: - get: - tags: [Merge Rules] - summary: List an Organisation's Merge Rules + /impact_frameworks: + post: + tags: [Library] + summary: Create an Impact Framework with its entries + operationId: createImpactFramework description: | - The Manage Merge Rules page. Requires an Admin or Creator (editor or reporter) of the - Organisation. - operationId: listMergeRules + Creates an Impact Framework (Template), your organisation's theory of change, with its + entries in order. Each entry has a `stage` and exactly one item: + + - `activity_tracker_id` or `new_activity_tracker` (an Activity or Attendance tracker, a + Change) in `Activity outputs` or `Participation outputs`; + - `outcome_id` or `new_outcome` in `Short-term outcomes`, `Medium-term outcomes` or + `Long-term outcomes`. An Outcome entry can also have `new_metrics`: new Metrics + (Indicators) that measure it. + + At most 50 entries and new Metrics together. Near-identical names of new items get `409` + with the matches, each with its `entry`, unless you send `force: true`. Nothing is created + unless everything is, and an error names the entry. It stays private to your organisation + unless you are Makerble staff and send `approved: true`. security: [{tokenAuth: []}] - parameters: - - name: charity_id - in: query - required: true - schema: - type: integer - description: The Organisation (Charity) ID - - $ref: '#/components/parameters/Page' - - $ref: '#/components/parameters/PerPage' - - $ref: '#/components/parameters/LastSyncDatetime' - responses: - "200": - description: Paginated list of Merge Rules - content: - application/json: - example: - page: 1 - page_size: 1 - page_count: 1 - total_count: 1 - data: - - id: 7 - name: Same email - conditions: [{ id: 31, field_name: email_address }] - match_type: and - merge_mode: suggest - status: Active - created_by: { id: 5, name: Asha Patel } - last_edited_by: { id: 5, name: Asha Patel } - last_edited_at: "2026-10-20T14:00:00Z" - created_at: "2026-10-20T14:00:00Z" - updated_at: "2026-10-20T14:00:00Z" + requestBody: + required: true + content: + application/json: + schema: + type: object + required: [organisation_id, name, entries] + properties: + organisation_id: + type: integer + description: The organisation (Charity) that will own it; you must be one of its editors + name: + type: string + description: + type: string + color: + type: string + causes: + type: array + items: {type: string} + department: + type: string + approved: + type: boolean + description: Makerble staff only + force: + $ref: '#/components/schemas/ForceCreate' + entries: + type: array + minItems: 1 + maxItems: 50 + items: + $ref: '#/components/schemas/ImpactFrameworkDraftEntry' + example: + organisation_id: 913 + name: "Youth employment" + entries: + - stage: Activity outputs + new_activity_tracker: + name: "Workshops delivered" + category: Education + - stage: Short-term outcomes + outcome_id: 3301 + new_metrics: + - name: "Job search hours" + metric_type: value + default_question: "How many hours did you spend looking for work this week?" + - stage: Long-term outcomes + new_outcome: + title: "In sustained work" + responses: + "201": + $ref: '#/components/responses/LibraryItemCreated' "401": $ref: '#/components/responses/Unauthorized' "403": - description: The user isn't an Admin or Creator of the Organisation + $ref: '#/components/responses/LibraryCreateForbidden' "404": $ref: '#/components/responses/NotFound' + "409": + $ref: '#/components/responses/LibraryDuplicates' + "422": + $ref: '#/components/responses/UnprocessableEntity' + /impact_frameworks/{id}/copy: post: - tags: [Merge Rules] - summary: Create a Merge Rule + tags: [Library] + summary: Copy an Impact Framework + operationId: copyImpactFramework description: | - Create a Merge Rule. `conditions` are Contact field (Current Field) ids from the - Organisation's Contact forms that must be identical. `match_type` `and` needs every - condition to match, `or` any one. `merge_mode` is required ("When contacts match this - rule"): `automatic` merges matching Contacts within 2 hours, keeping the one created first; - `suggest` puts matches in Suggested Merges for someone to review. New rules are Active. - operationId: createMergeRule + Copies an Impact Framework (Template), as **Copy** on the Manage Impact Frameworks page does. + The copy is named `Copy of ` and keeps the original's stages, metrics (Activity and + Attendance trackers, Outcomes and the trackers placed on it), causes, description and colour, + but none of its projects: it is not added to any project. It is yours, private and unapproved, + in the original's organisation if you belong to it, otherwise among your own Impact Frameworks. + + You may copy your own Impact Frameworks, any of an organisation you belong to, the Theory of + Change of a project you edit, and approved ImpactStore frameworks. Any other id answers `404`. security: [{tokenAuth: []}] - requestBody: - required: true - content: - application/json: - schema: - type: object - required: [charity_id, name, conditions, merge_mode] - properties: - charity_id: { type: integer } - name: { type: string } - conditions: { type: array, items: { type: integer } } - match_type: { type: string, enum: [and, or], default: and } - merge_mode: { type: string, enum: [automatic, suggest] } - status: { type: string, enum: [Active, Inactive] } - example: { charity_id: 12, name: Same email or mobile, conditions: [31, 32], match_type: or, merge_mode: suggest } + parameters: + - name: id + in: path + required: true + description: The id of the Impact Framework (Template) to copy + schema: + type: integer + example: 7174 responses: "201": - description: The new Merge Rule + $ref: '#/components/responses/LibraryItemCreated' "401": $ref: '#/components/responses/Unauthorized' - "403": - description: The user isn't an Admin or Creator of the Organisation "404": $ref: '#/components/responses/NotFound' "422": $ref: '#/components/responses/UnprocessableEntity' - /field_visibility_rules: + /impact_frameworks/{id}/missing_metrics: get: - tags: [Field Visibility] - summary: List who can see each Contact field + tags: [Library] + summary: List an Impact Framework's metrics a Results Canvas can't show + operationId: listMissingFrameworkMetrics description: | - The Field Visibility settings page. Every Contact field comes back once, whichever Contact - forms it is on. `field_class_name` and `field_key` identify it: `CustomField` or `RatioSet` - with its id for a form field or dropdown, `BeneficiaryColumn` with the column name for a - built-in field such as `date_of_birth`, `CustomFieldDefinition` with its id for a Custom - Forms field. `visibility` is `default` (everyone who can view the Contact) or `restricted`: - only users in one of its `teams`, or colleagues in any role on one of its `projects`, see the - value; Organisation Admins get no exception. A restriction never gives anyone access to a - Contact they can't already view. `visible_to_guests` says whether external guest users added - through a Contact's Override see the field. Requires an Organisation Admin (editor). - `last_synced_datetime` isn't supported: a field returned to default has no record to sync. - operationId: listFieldVisibilityRules + When a project's or an album's Results Canvas is viewed through an Impact Framework (its **Metrics** + dropdown), it shows only the framework's metrics that are already used on the project. This lists + the rest: the framework's Activity and Attendance trackers (`Change`) and Outcomes (`Outcome`) that + aren't used on the project, or aren't used on one or more of the album's open projects. It is the + list the canvas's "metrics aren't shown" popup shows. + + Each metric names the projects without it, and `can_add` says whether you may add it there. Add a + metric with [Add metric to](#add-metric-to): `POST + /metrics/{change|outcome}/{metric_id}/destinations/projects/{project_id}`. + + Give `project_id` or `album_id`. The project must be one you can open, the album one you can view, + and the Impact Framework one the canvas's Metrics dropdown offers you (your organisation's or your + own). Anything else answers `404`. security: [{tokenAuth: []}] parameters: - - name: charity_id - in: query + - name: id + in: path required: true + description: The id of the Impact Framework (Template) schema: type: integer - description: The Organisation (Charity) ID - - name: search - in: query - schema: - type: string - description: Part of the field name - - name: form + example: 7174 + - name: project_id in: query + description: The project whose Results Canvas to check schema: - type: string - description: Only fields on this Contact form (its name) - - name: visibility + type: integer + example: 2210 + - name: album_id in: query + description: The album (Bundle) whose Results Canvas to check, instead of a project schema: - type: string - enum: [default, restricted] + type: integer - $ref: '#/components/parameters/Page' - $ref: '#/components/parameters/PerPage' responses: "200": - description: Paginated list of Contact fields + description: The missing metrics, in the framework's column order content: application/json: + schema: + type: object + properties: + impact_framework: + type: object + properties: + id: { type: integer } + name: { type: string } + project_id: { type: integer, nullable: true } + album_id: { type: integer, nullable: true } + page: { type: integer } + page_size: { type: integer } + page_count: { type: integer } + total_count: { type: integer } + data: + type: array + items: + type: object + properties: + metric_type: { type: string, enum: [Change, Outcome] } + metric_id: { type: integer } + name: { type: string } + stage: { type: string, description: The Impact Scorecard column the framework puts it in } + stage_id: { type: integer } + projects: + type: array + description: The projects that don't use the metric yet + items: + type: object + properties: + id: { type: integer } + name: { type: string } + can_add: { type: boolean, description: Whether you may add the metric to this project } example: + impact_framework: { id: 7174, name: Bambanani ECD Logic Model } + project_id: null + album_id: 381 page: 1 page_size: 1 page_count: 1 total_count: 1 data: - - field_class_name: CustomField - field_key: "481" - name: NHS number - forms: [Person being referred] - visibility: restricted - teams: [{ id: 9, name: Beacons }] - projects: [{ id: 33, name: WAY Beacons CYP }] - visible_to_guests: false + - metric_type: Outcome + metric_id: 5521 + name: Improved school readiness + stage: Short-term outcomes + stage_id: 3 + projects: + - { id: 2210, name: Bambanani 2026, can_add: true } "401": $ref: '#/components/responses/Unauthorized' - "403": - description: The user isn't an Organisation Admin "404": $ref: '#/components/responses/NotFound' - patch: - tags: [Field Visibility] - summary: Change who can see Contact fields + "422": + $ref: '#/components/responses/UnprocessableEntity' + + /impact_frameworks/{id}/additions: + get: + tags: [Library] + summary: List where an Impact Framework has been added + operationId: listImpactFrameworkAdditions description: | - Change the settings of one or more Contact fields, all together or not at all. For each - field, `visibility: restricted` needs at least one of `team_ids` or `project_ids` (Teams and - Projects of the same Organisation); `visibility: default` removes the restriction. - `visible_to_guests` shows or hides the field from external guest users. Leave a key out to - keep that setting. Errors name the field, e.g. "NHS number: Choose at least one Team or - project for a restricted field". Requires an Organisation Admin (editor). - operationId: updateFieldVisibilityRules + The Projects and other Impact Frameworks this Impact Framework (Template) has been added to, by + whom and when, as recorded by **Add to projects** and by **Add metrics from another project or + framework** on Edit metrics. Only Projects and frameworks of your organisations, and frameworks + you made, are listed. + + `project` is null when the receiving framework isn't a Project's Theory of Change. `added_by` is + null for additions made before Makerble recorded who added them. security: [{tokenAuth: []}] - requestBody: - required: true - content: - application/json: - schema: - type: object - required: [charity_id, rules] - properties: - charity_id: { type: integer } - rules: - type: array - items: - type: object - required: [field_class_name, field_key] - properties: - field_class_name: { type: string, enum: [CustomField, RatioSet, BeneficiaryColumn, CustomFieldDefinition] } - field_key: { type: string, description: The field id, or the column name for a BeneficiaryColumn } - visibility: { type: string, enum: [default, restricted] } - team_ids: { type: array, items: { type: integer } } - project_ids: { type: array, items: { type: integer } } - visible_to_guests: { type: boolean } - example: - charity_id: 12 - rules: - - { field_class_name: CustomField, field_key: "481", visibility: restricted, team_ids: [9], project_ids: [33], visible_to_guests: false } + parameters: + - name: id + in: path + required: true + description: The id of the Impact Framework (Template) + schema: + type: integer + example: 7174 + - $ref: '#/components/parameters/Page' + - $ref: '#/components/parameters/PerPage' + - $ref: '#/components/parameters/LastSyncDatetime' responses: "200": - description: The changed fields + description: Where the framework has been added content: application/json: + schema: + type: object + properties: + page: {type: integer} + page_size: {type: integer} + page_count: {type: integer} + total_count: {type: integer} + data: + type: array + items: + type: object + properties: + id: {type: integer} + impact_framework_id: {type: integer} + receiving_framework: + type: object + properties: + id: {type: integer} + name: {type: string} + project: + type: object + nullable: true + properties: + id: {type: integer} + name: {type: string} + added_by: + type: object + nullable: true + properties: + id: {type: integer} + name: {type: string} + added_at: {type: string, format: date-time} + updated_at: {type: string, format: date-time} example: + page: 1 + page_size: 1 + page_count: 1 + total_count: 1 data: - - field_class_name: CustomField - field_key: "481" - name: NHS number - forms: [Person being referred] - visibility: restricted - teams: [{ id: 9, name: Beacons }] - projects: [{ id: 33, name: WAY Beacons CYP }] - visible_to_guests: false + - id: 31 + impact_framework_id: 7174 + receiving_framework: {id: 5549, name: Youth Club Theory of Change} + project: {id: 5427, name: Youth Club} + added_by: {id: 812, name: Sam Patel} + added_at: "2026-11-18T09:12:44.000Z" + updated_at: "2026-11-18T09:12:44.000Z" "401": $ref: '#/components/responses/Unauthorized' - "403": - description: The user isn't an Organisation Admin "404": $ref: '#/components/responses/NotFound' - "422": - $ref: '#/components/responses/UnprocessableEntity' - put: - tags: [Field Visibility] - summary: Change who can see Contact fields (same as PATCH) - description: The same as PATCH /field_visibility_rules. - operationId: replaceFieldVisibilityRules + post: + tags: [Library] + summary: Add an Impact Framework to projects or frameworks + operationId: addImpactFramework + description: | + Adds an Impact Framework's (Template's) metrics to Projects and to other Impact Frameworks, as the + **Add to projects** page and the **Add metrics from another project or framework** box on Edit + metrics do. Adding to a Project adds the metrics to that Project's own Theory of Change. + + The framework isn't copied: each metric goes into the same stage, a metric already there in that + stage is skipped, and the addition is recorded (see List where an Impact Framework has been added). + Adding the same framework again only adds metrics it has gained since. + + You must be able to edit each Project's or framework's metrics. One you can't edit, or that doesn't + exist, is listed in `refused` and the rest are still added. Give `project_ids`, `framework_ids` or both. security: [{tokenAuth: []}] + parameters: + - name: id + in: path + required: true + description: The id of the Impact Framework (Template) whose metrics to add + schema: + type: integer + example: 7174 requestBody: required: true content: application/json: schema: type: object - required: [charity_id, rules] properties: - charity_id: { type: integer } - rules: + project_ids: type: array - items: - type: object - required: [field_class_name, field_key] - properties: - field_class_name: { type: string, enum: [CustomField, RatioSet, BeneficiaryColumn, CustomFieldDefinition] } - field_key: { type: string, description: The field id, or the column name for a BeneficiaryColumn } - visibility: { type: string, enum: [default, restricted] } - team_ids: { type: array, items: { type: integer } } - project_ids: { type: array, items: { type: integer } } - visible_to_guests: { type: boolean } + items: {type: integer} + description: Projects to add the metrics to + framework_ids: + type: array + items: {type: integer} + description: Other Impact Frameworks (Templates) to add the metrics to example: - charity_id: 12 - rules: - - { field_class_name: CustomField, field_key: "481", visibility: restricted, team_ids: [9], project_ids: [33], visible_to_guests: false } + project_ids: [5427, 5428] + framework_ids: [1460] responses: - "200": - description: The changed fields + "201": + description: What was added and what was refused content: application/json: + schema: + type: object + properties: + data: + type: object + properties: + impact_framework_id: {type: integer} + added: + type: array + items: + type: object + properties: + receiving_framework_id: {type: integer} + project_id: {type: integer, nullable: true} + refused: + type: array + items: + type: object + properties: + project_id: {type: integer} + framework_id: {type: integer} + error: + type: string + enum: [forbidden, not-found, same_framework, not_saved] example: data: - - field_class_name: CustomField - field_key: "481" - name: NHS number - forms: [Person being referred] - visibility: restricted - teams: [{ id: 9, name: Beacons }] - projects: [{ id: 33, name: WAY Beacons CYP }] - visible_to_guests: false + impact_framework_id: 7174 + added: + - {receiving_framework_id: 5549, project_id: 5427} + - {receiving_framework_id: 1460, project_id: null} + refused: + - {project_id: 5428, error: forbidden} "401": $ref: '#/components/responses/Unauthorized' - "403": - description: The user isn't an Organisation Admin "404": $ref: '#/components/responses/NotFound' "422": $ref: '#/components/responses/UnprocessableEntity' - /merge_rules/{id}: - get: - tags: [Merge Rules] - summary: Get a Merge Rule - operationId: getMergeRule - security: [{tokenAuth: []}] - parameters: - - name: id - in: path - required: true - schema: - type: integer - responses: - "200": - description: The Merge Rule - "401": - $ref: '#/components/responses/Unauthorized' - "404": - $ref: '#/components/responses/NotFound' - - patch: - tags: [Merge Rules] - summary: Update a Merge Rule + /referral_submissions: + post: + tags: [Signup Pages] + summary: Sync a completed offline submission description: | - Change any of `name`, `conditions`, `match_type`, `merge_mode` and `status`; anything not - sent is kept, including the match type when only the conditions change. Set `merge_mode` to - `suggest` to stop a rule merging automatically, or `status` to `Inactive` to turn it off. - operationId: updateMergeRule - security: [{tokenAuth: []}] - parameters: - - name: id - in: path - required: true - schema: - type: integer + The endpoint an offline device posts a completed Signup Page submission to, + once it regains connectivity. Reuses the exact same model methods the live, + online submission flow calls — there's no separate "offline" data path to + keep in sync with the online one. + + **Authentication is a `ReferralLinkSubmissionCredential` bearer token** (the + `submission_credential.token` from the Form Definition), **not** the standard + `X-User-Email`/`X-User-Token` pair. Deactivating a Signup Page automatically + revokes its credential — there's no separate revoke action. + + `primary` is used for a **structured** link (one primary person plus zero or + more `related_people`); `roles` is used instead for a **personalised** link + (one entry per person, no "primary" concept). Every `contact_form_answers` / + survey `answers` object is keyed by the field's `id` from the Form Definition, + never by name. See the Form Definition's Field object for the value shape + each `field_type` expects (Sub Ratio ids for dropdown/scale fields, digits-only + for `telephone`, base64-encoded payload for `media`/`file`, etc.). + operationId: createReferralSubmission + security: [{submissionBearerAuth: []}] requestBody: + required: true content: application/json: schema: - type: object - properties: - name: { type: string } - conditions: { type: array, items: { type: integer } } - match_type: { type: string, enum: [and, or] } - merge_mode: { type: string, enum: [automatic, suggest] } - status: { type: string, enum: [Active, Inactive] } - example: { merge_mode: suggest } + $ref: '#/components/schemas/ReferralSubmissionRequest' responses: - "200": - description: The updated Merge Rule - "401": - $ref: '#/components/responses/Unauthorized' - "404": - $ref: '#/components/responses/NotFound' + "201": + description: New submission processed + content: + application/json: + schema: + $ref: '#/components/schemas/ReferralSubmissionResponse' + "200": + description: This `idempotency_key` had already been processed — returns the original result, not a new one + content: + application/json: + schema: + $ref: '#/components/schemas/ReferralSubmissionResponse' + "401": + description: Token unknown, or the Signup Page has been deactivated since the token was issued + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + example: + error: "unauthorized" "422": - $ref: '#/components/responses/UnprocessableEntity' + description: | + Either the contact form is a `CustomFieldCategory` ("advanced custom field") + form — unsupported by this endpoint — or a model validation failed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + examples: + unsupportedContactForm: + value: { error: "unsupported-contact-form", detail: "..." } + invalidSubmission: + value: { error: "invalid-submission", detail: ["..."] } - /checklists: + /suggested_merges: get: - tags: [Checklists] - summary: List an Organisation's Checklists + tags: [Suggested Merges] + summary: List Suggested Merges description: | - The Checklists of an Organisation (Charity). Visible to the Organisation's editors and - reporters, and to managers (editors) of its Projects. - operationId: listChecklists + The Suggested Merges page (Contacts > Merge Contacts > Suggested Merges): sets of Contacts + that look like the same person. Only suggestions where the user can see every Contact are + returned: all the Organisation's Contacts for an Organisation Admin, the Contacts in their + Projects for a Project Admin. Requires permission to merge Contacts in the Organisation. + Sorted High match strength first, then newest. + operationId: listSuggestedMerges security: [{tokenAuth: []}] parameters: - name: charity_id @@ -13427,222 +13885,143 @@ paths: schema: type: integer description: The Organisation (Charity) ID + - name: status + in: query + schema: + type: string + enum: [pending, merged, rejected, stale] + default: pending + description: "pending: waiting for review; rejected: marked Not duplicates; stale: a Contact was deleted" + - name: source + in: query + schema: + type: string + enum: [merge_rule, name_scan] + description: "merge_rule: from a Merge Rule in Suggest mode; name_scan: from similar names" + - name: beneficiary_id + in: query + schema: + type: integer + description: Only suggestions that include this Contact - $ref: '#/components/parameters/Page' - $ref: '#/components/parameters/PerPage' - $ref: '#/components/parameters/LastSyncDatetime' responses: "200": - description: Paginated list of Checklists, each with id, charity_id, name, description, created_by_id and actions_count + description: Paginated list of Suggested Merges + content: + application/json: + example: + page: 1 + page_size: 1 + page_count: 1 + total_count: 1 + data: + - id: 42 + status: pending + source: merge_rule + merge_rule: { id: 7, name: Same email } + match_strength: high + matched_fields: [{ field_id: 31, field_name: email_address, value: grace@example.com, match_type: exact }] + contacts: + - { id: 101, name: Grace Mensah, created_at: "2026-09-02T10:15:00Z", created_by: { id: 5, name: Asha Patel } } + - { id: 188, name: Grace Mensah, created_at: "2026-10-21T08:02:00Z", created_by: null } + created_at: "2026-10-21T09:00:00Z" + updated_at: "2026-10-21T09:00:00Z" + reviewed_by: null + reviewed_at: null "401": $ref: '#/components/responses/Unauthorized' "403": - description: The user has no role in the Organisation that lets them see Checklists + description: The user can't merge Contacts in the Organisation "404": $ref: '#/components/responses/NotFound' + "422": + $ref: '#/components/responses/UnprocessableEntity' + /suggested_merges/{id}/merge: post: - tags: [Checklists] - summary: Create a Checklist + tags: [Suggested Merges] + summary: Merge a Suggested Merge description: | - Creates a Checklist (Create > Checklist). Each action has an `action_type` and, unless the - type has no criteria keys, `criteria` saying what counts as done; see - `GET /checklists/action_types`. Actions keep the order sent. Requires an editor or reporter - of the Organisation. - - "What counts as done": send specific values under the type's criteria keys, or - `criteria: {any: true}` ("Any relationship", "Any survey" and so on) for any record of the - kind; `any` replaces specific values sent with it. An action with neither is saved as "Not set - yet" and can't be done for any Contact until its criteria are set. - - Each action may say who is responsible for it ("Who is responsible?"): `owner_kind` is `none` - (nobody in particular, the default), `adder` (the colleague who added the Checklist to the - Contact, or the Project's Project Managers when a Project added it automatically), `user` - (`owner_user_id`, a colleague), `team` (`owner_team_id`, anyone in one of the Organisation's - Teams who can see the Contact) or `relationship` (`owner_relationship_side` - ":parent|child", any colleague with that kind of Relationship with - the Contact, e.g. their Therapist). See `GET /checklists/owner_options`. - - "Only count records in this project": set `only_this_project: true` on an action whose type has - `project_scopable: true` in `GET /checklists/action_types` (surveys, events, labelled stories, - cases, project states). Then only records made in the Project through which the Checklist was - added to the Contact count towards it. It is ignored for other types. - - "Due within N days of the checklist being added": set `due_within_days` (a whole number from 0 - to 3650) to give an action a deadline. Each Contact's due date is the day the Checklist was - added to them plus that many days, so changing it moves the due date for everyone. Leave it - out, or send `null`, for no deadline. `GET /beneficiaries/{beneficiary_id}/checklists` then - says which actions are done late or overdue. - - "Allow colleagues to tick this off by hand with a note": set `allow_manual_completion: true` - on an action that can happen offline (a phone call, a home visit, a paper form). Colleagues - who can edit a Contact can then mark it done by hand with - `POST /beneficiaries/{beneficiary_id}/checklists/{checklist_id}/actions/{action_id}/completion`. - It is false unless sent; on an update, an action that doesn't mention it keeps its setting. - - "If earlier steps aren't done": set `if_earlier_steps_not_done` to say what a colleague sees - when they start an action for a Contact before the actions above it are done. `remind` (the - default, "Show a reminder, let them continue") shows a reminder they can dismiss; `ask_reason` - ("Warn and ask for a reason to skip") makes them give a reason, which is logged. On an update, - an action that doesn't mention it keeps its setting. - - "Video (optional)": set `video_url` to a web link (`https://` or `http://`, up to 2048 - characters) to a video about the step, for self-paced training. On the Checklist's page, - **Watch the journey** shows each step as a card with its video: a YouTube, Vimeo, Loom or - Google Drive link plays in the card, and any other link (SharePoint, Slack, an intranet) - opens in a new tab. Send an empty `video_url` to remove it; on an update, an action that - doesn't mention it keeps its video. - - Participant Journey stages: send `stages`, in order, each with a `key` of your choosing, a - `name` and an `icon` (see `GET /checklists/stage_icons`; `clipboard` if left out), and give - each action the `stage_key` of its stage. The Journey view on the Checklist's profile page - shows each stage as a column with its actions, left to right. Each stage's actions are kept - together, in stage order. Stages are optional; an action without a stage shows as its own - column. - - An action may leave out `action_type`: it is saved as "Not set yet", e.g. while mapping a - participant journey before deciding how each step is recorded, and can't be done until a type - is chosen. An action with neither a type nor a title is skipped. - operationId: createChecklist + Merges the suggestion's Contacts into one, as pressing Merge in Compare does. The Contact + created first is kept unless `winner_id` names another of its Contacts. One merge request is + made per other Contact; they are merged within a few minutes and can be undone with Unmerge + on the Merge Contacts page. + operationId: mergeSuggestedMerge security: [{tokenAuth: []}] + parameters: + - name: id + in: path + required: true + schema: + type: integer requestBody: - required: true content: application/json: - example: - charity_id: 913 - checklist: - name: "Induction" - description: "Steps for every new contact" - stages: - - key: "signup" - name: "Sign up" - icon: "clipboard" - - key: "support" - name: "Arrange support" - icon: "calendar" - actions: - - title: "How participants sign up" - stage_key: "signup" - - action_type: "add_role" - title: "Give them a Role" - stage_key: "support" - criteria: - beneficiary_role_ids: ["12", "14"] - - action_type: "add_relationship" - title: "Record a caregiver" - criteria: - any: true - - action_type: "invite_to_event" - title: "Invite them to an induction event" - only_this_project: true - due_within_days: 14 - criteria: - project_event_categories: ["301:7"] - - action_type: "create_task" - title: "Set a follow-up task" - owner_kind: "team" - owner_team_id: 18 - allow_manual_completion: true - if_earlier_steps_not_done: "ask_reason" - video_url: "https://www.loom.com/share/22af2a7d40a54d0ba6d720140230b565" + schema: + type: object + properties: + winner_id: + type: integer + description: The Contact to keep + example: { winner_id: 101 } responses: - "201": - description: The Checklist, with its actions, projects and contacts_count + "202": + description: Merging has begun. Returns `suggested_merge` (now `merged`) and `merge_request_ids`. "401": $ref: '#/components/responses/Unauthorized' - "403": - description: The user can't create Checklists for this Organisation "404": $ref: '#/components/responses/NotFound' "422": - $ref: '#/components/responses/UnprocessableEntity' + description: "`{error}`: the Contact to keep isn't one of the suggestion's, or it has already been reviewed" - /checklists/action_types: - get: - tags: [Checklists] - summary: List the actions a Checklist can contain + /suggested_merges/{id}/reject: + post: + tags: [Suggested Merges] + summary: Mark a Suggested Merge as Not duplicates description: | - Every action type with its name, the `criteria_keys` it stores, and `any_name`, the "Any" - choice for it, e.g. "Any relationship" (`criteria: {any: true}`). Criteria values are strings: - IDs, or pairs such as `project_states` ":", - `project_event_categories` ":", `relationship_sides` - ":parent|child", and `survey_waves`, one of: ":" (that Survey Campaign in its Project); "survey:" (a survey made with that Survey in any Project); or "shared::" (a survey tagged to that Shared Wave (Shared Interval) of the Survey, in any Project). The "for a - relative" types take `relatives: [{relationship_side, beneficiary_category_ids | survey_waves}]`. - operationId: listChecklistActionTypes + Records that the Contacts are different people, as pressing Not duplicates does. The pair + is not suggested together again, from any source. + operationId: rejectSuggestedMerge security: [{tokenAuth: []}] + parameters: + - name: id + in: path + required: true + schema: + type: integer responses: "200": - description: "`{data: [{action_type, name, criteria_keys, any_name, project_scopable}]}`" + description: Returns `suggested_merge`, now `rejected`, with `reviewed_by` and `reviewed_at` "401": $ref: '#/components/responses/Unauthorized' + "404": + $ref: '#/components/responses/NotFound' + "422": + description: "`{error}`: it has already been reviewed" - /checklists/stage_icons: - get: - tags: [Checklists] - summary: List the icons a Checklist stage can have - description: | - The icons a Participant Journey stage can have, in the order the icon picker shows them: - clipboard (sign-up clipboard), calendar, people, chart, flag, message, home, heart, school and book. - operationId: listChecklistStageIcons - security: [{tokenAuth: []}] - responses: - "200": - description: "`{data: [{icon, name}]}`" - "401": - $ref: '#/components/responses/Unauthorized' - - /checklists/owner_options: - get: - tags: [Checklists] - summary: List the choices for who is responsible for a Checklist action - description: | - The "Who is responsible?" dropdown on the Create / Edit Checklist page: the kinds of owner, the - Organisation's Teams and its relationship sides ("Therapist from Therapist & Client"). Colleagues - for `owner_kind: user` come from `GET /users`. Visible to anyone who can see the Organisation's - Checklists. - operationId: listChecklistOwnerOptions - security: [{tokenAuth: []}] - parameters: - - name: charity_id - in: query - required: true - schema: - type: integer - description: The Organisation (Charity) ID - responses: - "200": - description: "`{kinds: [{owner_kind, name}], teams: [{id, name}], relationship_sides: [{owner_relationship_side, name}]}`" - "401": - $ref: '#/components/responses/Unauthorized' - "403": - description: The user has no role in the Organisation that lets them see Checklists - "404": - $ref: '#/components/responses/NotFound' - - /checklists/sketch: + /duplicate_contacts: get: - tags: [Checklists] - summary: Draft a Checklist from a Project's setup + tags: [Duplicate Contacts] + summary: Scan for duplicate Contacts description: | - "Sketched from your setup" on the Checklists page: a participant journey drafted from what one of - the Organisation's Projects already has. Nothing is saved. Without `project_id`, the draft comes - from the running Project with the most Contacts that has at least two of: an active Signup Page, a - Contact Form (other than the Organisation's default), a Waiting List or Alumni status, and a - Survey. With `project_id`, it comes from that Project. + The Duplicate Contacts page: sets of Contacts that look like the same person. Only Contacts + the user could merge are scanned (all the Organisation's Contacts for an Organisation Admin, + the Contacts in their Projects for a Project Admin), and sets someone marked as Not + duplicates are left out. Requires permission to merge Contacts in the Organisation. - The draft uses the five Participant Journey stages, leaving out any with nothing found: Sign up - (one "Complete a form" step per Signup Page), Arrange support (the Contact Forms, then Waiting - List → Enrolled), Provide support (each Survey's first Wave, and "Invite to an event" for the - Project's Event Formats), Monitor progress (later Waves) and Achieve the goal (Move to Alumni). - Every step already says what counts as done. + `match: similar` (the default) ignores titles (Mr, Mrs, Dr), capital letters, punctuation, + word order and small spelling differences. It runs in the background because a large + Organisation takes several seconds: while it runs the call answers 202 with + `status: running`; call again after `retry_after` seconds to get the sets. A finished scan + is reused for 10 minutes. `match: exact` finds only names spelt exactly the same and + answers straight away. - `checklist` is in the shape `POST /checklists` takes, so it can be created as it is or after - changes. Every field is null when no Project has enough to draft from. Needs someone who can - create Checklists for the Organisation. - operationId: sketchChecklist + `match_strength` is `high` when the names are the same once normalised or the Contacts + share a date of birth, email or mobile, and `medium` otherwise. `reasons` are + `similar_name`, `same_name`, `same_date_of_birth`, `same_email` and `same_mobile`. + operationId: listDuplicateContacts security: [{tokenAuth: []}] parameters: - name: charity_id @@ -13651,373 +14030,459 @@ paths: schema: type: integer description: The Organisation (Charity) ID - - name: project_id + - name: match in: query - required: false schema: - type: integer - description: Draft from this Project instead of the one Makerble would choose + type: string + enum: [similar, exact] + default: similar + description: "similar: names that look alike; exact: names spelt exactly the same" + - $ref: '#/components/parameters/Page' + - $ref: '#/components/parameters/PerPage' responses: "200": - description: The draft + description: Paginated list of sets of duplicate Contacts, High first content: application/json: example: - project_id: 7 - project_name: "Youth Programme 2026" - name: "Youth Programme 2026 journey" - summary: "Youth Programme 2026 has the Referral Signup Page, the Intake form, a Waiting List → Enrolled → Alumni flow and the Wellbeing survey." - checklist: - name: "Youth Programme 2026 journey" - stages: - - {key: "stage0", name: "Sign up", icon: "clipboard", position: 0} - - {key: "stage1", name: "Arrange support", icon: "calendar", position: 1} - actions: - - title: "Referral" - action_type: "complete_form" - criteria: {beneficiary_category_ids: ["31"]} - stage_key: "stage0" - position: 0 - - title: "Waiting List → Enrolled" - action_type: "add_to_project" - criteria: {project_states: ["7:2"]} - stage_key: "stage1" - position: 1 + page: 1 + page_size: 1 + page_count: 1 + total_count: 1 + match: similar + status: completed + scanned_at: "2026-10-28T09:00:00Z" + data: + - contacts: + - { id: 101, name: Jane Doe, created_at: "2026-09-02T10:15:00Z", created_by: { id: 5, name: Asha Patel } } + - { id: 188, name: Mrs Jane Doe, created_at: "2026-10-21T08:02:00Z", created_by: null } + match_strength: high + reasons: [similar_name, same_date_of_birth] + "202": + description: A similar-name scan is running; call again after `retry_after` seconds + content: + application/json: + example: { match: similar, status: running, retry_after: 5 } "401": $ref: '#/components/responses/Unauthorized' "403": - description: The user can't create Checklists for the Organisation + description: The user can't merge Contacts in the Organisation "404": $ref: '#/components/responses/NotFound' + "422": + $ref: '#/components/responses/UnprocessableEntity' - /checklists/{id}: - get: - tags: [Checklists] - summary: Get a Checklist + /duplicate_contacts/not_duplicates: + post: + tags: [Duplicate Contacts] + summary: Mark Contacts as Not duplicates description: | - A Checklist with its ordered actions, the Projects that offer it and how many Contacts have it. - Each action includes who is responsible for it: `owner_kind`, `owner_user_id`, `owner_team_id`, - `owner_relationship_side` and a readable `owner_description`, and its settings - `due_within_days`, `only_this_project`, `allow_manual_completion` and - `if_earlier_steps_not_done` (`remind` or `ask_reason`), its `video_url` (null for none) and its - `stage_id`. `stages` lists the - Participant Journey stages in order, each with `id`, `name`, `icon`, `position` and `colour`. - An action whose type isn't chosen yet has a null `action_type` and `action_name` "Not set yet". - operationId: getChecklist + Records that a set of Contacts are different people, as pressing Not duplicates on the + Duplicate Contacts page does. They are never suggested together again: not by the scan, + the background check of new Contacts or a Merge Rule. + operationId: markNotDuplicates security: [{tokenAuth: []}] - parameters: - - name: id - in: path - required: true - schema: - type: integer + requestBody: + required: true + content: + application/json: + schema: + type: object + required: [contact_ids] + properties: + contact_ids: + type: array + items: { type: integer } + description: At least two Contacts + match_strength: + type: string + enum: [high, medium] + example: { contact_ids: [101, 188], match_strength: high } responses: "200": - description: The Checklist, with actions, projects ({project_id, project_name, assignment_mode}) and contacts_count + description: "`{contact_ids, message}`" "401": $ref: '#/components/responses/Unauthorized' + "403": + description: The user can't merge Contacts in the Organisation "404": - description: Not found, or another Organisation's + $ref: '#/components/responses/NotFound' + "422": + description: "`{error}`: fewer than two Contacts, or a Contact the user can't merge" - patch: - tags: [Checklists] - summary: Update a Checklist + /duplicate_contacts/merge: + post: + tags: [Duplicate Contacts] + summary: Merge a set of duplicate Contacts description: | - Updates the name, description or actions. An action sent with its `id` is changed; - `{id, _destroy: true}` removes it; an action without an `id` is added. Requires an editor or - reporter of the Organisation. Send `due_within_days: null` to remove an action's deadline. - - Stages work the same way: a stage sent with its `id` is renamed, given a new `icon` or moved - (`position`); `{id, _destroy: true}` removes it; a stage without an `id` is added, with a `key`. - An action joins a stage with `stage_key`: a new stage's `key`, or an existing stage's `id` as a - string. An empty `stage_key` takes the action out of its stage, and an action that doesn't send - `stage_key` stays where it is. A stage left without actions is removed. - operationId: updateChecklist + Merges the Contacts into one, as Merge Selected Contacts on the Duplicate Contacts page + does. The Contact created first is kept unless `winner_id` names another of them. One merge + request is made per other Contact; they are merged within a few minutes and can be undone + with Unmerge on the Merge Contacts page. + operationId: mergeDuplicateContacts security: [{tokenAuth: []}] - parameters: - - name: id - in: path - required: true - schema: - type: integer requestBody: required: true content: application/json: - example: - checklist: - name: "Induction (2027)" - actions: - - id: 55 - action_type: "add_role" - title: "Give them any Role" - criteria: - beneficiary_role_ids: ["12"] - - id: 56 - _destroy: true - - id: 57 - owner_kind: "adder" - due_within_days: 7 - stage_key: "88" - stages: - - id: 88 - name: "Arrange support" - icon: "people" + schema: + type: object + required: [contact_ids] + properties: + contact_ids: + type: array + items: { type: integer } + description: At least two Contacts + winner_id: + type: integer + description: The Contact to keep + example: { contact_ids: [101, 188], winner_id: 101 } responses: - "200": - description: The updated Checklist + "202": + description: "Merging has begun: `{winner_id, merge_request_ids, message}`" "401": $ref: '#/components/responses/Unauthorized' "403": - description: The user can't edit this Checklist + description: The user can't merge Contacts in the Organisation "404": $ref: '#/components/responses/NotFound' "422": - $ref: '#/components/responses/UnprocessableEntity' + description: "`{error}`: fewer than two Contacts, a Contact the user can't merge, or a Contact to keep that isn't one of them" - /checklists/{id}/skips: + /duplicate_contacts/settings: get: - tags: [Checklists] - summary: List a Checklist's skipped steps + tags: [Duplicate Contacts] + summary: Read "Suggest possible duplicates when contacts are created" description: | - The times colleagues did one of the Checklist's actions for a Contact before the earlier steps - were done, newest first: the exceptions shown on the Checklist's Board. Each skip has - `beneficiary_id`, `checklist_action_id`, `action_title`, `skipped_actions` ({id, title, - required_first}), `reason`, `user_id`, `user_name`, `story_id` (its story on the Contact's - timeline) and `created_at`. Only Contacts the user can see are included. - operationId: listChecklistSkips + The setting on the Merge Contacts page. When it is on (the default), every Contact created + is compared with the Organisation's other Contacts each hour, and similar names appear in + Suggested Merges for someone to review. Requires permission to merge Contacts in the + Organisation. + operationId: getDuplicateContactSettings security: [{tokenAuth: []}] parameters: - - name: id - in: path + - name: charity_id + in: query required: true schema: type: integer - - $ref: '#/components/parameters/Page' - - $ref: '#/components/parameters/PerPage' - - $ref: '#/components/parameters/LastSyncDatetime' + description: The Organisation (Charity) ID responses: "200": - description: "`{page, page_size, page_count, total_count, data: [skip]}`" + description: The setting + content: + application/json: + example: { charity_id: 12, suggest_on_create: true } "401": $ref: '#/components/responses/Unauthorized' + "403": + description: The user can't merge Contacts in the Organisation "404": $ref: '#/components/responses/NotFound' - - /checklists/{id}/projects/{project_id}: patch: - tags: [Checklists] - summary: Set how a Project offers a Checklist - description: | - The Add to Projects popup. `manual`: colleagues may add the Checklist to the Project's Contacts - by hand. `automatic`: every Contact now in the Project gets it (in the background), and so does - every Contact who later joins or is created in it. `none`: stop offering it; Contacts who - already have it keep it. Requires an Organisation editor, or a Project Manager of the Project. - - For an `automatic` Checklist, `on_leave` says what happens when a Contact leaves the Project, - moves to a closed status in it (Alumni or Declined) or is archived: `keep` (the default) or - `remove_if_incomplete`, which takes it off them unless every action is done. A Checklist - removed that way keeps the Contact's progress, and comes back when they rejoin. Send `mode`, - `on_leave` or both; `on_leave` on its own changes only that, and needs the Checklist to be - `automatic` in the Project. - operationId: setChecklistProject + tags: [Duplicate Contacts] + summary: Change "Suggest possible duplicates when contacts are created" + description: Turns the setting on or off. Requires an Organisation Admin (editor). + operationId: updateDuplicateContactSettings security: [{tokenAuth: []}] - parameters: - - name: id - in: path - required: true - schema: - type: integer - - name: project_id - in: path - required: true - schema: - type: integer requestBody: required: true content: application/json: schema: type: object + required: [charity_id, suggest_on_create] properties: - mode: - type: string - enum: [none, manual, automatic] - on_leave: - type: string - enum: [keep, remove_if_incomplete] - example: - mode: "automatic" - on_leave: "remove_if_incomplete" + charity_id: { type: integer } + suggest_on_create: { type: boolean } + example: { charity_id: 12, suggest_on_create: false } responses: "200": - description: "`{project_id, assignment_mode, on_leave}`" - "422": - $ref: '#/components/responses/UnprocessableEntity' + description: The setting, changed + content: + application/json: + example: { charity_id: 12, suggest_on_create: false } "401": $ref: '#/components/responses/Unauthorized' "403": - description: The user can't add Checklists to Projects in this Organisation + description: The user isn't an Organisation Admin "404": - description: The Checklist or Project wasn't found, or the user can't edit the Project + $ref: '#/components/responses/NotFound' + "422": + $ref: '#/components/responses/UnprocessableEntity' - /checklists/{id}/summary: + /merge_rules: get: - tags: [Checklists] - operationId: getChecklistSummary - summary: Checklist Summary across the projects you oversee - description: > - The Checklist Summary (the Summary tab of the Focus page) for one Checklist: one row for each - project (Workspace) you oversee that uses the Checklist, with its Project Managers ("Managed by"), - its other Workspace colleagues (reporters and observers), and for each step of the Checklist how - many of the project's contacts with the Checklist have done that step, as a count and a percentage. - Only Organisation Admins (every open project of their organisation), Team Leaders (open projects - where someone in a Team they lead is a colleague) and Album Editors (open projects in organisation - Albums they edit) may call it; anyone else gets 403. A Checklist that none of your projects uses - returns 404. Only contacts you may see, that aren't deleted and are still active in the project, - are counted. Rows are sorted before pagination; the sort is not remembered. + tags: [Merge Rules] + summary: List an Organisation's Merge Rules + description: | + The Manage Merge Rules page. Requires an Admin or Creator (editor or reporter) of the + Organisation. + operationId: listMergeRules security: [{tokenAuth: []}] parameters: - - name: id - in: path + - name: charity_id + in: query required: true - description: Checklist id - schema: {type: integer} + schema: + type: integer + description: The Organisation (Charity) ID - $ref: '#/components/parameters/Page' - $ref: '#/components/parameters/PerPage' - - name: sort - in: query - description: "project (default), managed_by, colleagues, or step_ (1 = first step)" - schema: {type: string, example: step_1} - - name: direction - in: query - schema: {type: string, enum: [asc, desc], default: asc} + - $ref: '#/components/parameters/LastSyncDatetime' responses: "200": - description: One page of projects + description: Paginated list of Merge Rules content: application/json: example: - checklist_id: 12 - checklist_name: Intake - sort: project - direction: asc - steps: - - {id: 31, number: 1, action_type: create_task, title: Consent form} - - {id: 32, number: 2, action_type: add_role, title: Enrol} page: 1 page_size: 1 page_count: 1 total_count: 1 data: - - project_id: 7 - project_name: Youth Club - managed_by: [Ama Ng] - workspace_colleagues: [Obi Eze] - contacts_count: 2 - steps: - - {action_id: 31, number: 1, done_count: 1, percent: 50} - - {action_id: 32, number: 2, done_count: 0, percent: 0} + - id: 7 + name: Same email + conditions: [{ id: 31, field_name: email_address }] + match_type: and + merge_mode: suggest + status: Active + created_by: { id: 5, name: Asha Patel } + last_edited_by: { id: 5, name: Asha Patel } + last_edited_at: "2026-10-20T14:00:00Z" + created_at: "2026-10-20T14:00:00Z" + updated_at: "2026-10-20T14:00:00Z" "401": $ref: '#/components/responses/Unauthorized' "403": - description: Not an Organisation Admin, Team Leader or Album Editor - content: - application/json: - example: {error: forbidden} + description: The user isn't an Admin or Creator of the Organisation + "404": + $ref: '#/components/responses/NotFound' + + post: + tags: [Merge Rules] + summary: Create a Merge Rule + description: | + Create a Merge Rule. `conditions` are Contact field (Current Field) ids from the + Organisation's Contact forms that must be identical. `match_type` `and` needs every + condition to match, `or` any one. `merge_mode` is required ("When contacts match this + rule"): `automatic` merges matching Contacts within 2 hours, keeping the one created first; + `suggest` puts matches in Suggested Merges for someone to review. New rules are Active. + operationId: createMergeRule + security: [{tokenAuth: []}] + requestBody: + required: true + content: + application/json: + schema: + type: object + required: [charity_id, name, conditions, merge_mode] + properties: + charity_id: { type: integer } + name: { type: string } + conditions: { type: array, items: { type: integer } } + match_type: { type: string, enum: [and, or], default: and } + merge_mode: { type: string, enum: [automatic, suggest] } + status: { type: string, enum: [Active, Inactive] } + example: { charity_id: 12, name: Same email or mobile, conditions: [31, 32], match_type: or, merge_mode: suggest } + responses: + "201": + description: The new Merge Rule + "401": + $ref: '#/components/responses/Unauthorized' + "403": + description: The user isn't an Admin or Creator of the Organisation "404": $ref: '#/components/responses/NotFound' "422": $ref: '#/components/responses/UnprocessableEntity' - /checklists/{id}/progress: + /field_visibility_rules: get: - tags: [Checklists] - summary: Get a Checklist's progress + tags: [Field Visibility] + summary: List who can see each Contact field description: | - Where the Contacts on a Checklist have got to: the Progress section of the Checklist's profile - page. For each action, in order: `completed` (Contacts who have done it), `furthest` (Contacts - for whom it is the furthest action done) and `waiting` (Contacts for whom it is the first action - not done, so a Contact who did steps 1 and 3 is waiting on step 2). Each list gives its full - count (`completed_count`, `furthest_count`, `waiting_count`) and the first `list_limit` (30) - Contacts alphabetically as `{beneficiary_id, name, actions_done}`, where `actions_done` is how many - of the Checklist's actions the Contact has done (shown as "3 of 8 actions done"). Each Contact in `waiting` also has the Board's - details: `days_waiting` (since the Checklist was added or the previous action was done), - `overdue` (the action is past its due date), `skipped_a_step` (a colleague logged starting a later - action first) and `responsible` (who is responsible for the action). `contacts_count` is every - Contact counted, `complete_count` those with every action done (the first of them in `complete`) - and `overdue_count` those whose waiting action is overdue. Only Contacts the user can see are counted. - operationId: getChecklistProgress + The Field Visibility settings page. Every Contact field comes back once, whichever Contact + forms it is on. `field_class_name` and `field_key` identify it: `CustomField` or `RatioSet` + with its id for a form field or dropdown, `BeneficiaryColumn` with the column name for a + built-in field such as `date_of_birth`, `CustomFieldDefinition` with its id for a Custom + Forms field. `visibility` is `default` (everyone who can view the Contact) or `restricted`: + only users in one of its `teams`, or colleagues in any role on one of its `projects`, see the + value; Organisation Admins get no exception. A restriction never gives anyone access to a + Contact they can't already view. `visible_to_guests` says whether external guest users added + through a Contact's Override see the field. Requires an Organisation Admin (editor). + `last_synced_datetime` isn't supported: a field returned to default has no record to sync. + operationId: listFieldVisibilityRules security: [{tokenAuth: []}] parameters: - - name: id - in: path + - name: charity_id + in: query required: true schema: type: integer - - name: project_id + description: The Organisation (Charity) ID + - name: search in: query - required: false - description: Count only the Contacts in this Project, which must be one the Checklist is added to schema: - type: integer - - name: responsible + type: string + description: Part of the field name + - name: form + in: query + schema: + type: string + description: Only fields on this Contact form (its name) + - name: visibility in: query - required: false - description: "Count only the Contacts whose waiting action this person or Team is responsible for: `me` (directly or through one of the user's Teams), `user:` or `team:`" schema: type: string + enum: [default, restricted] + - $ref: '#/components/parameters/Page' + - $ref: '#/components/parameters/PerPage' responses: "200": - description: The counts and lists for each action + description: Paginated list of Contact fields content: application/json: example: - checklist_id: 42 - project_id: null - responsible: null - contacts_count: 3 - complete_count: 1 - overdue_count: 1 - list_limit: 30 - complete: [{beneficiary_id: 904, name: "Refilwe Mahlangu", actions_done: 4}] - actions: - - id: 55 - number: 1 - action_type: "complete_form" - title: "Complete the Intake form" - completed_count: 2 - completed: [{beneficiary_id: 901, name: "Ayanda Dlamini", actions_done: 2}, {beneficiary_id: 902, name: "Kagiso Mokoena", actions_done: 3}] - furthest_count: 0 - furthest: [] - waiting_count: 1 - waiting: [{beneficiary_id: 903, name: "Mpho Sithole", actions_done: 0, days_waiting: 9, overdue: true, skipped_a_step: false, responsible: "Anyone in Youth Workers"}] + page: 1 + page_size: 1 + page_count: 1 + total_count: 1 + data: + - field_class_name: CustomField + field_key: "481" + name: NHS number + forms: [Person being referred] + visibility: restricted + teams: [{ id: 9, name: Beacons }] + projects: [{ id: 33, name: WAY Beacons CYP }] + visible_to_guests: false + "401": + $ref: '#/components/responses/Unauthorized' + "403": + description: The user isn't an Organisation Admin + "404": + $ref: '#/components/responses/NotFound' + patch: + tags: [Field Visibility] + summary: Change who can see Contact fields + description: | + Change the settings of one or more Contact fields, all together or not at all. For each + field, `visibility: restricted` needs at least one of `team_ids` or `project_ids` (Teams and + Projects of the same Organisation); `visibility: default` removes the restriction. + `visible_to_guests` shows or hides the field from external guest users. Leave a key out to + keep that setting. Errors name the field, e.g. "NHS number: Choose at least one Team or + project for a restricted field". Requires an Organisation Admin (editor). + operationId: updateFieldVisibilityRules + security: [{tokenAuth: []}] + requestBody: + required: true + content: + application/json: + schema: + type: object + required: [charity_id, rules] + properties: + charity_id: { type: integer } + rules: + type: array + items: + type: object + required: [field_class_name, field_key] + properties: + field_class_name: { type: string, enum: [CustomField, RatioSet, BeneficiaryColumn, CustomFieldDefinition] } + field_key: { type: string, description: The field id, or the column name for a BeneficiaryColumn } + visibility: { type: string, enum: [default, restricted] } + team_ids: { type: array, items: { type: integer } } + project_ids: { type: array, items: { type: integer } } + visible_to_guests: { type: boolean } + example: + charity_id: 12 + rules: + - { field_class_name: CustomField, field_key: "481", visibility: restricted, team_ids: [9], project_ids: [33], visible_to_guests: false } + responses: + "200": + description: The changed fields + content: + application/json: + example: + data: + - field_class_name: CustomField + field_key: "481" + name: NHS number + forms: [Person being referred] + visibility: restricted + teams: [{ id: 9, name: Beacons }] + projects: [{ id: 33, name: WAY Beacons CYP }] + visible_to_guests: false + "401": + $ref: '#/components/responses/Unauthorized' + "403": + description: The user isn't an Organisation Admin + "404": + $ref: '#/components/responses/NotFound' + "422": + $ref: '#/components/responses/UnprocessableEntity' + put: + tags: [Field Visibility] + summary: Change who can see Contact fields (same as PATCH) + description: The same as PATCH /field_visibility_rules. + operationId: replaceFieldVisibilityRules + security: [{tokenAuth: []}] + requestBody: + required: true + content: + application/json: + schema: + type: object + required: [charity_id, rules] + properties: + charity_id: { type: integer } + rules: + type: array + items: + type: object + required: [field_class_name, field_key] + properties: + field_class_name: { type: string, enum: [CustomField, RatioSet, BeneficiaryColumn, CustomFieldDefinition] } + field_key: { type: string, description: The field id, or the column name for a BeneficiaryColumn } + visibility: { type: string, enum: [default, restricted] } + team_ids: { type: array, items: { type: integer } } + project_ids: { type: array, items: { type: integer } } + visible_to_guests: { type: boolean } + example: + charity_id: 12 + rules: + - { field_class_name: CustomField, field_key: "481", visibility: restricted, team_ids: [9], project_ids: [33], visible_to_guests: false } + responses: + "200": + description: The changed fields + content: + application/json: + example: + data: + - field_class_name: CustomField + field_key: "481" + name: NHS number + forms: [Person being referred] + visibility: restricted + teams: [{ id: 9, name: Beacons }] + projects: [{ id: 33, name: WAY Beacons CYP }] + visible_to_guests: false "401": $ref: '#/components/responses/Unauthorized' + "403": + description: The user isn't an Organisation Admin "404": $ref: '#/components/responses/NotFound' "422": $ref: '#/components/responses/UnprocessableEntity' - /checklists/{id}/progress/contacts: + /merge_rules/{id}: get: - tags: [Checklists] - summary: List every Contact behind one of a Checklist's progress counts - description: | - Every Contact behind one count of the Checklist's Progress section, a page at a time, as the - **Show N more** buttons on the Checklist's page do. `GET /checklists/{id}/progress` lists only the - first `list_limit` (30) of each list; use this to get the rest. Choose the list with `list`: - - - `completed`, `furthest` or `waiting`: the Table's lists for the action `action_id`: who has - done it, for whom it is the furthest action done, and who is waiting on it - - `board`: the Board's column for the action `action_id` (those waiting on it, longest waiting first) - - `complete`: the Board's Fully complete column (no `action_id`) - - Each Contact is `{beneficiary_id, name, actions_done}`. In the `waiting` and `board` lists each - also has `days_waiting`, `overdue`, `skipped_a_step` and `responsible`. The same `project_id` and - `responsible` filters as `GET /checklists/{id}/progress` apply. Only Contacts the user can see are - counted. `per_page` is at most 200. - operationId: listChecklistProgressContacts + tags: [Merge Rules] + summary: Get a Merge Rule + operationId: getMergeRule security: [{tokenAuth: []}] parameters: - name: id @@ -14025,44 +14490,44 @@ paths: required: true schema: type: integer - - name: list - in: query + responses: + "200": + description: The Merge Rule + "401": + $ref: '#/components/responses/Unauthorized' + "404": + $ref: '#/components/responses/NotFound' + + patch: + tags: [Merge Rules] + summary: Update a Merge Rule + description: | + Change any of `name`, `conditions`, `match_type`, `merge_mode` and `status`; anything not + sent is kept, including the match type when only the conditions change. Set `merge_mode` to + `suggest` to stop a rule merging automatically, or `status` to `Inactive` to turn it off. + operationId: updateMergeRule + security: [{tokenAuth: []}] + parameters: + - name: id + in: path required: true - schema: - type: string - enum: [completed, furthest, waiting, board, complete] - - name: action_id - in: query - required: false - description: The action whose list it is. Required for every list but `complete` - schema: - type: integer - - name: project_id - in: query - required: false - description: Count only the Contacts in this Project, which must be one the Checklist is added to schema: type: integer - - name: responsible - in: query - required: false - description: "Count only the Contacts whose waiting action this person or Team is responsible for: `me`, `user:` or `team:`" - schema: - type: string - - $ref: '#/components/parameters/Page' - - $ref: '#/components/parameters/PerPage' + requestBody: + content: + application/json: + schema: + type: object + properties: + name: { type: string } + conditions: { type: array, items: { type: integer } } + match_type: { type: string, enum: [and, or] } + merge_mode: { type: string, enum: [automatic, suggest] } + status: { type: string, enum: [Active, Inactive] } + example: { merge_mode: suggest } responses: "200": - description: One page of the list, in the usual envelope - content: - application/json: - example: - page: 2 - page_size: 1 - page_count: 2 - total_count: 31 - data: - - {beneficiary_id: 903, name: "Mpho Sithole", actions_done: 0, days_waiting: 9, overdue: true, skipped_a_step: false, responsible: "Anyone in Youth Workers"} + description: The updated Merge Rule "401": $ref: '#/components/responses/Unauthorized' "404": @@ -14070,303 +14535,331 @@ paths: "422": $ref: '#/components/responses/UnprocessableEntity' - /checklists/{id}/journey: + /checklists: get: tags: [Checklists] - summary: Get a Checklist's Participant Journey + summary: List an Organisation's Checklists description: | - The Journey view on the Checklist's profile page: its steps left to right, grouped into stages. - `columns` are in order: each stage with its `stage_id`, `name`, `icon` and `colour`, then its - `steps`. A Checklist without stages has one column per step, named "Step 1", "Step 2" and so on, - with a null `stage_id` and `icon`; so does a step left outside the stages. Each step has - `action_id`, `number` (its place in the Checklist), `title`, `action_type`, `action_name` ("Not - set yet" while no type is chosen), `done_count` (Contacts who have done it) and `waiting_count` - (Contacts for whom it is the first step not done), out of `contacts_count`. Only Contacts the user - can see are counted. - operationId: getChecklistJourney + The Checklists of an Organisation (Charity). Visible to the Organisation's editors and + reporters, and to managers (editors) of its Projects. + operationId: listChecklists security: [{tokenAuth: []}] parameters: - - name: id - in: path + - name: charity_id + in: query required: true schema: type: integer + description: The Organisation (Charity) ID + - $ref: '#/components/parameters/Page' + - $ref: '#/components/parameters/PerPage' + - $ref: '#/components/parameters/LastSyncDatetime' responses: "200": - description: The columns of the Journey view - content: - application/json: - example: - checklist_id: 42 - contacts_count: 10 - columns: - - stage_id: 88 - name: "Sign up" - icon: "clipboard" - colour: "#AC3898" - steps: - - action_id: 55 - number: 1 - title: "How participants sign up" - action_type: "complete_form" - action_name: "Complete a form" - done_count: 10 - waiting_count: 0 - - stage_id: 89 - name: "Arrange support" - icon: "calendar" - colour: "#2F7DC0" - steps: - - action_id: 56 - number: 2 - title: "Initial assessment" - action_type: null - action_name: "Not set yet" - done_count: 8 - waiting_count: 2 + description: Paginated list of Checklists, each with id, charity_id, name, description, created_by_id and actions_count "401": $ref: '#/components/responses/Unauthorized' + "403": + description: The user has no role in the Organisation that lets them see Checklists "404": $ref: '#/components/responses/NotFound' - /beneficiaries/{beneficiary_id}/checklists: - get: + post: tags: [Checklists] - summary: Get a Contact's Checklists + summary: Create a Checklist description: | - The Checklists box on a Contact's profile: each Checklist with `done_count` of `actions_count`, - and every action with `done: true|false`. Only Contacts the user can see are returned. + Creates a Checklist (Create > Checklist). Each action has an `action_type` and, unless the + type has no criteria keys, `criteria` saying what counts as done; see + `GET /checklists/action_types`. Actions keep the order sent. Requires an editor or reporter + of the Organisation. - A done action has a `completion` (null while it isn't done) saying when, by whom and with what - record it was done: `completed_at` (when that record was made, e.g. the survey's date), - `completed_by_user_id` and `completed_by_name` (null when the record doesn't say who made it), - `completion_method` (`detected`, or `manual` when a colleague ticked it), `proof_type` and - `proof_id` (the record, e.g. `Story` 123, `BeneficiariesBeneficiaryRole`, `EventBeneficiary`) - and `proof_deleted` (true once that record has been deleted). An action stays done even if - its record is later edited or deleted. Actions are marked done in the background a few seconds - after the record that completes them is saved. + "What counts as done": send specific values under the type's criteria keys, or + `criteria: {any: true}` ("Any relationship", "Any survey" and so on) for any record of the + kind; `any` replaces specific values sent with it. An action with neither is saved as "Not set + yet" and can't be done for any Contact until its criteria are set. - Each action also says who is responsible for it for this Contact: the owner fields - (`owner_kind`, `owner_user_id`, `owner_team_id`, `owner_relationship_side`), `owner_overridden` - (true when a colleague changed it for this Contact only), `owner_description` (e.g. - "Safeguarding Team"), `responsible_user_ids` (only colleagues who can see the Contact) and - `owner_warning` when nobody responsible can see them (e.g. "No one in Safeguarding Team can see - this contact"). + Each action may say who is responsible for it ("Who is responsible?"): `owner_kind` is `none` + (nobody in particular, the default), `adder` (the colleague who added the Checklist to the + Contact, or the Project's Project Managers when a Project added it automatically), `user` + (`owner_user_id`, a colleague), `team` (`owner_team_id`, anyone in one of the Organisation's + Teams who can see the Contact) or `relationship` (`owner_relationship_side` + ":parent|child", any colleague with that kind of Relationship with + the Contact, e.g. their Therapist). See `GET /checklists/owner_options`. - An action whose Checklist gives it a deadline (`due_within_days`) has `due_on`: the day the - Checklist was added to the Contact plus that many days (null when there is no deadline). - `done_late` is true when it was done after `due_on`; `overdue` is true when it isn't done and - `due_on` has passed. Both are false for an action with no deadline. + "Only count records in this project": set `only_this_project: true` on an action whose type has + `project_scopable: true` in `GET /checklists/action_types` (surveys, events, labelled stories, + cases, project states). Then only records made in the Project through which the Checklist was + added to the Contact count towards it. It is ignored for other types. - `allow_manual_completion` says whether colleagues may tick the action off by hand - (`POST .../actions/{action_id}/completion`). - operationId: listContactChecklists - security: [{tokenAuth: []}] - parameters: - - name: beneficiary_id - in: path - required: true - schema: - type: integer - - $ref: '#/components/parameters/Page' - - $ref: '#/components/parameters/PerPage' - responses: - "200": - description: Paginated list of the Contact's Checklists with their progress - "401": - $ref: '#/components/responses/Unauthorized' - "404": - $ref: '#/components/responses/NotFound' + "Due within N days of the checklist being added": set `due_within_days` (a whole number from 0 + to 3650) to give an action a deadline. Each Contact's due date is the day the Checklist was + added to them plus that many days, so changing it moves the due date for everyone. Leave it + out, or send `null`, for no deadline. `GET /beneficiaries/{beneficiary_id}/checklists` then + says which actions are done late or overdue. - post: - tags: [Checklists] - summary: Add a Checklist to a Contact - description: | - Add a Checklist on the Contact's profile. Only a Checklist that one of the Contact's Projects - lets the user add by hand is allowed; see `GET /beneficiaries/{beneficiary_id}/checklists/available`. - It is added through a Project, the one whose records count for actions set to "Only count - records in this project": the only Project that allows it, or `project_id` when more than one - does (required then). Adding one that was removed from the Contact earlier restores the - actions they had done. An Organisation Admin may also add back a Checklist that was removed - from the Contact while one of their Projects adds it automatically; it is added through that - Project. - operationId: addContactChecklist + "Allow colleagues to tick this off by hand with a note": set `allow_manual_completion: true` + on an action that can happen offline (a phone call, a home visit, a paper form). Colleagues + who can edit a Contact can then mark it done by hand with + `POST /beneficiaries/{beneficiary_id}/checklists/{checklist_id}/actions/{action_id}/completion`. + It is false unless sent; on an update, an action that doesn't mention it keeps its setting. + + "If earlier steps aren't done": set `if_earlier_steps_not_done` to say what a colleague sees + when they start an action for a Contact before the actions above it are done. `remind` (the + default, "Show a reminder, let them continue") shows a reminder they can dismiss; `ask_reason` + ("Warn and ask for a reason to skip") makes them give a reason, which is logged. On an update, + an action that doesn't mention it keeps its setting. + + "Video (optional)": set `video_url` to a web link (`https://` or `http://`, up to 2048 + characters) to a video about the step, for self-paced training. On the Checklist's page, + **Watch the journey** shows each step as a card with its video: a YouTube, Vimeo, Loom or + Google Drive link plays in the card, and any other link (SharePoint, Slack, an intranet) + opens in a new tab. Send an empty `video_url` to remove it; on an update, an action that + doesn't mention it keeps its video. + + Participant Journey stages: send `stages`, in order, each with a `key` of your choosing, a + `name` and an `icon` (see `GET /checklists/stage_icons`; `clipboard` if left out), and give + each action the `stage_key` of its stage. The Journey view on the Checklist's profile page + shows each stage as a column with its actions, left to right. Each stage's actions are kept + together, in stage order. Stages are optional; an action without a stage shows as its own + column. + + An action may leave out `action_type`: it is saved as "Not set yet", e.g. while mapping a + participant journey before deciding how each step is recorded, and can't be done until a type + is chosen. An action with neither a type nor a title is skipped. + operationId: createChecklist security: [{tokenAuth: []}] - parameters: - - name: beneficiary_id - in: path - required: true - schema: - type: integer requestBody: required: true content: application/json: example: - checklist_id: 42 - project_id: 301 + charity_id: 913 + checklist: + name: "Induction" + description: "Steps for every new contact" + stages: + - key: "signup" + name: "Sign up" + icon: "clipboard" + - key: "support" + name: "Arrange support" + icon: "calendar" + actions: + - title: "How participants sign up" + stage_key: "signup" + - action_type: "add_role" + title: "Give them a Role" + stage_key: "support" + criteria: + beneficiary_role_ids: ["12", "14"] + - action_type: "add_relationship" + title: "Record a caregiver" + criteria: + any: true + - action_type: "invite_to_event" + title: "Invite them to an induction event" + only_this_project: true + due_within_days: 14 + criteria: + project_event_categories: ["301:7"] + - action_type: "create_task" + title: "Set a follow-up task" + owner_kind: "team" + owner_team_id: 18 + allow_manual_completion: true + if_earlier_steps_not_done: "ask_reason" + video_url: "https://www.loom.com/share/22af2a7d40a54d0ba6d720140230b565" responses: "201": - description: "`{checklist_id, beneficiary_id, added_by_user_id, project_id, created_at}`" + description: The Checklist, with its actions, projects and contacts_count "401": $ref: '#/components/responses/Unauthorized' + "403": + description: The user can't create Checklists for this Organisation "404": $ref: '#/components/responses/NotFound' "422": $ref: '#/components/responses/UnprocessableEntity' - /beneficiaries/{beneficiary_id}/checklists/{checklist_id}: - delete: + /checklists/action_types: + get: tags: [Checklists] - summary: Remove a Checklist from a Contact + summary: List the actions a Checklist can contain description: | - "Remove from this contact" in the ⋯ menu of a Checklist on the Contact's profile, for one added - by mistake or no longer relevant. It no longer shows on the Contact, in the Checklist's progress - or on Focus, and the removal is recorded on the Contact's History. The Contact's progress is - kept: adding the Checklist again (`POST /beneficiaries/{beneficiary_id}/checklists`) restores the - actions they had done, and a Project that adds the Checklist automatically won't add it back. - Allowed for Organisation Admins, and for colleagues who could add the Checklist to the Contact by - hand. - operationId: removeContactChecklist + Every action type with its name, the `criteria_keys` it stores, and `any_name`, the "Any" + choice for it, e.g. "Any relationship" (`criteria: {any: true}`). Criteria values are strings: + IDs, or pairs such as `project_states` ":", + `project_event_categories` ":", `relationship_sides` + ":parent|child", and `survey_waves`, one of: ":" (that Survey Campaign in its Project); "survey:" (a survey made with that Survey in any Project); or "shared::" (a survey tagged to that Shared Wave (Shared Interval) of the Survey, in any Project). The "for a + relative" types take `relatives: [{relationship_side, beneficiary_category_ids | survey_waves}]`. + operationId: listChecklistActionTypes security: [{tokenAuth: []}] - parameters: - - name: beneficiary_id - in: path - required: true - schema: - type: integer - - name: checklist_id - in: path - required: true - schema: - type: integer responses: "200": - description: "`{checklist_id, beneficiary_id, removed_at, removed_by_user_id}`" - content: - application/json: - example: - checklist_id: 42 - beneficiary_id: 1001 - removed_at: "2026-11-05T10:00:00Z" - removed_by_user_id: 7 + description: "`{data: [{action_type, name, criteria_keys, any_name, project_scopable}]}`" "401": $ref: '#/components/responses/Unauthorized' - "403": - description: "`{errors}`: the user is neither an Organisation Admin nor able to add this Checklist to the Contact" - "404": - $ref: '#/components/responses/NotFound' - /beneficiaries/{beneficiary_id}/checklists/{checklist_id}/actions/{action_id}/owner: - patch: + /checklists/stage_icons: + get: tags: [Checklists] - summary: Change who is responsible for an action for one Contact + summary: List the icons a Checklist stage can have description: | - The Change link under an action in a Contact's Checklists box. Sets who is responsible for this - action for this Contact only; other Contacts keep the Checklist's default. Choosing the - Checklist's own default removes the change. Takes the same owner fields as an action of - `POST /checklists`. Requires edit access to the Contact. - operationId: setContactChecklistActionOwner + The icons a Participant Journey stage can have, in the order the icon picker shows them: + clipboard (sign-up clipboard), calendar, people, chart, flag, message, home, heart, school and book. + operationId: listChecklistStageIcons security: [{tokenAuth: []}] - parameters: - - name: beneficiary_id - in: path - required: true - schema: - type: integer - - name: checklist_id - in: path - required: true - schema: - type: integer - - name: action_id - in: path + responses: + "200": + description: "`{data: [{icon, name}]}`" + "401": + $ref: '#/components/responses/Unauthorized' + + /checklists/owner_options: + get: + tags: [Checklists] + summary: List the choices for who is responsible for a Checklist action + description: | + The "Who is responsible?" dropdown on the Create / Edit Checklist page: the kinds of owner, the + Organisation's Teams and its relationship sides ("Therapist from Therapist & Client"). Colleagues + for `owner_kind: user` come from `GET /users`. Visible to anyone who can see the Organisation's + Checklists. + operationId: listChecklistOwnerOptions + security: [{tokenAuth: []}] + parameters: + - name: charity_id + in: query required: true schema: type: integer - requestBody: - required: true - content: - application/json: - example: - owner_kind: "user" - owner_user_id: 5021 + description: The Organisation (Charity) ID responses: "200": - description: "`{checklist_id, action_id, owner_kind, owner_user_id, owner_team_id, owner_relationship_side, owner_overridden, owner_description, responsible_user_ids, owner_warning}`" + description: "`{kinds: [{owner_kind, name}], teams: [{id, name}], relationship_sides: [{owner_relationship_side, name}]}`" "401": $ref: '#/components/responses/Unauthorized' "403": - description: The user can see the Contact but can't edit it + description: The user has no role in the Organisation that lets them see Checklists "404": $ref: '#/components/responses/NotFound' - "422": - $ref: '#/components/responses/UnprocessableEntity' - delete: + /checklists/sketch: + get: tags: [Checklists] - summary: Go back to the Checklist's own owner for one Contact - description: Removes a change made with the PATCH above, so this Contact follows the Checklist's default again. Requires edit access to the Contact. - operationId: resetContactChecklistActionOwner + summary: Draft a Checklist from a Project's setup + description: | + "Sketched from your setup" on the Checklists page: a participant journey drafted from what one of + the Organisation's Projects already has. Nothing is saved. Without `project_id`, the draft comes + from the running Project with the most Contacts that has at least two of: an active Signup Page, a + Contact Form (other than the Organisation's default), a Waiting List or Alumni status, and a + Survey. With `project_id`, it comes from that Project. + + The draft uses the five Participant Journey stages, leaving out any with nothing found: Sign up + (one "Complete a form" step per Signup Page), Arrange support (the Contact Forms, then Waiting + List → Enrolled), Provide support (each Survey's first Wave, and "Invite to an event" for the + Project's Event Formats), Monitor progress (later Waves) and Achieve the goal (Move to Alumni). + Every step already says what counts as done. + + `checklist` is in the shape `POST /checklists` takes, so it can be created as it is or after + changes. Every field is null when no Project has enough to draft from. Needs someone who can + create Checklists for the Organisation. + operationId: sketchChecklist security: [{tokenAuth: []}] parameters: - - name: beneficiary_id - in: path - required: true - schema: - type: integer - - name: checklist_id - in: path + - name: charity_id + in: query required: true schema: type: integer - - name: action_id - in: path - required: true + description: The Organisation (Charity) ID + - name: project_id + in: query + required: false schema: type: integer + description: Draft from this Project instead of the one Makerble would choose responses: "200": - description: The action's owner fields, as for the PATCH + description: The draft + content: + application/json: + example: + project_id: 7 + project_name: "Youth Programme 2026" + name: "Youth Programme 2026 journey" + summary: "Youth Programme 2026 has the Referral Signup Page, the Intake form, a Waiting List → Enrolled → Alumni flow and the Wellbeing survey." + checklist: + name: "Youth Programme 2026 journey" + stages: + - {key: "stage0", name: "Sign up", icon: "clipboard", position: 0} + - {key: "stage1", name: "Arrange support", icon: "calendar", position: 1} + actions: + - title: "Referral" + action_type: "complete_form" + criteria: {beneficiary_category_ids: ["31"]} + stage_key: "stage0" + position: 0 + - title: "Waiting List → Enrolled" + action_type: "add_to_project" + criteria: {project_states: ["7:2"]} + stage_key: "stage1" + position: 1 "401": $ref: '#/components/responses/Unauthorized' "403": - description: The user can see the Contact but can't edit it + description: The user can't create Checklists for the Organisation "404": $ref: '#/components/responses/NotFound' - /beneficiaries/{beneficiary_id}/checklists/{checklist_id}/actions/{action_id}/completion: - post: + /checklists/{id}: + get: tags: [Checklists] - summary: Mark a Contact's Checklist action as done by hand + summary: Get a Checklist description: | - The "Mark as done…" link under an action in a Contact's Checklists box, for steps that leave - no record Makerble can detect, such as a phone call, a home visit or a paper consent form. - Only an action whose Checklist allows it (`allow_manual_completion: true`) can be ticked off - this way, and only while it isn't done. Requires edit access to the Contact. - - `completed_on` is the date it happened (`YYYY-MM-DD`, today or earlier) and `note` says what - happened. The note, and the `evidence` file when one is sent as multipart form data, are - saved as a Story on the Contact's timeline, which becomes the action's proof. The Story goes - in the Project the Checklist was added through, otherwise the Contact's only Project the user - can record stories in; when there is more than one, send `project_id`. - - The action's `completion` then has `completion_method: manual`, `completed_by_user_id` the - user, `completed_at` the date given, and `proof_type: Story` with the new Story's `proof_id`. - operationId: markContactChecklistActionDone + A Checklist with its ordered actions, the Projects that offer it and how many Contacts have it. + Each action includes who is responsible for it: `owner_kind`, `owner_user_id`, `owner_team_id`, + `owner_relationship_side` and a readable `owner_description`, and its settings + `due_within_days`, `only_this_project`, `allow_manual_completion` and + `if_earlier_steps_not_done` (`remind` or `ask_reason`), its `video_url` (null for none) and its + `stage_id`. `stages` lists the + Participant Journey stages in order, each with `id`, `name`, `icon`, `position` and `colour`. + An action whose type isn't chosen yet has a null `action_type` and `action_name` "Not set yet". + operationId: getChecklist security: [{tokenAuth: []}] parameters: - - name: beneficiary_id - in: path - required: true - schema: - type: integer - - name: checklist_id + - name: id in: path required: true schema: type: integer - - name: action_id + responses: + "200": + description: The Checklist, with actions, projects ({project_id, project_name, assignment_mode}) and contacts_count + "401": + $ref: '#/components/responses/Unauthorized' + "404": + description: Not found, or another Organisation's + + patch: + tags: [Checklists] + summary: Update a Checklist + description: | + Updates the name, description or actions. An action sent with its `id` is changed; + `{id, _destroy: true}` removes it; an action without an `id` is added. Requires an editor or + reporter of the Organisation. Send `due_within_days: null` to remove an action's deadline. + + Stages work the same way: a stage sent with its `id` is renamed, given a new `icon` or moved + (`position`); `{id, _destroy: true}` removes it; a stage without an `id` is added, with a `key`. + An action joins a stage with `stage_key`: a new stage's `key`, or an existing stage's `id` as a + string. An empty `stage_key` takes the action out of its stage, and an action that doesn't send + `stage_key` stays where it is. A stage left without actions is removed. + operationId: updateChecklist + security: [{tokenAuth: []}] + parameters: + - name: id in: path required: true schema: @@ -14376,617 +14869,825 @@ paths: content: application/json: example: - completed_on: "2026-10-20" - note: "Paper consent signed at the home visit, scanned to file" - project_id: 301 - multipart/form-data: - schema: - type: object - required: [completed_on, note] - properties: - completed_on: - type: string - format: date - note: - type: string - project_id: - type: integer - evidence: - type: string - format: binary + checklist: + name: "Induction (2027)" + actions: + - id: 55 + action_type: "add_role" + title: "Give them any Role" + criteria: + beneficiary_role_ids: ["12"] + - id: 56 + _destroy: true + - id: 57 + owner_kind: "adder" + due_within_days: 7 + stage_key: "88" + stages: + - id: 88 + name: "Arrange support" + icon: "people" responses: - "201": - description: "`{checklist_id, action_id, done: true, completion: {completed_at, completed_by_user_id, completed_by_name, completion_method, proof_type, proof_id, proof_deleted}}`" + "200": + description: The updated Checklist "401": $ref: '#/components/responses/Unauthorized' "403": - description: The user can see the Contact but can't edit it + description: The user can't edit this Checklist "404": $ref: '#/components/responses/NotFound' "422": $ref: '#/components/responses/UnprocessableEntity' - delete: + /checklists/{id}/skips: + get: tags: [Checklists] - summary: Undo marking a Contact's Checklist action as done by hand + summary: List a Checklist's skipped steps description: | - Takes back a tick made by hand. Only the colleague who made it, or an Organisation Admin, can - undo it, and only a manual completion can be undone. The Story stays on the Contact's - timeline. Makerble then looks again for a record that proves the action done, so the - response can still say `done: true` with a `detected` completion. Requires edit access to the - Contact. - operationId: undoContactChecklistActionDone + The times colleagues did one of the Checklist's actions for a Contact before the earlier steps + were done, newest first: the exceptions shown on the Checklist's Board. Each skip has + `beneficiary_id`, `checklist_action_id`, `action_title`, `skipped_actions` ({id, title, + required_first}), `reason`, `user_id`, `user_name`, `story_id` (its story on the Contact's + timeline) and `created_at`. Only Contacts the user can see are included. + operationId: listChecklistSkips security: [{tokenAuth: []}] parameters: - - name: beneficiary_id - in: path - required: true - schema: - type: integer - - name: checklist_id - in: path - required: true - schema: - type: integer - - name: action_id + - name: id in: path required: true schema: type: integer + - $ref: '#/components/parameters/Page' + - $ref: '#/components/parameters/PerPage' + - $ref: '#/components/parameters/LastSyncDatetime' responses: "200": - description: "`{checklist_id, action_id, done, completion}` (completion null when not done)" + description: "`{page, page_size, page_count, total_count, data: [skip]}`" "401": $ref: '#/components/responses/Unauthorized' - "403": - description: The user can see the Contact but can't edit it "404": $ref: '#/components/responses/NotFound' - "422": - $ref: '#/components/responses/UnprocessableEntity' - /beneficiaries/{beneficiary_id}/checklists/next_step: - get: + /checklists/{id}/projects/{project_id}: + patch: tags: [Checklists] - summary: Get a Contact's next step + summary: Set how a Project offers a Checklist description: | - What to do next for a Contact, as on the Next step card of their profile: the first action - not yet done on each of their Checklists, the most pressing first (overdue, then the earliest - `due_on`, then by Checklist name), so `data[0]` is the next step. Each step has the Checklist - (`checklist_id`, `checklist_name`), its place in it (`number` of `total`), the action - (`action_id`, `action_type`, `action_name`, `title`, `description`), its deadline (`due_on`, - `overdue`), `if_earlier_steps_not_done` and who is responsible for it (the same owner fields as - `GET /beneficiaries/{beneficiary_id}/checklists`). `others_count` is how many other Checklists - are waiting; `all_done` is true when every action on the Contact's Checklists is done. Not - paginated: a Contact has few Checklists. - operationId: getContactNextStep + The Add to Projects popup. `manual`: colleagues may add the Checklist to the Project's Contacts + by hand. `automatic`: every Contact now in the Project gets it (in the background), and so does + every Contact who later joins or is created in it. `none`: stop offering it; Contacts who + already have it keep it. Requires an Organisation editor, or a Project Manager of the Project. + + For an `automatic` Checklist, `on_leave` says what happens when a Contact leaves the Project, + moves to a closed status in it (Alumni or Declined) or is archived: `keep` (the default) or + `remove_if_incomplete`, which takes it off them unless every action is done. A Checklist + removed that way keeps the Contact's progress, and comes back when they rejoin. Send `mode`, + `on_leave` or both; `on_leave` on its own changes only that, and needs the Checklist to be + `automatic` in the Project. + operationId: setChecklistProject security: [{tokenAuth: []}] parameters: - - name: beneficiary_id + - name: id + in: path + required: true + schema: + type: integer + - name: project_id in: path required: true schema: type: integer + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + mode: + type: string + enum: [none, manual, automatic] + on_leave: + type: string + enum: [keep, remove_if_incomplete] + example: + mode: "automatic" + on_leave: "remove_if_incomplete" responses: "200": - description: "`{all_done, others_count, data: [{checklist_id, checklist_name, number, total, action_id, action_type, action_name, title, description, due_on, overdue, if_earlier_steps_not_done, owner_kind, owner_description, responsible_user_ids, ...}]}`" + description: "`{project_id, assignment_mode, on_leave}`" + "422": + $ref: '#/components/responses/UnprocessableEntity' "401": $ref: '#/components/responses/Unauthorized' + "403": + description: The user can't add Checklists to Projects in this Organisation "404": - $ref: '#/components/responses/NotFound' + description: The Checklist or Project wasn't found, or the user can't edit the Project - /beneficiaries/{beneficiary_id}/checklists/{checklist_id}/actions/{action_id}/gate: + /checklists/{id}/summary: get: tags: [Checklists] - summary: Check the earlier steps before a Checklist action - description: | - The "soft gate" a colleague sees on the Contact's profile when they start an action before the - earlier steps on the same Checklist are done. `gated` is true when some aren't; `missing` lists - them ({action_id, number, action_type, title, required_first}); `reason_required` is true when - one is set to "Warn and ask for a reason to skip" (Required first). Nothing is blocked: to go - ahead, record the skip with `POST .../skips`. - operationId: getContactChecklistGate + operationId: getChecklistSummary + summary: Checklist Summary across the projects you oversee + description: > + The Checklist Summary (the Summary tab of the Focus page) for one Checklist: one row for each + project (Workspace) you oversee that uses the Checklist, with its Project Managers ("Managed by"), + its other Workspace colleagues (reporters and observers), and for each step of the Checklist how + many of the project's contacts with the Checklist have done that step, as a count and a percentage. + Only Organisation Admins (every open project of their organisation), Team Leaders (open projects + where someone in a Team they lead is a colleague) and Album Editors (open projects in organisation + Albums they edit) may call it; anyone else gets 403. A Checklist that none of your projects uses + returns 404. Only contacts you may see, that aren't deleted and are still active in the project, + are counted. Rows are sorted before pagination; the sort is not remembered. security: [{tokenAuth: []}] parameters: - - {name: beneficiary_id, in: path, required: true, schema: {type: integer}} - - {name: checklist_id, in: path, required: true, schema: {type: integer}} - - {name: action_id, in: path, required: true, schema: {type: integer}} + - name: id + in: path + required: true + description: Checklist id + schema: {type: integer} + - $ref: '#/components/parameters/Page' + - $ref: '#/components/parameters/PerPage' + - name: sort + in: query + description: "project (default), managed_by, colleagues, or step_ (1 = first step)" + schema: {type: string, example: step_1} + - name: direction + in: query + schema: {type: string, enum: [asc, desc], default: asc} responses: "200": - description: "`{gated, reason_required, missing: [{action_id, number, action_type, title, required_first}]}`" - "401": - $ref: '#/components/responses/Unauthorized' - "404": - $ref: '#/components/responses/NotFound' - - /beneficiaries/{beneficiary_id}/checklists/{checklist_id}/actions/{action_id}/skips: - post: - tags: [Checklists] - summary: Skip the earlier steps of a Checklist action - description: | - Records that the action is being done for the Contact before its earlier steps ("Continue - anyway" on the profile): who, when, which steps and why. The skip is also put on the Contact's - timeline as a story. `reason` is required when a missing step is Required first. Needs edit - access to the Contact. - operationId: skipContactChecklistSteps - security: [{tokenAuth: []}] - parameters: - - {name: beneficiary_id, in: path, required: true, schema: {type: integer}} - - {name: checklist_id, in: path, required: true, schema: {type: integer}} - - {name: action_id, in: path, required: true, schema: {type: integer}} - requestBody: - required: false - content: - application/json: - example: - reason: "The induction is this week; consent is in the post" - responses: - "201": - description: The skip ({id, beneficiary_id, checklist_id, checklist_action_id, action_title, skipped_actions, reason, user_id, user_name, story_id, created_at}) + description: One page of projects + content: + application/json: + example: + checklist_id: 12 + checklist_name: Intake + sort: project + direction: asc + steps: + - {id: 31, number: 1, action_type: create_task, title: Consent form} + - {id: 32, number: 2, action_type: add_role, title: Enrol} + page: 1 + page_size: 1 + page_count: 1 + total_count: 1 + data: + - project_id: 7 + project_name: Youth Club + managed_by: [Ama Ng] + workspace_colleagues: [Obi Eze] + contacts_count: 2 + steps: + - {action_id: 31, number: 1, done_count: 1, percent: 50} + - {action_id: 32, number: 2, done_count: 0, percent: 0} "401": $ref: '#/components/responses/Unauthorized' "403": - description: The user can't edit this Contact + description: Not an Organisation Admin, Team Leader or Album Editor + content: + application/json: + example: {error: forbidden} "404": $ref: '#/components/responses/NotFound' "422": $ref: '#/components/responses/UnprocessableEntity' - /beneficiaries/{beneficiary_id}/checklists/available: + /checklists/{id}/progress: get: tags: [Checklists] - summary: List the Checklists that can be added to a Contact + summary: Get a Checklist's progress description: | - The Checklists the user may add to this Contact by hand, other than those it already has, each - with the Projects it can be added through (`projects: [{id, name}]`). When there is more than - one, pass the chosen one as `project_id` to `POST /beneficiaries/{beneficiary_id}/checklists`. - operationId: listAvailableContactChecklists + Where the Contacts on a Checklist have got to: the Progress section of the Checklist's profile + page. For each action, in order: `completed` (Contacts who have done it), `furthest` (Contacts + for whom it is the furthest action done) and `waiting` (Contacts for whom it is the first action + not done, so a Contact who did steps 1 and 3 is waiting on step 2). Each list gives its full + count (`completed_count`, `furthest_count`, `waiting_count`) and the first `list_limit` (30) + Contacts alphabetically as `{beneficiary_id, name, actions_done}`, where `actions_done` is how many + of the Checklist's actions the Contact has done (shown as "3 of 8 actions done"). Each Contact in `waiting` also has the Board's + details: `days_waiting` (since the Checklist was added or the previous action was done), + `overdue` (the action is past its due date), `skipped_a_step` (a colleague logged starting a later + action first) and `responsible` (who is responsible for the action). `contacts_count` is every + Contact counted, `complete_count` those with every action done (the first of them in `complete`) + and `overdue_count` those whose waiting action is overdue. Only Contacts the user can see are counted. + operationId: getChecklistProgress security: [{tokenAuth: []}] parameters: - - name: beneficiary_id + - name: id in: path required: true schema: type: integer + - name: project_id + in: query + required: false + description: Count only the Contacts in this Project, which must be one the Checklist is added to + schema: + type: integer + - name: responsible + in: query + required: false + description: "Count only the Contacts whose waiting action this person or Team is responsible for: `me` (directly or through one of the user's Teams), `user:` or `team:`" + schema: + type: string responses: "200": - description: "`{data: [{id, name, projects: [{id, name}]}]}`" + description: The counts and lists for each action + content: + application/json: + example: + checklist_id: 42 + project_id: null + responsible: null + contacts_count: 3 + complete_count: 1 + overdue_count: 1 + list_limit: 30 + complete: [{beneficiary_id: 904, name: "Refilwe Mahlangu", actions_done: 4}] + actions: + - id: 55 + number: 1 + action_type: "complete_form" + title: "Complete the Intake form" + completed_count: 2 + completed: [{beneficiary_id: 901, name: "Ayanda Dlamini", actions_done: 2}, {beneficiary_id: 902, name: "Kagiso Mokoena", actions_done: 3}] + furthest_count: 0 + furthest: [] + waiting_count: 1 + waiting: [{beneficiary_id: 903, name: "Mpho Sithole", actions_done: 0, days_waiting: 9, overdue: true, skipped_a_step: false, responsible: "Anyone in Youth Workers"}] "401": $ref: '#/components/responses/Unauthorized' "404": $ref: '#/components/responses/NotFound' + "422": + $ref: '#/components/responses/UnprocessableEntity' - /cohort_trackers: + /checklists/{id}/progress/contacts: get: - tags: [Cohort Trackers] - summary: List an Organisation's Cohort Trackers + tags: [Checklists] + summary: List every Contact behind one of a Checklist's progress counts description: | - The Cohort Trackers of an Organisation (Charity). Visible to the Organisation's - editors and reporters, and to managers (editors) of its Projects. - operationId: listCohortTrackers + Every Contact behind one count of the Checklist's Progress section, a page at a time, as the + **Show N more** buttons on the Checklist's page do. `GET /checklists/{id}/progress` lists only the + first `list_limit` (30) of each list; use this to get the rest. Choose the list with `list`: + + - `completed`, `furthest` or `waiting`: the Table's lists for the action `action_id`: who has + done it, for whom it is the furthest action done, and who is waiting on it + - `board`: the Board's column for the action `action_id` (those waiting on it, longest waiting first) + - `complete`: the Board's Fully complete column (no `action_id`) + + Each Contact is `{beneficiary_id, name, actions_done}`. In the `waiting` and `board` lists each + also has `days_waiting`, `overdue`, `skipped_a_step` and `responsible`. The same `project_id` and + `responsible` filters as `GET /checklists/{id}/progress` apply. Only Contacts the user can see are + counted. `per_page` is at most 200. + operationId: listChecklistProgressContacts security: [{tokenAuth: []}] parameters: - - name: charity_id + - name: id + in: path + required: true + schema: + type: integer + - name: list in: query required: true + schema: + type: string + enum: [completed, furthest, waiting, board, complete] + - name: action_id + in: query + required: false + description: The action whose list it is. Required for every list but `complete` schema: type: integer - description: The Organisation (Charity) ID - - $ref: '#/components/parameters/Page' - - $ref: '#/components/parameters/PerPage' - - $ref: '#/components/parameters/LastSyncDatetime' - responses: - "200": - description: Paginated list of Cohort Trackers - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedCohortTrackers' - "401": - $ref: '#/components/responses/Unauthorized' - "403": - description: The user has no editor or reporter role in the Organisation - "404": - $ref: '#/components/responses/NotFound' - - post: - tags: [Cohort Trackers] - summary: Create a Cohort Tracker - description: | - Creates a Cohort Tracker (Create a metric > Cohort Tracker). Every tracker counts only - members of the Project or Album it is placed on: `membership` is `ever_enrolled` - (default: anyone whose status History shows them Enrolled at any time) or - `currently_enrolled` (their current Project State). `criteria` adds further conditions, in - the Contact Filters format; see `POST /cohort_trackers/preview` for the keys. - Requires an editor or reporter of the Organisation. `criteria` may also be sent as a JSON string. - operationId: createCohortTracker - security: [{tokenAuth: []}] - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/CohortTrackerRequest' - example: - cohort_tracker: - charity_id: 913 - name: "Bambanani children who start Ignite" - membership: "ever_enrolled" - criteria: - bundle_ids: ["57", "58"] + - name: project_id + in: query + required: false + description: Count only the Contacts in this Project, which must be one the Checklist is added to + schema: + type: integer + - name: responsible + in: query + required: false + description: "Count only the Contacts whose waiting action this person or Team is responsible for: `me`, `user:` or `team:`" + schema: + type: string + - $ref: '#/components/parameters/Page' + - $ref: '#/components/parameters/PerPage' responses: - "201": - description: Cohort Tracker created + "200": + description: One page of the list, in the usual envelope content: application/json: - schema: - $ref: '#/components/schemas/CohortTrackerDetail' + example: + page: 2 + page_size: 1 + page_count: 2 + total_count: 31 + data: + - {beneficiary_id: 903, name: "Mpho Sithole", actions_done: 0, days_waiting: 9, overdue: true, skipped_a_step: false, responsible: "Anyone in Youth Workers"} "401": $ref: '#/components/responses/Unauthorized' - "403": - description: The user can't create Cohort Trackers for this Organisation "404": $ref: '#/components/responses/NotFound' "422": $ref: '#/components/responses/UnprocessableEntity' - /cohort_trackers/preview: - post: - tags: [Cohort Trackers] - summary: Preview Cohort Tracker criteria + /checklists/{id}/journey: + get: + tags: [Checklists] + summary: Get a Checklist's Participant Journey description: | - How many of the Organisation's Contacts currently meet some criteria, before the tracker is - placed on a Project or Album ("Currently matches N contacts across your organisation"), and - the criteria as they would be stored. `criteria` takes any key the Contacts page's Filters - sidebar sends; keys no filter reads are dropped from the stored criteria. - - These keys follow the Project or Album the tracker is placed on and the reporting period: - - `project_ids` (with `project_ids_narrow: "true"` to require all of them), in any state - - `bundle_ids` (Albums) and `narrow_bundle_ids` - - `projects_states_hash`: `{project_id: beneficiary_state_id}`, current Project State in each - - `project_beneficiary_states`: `{project_id: {state_id: {enabled: "true", added_from_date, removed_from_date}}}`, dates as `dd/mm/yyyy - dd/mm/yyyy`, matched against status History - - `project_story_category_ids` (Survey Campaigns completed) with `project_story_category_filter_data: {id: {story_date_from}}` - - `attendance_rate`: `{change_id, from, to, event_scope}` - - `same_day_rate` (Same-day rate): `{change_id, event_scope, event_filter_params, qualifying_change_ids, match: all|any, qualifying_event_scope, qualifying_event_filter_params, from, to}`. On the days the `change_id` Engagement Tracker was recorded for a Contact at an event, the percentage of those days on which the `qualifying_change_ids` Engagement Trackers (all of them, or any one) were also recorded for them at an event on the same date, in the Organisation's time zone. A day with no matching record counts as not met; Contacts with no such days never match. E.g. children who received all four meals on every day they attended class: `from: "100", to: "100"` - - `distance_travelled`: `{trackers: [{indicator_id, directions: [improved|no_change|worsened|reached_top]}], match: any|all|at_least, match_count, same_project, story_category_ids, responses_between}`. Compares each Contact's first and latest answer to each Choice Tracker; `reached_top` means the latest answer is the best on the scale, whatever the first was. `match` says how many of the trackers a Contact must meet: `any` (default), `all`, or `at_least` `match_count` of them. E.g. Contacts who improved or reached the top answer in at least 2 of 3 goals: three trackers with `directions: [improved, reached_top]`, `match: at_least`, `match_count: 2`. With `denominator: enough_data`, a percentage is out of the Contacts with two responses on that many trackers. Optional `story_category_ids` (Survey ids) compares only answers given in those Surveys, e.g. when teachers and parents fill in different versions of the same survey; empty or omitted uses answers from any Survey. Optional `responses_between` (`dd/mm/yyyy - dd/mm/yyyy`, either end may be blank) compares only answers dated in that range; in a Cohort Tracker it narrows the reporting period further - - `indicator_comparisons`: `{indicator_id: {response: any|latest, op, sub_ratio_ids, values}}` - - `indicator_sub_ratios_hash`: `{indicator_id: [sub_ratio_id]}` - - The Contacts page's other sections apply as they do there, against the Contacts' current - details, e.g. `group_ids`, `beneficiary_types`, `age_from` / `age_to` (`{year, month, day}`), - `date_of_birth_from` and `created_at_from` (`yyyy/mm/dd - yyyy/mm/dd`), `created_by_ids`, - `story_creator_ids`, `case_owner_ids`, `case_worker_ids`, `open_cases`, `closed_cases`, - `custom_field_value_hash`, `custom_field_definition_hash`, `changes_hash`, `indicators_hash`, - `outcome_hash`, `event_ids`, `flag_hash`, `relationship_category_hash` and `beneficiary_roles_hash`. - operationId: previewCohortTracker + The Journey view on the Checklist's profile page: its steps left to right, grouped into stages. + `columns` are in order: each stage with its `stage_id`, `name`, `icon` and `colour`, then its + `steps`. A Checklist without stages has one column per step, named "Step 1", "Step 2" and so on, + with a null `stage_id` and `icon`; so does a step left outside the stages. Each step has + `action_id`, `number` (its place in the Checklist), `title`, `action_type`, `action_name` ("Not + set yet" while no type is chosen), `done_count` (Contacts who have done it) and `waiting_count` + (Contacts for whom it is the first step not done), out of `contacts_count`. Only Contacts the user + can see are counted. + operationId: getChecklistJourney security: [{tokenAuth: []}] - requestBody: - required: true - content: - application/json: - schema: - type: object - required: [charity_id] - properties: - charity_id: - type: integer - cohort_tracker: - type: object - properties: - criteria: - type: object - membership: - type: string - enum: [ever_enrolled, currently_enrolled] - example: - charity_id: 913 - cohort_tracker: - criteria: - attendance_rate: { change_id: "412", from: "75", to: "100" } + parameters: + - name: id + in: path + required: true + schema: + type: integer responses: "200": - description: The count and the normalised criteria + description: The columns of the Journey view content: application/json: - schema: - type: object - properties: - count: - type: integer - example: 42 - criteria: - type: object - names_projects_or_albums: - type: boolean + example: + checklist_id: 42 + contacts_count: 10 + columns: + - stage_id: 88 + name: "Sign up" + icon: "clipboard" + colour: "#AC3898" + steps: + - action_id: 55 + number: 1 + title: "How participants sign up" + action_type: "complete_form" + action_name: "Complete a form" + done_count: 10 + waiting_count: 0 + - stage_id: 89 + name: "Arrange support" + icon: "calendar" + colour: "#2F7DC0" + steps: + - action_id: 56 + number: 2 + title: "Initial assessment" + action_type: null + action_name: "Not set yet" + done_count: 8 + waiting_count: 2 "401": $ref: '#/components/responses/Unauthorized' - "403": - description: The user can't create Cohort Trackers for this Organisation - "422": - $ref: '#/components/responses/UnprocessableEntity' + "404": + $ref: '#/components/responses/NotFound' - /cohort_trackers/{id}: + /beneficiaries/{beneficiary_id}/checklists: get: - tags: [Cohort Trackers] - summary: Get a Cohort Tracker + tags: [Checklists] + summary: Get a Contact's Checklists description: | - A Cohort Tracker with where it is used. `names_projects_or_albums` is true when its criteria - point at specific Projects or Albums, so it counts against those same ones wherever it is placed. - operationId: getCohortTracker + The Checklists box on a Contact's profile: each Checklist with `done_count` of `actions_count`, + and every action with `done: true|false`. Only Contacts the user can see are returned. + + A done action has a `completion` (null while it isn't done) saying when, by whom and with what + record it was done: `completed_at` (when that record was made, e.g. the survey's date), + `completed_by_user_id` and `completed_by_name` (null when the record doesn't say who made it), + `completion_method` (`detected`, or `manual` when a colleague ticked it), `proof_type` and + `proof_id` (the record, e.g. `Story` 123, `BeneficiariesBeneficiaryRole`, `EventBeneficiary`) + and `proof_deleted` (true once that record has been deleted). An action stays done even if + its record is later edited or deleted. Actions are marked done in the background a few seconds + after the record that completes them is saved. + + Each action also says who is responsible for it for this Contact: the owner fields + (`owner_kind`, `owner_user_id`, `owner_team_id`, `owner_relationship_side`), `owner_overridden` + (true when a colleague changed it for this Contact only), `owner_description` (e.g. + "Safeguarding Team"), `responsible_user_ids` (only colleagues who can see the Contact) and + `owner_warning` when nobody responsible can see them (e.g. "No one in Safeguarding Team can see + this contact"). + + An action whose Checklist gives it a deadline (`due_within_days`) has `due_on`: the day the + Checklist was added to the Contact plus that many days (null when there is no deadline). + `done_late` is true when it was done after `due_on`; `overdue` is true when it isn't done and + `due_on` has passed. Both are false for an action with no deadline. + + `allow_manual_completion` says whether colleagues may tick the action off by hand + (`POST .../actions/{action_id}/completion`). + operationId: listContactChecklists security: [{tokenAuth: []}] parameters: - - $ref: '#/components/parameters/ResourceId' + - name: beneficiary_id + in: path + required: true + schema: + type: integer + - $ref: '#/components/parameters/Page' + - $ref: '#/components/parameters/PerPage' responses: "200": - description: The Cohort Tracker - content: - application/json: - schema: - $ref: '#/components/schemas/CohortTrackerDetail' + description: Paginated list of the Contact's Checklists with their progress "401": $ref: '#/components/responses/Unauthorized' "404": $ref: '#/components/responses/NotFound' - patch: - tags: [Cohort Trackers] - summary: Update a Cohort Tracker + post: + tags: [Checklists] + summary: Add a Checklist to a Contact description: | - Updates the fields sent. Changes apply everywhere the tracker is used. Requires an - Organisation editor, or the reporter who created it. - - Switching `result_type` between a number of Contacts and a percentage clears the tracker's - targets on every Project and Album, because the two aren't comparable. While it has targets, - the switch is refused (422, "Switching result type clears this tracker's N targets. Confirm to - continue.") unless `confirm_clear_targets` is true. - operationId: updateCohortTracker + Add a Checklist on the Contact's profile. Only a Checklist that one of the Contact's Projects + lets the user add by hand is allowed; see `GET /beneficiaries/{beneficiary_id}/checklists/available`. + It is added through a Project, the one whose records count for actions set to "Only count + records in this project": the only Project that allows it, or `project_id` when more than one + does (required then). Adding one that was removed from the Contact earlier restores the + actions they had done. An Organisation Admin may also add back a Checklist that was removed + from the Contact while one of their Projects adds it automatically; it is added through that + Project. + operationId: addContactChecklist security: [{tokenAuth: []}] parameters: - - $ref: '#/components/parameters/ResourceId' - requestBody: - required: true + - name: beneficiary_id + in: path + required: true + schema: + type: integer + requestBody: + required: true content: application/json: - schema: - $ref: '#/components/schemas/CohortTrackerRequest' example: - cohort_tracker: - name: "Children attending 80%+" + checklist_id: 42 + project_id: 301 + responses: + "201": + description: "`{checklist_id, beneficiary_id, added_by_user_id, project_id, created_at}`" + "401": + $ref: '#/components/responses/Unauthorized' + "404": + $ref: '#/components/responses/NotFound' + "422": + $ref: '#/components/responses/UnprocessableEntity' + + /beneficiaries/{beneficiary_id}/checklists/{checklist_id}: + delete: + tags: [Checklists] + summary: Remove a Checklist from a Contact + description: | + "Remove from this contact" in the ⋯ menu of a Checklist on the Contact's profile, for one added + by mistake or no longer relevant. It no longer shows on the Contact, in the Checklist's progress + or on Focus, and the removal is recorded on the Contact's History. The Contact's progress is + kept: adding the Checklist again (`POST /beneficiaries/{beneficiary_id}/checklists`) restores the + actions they had done, and a Project that adds the Checklist automatically won't add it back. + Allowed for Organisation Admins, and for colleagues who could add the Checklist to the Contact by + hand. + operationId: removeContactChecklist + security: [{tokenAuth: []}] + parameters: + - name: beneficiary_id + in: path + required: true + schema: + type: integer + - name: checklist_id + in: path + required: true + schema: + type: integer responses: "200": - description: Cohort Tracker updated + description: "`{checklist_id, beneficiary_id, removed_at, removed_by_user_id}`" content: application/json: - schema: - $ref: '#/components/schemas/CohortTrackerDetail' + example: + checklist_id: 42 + beneficiary_id: 1001 + removed_at: "2026-11-05T10:00:00Z" + removed_by_user_id: 7 "401": $ref: '#/components/responses/Unauthorized' "403": - description: The user can't edit this Cohort Tracker + description: "`{errors}`: the user is neither an Organisation Admin nor able to add this Checklist to the Contact" "404": $ref: '#/components/responses/NotFound' - "422": - $ref: '#/components/responses/UnprocessableEntity' - delete: - tags: [Cohort Trackers] - summary: Delete a Cohort Tracker - description: Refused (422) while the tracker is used on any Project, Album or Scorecard Template. - operationId: deleteCohortTracker + /beneficiaries/{beneficiary_id}/checklists/{checklist_id}/actions/{action_id}/owner: + patch: + tags: [Checklists] + summary: Change who is responsible for an action for one Contact + description: | + The Change link under an action in a Contact's Checklists box. Sets who is responsible for this + action for this Contact only; other Contacts keep the Checklist's default. Choosing the + Checklist's own default removes the change. Takes the same owner fields as an action of + `POST /checklists`. Requires edit access to the Contact. + operationId: setContactChecklistActionOwner security: [{tokenAuth: []}] parameters: - - $ref: '#/components/parameters/ResourceId' + - name: beneficiary_id + in: path + required: true + schema: + type: integer + - name: checklist_id + in: path + required: true + schema: + type: integer + - name: action_id + in: path + required: true + schema: + type: integer + requestBody: + required: true + content: + application/json: + example: + owner_kind: "user" + owner_user_id: 5021 responses: - "204": - description: Deleted + "200": + description: "`{checklist_id, action_id, owner_kind, owner_user_id, owner_team_id, owner_relationship_side, owner_overridden, owner_description, responsible_user_ids, owner_warning}`" "401": $ref: '#/components/responses/Unauthorized' "403": - description: The user can't delete this Cohort Tracker + description: The user can see the Contact but can't edit it "404": $ref: '#/components/responses/NotFound' "422": $ref: '#/components/responses/UnprocessableEntity' - /cohort_trackers/{id}/projects/{project_id}: - get: - tags: [Cohort Trackers] - summary: Get a Cohort Tracker's targets on a Project - description: The one-off target and deadline targets (the Project's Set Targets page). Requires rights to edit the Project's targets. - operationId: getCohortTrackerProjectTargets + delete: + tags: [Checklists] + summary: Go back to the Checklist's own owner for one Contact + description: Removes a change made with the PATCH above, so this Contact follows the Checklist's default again. Requires edit access to the Contact. + operationId: resetContactChecklistActionOwner security: [{tokenAuth: []}] parameters: - - $ref: '#/components/parameters/ResourceId' - - $ref: '#/components/parameters/CohortTrackerProjectId' + - name: beneficiary_id + in: path + required: true + schema: + type: integer + - name: checklist_id + in: path + required: true + schema: + type: integer + - name: action_id + in: path + required: true + schema: + type: integer responses: "200": - description: The targets - content: - application/json: - schema: - $ref: '#/components/schemas/CohortTrackerPlacement' + description: The action's owner fields, as for the PATCH "401": $ref: '#/components/responses/Unauthorized' "403": - description: The user can't edit this Project's targets + description: The user can see the Contact but can't edit it "404": $ref: '#/components/responses/NotFound' + /beneficiaries/{beneficiary_id}/checklists/{checklist_id}/actions/{action_id}/completion: post: - tags: [Cohort Trackers] - summary: Add a Cohort Tracker to a Project + tags: [Checklists] + summary: Mark a Contact's Checklist action as done by hand description: | - Places the tracker in a column of the Project's Impact Scorecard (Edit Project Metrics), - optionally with a one-off target. The Project's Albums pick it up automatically. The tracker - and Project must belong to the same Organisation, and the user needs rights to edit the - Project's metrics. - operationId: addCohortTrackerToProject + The "Mark as done…" link under an action in a Contact's Checklists box, for steps that leave + no record Makerble can detect, such as a phone call, a home visit or a paper consent form. + Only an action whose Checklist allows it (`allow_manual_completion: true`) can be ticked off + this way, and only while it isn't done. Requires edit access to the Contact. + + `completed_on` is the date it happened (`YYYY-MM-DD`, today or earlier) and `note` says what + happened. The note, and the `evidence` file when one is sent as multipart form data, are + saved as a Story on the Contact's timeline, which becomes the action's proof. The Story goes + in the Project the Checklist was added through, otherwise the Contact's only Project the user + can record stories in; when there is more than one, send `project_id`. + + The action's `completion` then has `completion_method: manual`, `completed_by_user_id` the + user, `completed_at` the date given, and `proof_type: Story` with the new Story's `proof_id`. + operationId: markContactChecklistActionDone security: [{tokenAuth: []}] parameters: - - $ref: '#/components/parameters/ResourceId' - - $ref: '#/components/parameters/CohortTrackerProjectId' + - name: beneficiary_id + in: path + required: true + schema: + type: integer + - name: checklist_id + in: path + required: true + schema: + type: integer + - name: action_id + in: path + required: true + schema: + type: integer requestBody: required: true content: application/json: + example: + completed_on: "2026-10-20" + note: "Paper consent signed at the home visit, scanned to file" + project_id: 301 + multipart/form-data: schema: type: object - required: [column] + required: [completed_on, note] properties: - column: + completed_on: type: string - enum: [activities, engagement, potential, behaviour, growth] - target: + format: date + note: + type: string + project_id: type: integer - example: - column: engagement - target: 40 + evidence: + type: string + format: binary responses: "201": - description: Placed - content: - application/json: - schema: - $ref: '#/components/schemas/CohortTrackerPlacement' + description: "`{checklist_id, action_id, done: true, completion: {completed_at, completed_by_user_id, completed_by_name, completion_method, proof_type, proof_id, proof_deleted}}`" "401": $ref: '#/components/responses/Unauthorized' "403": - description: The user can't edit this Project's metrics + description: The user can see the Contact but can't edit it "404": $ref: '#/components/responses/NotFound' "422": $ref: '#/components/responses/UnprocessableEntity' - patch: - tags: [Cohort Trackers] - summary: Set a Cohort Tracker's targets on a Project + delete: + tags: [Checklists] + summary: Undo marking a Contact's Checklist action as done by hand description: | - Sets the one-off target and/or replaces this tracker's deadline targets on the Project (Set - Targets). A target is a number of Contacts to reach, not a total that adds up across periods. - `deadlines: []` clears the deadline targets. Requires rights to edit the Project's targets. - operationId: setCohortTrackerProjectTargets + Takes back a tick made by hand. Only the colleague who made it, or an Organisation Admin, can + undo it, and only a manual completion can be undone. The Story stays on the Contact's + timeline. Makerble then looks again for a record that proves the action done, so the + response can still say `done: true` with a `detected` completion. Requires edit access to the + Contact. + operationId: undoContactChecklistActionDone security: [{tokenAuth: []}] parameters: - - $ref: '#/components/parameters/ResourceId' - - $ref: '#/components/parameters/CohortTrackerProjectId' - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/CohortTrackerTargetsRequest' - example: - target: 40 - deadlines: - - { date: "2026-06-30", number: 20 } - - { date: "2026-12-31", number: 40 } + - name: beneficiary_id + in: path + required: true + schema: + type: integer + - name: checklist_id + in: path + required: true + schema: + type: integer + - name: action_id + in: path + required: true + schema: + type: integer responses: "200": - description: Targets saved - content: - application/json: - schema: - $ref: '#/components/schemas/CohortTrackerPlacement' + description: "`{checklist_id, action_id, done, completion}` (completion null when not done)" "401": $ref: '#/components/responses/Unauthorized' "403": - description: The user can't edit this Project's targets + description: The user can see the Contact but can't edit it "404": $ref: '#/components/responses/NotFound' "422": $ref: '#/components/responses/UnprocessableEntity' - delete: - tags: [Cohort Trackers] - summary: Remove a Cohort Tracker from a Project - operationId: removeCohortTrackerFromProject + /beneficiaries/{beneficiary_id}/checklists/next_step: + get: + tags: [Checklists] + summary: Get a Contact's next step + description: | + What to do next for a Contact, as on the Next step card of their profile: the first action + not yet done on each of their Checklists, the most pressing first (overdue, then the earliest + `due_on`, then by Checklist name), so `data[0]` is the next step. Each step has the Checklist + (`checklist_id`, `checklist_name`), its place in it (`number` of `total`), the action + (`action_id`, `action_type`, `action_name`, `title`, `description`), its deadline (`due_on`, + `overdue`), `if_earlier_steps_not_done` and who is responsible for it (the same owner fields as + `GET /beneficiaries/{beneficiary_id}/checklists`). `others_count` is how many other Checklists + are waiting; `all_done` is true when every action on the Contact's Checklists is done. Not + paginated: a Contact has few Checklists. + operationId: getContactNextStep security: [{tokenAuth: []}] parameters: - - $ref: '#/components/parameters/ResourceId' - - $ref: '#/components/parameters/CohortTrackerProjectId' + - name: beneficiary_id + in: path + required: true + schema: + type: integer responses: - "204": - description: Removed + "200": + description: "`{all_done, others_count, data: [{checklist_id, checklist_name, number, total, action_id, action_type, action_name, title, description, due_on, overdue, if_earlier_steps_not_done, owner_kind, owner_description, responsible_user_ids, ...}]}`" "401": $ref: '#/components/responses/Unauthorized' - "403": - description: The user can't edit this Project's metrics "404": $ref: '#/components/responses/NotFound' - /cohort_trackers/{id}/albums/{bundle_id}: + /beneficiaries/{beneficiary_id}/checklists/{checklist_id}/actions/{action_id}/gate: get: - tags: [Cohort Trackers] - summary: Get a Cohort Tracker's targets on an Album + tags: [Checklists] + summary: Check the earlier steps before a Checklist action description: | - An Album inherits the Cohort Trackers on its Projects. Returns the Album's one-off and deadline - targets for the tracker, and `album_target_type`: the Album's Set Targets page shows Cohort - Tracker targets under manual targets. Requires rights to edit the Album's targets. - operationId: getCohortTrackerAlbumTargets + The "soft gate" a colleague sees on the Contact's profile when they start an action before the + earlier steps on the same Checklist are done. `gated` is true when some aren't; `missing` lists + them ({action_id, number, action_type, title, required_first}); `reason_required` is true when + one is set to "Warn and ask for a reason to skip" (Required first). Nothing is blocked: to go + ahead, record the skip with `POST .../skips`. + operationId: getContactChecklistGate security: [{tokenAuth: []}] parameters: - - $ref: '#/components/parameters/ResourceId' - - $ref: '#/components/parameters/CohortTrackerAlbumId' + - {name: beneficiary_id, in: path, required: true, schema: {type: integer}} + - {name: checklist_id, in: path, required: true, schema: {type: integer}} + - {name: action_id, in: path, required: true, schema: {type: integer}} responses: "200": - description: The targets - content: - application/json: - schema: - $ref: '#/components/schemas/CohortTrackerAlbumTargets' + description: "`{gated, reason_required, missing: [{action_id, number, action_type, title, required_first}]}`" "401": $ref: '#/components/responses/Unauthorized' - "403": - description: The user can't edit this Album's targets "404": $ref: '#/components/responses/NotFound' - patch: - tags: [Cohort Trackers] - summary: Set a Cohort Tracker's targets on an Album + /beneficiaries/{beneficiary_id}/checklists/{checklist_id}/actions/{action_id}/skips: + post: + tags: [Checklists] + summary: Skip the earlier steps of a Checklist action description: | - Sets the Album's one-off target and/or replaces its deadline targets (saved as manual targets) for - the tracker. An Album's target is never the sum of its Projects'. Requires rights to edit the - Album's targets. - operationId: setCohortTrackerAlbumTargets + Records that the action is being done for the Contact before its earlier steps ("Continue + anyway" on the profile): who, when, which steps and why. The skip is also put on the Contact's + timeline as a story. `reason` is required when a missing step is Required first. Needs edit + access to the Contact. + operationId: skipContactChecklistSteps security: [{tokenAuth: []}] parameters: - - $ref: '#/components/parameters/ResourceId' - - $ref: '#/components/parameters/CohortTrackerAlbumId' + - {name: beneficiary_id, in: path, required: true, schema: {type: integer}} + - {name: checklist_id, in: path, required: true, schema: {type: integer}} + - {name: action_id, in: path, required: true, schema: {type: integer}} requestBody: - required: true + required: false content: application/json: - schema: - $ref: '#/components/schemas/CohortTrackerTargetsRequest' example: - target: 120 - deadlines: - - { date: "2026-12-31", number: 100 } + reason: "The induction is this week; consent is in the post" responses: - "200": - description: Targets saved - content: - application/json: - schema: - $ref: '#/components/schemas/CohortTrackerAlbumTargets' + "201": + description: The skip ({id, beneficiary_id, checklist_id, checklist_action_id, action_title, skipped_actions, reason, user_id, user_name, story_id, created_at}) "401": $ref: '#/components/responses/Unauthorized' "403": - description: The user can't edit this Album's targets + description: The user can't edit this Contact "404": $ref: '#/components/responses/NotFound' "422": $ref: '#/components/responses/UnprocessableEntity' - /formula_trackers: + /beneficiaries/{beneficiary_id}/checklists/available: get: - tags: [Formula Trackers] - summary: List an Organisation's Formula Trackers + tags: [Checklists] + summary: List the Checklists that can be added to a Contact description: | - The Formula Trackers of an Organisation (Charity). Visible to the Organisation's editors and - reporters, and to managers (editors) of its Projects. - operationId: listFormulaTrackers + The Checklists the user may add to this Contact by hand, other than those it already has, each + with the Projects it can be added through (`projects: [{id, name}]`). When there is more than + one, pass the chosen one as `project_id` to `POST /beneficiaries/{beneficiary_id}/checklists`. + operationId: listAvailableContactChecklists + security: [{tokenAuth: []}] + parameters: + - name: beneficiary_id + in: path + required: true + schema: + type: integer + responses: + "200": + description: "`{data: [{id, name, projects: [{id, name}]}]}`" + "401": + $ref: '#/components/responses/Unauthorized' + "404": + $ref: '#/components/responses/NotFound' + + /cohort_trackers: + get: + tags: [Cohort Trackers] + summary: List an Organisation's Cohort Trackers + description: | + The Cohort Trackers of an Organisation (Charity). Visible to the Organisation's + editors and reporters, and to managers (editors) of its Projects. + operationId: listCohortTrackers security: [{tokenAuth: []}] parameters: - name: charity_id @@ -15000,11 +15701,11 @@ paths: - $ref: '#/components/parameters/LastSyncDatetime' responses: "200": - description: Paginated list of Formula Trackers + description: Paginated list of Cohort Trackers content: application/json: schema: - $ref: '#/components/schemas/PaginatedFormulaTrackers' + $ref: '#/components/schemas/PaginatedCohortTrackers' "401": $ref: '#/components/responses/Unauthorized' "403": @@ -15013,125 +15714,75 @@ paths: $ref: '#/components/responses/NotFound' post: - tags: [Formula Trackers] - summary: Create a Formula Tracker + tags: [Cohort Trackers] + summary: Create a Cohort Tracker description: | - Creates a Formula Tracker (Create a metric > Formula Tracker): a metric worked out from the - Organisation's other trackers. `expression` is the formula as an ordered list of tokens, never - free text: - - - `{kind: tracker, type, id}`: one of the Organisation's trackers that has a number. `type` is - `Change` (Activity or Engagement tracker), `Indicator` (Achievement or Numerical tracker; not a - Choice tracker), `CohortTracker`, `WorkflowTracker`, `FilteredMetric` (a filtered version) or - `FormulaTracker`. List them with `GET /formula_trackers/operands`. - - `{kind: operator, value}`: `+`, `-`, `*` or `/`. × and ÷ are worked out before + and −. - - `{kind: number, value}`, e.g. 100. - - `{kind: open}` and `{kind: close}`: brackets, worked out first. - - Refused (422) when the formula is empty, starts or ends with an operator, has two operators - or two values in a row, unmatched or empty brackets, uses another Organisation's tracker, or - uses itself (directly or through other Formula Trackers). - - Each timeframe's result is worked out from each tracker's result for the same Project or Album - and timeframe, then the formula: a Year to Date percentage is Year to Date numerator ÷ Year to - Date denominator. `result_kind` is `additive` only when the formula adds and subtracts trackers - that add up, with no numbers; otherwise `snapshot`. Dividing by 0 gives no result (null). - Requires an editor or reporter of the Organisation. - operationId: createFormulaTracker + Creates a Cohort Tracker (Create a metric > Cohort Tracker). Every tracker counts only + members of the Project or Album it is placed on: `membership` is `ever_enrolled` + (default: anyone whose status History shows them Enrolled at any time) or + `currently_enrolled` (their current Project State). `criteria` adds further conditions, in + the Contact Filters format; see `POST /cohort_trackers/preview` for the keys. + Requires an editor or reporter of the Organisation. `criteria` may also be sent as a JSON string. + operationId: createCohortTracker security: [{tokenAuth: []}] requestBody: required: true content: application/json: schema: - $ref: '#/components/schemas/FormulaTrackerRequest' - examples: - referralsCompleted: - summary: Referrals completed = External referrals + Internal referrals - value: - formula_tracker: - charity_id: 913 - name: "Referrals completed" - expression: - - { kind: tracker, type: Change, id: 5120 } - - { kind: operator, value: "+" } - - { kind: tracker, type: WorkflowTracker, id: 41 } - percentageSupported: - summary: "% of children receiving support = Children supported ÷ Children enrolled × 100" - value: - formula_tracker: - charity_id: 913 - name: "% of children receiving support" - display_format: "percentage" - decimal_places: 1 - expression: - - { kind: tracker, type: Change, id: 5121 } - - { kind: operator, value: "/" } - - { kind: tracker, type: CohortTracker, id: 77 } - - { kind: operator, value: "*" } - - { kind: number, value: 100 } + $ref: '#/components/schemas/CohortTrackerRequest' + example: + cohort_tracker: + charity_id: 913 + name: "Bambanani children who start Ignite" + membership: "ever_enrolled" + criteria: + bundle_ids: ["57", "58"] responses: "201": - description: Formula Tracker created + description: Cohort Tracker created content: application/json: schema: - $ref: '#/components/schemas/FormulaTrackerDetail' + $ref: '#/components/schemas/CohortTrackerDetail' "401": $ref: '#/components/responses/Unauthorized' "403": - description: The user can't create Formula Trackers for this Organisation + description: The user can't create Cohort Trackers for this Organisation "404": $ref: '#/components/responses/NotFound' "422": $ref: '#/components/responses/UnprocessableEntity' - /formula_trackers/operands: - get: - tags: [Formula Trackers] - summary: List the trackers a formula can use - description: | - The Organisation's trackers that have a number, by name, with the `type` and `id` to send in a - tracker token: its Activity, Engagement, Achievement and Numerical trackers (owned by it or used - on its Projects), Cohort, Workflow and Formula Trackers, and filtered versions. Choice trackers - aren't listed. - operationId: listFormulaTrackerOperands - security: [{tokenAuth: []}] - parameters: - - name: charity_id - in: query - required: true - schema: - type: integer - description: The Organisation (Charity) ID - - $ref: '#/components/parameters/Page' - - $ref: '#/components/parameters/PerPage' - responses: - "200": - description: Paginated list of trackers - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedFormulaTrackerOperands' - "401": - $ref: '#/components/responses/Unauthorized' - "403": - description: The user can't create Formula Trackers for this Organisation - "404": - $ref: '#/components/responses/NotFound' - - /formula_trackers/preview: + /cohort_trackers/preview: post: - tags: [Formula Trackers] - summary: Preview a Formula Tracker + tags: [Cohort Trackers] + summary: Preview Cohort Tracker criteria description: | - What a formula gives on one of the Organisation's Projects, before it is saved: the result for - the current Period (ending at the Project's next deadline, or today when it has none ahead), Year - to Date and All-time, each tracker's own result, and warnings worth checking (a tracker used - twice, a Numerical tracker added to a count, different units added together, dividing by a - tracker that could be 0). A formula with errors is refused (422) with `errors` and `warnings`. - Send `formula_tracker_id` when editing a tracker, so a formula that uses it is caught. - operationId: previewFormulaTracker + How many of the Organisation's Contacts currently meet some criteria, before the tracker is + placed on a Project or Album ("Currently matches N contacts across your organisation"), and + the criteria as they would be stored. `criteria` takes any key the Contacts page's Filters + sidebar sends; keys no filter reads are dropped from the stored criteria. + + These keys follow the Project or Album the tracker is placed on and the reporting period: + - `project_ids` (with `project_ids_narrow: "true"` to require all of them), in any state + - `bundle_ids` (Albums) and `narrow_bundle_ids` + - `projects_states_hash`: `{project_id: beneficiary_state_id}`, current Project State in each + - `project_beneficiary_states`: `{project_id: {state_id: {enabled: "true", added_from_date, removed_from_date}}}`, dates as `dd/mm/yyyy - dd/mm/yyyy`, matched against status History + - `project_story_category_ids` (Survey Campaigns completed) with `project_story_category_filter_data: {id: {story_date_from}}` + - `attendance_rate`: `{change_id, from, to, event_scope}` + - `same_day_rate` (Same-day rate): `{change_id, event_scope, event_filter_params, qualifying_change_ids, match: all|any, qualifying_event_scope, qualifying_event_filter_params, from, to}`. On the days the `change_id` Engagement Tracker was recorded for a Contact at an event, the percentage of those days on which the `qualifying_change_ids` Engagement Trackers (all of them, or any one) were also recorded for them at an event on the same date, in the Organisation's time zone. A day with no matching record counts as not met; Contacts with no such days never match. E.g. children who received all four meals on every day they attended class: `from: "100", to: "100"` + - `distance_travelled`: `{trackers: [{indicator_id, directions: [improved|no_change|worsened|reached_top]}], match: any|all|at_least, match_count, same_project, story_category_ids, responses_between}`. Compares each Contact's first and latest answer to each Choice Tracker; `reached_top` means the latest answer is the best on the scale, whatever the first was. `match` says how many of the trackers a Contact must meet: `any` (default), `all`, or `at_least` `match_count` of them. E.g. Contacts who improved or reached the top answer in at least 2 of 3 goals: three trackers with `directions: [improved, reached_top]`, `match: at_least`, `match_count: 2`. With `denominator: enough_data`, a percentage is out of the Contacts with two responses on that many trackers. Optional `story_category_ids` (Survey ids) compares only answers given in those Surveys, e.g. when teachers and parents fill in different versions of the same survey; empty or omitted uses answers from any Survey. Optional `responses_between` (`dd/mm/yyyy - dd/mm/yyyy`, either end may be blank) compares only answers dated in that range; in a Cohort Tracker it narrows the reporting period further + - `indicator_comparisons`: `{indicator_id: {response: any|latest, op, sub_ratio_ids, values}}` + - `indicator_sub_ratios_hash`: `{indicator_id: [sub_ratio_id]}` + + The Contacts page's other sections apply as they do there, against the Contacts' current + details, e.g. `group_ids`, `beneficiary_types`, `age_from` / `age_to` (`{year, month, day}`), + `date_of_birth_from` and `created_at_from` (`yyyy/mm/dd - yyyy/mm/dd`), `created_by_ids`, + `story_creator_ids`, `case_owner_ids`, `case_worker_ids`, `open_cases`, `closed_cases`, + `custom_field_value_hash`, `custom_field_definition_hash`, `changes_hash`, `indicators_hash`, + `outcome_hash`, `event_ids`, `flag_hash`, `relationship_category_hash` and `beneficiary_roles_hash`. + operationId: previewCohortTracker security: [{tokenAuth: []}] requestBody: required: true @@ -15139,69 +15790,80 @@ paths: application/json: schema: type: object - required: [charity_id, project_id] + required: [charity_id] properties: charity_id: type: integer - project_id: - type: integer - formula_tracker_id: - type: integer - description: The Formula Tracker being edited, if any - formula_tracker: - $ref: '#/components/schemas/FormulaTrackerAttributes' + cohort_tracker: + type: object + properties: + criteria: + type: object + membership: + type: string + enum: [ever_enrolled, currently_enrolled] example: charity_id: 913 - project_id: 4510 - formula_tracker: - expression: - - { kind: tracker, type: Change, id: 5120 } - - { kind: operator, value: "+" } - - { kind: tracker, type: WorkflowTracker, id: 41 } + cohort_tracker: + criteria: + attendance_rate: { change_id: "412", from: "75", to: "100" } responses: "200": - description: The results + description: The count and the normalised criteria content: application/json: schema: - $ref: '#/components/schemas/FormulaTrackerPreview' + type: object + properties: + count: + type: integer + example: 42 + criteria: + type: object + names_projects_or_albums: + type: boolean "401": $ref: '#/components/responses/Unauthorized' "403": - description: The user can't create Formula Trackers for this Organisation - "404": - $ref: '#/components/responses/NotFound' + description: The user can't create Cohort Trackers for this Organisation "422": $ref: '#/components/responses/UnprocessableEntity' - /formula_trackers/{id}: + /cohort_trackers/{id}: get: - tags: [Formula Trackers] - summary: Get a Formula Tracker - description: A Formula Tracker with where it is used and any warnings about its formula. - operationId: getFormulaTracker + tags: [Cohort Trackers] + summary: Get a Cohort Tracker + description: | + A Cohort Tracker with where it is used. `names_projects_or_albums` is true when its criteria + point at specific Projects or Albums, so it counts against those same ones wherever it is placed. + operationId: getCohortTracker security: [{tokenAuth: []}] parameters: - $ref: '#/components/parameters/ResourceId' responses: "200": - description: The Formula Tracker + description: The Cohort Tracker content: application/json: schema: - $ref: '#/components/schemas/FormulaTrackerDetail' + $ref: '#/components/schemas/CohortTrackerDetail' "401": $ref: '#/components/responses/Unauthorized' "404": $ref: '#/components/responses/NotFound' patch: - tags: [Formula Trackers] - summary: Update a Formula Tracker + tags: [Cohort Trackers] + summary: Update a Cohort Tracker description: | - Updates the fields sent; `expression` replaces the whole formula. Changes apply everywhere the - tracker is used. Requires an Organisation editor, or the reporter who created it. - operationId: updateFormulaTracker + Updates the fields sent. Changes apply everywhere the tracker is used. Requires an + Organisation editor, or the reporter who created it. + + Switching `result_type` between a number of Contacts and a percentage clears the tracker's + targets on every Project and Album, because the two aren't comparable. While it has targets, + the switch is refused (422, "Switching result type clears this tracker's N targets. Confirm to + continue.") unless `confirm_clear_targets` is true. + operationId: updateCohortTracker security: [{tokenAuth: []}] parameters: - $ref: '#/components/parameters/ResourceId' @@ -15210,31 +15872,31 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/FormulaTrackerRequest' + $ref: '#/components/schemas/CohortTrackerRequest' example: - formula_tracker: - decimal_places: 1 + cohort_tracker: + name: "Children attending 80%+" responses: "200": - description: Formula Tracker updated + description: Cohort Tracker updated content: application/json: schema: - $ref: '#/components/schemas/FormulaTrackerDetail' + $ref: '#/components/schemas/CohortTrackerDetail' "401": $ref: '#/components/responses/Unauthorized' "403": - description: The user can't edit this Formula Tracker + description: The user can't edit this Cohort Tracker "404": $ref: '#/components/responses/NotFound' "422": $ref: '#/components/responses/UnprocessableEntity' delete: - tags: [Formula Trackers] - summary: Delete a Formula Tracker + tags: [Cohort Trackers] + summary: Delete a Cohort Tracker description: Refused (422) while the tracker is used on any Project, Album or Scorecard Template. - operationId: deleteFormulaTracker + operationId: deleteCohortTracker security: [{tokenAuth: []}] parameters: - $ref: '#/components/parameters/ResourceId' @@ -15244,18 +15906,18 @@ paths: "401": $ref: '#/components/responses/Unauthorized' "403": - description: The user can't delete this Formula Tracker + description: The user can't delete this Cohort Tracker "404": $ref: '#/components/responses/NotFound' "422": $ref: '#/components/responses/UnprocessableEntity' - /formula_trackers/{id}/projects/{project_id}: + /cohort_trackers/{id}/projects/{project_id}: get: - tags: [Formula Trackers] - summary: Get a Formula Tracker's targets on a Project + tags: [Cohort Trackers] + summary: Get a Cohort Tracker's targets on a Project description: The one-off target and deadline targets (the Project's Set Targets page). Requires rights to edit the Project's targets. - operationId: getFormulaTrackerProjectTargets + operationId: getCohortTrackerProjectTargets security: [{tokenAuth: []}] parameters: - $ref: '#/components/parameters/ResourceId' @@ -15266,7 +15928,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/FormulaTrackerPlacement' + $ref: '#/components/schemas/CohortTrackerPlacement' "401": $ref: '#/components/responses/Unauthorized' "403": @@ -15275,14 +15937,14 @@ paths: $ref: '#/components/responses/NotFound' post: - tags: [Formula Trackers] - summary: Add a Formula Tracker to a Project + tags: [Cohort Trackers] + summary: Add a Cohort Tracker to a Project description: | Places the tracker in a column of the Project's Impact Scorecard (Edit Project Metrics), optionally with a one-off target. The Project's Albums pick it up automatically. The tracker and Project must belong to the same Organisation, and the user needs rights to edit the Project's metrics. - operationId: addFormulaTrackerToProject + operationId: addCohortTrackerToProject security: [{tokenAuth: []}] parameters: - $ref: '#/components/parameters/ResourceId' @@ -15309,7 +15971,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/FormulaTrackerPlacement' + $ref: '#/components/schemas/CohortTrackerPlacement' "401": $ref: '#/components/responses/Unauthorized' "403": @@ -15320,14 +15982,13 @@ paths: $ref: '#/components/responses/UnprocessableEntity' patch: - tags: [Formula Trackers] - summary: Set a Formula Tracker's targets on a Project + tags: [Cohort Trackers] + summary: Set a Cohort Tracker's targets on a Project description: | Sets the one-off target and/or replaces this tracker's deadline targets on the Project (Set - Targets). An additive tracker adds its targets up across deadlines; a snapshot uses each - deadline's target on its own. A percentage tracker's targets are whole percentages from 0 to - 100. `deadlines: []` clears the deadline targets. Requires rights to edit the Project's targets. - operationId: setFormulaTrackerProjectTargets + Targets). A target is a number of Contacts to reach, not a total that adds up across periods. + `deadlines: []` clears the deadline targets. Requires rights to edit the Project's targets. + operationId: setCohortTrackerProjectTargets security: [{tokenAuth: []}] parameters: - $ref: '#/components/parameters/ResourceId' @@ -15342,13 +16003,14 @@ paths: target: 40 deadlines: - { date: "2026-06-30", number: 20 } + - { date: "2026-12-31", number: 40 } responses: "200": description: Targets saved content: application/json: schema: - $ref: '#/components/schemas/FormulaTrackerPlacement' + $ref: '#/components/schemas/CohortTrackerPlacement' "401": $ref: '#/components/responses/Unauthorized' "403": @@ -15359,9 +16021,9 @@ paths: $ref: '#/components/responses/UnprocessableEntity' delete: - tags: [Formula Trackers] - summary: Remove a Formula Tracker from a Project - operationId: removeFormulaTrackerFromProject + tags: [Cohort Trackers] + summary: Remove a Cohort Tracker from a Project + operationId: removeCohortTrackerFromProject security: [{tokenAuth: []}] parameters: - $ref: '#/components/parameters/ResourceId' @@ -15376,15 +16038,15 @@ paths: "404": $ref: '#/components/responses/NotFound' - /formula_trackers/{id}/albums/{bundle_id}: + /cohort_trackers/{id}/albums/{bundle_id}: get: - tags: [Formula Trackers] - summary: Get a Formula Tracker's targets on an Album + tags: [Cohort Trackers] + summary: Get a Cohort Tracker's targets on an Album description: | - An Album inherits the Formula Trackers on its Projects. Returns the Album's one-off and - deadline targets for the tracker, and `album_target_type`: the Album's Set Targets page shows - Formula Tracker targets under manual targets. Requires rights to edit the Album's targets. - operationId: getFormulaTrackerAlbumTargets + An Album inherits the Cohort Trackers on its Projects. Returns the Album's one-off and deadline + targets for the tracker, and `album_target_type`: the Album's Set Targets page shows Cohort + Tracker targets under manual targets. Requires rights to edit the Album's targets. + operationId: getCohortTrackerAlbumTargets security: [{tokenAuth: []}] parameters: - $ref: '#/components/parameters/ResourceId' @@ -15395,7 +16057,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/FormulaTrackerAlbumTargets' + $ref: '#/components/schemas/CohortTrackerAlbumTargets' "401": $ref: '#/components/responses/Unauthorized' "403": @@ -15404,13 +16066,13 @@ paths: $ref: '#/components/responses/NotFound' patch: - tags: [Formula Trackers] - summary: Set a Formula Tracker's targets on an Album + tags: [Cohort Trackers] + summary: Set a Cohort Tracker's targets on an Album description: | - Sets the Album's one-off target and/or replaces its deadline targets (saved as manual targets) - for the tracker. An Album's result is worked out from the Album's own results, so its target is - never the sum of its Projects'. Requires rights to edit the Album's targets. - operationId: setFormulaTrackerAlbumTargets + Sets the Album's one-off target and/or replaces its deadline targets (saved as manual targets) for + the tracker. An Album's target is never the sum of its Projects'. Requires rights to edit the + Album's targets. + operationId: setCohortTrackerAlbumTargets security: [{tokenAuth: []}] parameters: - $ref: '#/components/parameters/ResourceId' @@ -15431,7 +16093,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/FormulaTrackerAlbumTargets' + $ref: '#/components/schemas/CohortTrackerAlbumTargets' "401": $ref: '#/components/responses/Unauthorized' "403": @@ -15441,526 +16103,552 @@ paths: "422": $ref: '#/components/responses/UnprocessableEntity' - /contact_automations: + /formula_trackers: get: - tags: [Automations] - summary: List Contact Automations + tags: [Formula Trackers] + summary: List an Organisation's Formula Trackers description: | - The Contact Automations the user can see: those of Organisations where they are an editor or - observer, those on Projects they manage, and those they made. `active` false means paused. - operationId: listContactAutomations + The Formula Trackers of an Organisation (Charity). Visible to the Organisation's editors and + reporters, and to managers (editors) of its Projects. + operationId: listFormulaTrackers security: [{tokenAuth: []}] parameters: - - name: project_id - in: query - schema: - type: integer - description: Only the Contact Automations on this Project - - name: flag_id + - name: charity_id in: query + required: true schema: type: integer - description: | - Only the Contact Automations whose actions add this Flag to Contacts, as the "Automations that - add this flag automatically" column on Manage Flags counts them. A Flag of another Organisation - finds nothing. - example: 12 + description: The Organisation (Charity) ID - $ref: '#/components/parameters/Page' - $ref: '#/components/parameters/PerPage' - $ref: '#/components/parameters/LastSyncDatetime' responses: "200": - description: Paginated list of Contact Automations + description: Paginated list of Formula Trackers content: application/json: schema: - $ref: '#/components/schemas/PaginatedContactAutomations' + $ref: '#/components/schemas/PaginatedFormulaTrackers' "401": $ref: '#/components/responses/Unauthorized' + "403": + description: The user has no editor or reporter role in the Organisation + "404": + $ref: '#/components/responses/NotFound' post: - tags: [Automations] - summary: Create a Contact Automation + tags: [Formula Trackers] + summary: Create a Formula Tracker description: | - Creates a Contact Automation on a Project, the same as one made on the Contact Automations - page: when the Project's Contacts meet the `criteria`, the `actions` run, once per Contact until - that alert is resolved. - - `criteria` names one field: `field` (an `other_fields` key from the options, e.g. - `minutes_since_contact_enrolled`), `current_field_id` (a Contact or Survey field), - `relationship_category_id` or `event_state_id`. Then a `condition` from that field's - conditions and a `value` (minutes, for the "Amount of time" fields), `state_ids` (Ratio Set - states) or `text`. For `field: survey_verdict_is`, give `survey_id` and `verdict_ids`. + Creates a Formula Tracker (Create a metric > Formula Tracker): a metric worked out from the + Organisation's other trackers. `expression` is the formula as an ordered list of tokens, never + free text: - `actions` can be any of `send_survey`, `in_app_alert`, `change_status` (statuses on this - Project, or `removed`) and `flags`. Every id must be one that - `GET /contact_automations/options` offers; any other is refused with 422, naming it. + - `{kind: tracker, type, id}`: one of the Organisation's trackers that has a number. `type` is + `Change` (Activity or Engagement tracker), `Indicator` (Achievement or Numerical tracker; not a + Choice tracker), `CohortTracker`, `WorkflowTracker`, `FilteredMetric` (a filtered version) or + `FormulaTracker`. List them with `GET /formula_trackers/operands`. + - `{kind: operator, value}`: `+`, `-`, `*` or `/`. × and ÷ are worked out before + and −. + - `{kind: number, value}`, e.g. 100. + - `{kind: open}` and `{kind: close}`: brackets, worked out first. - `active` defaults to true; send false to save the automation paused, then check who it would - act on with `GET /contact_automations/{id}/matching_contacts` before resuming it. Requires an - editor of the Organisation or of the Project. - operationId: createContactAutomation + Refused (422) when the formula is empty, starts or ends with an operator, has two operators + or two values in a row, unmatched or empty brackets, uses another Organisation's tracker, or + uses itself (directly or through other Formula Trackers). + + Each timeframe's result is worked out from each tracker's result for the same Project or Album + and timeframe, then the formula: a Year to Date percentage is Year to Date numerator ÷ Year to + Date denominator. `result_kind` is `additive` only when the formula adds and subtracts trackers + that add up, with no numbers; otherwise `snapshot`. Dividing by 0 gives no result (null). + Requires an editor or reporter of the Organisation. + operationId: createFormulaTracker security: [{tokenAuth: []}] requestBody: required: true content: application/json: schema: - $ref: '#/components/schemas/ContactAutomationRequest' + $ref: '#/components/schemas/FormulaTrackerRequest' examples: - surveyOnEnrolment: - summary: Send a Survey an hour after a Contact is enrolled, saved paused + referralsCompleted: + summary: Referrals completed = External referrals + Internal referrals value: - project_id: 821 - active: false - criteria: - field: minutes_since_contact_enrolled - condition: greater_than_or_equal_to - value: 60 - actions: - send_survey: - survey_id: 5194 - via_email: true - email_message: "Please tell us how you are getting on." + formula_tracker: + charity_id: 913 + name: "Referrals completed" + expression: + - { kind: tracker, type: Change, id: 5120 } + - { kind: operator, value: "+" } + - { kind: tracker, type: WorkflowTracker, id: 41 } + percentageSupported: + summary: "% of children receiving support = Children supported ÷ Children enrolled × 100" + value: + formula_tracker: + charity_id: 913 + name: "% of children receiving support" + display_format: "percentage" + decimal_places: 1 + expression: + - { kind: tracker, type: Change, id: 5121 } + - { kind: operator, value: "/" } + - { kind: tracker, type: CohortTracker, id: 77 } + - { kind: operator, value: "*" } + - { kind: number, value: 100 } responses: "201": - description: Contact Automation created + description: Formula Tracker created content: application/json: schema: - $ref: '#/components/schemas/ContactAutomation' + $ref: '#/components/schemas/FormulaTrackerDetail' "401": $ref: '#/components/responses/Unauthorized' "403": - $ref: '#/components/responses/Forbidden' + description: The user can't create Formula Trackers for this Organisation "404": $ref: '#/components/responses/NotFound' "422": $ref: '#/components/responses/UnprocessableEntity' - /contact_automations/options: + /formula_trackers/operands: get: - tags: [Automations] - summary: What a new Contact Automation can use + tags: [Formula Trackers] + summary: List the trackers a formula can use description: | - For one Project: its criteria fields (Contact fields and Survey fields by `current_field_id`, - each with its `conditions` and, for a Ratio Set or scale Indicator, its `states`; - `other_fields` by key with a `value_unit`; `relationships`; `event_states`) and the choices for - its actions (`surveys` with their verdicts, `statuses`, `flags`, `colleagues`, - `in_app_alert_recipients`). Built from the same lists as the Contact Automation page. - operationId: getContactAutomationOptions + The Organisation's trackers that have a number, by name, with the `type` and `id` to send in a + tracker token: its Activity, Engagement, Achievement and Numerical trackers (owned by it or used + on its Projects), Cohort, Workflow and Formula Trackers, and filtered versions. Choice trackers + aren't listed. + operationId: listFormulaTrackerOperands security: [{tokenAuth: []}] parameters: - - name: project_id + - name: charity_id in: query required: true schema: type: integer + description: The Organisation (Charity) ID + - $ref: '#/components/parameters/Page' + - $ref: '#/components/parameters/PerPage' responses: "200": - description: The options + description: Paginated list of trackers content: application/json: schema: - type: object - properties: - project_id: - type: integer - criteria: - type: object - actions: - type: object + $ref: '#/components/schemas/PaginatedFormulaTrackerOperands' "401": $ref: '#/components/responses/Unauthorized' "403": - $ref: '#/components/responses/Forbidden' + description: The user can't create Formula Trackers for this Organisation "404": $ref: '#/components/responses/NotFound' - /contact_automations/{id}: - get: - tags: [Automations] - summary: Get a Contact Automation - operationId: getContactAutomation + /formula_trackers/preview: + post: + tags: [Formula Trackers] + summary: Preview a Formula Tracker + description: | + What a formula gives on one of the Organisation's Projects, before it is saved: the result for + the current Period (ending at the Project's next deadline, or today when it has none ahead), Year + to Date and All-time, each tracker's own result, and warnings worth checking (a tracker used + twice, a Numerical tracker added to a count, different units added together, dividing by a + tracker that could be 0). A formula with errors is refused (422) with `errors` and `warnings`. + Send `formula_tracker_id` when editing a tracker, so a formula that uses it is caught. + operationId: previewFormulaTracker security: [{tokenAuth: []}] - parameters: - - name: id - in: path - required: true - schema: - type: integer + requestBody: + required: true + content: + application/json: + schema: + type: object + required: [charity_id, project_id] + properties: + charity_id: + type: integer + project_id: + type: integer + formula_tracker_id: + type: integer + description: The Formula Tracker being edited, if any + formula_tracker: + $ref: '#/components/schemas/FormulaTrackerAttributes' + example: + charity_id: 913 + project_id: 4510 + formula_tracker: + expression: + - { kind: tracker, type: Change, id: 5120 } + - { kind: operator, value: "+" } + - { kind: tracker, type: WorkflowTracker, id: 41 } responses: "200": - description: The Contact Automation + description: The results content: application/json: schema: - $ref: '#/components/schemas/ContactAutomation' + $ref: '#/components/schemas/FormulaTrackerPreview' "401": $ref: '#/components/responses/Unauthorized' + "403": + description: The user can't create Formula Trackers for this Organisation "404": $ref: '#/components/responses/NotFound' + "422": + $ref: '#/components/responses/UnprocessableEntity' - /contact_automations/{id}/pause: - post: - tags: [Automations] - summary: Pause a Contact Automation - description: A paused Contact Automation acts on nobody until it is resumed. Requires an editor of the Organisation or of the Project. - operationId: pauseContactAutomation + /formula_trackers/{id}: + get: + tags: [Formula Trackers] + summary: Get a Formula Tracker + description: A Formula Tracker with where it is used and any warnings about its formula. + operationId: getFormulaTracker security: [{tokenAuth: []}] parameters: - - name: id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/ResourceId' responses: "200": - description: The paused Contact Automation + description: The Formula Tracker content: application/json: schema: - $ref: '#/components/schemas/ContactAutomation' + $ref: '#/components/schemas/FormulaTrackerDetail' "401": $ref: '#/components/responses/Unauthorized' - "403": - $ref: '#/components/responses/Forbidden' "404": $ref: '#/components/responses/NotFound' - /contact_automations/{id}/resume: - post: - tags: [Automations] - summary: Resume a Contact Automation - description: Resuming lets it act on every Contact it matches. Requires an editor of the Organisation or of the Project. - operationId: resumeContactAutomation + patch: + tags: [Formula Trackers] + summary: Update a Formula Tracker + description: | + Updates the fields sent; `expression` replaces the whole formula. Changes apply everywhere the + tracker is used. Requires an Organisation editor, or the reporter who created it. + operationId: updateFormulaTracker security: [{tokenAuth: []}] parameters: - - name: id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/ResourceId' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/FormulaTrackerRequest' + example: + formula_tracker: + decimal_places: 1 responses: "200": - description: The resumed Contact Automation + description: Formula Tracker updated content: application/json: schema: - $ref: '#/components/schemas/ContactAutomation' + $ref: '#/components/schemas/FormulaTrackerDetail' "401": $ref: '#/components/responses/Unauthorized' "403": - $ref: '#/components/responses/Forbidden' + description: The user can't edit this Formula Tracker "404": $ref: '#/components/responses/NotFound' + "422": + $ref: '#/components/responses/UnprocessableEntity' - /contact_automations/{id}/matching_contacts: - get: - tags: [Automations] - summary: Contacts a Contact Automation would act on now - description: | - The Contacts the automation would act on if it ran now, limited to those the user can see, the - same as the page's Test button. It leaves out Contacts the automation has already acted on and - not resolved. Works on a paused automation. - operationId: listContactAutomationMatchingContacts + delete: + tags: [Formula Trackers] + summary: Delete a Formula Tracker + description: Refused (422) while the tracker is used on any Project, Album or Scorecard Template. + operationId: deleteFormulaTracker security: [{tokenAuth: []}] parameters: - - name: id - in: path - required: true - schema: - type: integer - - $ref: '#/components/parameters/Page' - - $ref: '#/components/parameters/PerPage' + - $ref: '#/components/parameters/ResourceId' responses: - "200": - description: Paginated list of Contacts, each with id and name - content: - application/json: - schema: - $ref: '#/components/schemas/PaginationEnvelope' + "204": + description: Deleted "401": $ref: '#/components/responses/Unauthorized' + "403": + description: The user can't delete this Formula Tracker "404": $ref: '#/components/responses/NotFound' + "422": + $ref: '#/components/responses/UnprocessableEntity' - /project_automations: + /formula_trackers/{id}/projects/{project_id}: get: - tags: [Automations] - summary: List Project Automations - description: The Project Automations of Organisations where the user is an editor or observer, in priority order. - operationId: listProjectAutomations + tags: [Formula Trackers] + summary: Get a Formula Tracker's targets on a Project + description: The one-off target and deadline targets (the Project's Set Targets page). Requires rights to edit the Project's targets. + operationId: getFormulaTrackerProjectTargets security: [{tokenAuth: []}] parameters: - - name: charity_id - in: query - schema: - type: integer - description: Only this Organisation's - - $ref: '#/components/parameters/Page' - - $ref: '#/components/parameters/PerPage' - - $ref: '#/components/parameters/LastSyncDatetime' + - $ref: '#/components/parameters/ResourceId' + - $ref: '#/components/parameters/CohortTrackerProjectId' responses: "200": - description: Paginated list of Project Automations + description: The targets content: application/json: schema: - $ref: '#/components/schemas/PaginatedProjectAutomations' + $ref: '#/components/schemas/FormulaTrackerPlacement' "401": $ref: '#/components/responses/Unauthorized' + "403": + description: The user can't edit this Project's targets + "404": + $ref: '#/components/responses/NotFound' post: - tags: [Automations] - summary: Create a Project Automation + tags: [Formula Trackers] + summary: Add a Formula Tracker to a Project description: | - Creates a Project Automation, the same as one made on the Project Automations page: whenever a - Project matching its saved project filter is created or edited, its `settings` are copied onto - the Project. It goes last in priority. - - `settings` takes true or false for the setting names in the options, `default_story_privacy`, - and id lists for Contact Forms, Surveys, Event Formats, colleagues and Contact Automation - Templates. A setting that isn't sent takes the page's own default for a new automation (the - statuses, Events, Timesheets, Cases and the Survey Progress Board switched on; privacy "Only - organisation colleagues"). An unknown setting, or an id not in the options, is refused with 422. - `active` defaults to true. Requires an editor of the Organisation. - operationId: createProjectAutomation + Places the tracker in a column of the Project's Impact Scorecard (Edit Project Metrics), + optionally with a one-off target. The Project's Albums pick it up automatically. The tracker + and Project must belong to the same Organisation, and the user needs rights to edit the + Project's metrics. + operationId: addFormulaTrackerToProject security: [{tokenAuth: []}] + parameters: + - $ref: '#/components/parameters/ResourceId' + - $ref: '#/components/parameters/CohortTrackerProjectId' requestBody: required: true content: application/json: schema: - $ref: '#/components/schemas/ProjectAutomationRequest' - examples: - youthProjects: - summary: Cases and a baseline Survey for youth Projects - value: - charity_id: 324 - name: "Youth project set-up" - saved_filter_id: 2493 - settings: - is_creation_of_new_cases_enabled: true - default_story_privacy: only_project_colleagues - enrolled_state_baseline_survey_ids: [5194] + type: object + required: [column] + properties: + column: + type: string + enum: [activities, engagement, potential, behaviour, growth] + target: + type: integer + example: + column: engagement + target: 40 responses: "201": - description: Project Automation created + description: Placed content: application/json: schema: - $ref: '#/components/schemas/ProjectAutomation' + $ref: '#/components/schemas/FormulaTrackerPlacement' "401": $ref: '#/components/responses/Unauthorized' "403": - $ref: '#/components/responses/Forbidden' + description: The user can't edit this Project's metrics "404": $ref: '#/components/responses/NotFound' "422": $ref: '#/components/responses/UnprocessableEntity' - /project_automations/options: - get: - tags: [Automations] - summary: What a new Project Automation can use + patch: + tags: [Formula Trackers] + summary: Set a Formula Tracker's targets on a Project description: | - For one Organisation: `saved_filters` (the user's saved project filters and those colleagues - have shared), `contact_forms`, `surveys`, `event_formats`, `colleagues`, - `contact_automation_templates`, the `settings` names and `default_story_privacy_values`. - operationId: getProjectAutomationOptions + Sets the one-off target and/or replaces this tracker's deadline targets on the Project (Set + Targets). An additive tracker adds its targets up across deadlines; a snapshot uses each + deadline's target on its own. A percentage tracker's targets are whole percentages from 0 to + 100. `deadlines: []` clears the deadline targets. Requires rights to edit the Project's targets. + operationId: setFormulaTrackerProjectTargets security: [{tokenAuth: []}] parameters: - - name: charity_id - in: query - required: true - schema: - type: integer + - $ref: '#/components/parameters/ResourceId' + - $ref: '#/components/parameters/CohortTrackerProjectId' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/CohortTrackerTargetsRequest' + example: + target: 40 + deadlines: + - { date: "2026-06-30", number: 20 } responses: "200": - description: The options + description: Targets saved content: application/json: schema: - type: object + $ref: '#/components/schemas/FormulaTrackerPlacement' "401": $ref: '#/components/responses/Unauthorized' "403": - $ref: '#/components/responses/Forbidden' + description: The user can't edit this Project's targets "404": $ref: '#/components/responses/NotFound' + "422": + $ref: '#/components/responses/UnprocessableEntity' - /project_automations/{id}: - get: - tags: [Automations] - summary: Get a Project Automation - operationId: getProjectAutomation + delete: + tags: [Formula Trackers] + summary: Remove a Formula Tracker from a Project + operationId: removeFormulaTrackerFromProject security: [{tokenAuth: []}] parameters: - - name: id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/ResourceId' + - $ref: '#/components/parameters/CohortTrackerProjectId' responses: - "200": - description: The Project Automation - content: - application/json: - schema: - $ref: '#/components/schemas/ProjectAutomation' + "204": + description: Removed "401": $ref: '#/components/responses/Unauthorized' + "403": + description: The user can't edit this Project's metrics "404": $ref: '#/components/responses/NotFound' - /project_automations/{id}/pause: - post: - tags: [Automations] - summary: Pause a Project Automation - description: New and edited Projects skip a paused Project Automation. Requires an editor of the Organisation. - operationId: pauseProjectAutomation + /formula_trackers/{id}/albums/{bundle_id}: + get: + tags: [Formula Trackers] + summary: Get a Formula Tracker's targets on an Album + description: | + An Album inherits the Formula Trackers on its Projects. Returns the Album's one-off and + deadline targets for the tracker, and `album_target_type`: the Album's Set Targets page shows + Formula Tracker targets under manual targets. Requires rights to edit the Album's targets. + operationId: getFormulaTrackerAlbumTargets security: [{tokenAuth: []}] parameters: - - name: id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/ResourceId' + - $ref: '#/components/parameters/CohortTrackerAlbumId' responses: "200": - description: The paused Project Automation + description: The targets content: application/json: schema: - $ref: '#/components/schemas/ProjectAutomation' + $ref: '#/components/schemas/FormulaTrackerAlbumTargets' "401": $ref: '#/components/responses/Unauthorized' "403": - $ref: '#/components/responses/Forbidden' + description: The user can't edit this Album's targets "404": $ref: '#/components/responses/NotFound' - /project_automations/{id}/resume: - post: - tags: [Automations] - summary: Resume a Project Automation - operationId: resumeProjectAutomation + patch: + tags: [Formula Trackers] + summary: Set a Formula Tracker's targets on an Album + description: | + Sets the Album's one-off target and/or replaces its deadline targets (saved as manual targets) + for the tracker. An Album's result is worked out from the Album's own results, so its target is + never the sum of its Projects'. Requires rights to edit the Album's targets. + operationId: setFormulaTrackerAlbumTargets security: [{tokenAuth: []}] parameters: - - name: id - in: path - required: true - schema: - type: integer + - $ref: '#/components/parameters/ResourceId' + - $ref: '#/components/parameters/CohortTrackerAlbumId' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/CohortTrackerTargetsRequest' + example: + target: 120 + deadlines: + - { date: "2026-12-31", number: 100 } responses: "200": - description: The resumed Project Automation + description: Targets saved content: application/json: schema: - $ref: '#/components/schemas/ProjectAutomation' + $ref: '#/components/schemas/FormulaTrackerAlbumTargets' "401": $ref: '#/components/responses/Unauthorized' "403": - $ref: '#/components/responses/Forbidden' + description: The user can't edit this Album's targets "404": $ref: '#/components/responses/NotFound' + "422": + $ref: '#/components/responses/UnprocessableEntity' - /automation_templates: + /contact_automations: get: tags: [Automations] - summary: List Automation Templates - description: The Automation Templates of Organisations where the user is an editor or observer, each with the Contact Automation it copies. - operationId: listAutomationTemplates + summary: List Contact Automations + description: | + The Contact Automations the user can see: those of Organisations where they are an editor or + observer, those on Projects they manage, and those they made. `active` false means paused. + operationId: listContactAutomations security: [{tokenAuth: []}] parameters: - - name: charity_id + - name: project_id in: query schema: type: integer - - name: status + description: Only the Contact Automations on this Project + - name: flag_id in: query schema: - type: string - enum: [available, hide] + type: integer + description: | + Only the Contact Automations whose actions add this Flag to Contacts, as the "Automations that + add this flag automatically" column on Manage Flags counts them. A Flag of another Organisation + finds nothing. + example: 12 - $ref: '#/components/parameters/Page' - $ref: '#/components/parameters/PerPage' - $ref: '#/components/parameters/LastSyncDatetime' responses: "200": - description: Paginated list of Automation Templates - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedAutomationTemplates' - "401": - $ref: '#/components/responses/Unauthorized' - - /automation_templates/{id}: - get: - tags: [Automations] - summary: Get an Automation Template - operationId: getAutomationTemplate - security: [{tokenAuth: []}] - parameters: - - name: id - in: path - required: true - schema: - type: integer - responses: - "200": - description: The Automation Template + description: Paginated list of Contact Automations content: application/json: schema: - $ref: '#/components/schemas/AutomationTemplate' + $ref: '#/components/schemas/PaginatedContactAutomations' "401": $ref: '#/components/responses/Unauthorized' - "404": - $ref: '#/components/responses/NotFound' - /automation_templates/{id}/apply: post: tags: [Automations] - summary: Apply an Automation Template to a Project + summary: Create a Contact Automation description: | - Copies the template's Contact Automation onto a Project in the template's Organisation, the same - as "+ Add to Project" on the Automation Templates page. Refused with 422, naming what to add - first, if the Project hasn't got the template's Survey, or (for an Event criteria) Events switched - on and its Event Format; and if the template is already on that Project. `active` defaults to - true. Requires an editor of the Organisation or of the Project. - operationId: applyAutomationTemplate + Creates a Contact Automation on a Project, the same as one made on the Contact Automations + page: when the Project's Contacts meet the `criteria`, the `actions` run, once per Contact until + that alert is resolved. + + `criteria` names one field: `field` (an `other_fields` key from the options, e.g. + `minutes_since_contact_enrolled`), `current_field_id` (a Contact or Survey field), + `relationship_category_id` or `event_state_id`. Then a `condition` from that field's + conditions and a `value` (minutes, for the "Amount of time" fields), `state_ids` (Ratio Set + states) or `text`. For `field: survey_verdict_is`, give `survey_id` and `verdict_ids`. + + `actions` can be any of `send_survey`, `in_app_alert`, `change_status` (statuses on this + Project, or `removed`) and `flags`. Every id must be one that + `GET /contact_automations/options` offers; any other is refused with 422, naming it. + + `active` defaults to true; send false to save the automation paused, then check who it would + act on with `GET /contact_automations/{id}/matching_contacts` before resuming it. Requires an + editor of the Organisation or of the Project. + operationId: createContactAutomation security: [{tokenAuth: []}] - parameters: - - name: id - in: path - required: true - schema: - type: integer requestBody: required: true content: application/json: schema: - type: object - required: [project_id] - properties: - project_id: - type: integer - active: - type: boolean - default: true + $ref: '#/components/schemas/ContactAutomationRequest' examples: - paused: - summary: Add it to a Project, paused + surveyOnEnrolment: + summary: Send a Survey an hour after a Contact is enrolled, saved paused value: project_id: 821 active: false + criteria: + field: minutes_since_contact_enrolled + condition: greater_than_or_equal_to + value: 60 + actions: + send_survey: + survey_id: 5194 + via_email: true + email_message: "Please tell us how you are getting on." responses: "201": - description: The new Contact Automation on the Project + description: Contact Automation created content: application/json: schema: @@ -15974,1706 +16662,1792 @@ paths: "422": $ref: '#/components/responses/UnprocessableEntity' - /formula_trackers/{id}/projects/{project_id}/results: + /contact_automations/options: get: - tags: [Formula Trackers] - summary: Get a Formula Tracker's result on a Project + tags: [Automations] + summary: What a new Contact Automation can use description: | - A Formula Tracker's result on a Project's Results Canvas: what its card shows, and what its popup - opens. The tracker must be on the Project. - - Each timeframe is worked out from that timeframe's own tracker numbers, so a Year to Date - percentage is the Year to Date numerator ÷ the Year to Date denominator, never an average of the - periods. `number` is null, and `display_value` is "–", when a tracker the formula uses has no - result or it divides by 0 (the canvas says "Not enough data to work this out yet"). - `display_value` is the result as the canvas shows it, from the tracker's display format, decimal - places and unit label. - - `result_kind` `additive` (only + and − of trackers that add up) adds up across periods. - `snapshot` (× ÷ or a number) is read as of `as_of`: the window's last day, or today while that is - still to come. `target` is the deadline targets dated in the window, added up (for a snapshot, - the one on its last day), or else the one-off target, or null. + For one Project: its criteria fields (Contact fields and Survey fields by `current_field_id`, + each with its `conditions` and, for a Ratio Set or scale Indicator, its `states`; + `other_fields` by key with a `value_unit`; `relationships`; `event_states`) and the choices for + its actions (`surveys` with their verdicts, `statuses`, `flags`, `colleagues`, + `in_app_alert_recipients`). Built from the same lists as the Contact Automation page. + operationId: getContactAutomationOptions + security: [{tokenAuth: []}] + parameters: + - name: project_id + in: query + required: true + schema: + type: integer + responses: + "200": + description: The options + content: + application/json: + schema: + type: object + properties: + project_id: + type: integer + criteria: + type: object + actions: + type: object + "401": + $ref: '#/components/responses/Unauthorized' + "403": + $ref: '#/components/responses/Forbidden' + "404": + $ref: '#/components/responses/NotFound' - `trackers` lists each tracker the formula uses with its number for the window; `formula` writes - the formula out in words and `formula_with_values` with those numbers in place. + /contact_automations/{id}: + get: + tags: [Automations] + summary: Get a Contact Automation + operationId: getContactAutomation + security: [{tokenAuth: []}] + parameters: + - name: id + in: path + required: true + schema: + type: integer + responses: + "200": + description: The Contact Automation + content: + application/json: + schema: + $ref: '#/components/schemas/ContactAutomation' + "401": + $ref: '#/components/responses/Unauthorized' + "404": + $ref: '#/components/responses/NotFound' - When the formula only adds Workflow Trackers that count items (`itemised: true`, e.g. External - referrals + Internal referrals), `data` lists one page of the items counted, newest first. An item - the user may not see is counted in `hidden_count` for that page but never listed. Otherwise `data` - is empty and the counts are 0. Requires the same rights as viewing that Results Canvas. - operationId: getFormulaTrackerProjectResults + /contact_automations/{id}/pause: + post: + tags: [Automations] + summary: Pause a Contact Automation + description: A paused Contact Automation acts on nobody until it is resumed. Requires an editor of the Organisation or of the Project. + operationId: pauseContactAutomation security: [{tokenAuth: []}] parameters: - - $ref: '#/components/parameters/ResourceId' - - $ref: '#/components/parameters/CohortTrackerProjectId' - - $ref: '#/components/parameters/CohortTrackerTimeframe' - - $ref: '#/components/parameters/CohortTrackerAsOf' - - $ref: '#/components/parameters/Page' - - $ref: '#/components/parameters/PerPage' + - name: id + in: path + required: true + schema: + type: integer responses: "200": - description: The result and the trackers behind it + description: The paused Contact Automation content: application/json: schema: - $ref: '#/components/schemas/FormulaTrackerResult' - example: - formula_tracker_id: 12 - name: "% of children receiving support" - project_id: 34 - timeframe: year_to_date - starts_on: "2026-01-01" - ends_on: "2026-12-31" - result_kind: snapshot - as_of: "2026-10-13" - display_format: percentage - decimal_places: 1 - unit: percentage - number: 50 - display_value: "50.0%" - target: 60 - formula: "% of children receiving support = Children supported ÷ Children flagged × 100" - formula_with_values: "4 ÷ 8 × 100" - trackers: - - { type: Change, id: 81, name: Children supported, type_name: Engagement tracker, unit: count, number: 4 } - - { type: Change, id: 82, name: Children flagged, type_name: Engagement tracker, unit: count, number: 8 } - itemised: false - page: 1 - page_size: 0 - page_count: 0 - total_count: 0 - hidden_count: 0 - data: [] + $ref: '#/components/schemas/ContactAutomation' "401": $ref: '#/components/responses/Unauthorized' "403": - description: The user can't see this Project's Results Canvas + $ref: '#/components/responses/Forbidden' "404": $ref: '#/components/responses/NotFound' - "422": - $ref: '#/components/responses/UnprocessableEntity' - /formula_trackers/{id}/albums/{bundle_id}/results: - get: - tags: [Formula Trackers] - summary: Get a Formula Tracker's result on an Album - description: | - As for a Project, with each tracker the formula uses worked out on the Album as a whole (its open - Projects together) before the formula is applied, so an Album percentage is the Album's numerator - ÷ the Album's denominator, not the Projects' percentages added up. The tracker must be on one of - the Album's Projects. Requires rights to see the Album. - operationId: getFormulaTrackerAlbumResults + /contact_automations/{id}/resume: + post: + tags: [Automations] + summary: Resume a Contact Automation + description: Resuming lets it act on every Contact it matches. Requires an editor of the Organisation or of the Project. + operationId: resumeContactAutomation security: [{tokenAuth: []}] parameters: - - $ref: '#/components/parameters/ResourceId' - - $ref: '#/components/parameters/CohortTrackerAlbumId' - - $ref: '#/components/parameters/CohortTrackerTimeframe' - - $ref: '#/components/parameters/CohortTrackerAsOf' - - $ref: '#/components/parameters/Page' - - $ref: '#/components/parameters/PerPage' + - name: id + in: path + required: true + schema: + type: integer responses: "200": - description: The result and the trackers behind it + description: The resumed Contact Automation content: application/json: schema: - $ref: '#/components/schemas/FormulaTrackerResult' + $ref: '#/components/schemas/ContactAutomation' "401": $ref: '#/components/responses/Unauthorized' "403": - description: The user can't see this Album + $ref: '#/components/responses/Forbidden' "404": $ref: '#/components/responses/NotFound' - "422": - $ref: '#/components/responses/UnprocessableEntity' - /workflow_trackers: + /contact_automations/{id}/matching_contacts: get: - tags: [Workflow Trackers] - summary: List an Organisation's Workflow Trackers + tags: [Automations] + summary: Contacts a Contact Automation would act on now description: | - The Workflow Trackers of an Organisation (Charity). Visible to the Organisation's editors and - reporters, and to managers (editors) of its Projects. - operationId: listWorkflowTrackers + The Contacts the automation would act on if it ran now, limited to those the user can see, the + same as the page's Test button. It leaves out Contacts the automation has already acted on and + not resolved. Works on a paused automation. + operationId: listContactAutomationMatchingContacts security: [{tokenAuth: []}] parameters: - - name: charity_id - in: query + - name: id + in: path required: true schema: type: integer - description: The Organisation (Charity) ID - $ref: '#/components/parameters/Page' - $ref: '#/components/parameters/PerPage' - - $ref: '#/components/parameters/LastSyncDatetime' responses: "200": - description: Paginated list of Workflow Trackers + description: Paginated list of Contacts, each with id and name content: application/json: schema: - $ref: '#/components/schemas/PaginatedWorkflowTrackers' + $ref: '#/components/schemas/PaginationEnvelope' "401": $ref: '#/components/responses/Unauthorized' - "403": - description: The user has no editor or reporter role in the Organisation "404": $ref: '#/components/responses/NotFound' - post: - tags: [Workflow Trackers] - summary: Create a Workflow Tracker - description: | - Creates a Workflow Tracker (Create a metric > Workflow Tracker): a metric that counts records - Makerble's own features create, rather than Contacts tagged in updates. `source` says what it counts: - - - `signpostings`: Signpostings made from the Project (or an Album's Projects) it is placed on. - A signposting counts once whether it names the Organisation signposted to, the Person, or - both. Signpostings saved without a Project aren't counted on any Project or Album. - - `internal_referrals`: Contacts in the Project who are added to another of the Organisation's - Projects, dated by the Status in Projects history. Moving between states of the same Project - isn't a referral. `settings` choose which Projects count: `{destinations: any}`, - `{destinations: only, project_ids: [...]}` or `{destinations: except, project_ids: [...]}` - (the default, with none listed). - - `cases_created`: Cases (Cases App) created on the Project, or on any of an Album's Projects, - each Case counted once. - - `cases_closed`: each time one of those Cases is closed. A Case closed, reopened and closed - again counts twice, or once when counting each Contact once. - - `cases_open`: the Cases open at the end of each timeframe (or today, while that is still to - come). Always a snapshot. - - `time_spent`: hours logged in Timesheets on the Project, or any of an Album's Projects, each - entry once, to 1 decimal place. Task and Update Timesheets are dated by their Update (Story), - or by when their Task was done; Event Timesheets by when the Event started. Timesheets on draft - Updates aren't counted. `settings` choose `kinds` (any of `updates_and_tasks`, `event_staff`, - `event_guests`; default the first two) and, optionally, only the time of some colleagues: - `user_ids` and/or `roles` (`editor`: Organisation Admins and Project Managers, `reporter`: - Changemakers, `observer`: Observers). These don't narrow Event guests' time. Always counts - `items`; `unit` is `hours`. - - For the three Cases sources, `settings` can name one Case Form, `{case_form_id: ...}`, to count - only the Cases created with it; leave it out or send null for any Case Form. Confidential Cases - are counted, but only listed to people who can see them. - - `count_mode` is `items` (default: each signposting, referral, Case or closing; adds up across - periods, except for `cases_open`) or `contacts` (each Contact once; a snapshot). Requires an - editor or reporter of the Organisation. - operationId: createWorkflowTracker + /project_automations: + get: + tags: [Automations] + summary: List Project Automations + description: The Project Automations of Organisations where the user is an editor or observer, in priority order. + operationId: listProjectAutomations security: [{tokenAuth: []}] - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/WorkflowTrackerRequest' - examples: - internalReferrals: - summary: Internal referrals to any Project but two - value: - workflow_tracker: - charity_id: 913 - name: "Internal referrals" - source: "internal_referrals" - count_mode: "items" - settings: - destinations: "except" - project_ids: [4512, 4513] - casesOpen: - summary: Cases open, for one Case Form - value: - workflow_tracker: - charity_id: 913 - name: "Safeguarding cases open" - source: "cases_open" - count_mode: "items" - settings: - case_form_id: 2207 + parameters: + - name: charity_id + in: query + schema: + type: integer + description: Only this Organisation's + - $ref: '#/components/parameters/Page' + - $ref: '#/components/parameters/PerPage' + - $ref: '#/components/parameters/LastSyncDatetime' responses: - "201": - description: Workflow Tracker created + "200": + description: Paginated list of Project Automations content: application/json: schema: - $ref: '#/components/schemas/WorkflowTrackerDetail' + $ref: '#/components/schemas/PaginatedProjectAutomations' "401": $ref: '#/components/responses/Unauthorized' - "403": - description: The user can't create Workflow Trackers for this Organisation - "404": - $ref: '#/components/responses/NotFound' - "422": - $ref: '#/components/responses/UnprocessableEntity' - /workflow_trackers/preview: post: - tags: [Workflow Trackers] - summary: Preview a Workflow Tracker + tags: [Automations] + summary: Create a Project Automation description: | - What a Workflow Tracker with these settings gives on one of the Organisation's Projects, before - it is saved: the result for the current Period (ending at the Project's next deadline, or today - when it has none ahead), Year to Date and All-time, and the latest records counted. - operationId: previewWorkflowTracker + Creates a Project Automation, the same as one made on the Project Automations page: whenever a + Project matching its saved project filter is created or edited, its `settings` are copied onto + the Project. It goes last in priority. + + `settings` takes true or false for the setting names in the options, `default_story_privacy`, + and id lists for Contact Forms, Surveys, Event Formats, colleagues and Contact Automation + Templates. A setting that isn't sent takes the page's own default for a new automation (the + statuses, Events, Timesheets, Cases and the Survey Progress Board switched on; privacy "Only + organisation colleagues"). An unknown setting, or an id not in the options, is refused with 422. + `active` defaults to true. Requires an editor of the Organisation. + operationId: createProjectAutomation security: [{tokenAuth: []}] requestBody: required: true content: application/json: schema: - type: object - required: [charity_id, project_id] - properties: - charity_id: - type: integer - project_id: - type: integer - workflow_tracker: - $ref: '#/components/schemas/WorkflowTrackerAttributes' - example: - charity_id: 913 - project_id: 4510 - workflow_tracker: - source: "signpostings" - count_mode: "items" + $ref: '#/components/schemas/ProjectAutomationRequest' + examples: + youthProjects: + summary: Cases and a baseline Survey for youth Projects + value: + charity_id: 324 + name: "Youth project set-up" + saved_filter_id: 2493 + settings: + is_creation_of_new_cases_enabled: true + default_story_privacy: only_project_colleagues + enrolled_state_baseline_survey_ids: [5194] responses: - "200": - description: The results and the latest records + "201": + description: Project Automation created content: application/json: schema: - $ref: '#/components/schemas/WorkflowTrackerPreview' + $ref: '#/components/schemas/ProjectAutomation' "401": $ref: '#/components/responses/Unauthorized' "403": - description: The user can't create Workflow Trackers for this Organisation + $ref: '#/components/responses/Forbidden' "404": $ref: '#/components/responses/NotFound' "422": $ref: '#/components/responses/UnprocessableEntity' - /workflow_trackers/{id}: + /project_automations/options: get: - tags: [Workflow Trackers] - summary: Get a Workflow Tracker - description: A Workflow Tracker with where it is used. - operationId: getWorkflowTracker + tags: [Automations] + summary: What a new Project Automation can use + description: | + For one Organisation: `saved_filters` (the user's saved project filters and those colleagues + have shared), `contact_forms`, `surveys`, `event_formats`, `colleagues`, + `contact_automation_templates`, the `settings` names and `default_story_privacy_values`. + operationId: getProjectAutomationOptions security: [{tokenAuth: []}] parameters: - - $ref: '#/components/parameters/ResourceId' + - name: charity_id + in: query + required: true + schema: + type: integer responses: "200": - description: The Workflow Tracker + description: The options content: application/json: schema: - $ref: '#/components/schemas/WorkflowTrackerDetail' + type: object "401": $ref: '#/components/responses/Unauthorized' + "403": + $ref: '#/components/responses/Forbidden' "404": $ref: '#/components/responses/NotFound' - patch: - tags: [Workflow Trackers] - summary: Update a Workflow Tracker - description: | - Updates the fields sent. Changes apply everywhere the tracker is used. Requires an - Organisation editor, or the reporter who created it. - operationId: updateWorkflowTracker + /project_automations/{id}: + get: + tags: [Automations] + summary: Get a Project Automation + operationId: getProjectAutomation security: [{tokenAuth: []}] parameters: - - $ref: '#/components/parameters/ResourceId' - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/WorkflowTrackerRequest' - example: - workflow_tracker: - count_mode: "contacts" + - name: id + in: path + required: true + schema: + type: integer responses: "200": - description: Workflow Tracker updated + description: The Project Automation content: application/json: schema: - $ref: '#/components/schemas/WorkflowTrackerDetail' + $ref: '#/components/schemas/ProjectAutomation' "401": $ref: '#/components/responses/Unauthorized' - "403": - description: The user can't edit this Workflow Tracker "404": $ref: '#/components/responses/NotFound' - "422": - $ref: '#/components/responses/UnprocessableEntity' - delete: - tags: [Workflow Trackers] - summary: Delete a Workflow Tracker - description: Refused (422) while the tracker is used on any Project, Album or Scorecard Template. - operationId: deleteWorkflowTracker + /project_automations/{id}/pause: + post: + tags: [Automations] + summary: Pause a Project Automation + description: New and edited Projects skip a paused Project Automation. Requires an editor of the Organisation. + operationId: pauseProjectAutomation security: [{tokenAuth: []}] parameters: - - $ref: '#/components/parameters/ResourceId' + - name: id + in: path + required: true + schema: + type: integer responses: - "204": - description: Deleted + "200": + description: The paused Project Automation + content: + application/json: + schema: + $ref: '#/components/schemas/ProjectAutomation' "401": $ref: '#/components/responses/Unauthorized' "403": - description: The user can't delete this Workflow Tracker + $ref: '#/components/responses/Forbidden' "404": $ref: '#/components/responses/NotFound' - "422": - $ref: '#/components/responses/UnprocessableEntity' - /workflow_trackers/{id}/projects/{project_id}: - get: - tags: [Workflow Trackers] - summary: Get a Workflow Tracker's targets on a Project - description: The one-off target and deadline targets (the Project's Set Targets page). Requires rights to edit the Project's targets. - operationId: getWorkflowTrackerProjectTargets + /project_automations/{id}/resume: + post: + tags: [Automations] + summary: Resume a Project Automation + operationId: resumeProjectAutomation security: [{tokenAuth: []}] parameters: - - $ref: '#/components/parameters/ResourceId' - - $ref: '#/components/parameters/CohortTrackerProjectId' + - name: id + in: path + required: true + schema: + type: integer responses: "200": - description: The targets + description: The resumed Project Automation content: application/json: schema: - $ref: '#/components/schemas/WorkflowTrackerPlacement' + $ref: '#/components/schemas/ProjectAutomation' "401": $ref: '#/components/responses/Unauthorized' "403": - description: The user can't edit this Project's targets + $ref: '#/components/responses/Forbidden' "404": $ref: '#/components/responses/NotFound' - post: - tags: [Workflow Trackers] - summary: Add a Workflow Tracker to a Project - description: | - Places the tracker in a column of the Project's Impact Scorecard (Edit Project Metrics), - optionally with a one-off target. The Project's Albums pick it up automatically. The tracker - and Project must belong to the same Organisation, and the user needs rights to edit the - Project's metrics. - operationId: addWorkflowTrackerToProject + /automation_templates: + get: + tags: [Automations] + summary: List Automation Templates + description: The Automation Templates of Organisations where the user is an editor or observer, each with the Contact Automation it copies. + operationId: listAutomationTemplates security: [{tokenAuth: []}] parameters: - - $ref: '#/components/parameters/ResourceId' - - $ref: '#/components/parameters/CohortTrackerProjectId' + - name: charity_id + in: query + schema: + type: integer + - name: status + in: query + schema: + type: string + enum: [available, hide] + - $ref: '#/components/parameters/Page' + - $ref: '#/components/parameters/PerPage' + - $ref: '#/components/parameters/LastSyncDatetime' + responses: + "200": + description: Paginated list of Automation Templates + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedAutomationTemplates' + "401": + $ref: '#/components/responses/Unauthorized' + + /automation_templates/{id}: + get: + tags: [Automations] + summary: Get an Automation Template + operationId: getAutomationTemplate + security: [{tokenAuth: []}] + parameters: + - name: id + in: path + required: true + schema: + type: integer + responses: + "200": + description: The Automation Template + content: + application/json: + schema: + $ref: '#/components/schemas/AutomationTemplate' + "401": + $ref: '#/components/responses/Unauthorized' + "404": + $ref: '#/components/responses/NotFound' + + /automation_templates/{id}/apply: + post: + tags: [Automations] + summary: Apply an Automation Template to a Project + description: | + Copies the template's Contact Automation onto a Project in the template's Organisation, the same + as "+ Add to Project" on the Automation Templates page. Refused with 422, naming what to add + first, if the Project hasn't got the template's Survey, or (for an Event criteria) Events switched + on and its Event Format; and if the template is already on that Project. `active` defaults to + true. Requires an editor of the Organisation or of the Project. + operationId: applyAutomationTemplate + security: [{tokenAuth: []}] + parameters: + - name: id + in: path + required: true + schema: + type: integer requestBody: required: true content: application/json: schema: type: object - required: [column] + required: [project_id] properties: - column: - type: string - enum: [activities, engagement, potential, behaviour, growth] - target: + project_id: type: integer - example: - column: activities - target: 40 + active: + type: boolean + default: true + examples: + paused: + summary: Add it to a Project, paused + value: + project_id: 821 + active: false responses: "201": - description: Placed + description: The new Contact Automation on the Project content: application/json: schema: - $ref: '#/components/schemas/WorkflowTrackerPlacement' + $ref: '#/components/schemas/ContactAutomation' "401": $ref: '#/components/responses/Unauthorized' "403": - description: The user can't edit this Project's metrics + $ref: '#/components/responses/Forbidden' "404": $ref: '#/components/responses/NotFound' "422": $ref: '#/components/responses/UnprocessableEntity' - patch: - tags: [Workflow Trackers] - summary: Set a Workflow Tracker's targets on a Project + /formula_trackers/{id}/projects/{project_id}/results: + get: + tags: [Formula Trackers] + summary: Get a Formula Tracker's result on a Project description: | - Sets the one-off target and/or replaces this tracker's deadline targets on the Project (Set - Targets). A tracker counting items adds its targets up across deadlines; one counting each - Contact once uses each deadline's target on its own. `deadlines: []` clears the deadline - targets. Requires rights to edit the Project's targets. - operationId: setWorkflowTrackerProjectTargets + A Formula Tracker's result on a Project's Results Canvas: what its card shows, and what its popup + opens. The tracker must be on the Project. + + Each timeframe is worked out from that timeframe's own tracker numbers, so a Year to Date + percentage is the Year to Date numerator ÷ the Year to Date denominator, never an average of the + periods. `number` is null, and `display_value` is "–", when a tracker the formula uses has no + result or it divides by 0 (the canvas says "Not enough data to work this out yet"). + `display_value` is the result as the canvas shows it, from the tracker's display format, decimal + places and unit label. + + `result_kind` `additive` (only + and − of trackers that add up) adds up across periods. + `snapshot` (× ÷ or a number) is read as of `as_of`: the window's last day, or today while that is + still to come. `target` is the deadline targets dated in the window, added up (for a snapshot, + the one on its last day), or else the one-off target, or null. + + `trackers` lists each tracker the formula uses with its number for the window; `formula` writes + the formula out in words and `formula_with_values` with those numbers in place. + + When the formula only adds Workflow Trackers that count items (`itemised: true`, e.g. External + referrals + Internal referrals), `data` lists one page of the items counted, newest first. An item + the user may not see is counted in `hidden_count` for that page but never listed. Otherwise `data` + is empty and the counts are 0. Requires the same rights as viewing that Results Canvas. + operationId: getFormulaTrackerProjectResults security: [{tokenAuth: []}] parameters: - $ref: '#/components/parameters/ResourceId' - $ref: '#/components/parameters/CohortTrackerProjectId' - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/CohortTrackerTargetsRequest' - example: - target: 40 - deadlines: - - { date: "2026-06-30", number: 20 } + - $ref: '#/components/parameters/CohortTrackerTimeframe' + - $ref: '#/components/parameters/CohortTrackerAsOf' + - $ref: '#/components/parameters/Page' + - $ref: '#/components/parameters/PerPage' responses: "200": - description: Targets saved + description: The result and the trackers behind it content: application/json: schema: - $ref: '#/components/schemas/WorkflowTrackerPlacement' + $ref: '#/components/schemas/FormulaTrackerResult' + example: + formula_tracker_id: 12 + name: "% of children receiving support" + project_id: 34 + timeframe: year_to_date + starts_on: "2026-01-01" + ends_on: "2026-12-31" + result_kind: snapshot + as_of: "2026-10-13" + display_format: percentage + decimal_places: 1 + unit: percentage + number: 50 + display_value: "50.0%" + target: 60 + formula: "% of children receiving support = Children supported ÷ Children flagged × 100" + formula_with_values: "4 ÷ 8 × 100" + trackers: + - { type: Change, id: 81, name: Children supported, type_name: Engagement tracker, unit: count, number: 4 } + - { type: Change, id: 82, name: Children flagged, type_name: Engagement tracker, unit: count, number: 8 } + itemised: false + page: 1 + page_size: 0 + page_count: 0 + total_count: 0 + hidden_count: 0 + data: [] "401": $ref: '#/components/responses/Unauthorized' "403": - description: The user can't edit this Project's targets + description: The user can't see this Project's Results Canvas "404": $ref: '#/components/responses/NotFound' "422": $ref: '#/components/responses/UnprocessableEntity' - delete: - tags: [Workflow Trackers] - summary: Remove a Workflow Tracker from a Project - operationId: removeWorkflowTrackerFromProject + /formula_trackers/{id}/albums/{bundle_id}/results: + get: + tags: [Formula Trackers] + summary: Get a Formula Tracker's result on an Album + description: | + As for a Project, with each tracker the formula uses worked out on the Album as a whole (its open + Projects together) before the formula is applied, so an Album percentage is the Album's numerator + ÷ the Album's denominator, not the Projects' percentages added up. The tracker must be on one of + the Album's Projects. Requires rights to see the Album. + operationId: getFormulaTrackerAlbumResults security: [{tokenAuth: []}] parameters: - $ref: '#/components/parameters/ResourceId' - - $ref: '#/components/parameters/CohortTrackerProjectId' + - $ref: '#/components/parameters/CohortTrackerAlbumId' + - $ref: '#/components/parameters/CohortTrackerTimeframe' + - $ref: '#/components/parameters/CohortTrackerAsOf' + - $ref: '#/components/parameters/Page' + - $ref: '#/components/parameters/PerPage' responses: - "204": - description: Removed + "200": + description: The result and the trackers behind it + content: + application/json: + schema: + $ref: '#/components/schemas/FormulaTrackerResult' "401": $ref: '#/components/responses/Unauthorized' "403": - description: The user can't edit this Project's metrics + description: The user can't see this Album "404": $ref: '#/components/responses/NotFound' + "422": + $ref: '#/components/responses/UnprocessableEntity' - /workflow_trackers/{id}/albums/{bundle_id}: + /workflow_trackers: get: tags: [Workflow Trackers] - summary: Get a Workflow Tracker's targets on an Album + summary: List an Organisation's Workflow Trackers description: | - An Album inherits the Workflow Trackers on its Projects. Returns the Album's one-off and - deadline targets for the tracker, and `album_target_type`: the Album's Set Targets page shows - Workflow Tracker targets under manual targets. Requires rights to edit the Album's targets. - operationId: getWorkflowTrackerAlbumTargets + The Workflow Trackers of an Organisation (Charity). Visible to the Organisation's editors and + reporters, and to managers (editors) of its Projects. + operationId: listWorkflowTrackers security: [{tokenAuth: []}] parameters: - - $ref: '#/components/parameters/ResourceId' - - $ref: '#/components/parameters/CohortTrackerAlbumId' + - name: charity_id + in: query + required: true + schema: + type: integer + description: The Organisation (Charity) ID + - $ref: '#/components/parameters/Page' + - $ref: '#/components/parameters/PerPage' + - $ref: '#/components/parameters/LastSyncDatetime' responses: "200": - description: The targets + description: Paginated list of Workflow Trackers content: application/json: schema: - $ref: '#/components/schemas/WorkflowTrackerAlbumTargets' + $ref: '#/components/schemas/PaginatedWorkflowTrackers' "401": $ref: '#/components/responses/Unauthorized' "403": - description: The user can't edit this Album's targets + description: The user has no editor or reporter role in the Organisation "404": $ref: '#/components/responses/NotFound' - patch: + post: tags: [Workflow Trackers] - summary: Set a Workflow Tracker's targets on an Album + summary: Create a Workflow Tracker description: | - Sets the Album's one-off target and/or replaces its deadline targets (saved as manual targets) - for the tracker. An Album counts each record once across its Projects, so its target is never - the sum of its Projects'. Requires rights to edit the Album's targets. - operationId: setWorkflowTrackerAlbumTargets - security: [{tokenAuth: []}] - parameters: - - $ref: '#/components/parameters/ResourceId' - - $ref: '#/components/parameters/CohortTrackerAlbumId' + Creates a Workflow Tracker (Create a metric > Workflow Tracker): a metric that counts records + Makerble's own features create, rather than Contacts tagged in updates. `source` says what it counts: + + - `signpostings`: Signpostings made from the Project (or an Album's Projects) it is placed on. + A signposting counts once whether it names the Organisation signposted to, the Person, or + both. Signpostings saved without a Project aren't counted on any Project or Album. + - `internal_referrals`: Contacts in the Project who are added to another of the Organisation's + Projects, dated by the Status in Projects history. Moving between states of the same Project + isn't a referral. `settings` choose which Projects count: `{destinations: any}`, + `{destinations: only, project_ids: [...]}` or `{destinations: except, project_ids: [...]}` + (the default, with none listed). + - `cases_created`: Cases (Cases App) created on the Project, or on any of an Album's Projects, + each Case counted once. + - `cases_closed`: each time one of those Cases is closed. A Case closed, reopened and closed + again counts twice, or once when counting each Contact once. + - `cases_open`: the Cases open at the end of each timeframe (or today, while that is still to + come). Always a snapshot. + - `time_spent`: hours logged in Timesheets on the Project, or any of an Album's Projects, each + entry once, to 1 decimal place. Task and Update Timesheets are dated by their Update (Story), + or by when their Task was done; Event Timesheets by when the Event started. Timesheets on draft + Updates aren't counted. `settings` choose `kinds` (any of `updates_and_tasks`, `event_staff`, + `event_guests`; default the first two) and, optionally, only the time of some colleagues: + `user_ids` and/or `roles` (`editor`: Organisation Admins and Project Managers, `reporter`: + Changemakers, `observer`: Observers). These don't narrow Event guests' time. Always counts + `items`; `unit` is `hours`. + + For the three Cases sources, `settings` can name one Case Form, `{case_form_id: ...}`, to count + only the Cases created with it; leave it out or send null for any Case Form. Confidential Cases + are counted, but only listed to people who can see them. + + `count_mode` is `items` (default: each signposting, referral, Case or closing; adds up across + periods, except for `cases_open`) or `contacts` (each Contact once; a snapshot). Requires an + editor or reporter of the Organisation. + operationId: createWorkflowTracker + security: [{tokenAuth: []}] requestBody: required: true content: application/json: schema: - $ref: '#/components/schemas/CohortTrackerTargetsRequest' - example: - target: 120 - deadlines: - - { date: "2026-12-31", number: 100 } + $ref: '#/components/schemas/WorkflowTrackerRequest' + examples: + internalReferrals: + summary: Internal referrals to any Project but two + value: + workflow_tracker: + charity_id: 913 + name: "Internal referrals" + source: "internal_referrals" + count_mode: "items" + settings: + destinations: "except" + project_ids: [4512, 4513] + casesOpen: + summary: Cases open, for one Case Form + value: + workflow_tracker: + charity_id: 913 + name: "Safeguarding cases open" + source: "cases_open" + count_mode: "items" + settings: + case_form_id: 2207 responses: - "200": - description: Targets saved + "201": + description: Workflow Tracker created content: application/json: schema: - $ref: '#/components/schemas/WorkflowTrackerAlbumTargets' + $ref: '#/components/schemas/WorkflowTrackerDetail' "401": $ref: '#/components/responses/Unauthorized' "403": - description: The user can't edit this Album's targets + description: The user can't create Workflow Trackers for this Organisation "404": $ref: '#/components/responses/NotFound' "422": $ref: '#/components/responses/UnprocessableEntity' - /workflow_trackers/{id}/projects/{project_id}/results: - get: + /workflow_trackers/preview: + post: tags: [Workflow Trackers] - summary: Get a Workflow Tracker's result on a Project + summary: Preview a Workflow Tracker description: | - A Workflow Tracker's result on a Project's Results Canvas, with the items behind it: what the - Workflow Tracker card shows, and the list its popup opens. The tracker must be on the Project. - - `result_kind` `additive` (counting each signposting or referral) adds up across periods. - `snapshot` (counting each Contact once) is worked out for the window on its own and read as of - `as_of`: the window's last day, or today while that is still to come. `target` is the deadline - targets dated in the window, added up (for a snapshot, the one on its last day), or else the - one-off target, or null. - - `data` lists one page of the items counted, newest first: the Contact, `detail` (who they were - signposted to, or the Project they were referred to), `project_id` (a referral's destination) and - when it happened. For `time_spent`, `number` is hours to 1 decimal place and each item is a - Timesheet entry: whose time it is (`user_id`, `user_name`; or the Contact for an Event guest's), - its `hours`, and the Update, Task or Event it was logged on, which the user must be able to see - for it to be listed. `total_count` counts every item, whatever the count mode. An item the user may - not see (a Contact they can't read, or a referral to a Project they can't see) is counted in - `hidden_count` for that page but never listed. Requires the same rights as viewing that Results - Canvas. - operationId: getWorkflowTrackerProjectResults + What a Workflow Tracker with these settings gives on one of the Organisation's Projects, before + it is saved: the result for the current Period (ending at the Project's next deadline, or today + when it has none ahead), Year to Date and All-time, and the latest records counted. + operationId: previewWorkflowTracker security: [{tokenAuth: []}] - parameters: - - $ref: '#/components/parameters/ResourceId' - - $ref: '#/components/parameters/CohortTrackerProjectId' - - $ref: '#/components/parameters/CohortTrackerTimeframe' - - $ref: '#/components/parameters/CohortTrackerAsOf' - - $ref: '#/components/parameters/Page' - - $ref: '#/components/parameters/PerPage' + requestBody: + required: true + content: + application/json: + schema: + type: object + required: [charity_id, project_id] + properties: + charity_id: + type: integer + project_id: + type: integer + workflow_tracker: + $ref: '#/components/schemas/WorkflowTrackerAttributes' + example: + charity_id: 913 + project_id: 4510 + workflow_tracker: + source: "signpostings" + count_mode: "items" responses: "200": - description: The result and the items behind it + description: The results and the latest records content: application/json: schema: - $ref: '#/components/schemas/WorkflowTrackerResult' - example: - workflow_tracker_id: 7 - name: Signpostings made - project_id: 34 - timeframe: period - starts_on: "2026-07-01" - ends_on: "2026-12-31" - result_kind: additive - as_of: null - number: 12 - target: 20 - page: 1 - page_size: 9 - page_count: 2 - total_count: 12 - hidden_count: 1 - data: - - { contact_id: 501, contact_name: Thandi Mokoena, detail: "Mfuleni Clinic · Nurse Dlamini", project_id: null, happened_at: "2026-09-01T09:00:00Z" } + $ref: '#/components/schemas/WorkflowTrackerPreview' "401": $ref: '#/components/responses/Unauthorized' "403": - description: The user can't see this Project's Results Canvas + description: The user can't create Workflow Trackers for this Organisation "404": $ref: '#/components/responses/NotFound' "422": $ref: '#/components/responses/UnprocessableEntity' - /workflow_trackers/{id}/albums/{bundle_id}/results: + /workflow_trackers/{id}: get: tags: [Workflow Trackers] - summary: Get a Workflow Tracker's result on an Album - description: | - As for a Project, across the Album's open Projects: an item, or in `contacts` mode a Contact, - counts once however many of its Projects it relates to, so the result is never the sum of the - Projects'. The tracker must be on one of the Album's Projects. Requires rights to see the Album. - operationId: getWorkflowTrackerAlbumResults + summary: Get a Workflow Tracker + description: A Workflow Tracker with where it is used. + operationId: getWorkflowTracker security: [{tokenAuth: []}] parameters: - $ref: '#/components/parameters/ResourceId' - - $ref: '#/components/parameters/CohortTrackerAlbumId' - - $ref: '#/components/parameters/CohortTrackerTimeframe' - - $ref: '#/components/parameters/CohortTrackerAsOf' - - $ref: '#/components/parameters/Page' - - $ref: '#/components/parameters/PerPage' responses: "200": - description: The result and the items behind it + description: The Workflow Tracker content: application/json: schema: - $ref: '#/components/schemas/WorkflowTrackerResult' + $ref: '#/components/schemas/WorkflowTrackerDetail' "401": $ref: '#/components/responses/Unauthorized' - "403": - description: The user can't see this Album "404": $ref: '#/components/responses/NotFound' - "422": - $ref: '#/components/responses/UnprocessableEntity' - /cohort_trackers/{id}/projects/{project_id}/results: - get: - tags: [Cohort Trackers] - summary: Get a Cohort Tracker's result on a Project + patch: + tags: [Workflow Trackers] + summary: Update a Workflow Tracker description: | - A Cohort Tracker's result on a Project's Results Canvas, with the Contacts behind it. Only data saved - in the Project counts. The tracker must be on the Project. - - The result is the number of distinct Contacts who meet the tracker's membership setting and all - its criteria, counting only stories, events and survey responses saved in scope and dated in the - window. Results are worked out afresh for each window, so a Year to Date result is not the sum - of the period results. `target` is the tracker's deadline target on the window's last day, or - else its one-off target; targets are never summed across deadlines. - - `data` lists the Contacts in the cohort alphabetically, with `qualifying_value` (named by - `qualifying_value_label`, e.g. an attendance rate as a percentage) where the criteria have one. - A Contact the user may not read is listed as `{restricted: true}` with no details, so the - list always adds up to `count`. Requires the same rights as viewing that Results Canvas. - - A percentage tracker also returns `denominator_count` and `percentage`, as the canvas shows - "84% Children attending 75%+" with "42 of 50 contacts with enough data". The cohort is always - within the denominator. `percentage` is a whole number, or null when `denominator_count` is 0 - (the canvas shows "–"). `cohort=not_in` lists the rest of the denominator. - operationId: getCohortTrackerProjectResults + Updates the fields sent. Changes apply everywhere the tracker is used. Requires an + Organisation editor, or the reporter who created it. + operationId: updateWorkflowTracker security: [{tokenAuth: []}] parameters: - $ref: '#/components/parameters/ResourceId' - - $ref: '#/components/parameters/CohortTrackerProjectId' - - $ref: '#/components/parameters/CohortTrackerTimeframe' - - $ref: '#/components/parameters/CohortTrackerAsOf' - - $ref: '#/components/parameters/CohortTrackerCohort' - - $ref: '#/components/parameters/Page' - - $ref: '#/components/parameters/PerPage' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/WorkflowTrackerRequest' + example: + workflow_tracker: + count_mode: "contacts" responses: "200": - description: The result and the Contacts behind it + description: Workflow Tracker updated content: application/json: schema: - $ref: '#/components/schemas/CohortTrackerResult' - example: - cohort_tracker_id: 12 - name: Children attending 75%+ - project_id: 34 - timeframe: year_to_date - starts_on: "2026-04-01" - ends_on: "2026-06-30" - count: 42 - eligible_count: 50 - result_type: percentage - denominator: enough_data - denominator_count: 50 - percentage: 84 - target: { number: 75, date: "2026-06-30" } - qualifying_value_label: Attendance rate - cohort: in - page: 1 - page_size: 2 - page_count: 21 - total_count: 42 - data: - - { restricted: false, id: 101, name: Aisha Dlamini, qualifying_value: 82.5 } - - { restricted: true } + $ref: '#/components/schemas/WorkflowTrackerDetail' "401": $ref: '#/components/responses/Unauthorized' "403": - description: The user can't see this Results Canvas + description: The user can't edit this Workflow Tracker + "404": + $ref: '#/components/responses/NotFound' + "422": + $ref: '#/components/responses/UnprocessableEntity' - /projects/{project_id}/filtered_metrics: - parameters: - - $ref: '#/components/parameters/FilteredMetricProjectId' - get: - tags: [Filtered Metrics] - summary: List a Project's filtered versions of metrics - description: | - The filtered versions on a Project's Results Canvas. Visible to the Project's or its - Organisation's managers (editors), changemakers (reporters) and analysts (observers): the - same people who can see the Results Canvas. - operationId: listProjectFilteredMetrics + delete: + tags: [Workflow Trackers] + summary: Delete a Workflow Tracker + description: Refused (422) while the tracker is used on any Project, Album or Scorecard Template. + operationId: deleteWorkflowTracker security: [{tokenAuth: []}] parameters: - - $ref: '#/components/parameters/Page' - - $ref: '#/components/parameters/PerPage' - - $ref: '#/components/parameters/LastSyncDatetime' + - $ref: '#/components/parameters/ResourceId' + responses: + "204": + description: Deleted + "401": + $ref: '#/components/responses/Unauthorized' + "403": + description: The user can't delete this Workflow Tracker + "404": + $ref: '#/components/responses/NotFound' + "422": + $ref: '#/components/responses/UnprocessableEntity' + + /workflow_trackers/{id}/projects/{project_id}: + get: + tags: [Workflow Trackers] + summary: Get a Workflow Tracker's targets on a Project + description: The one-off target and deadline targets (the Project's Set Targets page). Requires rights to edit the Project's targets. + operationId: getWorkflowTrackerProjectTargets + security: [{tokenAuth: []}] + parameters: + - $ref: '#/components/parameters/ResourceId' + - $ref: '#/components/parameters/CohortTrackerProjectId' responses: "200": - description: Paginated list of filtered versions + description: The targets content: application/json: schema: - $ref: '#/components/schemas/PaginatedFilteredMetrics' + $ref: '#/components/schemas/WorkflowTrackerPlacement' "401": $ref: '#/components/responses/Unauthorized' "403": - description: The user can't see the Project's Results Canvas + description: The user can't edit this Project's targets "404": $ref: '#/components/responses/NotFound' + post: - tags: [Filtered Metrics] - summary: Add a filtered version of a metric to a Project + tags: [Workflow Trackers] + summary: Add a Workflow Tracker to a Project description: | - Edit Project Metrics > Add filtered version. The metric being filtered must already be on the - Project: a Change in one of its columns, or an Indicator under one of its Outcomes. A Change's - filtered version goes directly after it in its column (or at the end of `column` if given); an - Indicator's sits under the same Outcome, directly after it. Albums show every filtered version on - their Projects. - - `response_criteria` filters the responses (stories) the metric was recorded in, as a Progress - Board's "Filter responses/stories by" does: `story_category_ids` (Surveys), `wave_ids` - (Intervals), `date_range` ("dd/mm/yyyy - dd/mm/yyyy", Date Happened, either end optional), - `label_ids` and `author_ids`. Project and Album keys are refused: the responses always come from - the Project or Album it is on. - - `contact_criteria` filters the Contacts tagged in them, in the Contact Filters format (see - `POST /cohort_trackers/preview`). Age (`age_from` / `age_to`) is worked out at the date of each - response; other Bio fields use the Contact's current value; the other sections are judged at the - end of each reporting period. Either may be sent as a JSON string. Requires the right to edit the + Places the tracker in a column of the Project's Impact Scorecard (Edit Project Metrics), + optionally with a one-off target. The Project's Albums pick it up automatically. The tracker + and Project must belong to the same Organisation, and the user needs rights to edit the Project's metrics. - operationId: createFilteredMetric + operationId: addWorkflowTrackerToProject security: [{tokenAuth: []}] + parameters: + - $ref: '#/components/parameters/ResourceId' + - $ref: '#/components/parameters/CohortTrackerProjectId' requestBody: required: true content: application/json: schema: - $ref: '#/components/schemas/FilteredMetricRequest' + type: object + required: [column] + properties: + column: + type: string + enum: [activities, engagement, potential, behaviour, growth] + target: + type: integer example: - filtered_metric: - parent_type: "Change" - parent_id: 4021 - display_name: "Session attendances — Female, under 21" - response_criteria: - wave_ids: ["12"] - contact_criteria: - sub_ratio_ids: ["881"] - age_to: {year: "20", month: "11", day: "30"} + column: activities + target: 40 responses: "201": - description: Filtered version added to the Project + description: Placed content: application/json: schema: - $ref: '#/components/schemas/FilteredMetric' + $ref: '#/components/schemas/WorkflowTrackerPlacement' "401": $ref: '#/components/responses/Unauthorized' "403": - description: The user can't edit the Project's metrics + description: The user can't edit this Project's metrics "404": $ref: '#/components/responses/NotFound' "422": $ref: '#/components/responses/UnprocessableEntity' - /projects/{project_id}/filtered_metrics/preview: - parameters: - - $ref: '#/components/parameters/FilteredMetricProjectId' - post: - tags: [Filtered Metrics] - summary: Preview a filtered version + patch: + tags: [Workflow Trackers] + summary: Set a Workflow Tracker's targets on a Project description: | - The Add filtered version dialog's "N of M session attendances in this project currently match", - before it is added: `count` is how many of the metric's tagged responses on the Project pass - the filters to date (a Numerical tracker's total), `total` how many there are with no filters. - Takes the same body as adding one; `display_name` is optional. - operationId: previewFilteredMetric + Sets the one-off target and/or replaces this tracker's deadline targets on the Project (Set + Targets). A tracker counting items adds its targets up across deadlines; one counting each + Contact once uses each deadline's target on its own. `deadlines: []` clears the deadline + targets. Requires rights to edit the Project's targets. + operationId: setWorkflowTrackerProjectTargets security: [{tokenAuth: []}] + parameters: + - $ref: '#/components/parameters/ResourceId' + - $ref: '#/components/parameters/CohortTrackerProjectId' requestBody: required: true content: application/json: schema: - $ref: '#/components/schemas/FilteredMetricRequest' + $ref: '#/components/schemas/CohortTrackerTargetsRequest' example: - filtered_metric: - parent_type: "Change" - parent_id: 4021 - contact_criteria: - sub_ratio_ids: ["881"] + target: 40 + deadlines: + - { date: "2026-06-30", number: 20 } responses: "200": - description: The count and the unfiltered total + description: Targets saved content: application/json: schema: - type: object - properties: - count: - type: number - total: - type: number - example: - count: 262 - total: 1540 + $ref: '#/components/schemas/WorkflowTrackerPlacement' "401": $ref: '#/components/responses/Unauthorized' "403": - description: The user can't edit the Project's metrics + description: The user can't edit this Project's targets "404": $ref: '#/components/responses/NotFound' "422": $ref: '#/components/responses/UnprocessableEntity' - /cohort_trackers/{id}/albums/{bundle_id}/results: - get: - tags: [Cohort Trackers] - summary: Get a Cohort Tracker's result on an Album - description: | - A Cohort Tracker's result on an Album's Results Canvas, with the Contacts behind it. The Album's - Projects are counted together and each Contact once, so the result is never the sum of the - Projects' results. The tracker must be on one of the Album's Projects. - - The result is the number of distinct Contacts who meet the tracker's membership setting and all - its criteria, counting only stories, events and survey responses saved in scope and dated in the - window. Results are worked out afresh for each window, so a Year to Date result is not the sum - of the period results. `target` is the tracker's deadline target on the window's last day, or - else its one-off target; targets are never summed across deadlines. - - `data` lists the Contacts in the cohort alphabetically, with `qualifying_value` (named by - `qualifying_value_label`, e.g. an attendance rate as a percentage) where the criteria have one. - A Contact the user may not read is listed as `{restricted: true}` with no details, so the - list always adds up to `count`. Requires the same rights as viewing that Results Canvas. - - A percentage tracker also returns `denominator_count` and `percentage`, as the canvas shows - "84% Children attending 75%+" with "42 of 50 contacts with enough data". The cohort is always - within the denominator. `percentage` is a whole number, or null when `denominator_count` is 0 - (the canvas shows "–"). `cohort=not_in` lists the rest of the denominator. - operationId: getCohortTrackerAlbumResults + delete: + tags: [Workflow Trackers] + summary: Remove a Workflow Tracker from a Project + operationId: removeWorkflowTrackerFromProject security: [{tokenAuth: []}] parameters: - $ref: '#/components/parameters/ResourceId' - - $ref: '#/components/parameters/CohortTrackerAlbumId' - - $ref: '#/components/parameters/CohortTrackerTimeframe' - - $ref: '#/components/parameters/CohortTrackerAsOf' - - $ref: '#/components/parameters/CohortTrackerCohort' - - $ref: '#/components/parameters/Page' - - $ref: '#/components/parameters/PerPage' + - $ref: '#/components/parameters/CohortTrackerProjectId' responses: - "200": - description: The result and the Contacts behind it - content: - application/json: - schema: - $ref: '#/components/schemas/CohortTrackerResult' - example: - cohort_tracker_id: 12 - name: Children attending 75%+ - album_id: 34 - timeframe: year_to_date - starts_on: "2026-04-01" - ends_on: "2026-06-30" - count: 42 - eligible_count: 50 - result_type: percentage - denominator: enough_data - denominator_count: 50 - percentage: 84 - target: { number: 75, date: "2026-06-30" } - qualifying_value_label: Attendance rate - cohort: in - page: 1 - page_size: 2 - page_count: 21 - total_count: 42 - data: - - { restricted: false, id: 101, name: Aisha Dlamini, qualifying_value: 82.5 } - - { restricted: true } + "204": + description: Removed "401": $ref: '#/components/responses/Unauthorized' "403": - description: The user can't see this Results Canvas + description: The user can't edit this Project's metrics + "404": + $ref: '#/components/responses/NotFound' - /projects/{project_id}/filtered_metrics/{id}: - parameters: - - $ref: '#/components/parameters/FilteredMetricProjectId' - - $ref: '#/components/parameters/FilteredMetricId' + /workflow_trackers/{id}/albums/{bundle_id}: get: - tags: [Filtered Metrics] - summary: Get a filtered version on a Project - operationId: getProjectFilteredMetric + tags: [Workflow Trackers] + summary: Get a Workflow Tracker's targets on an Album + description: | + An Album inherits the Workflow Trackers on its Projects. Returns the Album's one-off and + deadline targets for the tracker, and `album_target_type`: the Album's Set Targets page shows + Workflow Tracker targets under manual targets. Requires rights to edit the Album's targets. + operationId: getWorkflowTrackerAlbumTargets security: [{tokenAuth: []}] + parameters: + - $ref: '#/components/parameters/ResourceId' + - $ref: '#/components/parameters/CohortTrackerAlbumId' responses: "200": - description: The filtered version + description: The targets content: application/json: schema: - $ref: '#/components/schemas/FilteredMetric' + $ref: '#/components/schemas/WorkflowTrackerAlbumTargets' "401": $ref: '#/components/responses/Unauthorized' "403": - description: The user can't see the Project's Results Canvas + description: The user can't edit this Album's targets "404": $ref: '#/components/responses/NotFound' + patch: - tags: [Filtered Metrics] - summary: Update a filtered version + tags: [Workflow Trackers] + summary: Set a Workflow Tracker's targets on an Album description: | - Renames it or replaces its filters: `response_criteria` and `contact_criteria`, when sent, - replace the stored ones (`{}` clears them). The metric it filters and its placement can't be - changed. The change applies wherever it is used. Requires the right to edit the Project's metrics. - operationId: updateFilteredMetric + Sets the Album's one-off target and/or replaces its deadline targets (saved as manual targets) + for the tracker. An Album counts each record once across its Projects, so its target is never + the sum of its Projects'. Requires rights to edit the Album's targets. + operationId: setWorkflowTrackerAlbumTargets security: [{tokenAuth: []}] + parameters: + - $ref: '#/components/parameters/ResourceId' + - $ref: '#/components/parameters/CohortTrackerAlbumId' requestBody: required: true content: application/json: schema: - $ref: '#/components/schemas/FilteredMetricRequest' + $ref: '#/components/schemas/CohortTrackerTargetsRequest' example: - filtered_metric: - display_name: "Session attendances — Female" - contact_criteria: - sub_ratio_ids: ["881"] + target: 120 + deadlines: + - { date: "2026-12-31", number: 100 } responses: "200": - description: Filtered version updated + description: Targets saved content: application/json: schema: - $ref: '#/components/schemas/FilteredMetric' + $ref: '#/components/schemas/WorkflowTrackerAlbumTargets' "401": $ref: '#/components/responses/Unauthorized' "403": - description: The user can't edit the Project's metrics + description: The user can't edit this Album's targets "404": $ref: '#/components/responses/NotFound' "422": $ref: '#/components/responses/UnprocessableEntity' - delete: - tags: [Filtered Metrics] - summary: Remove a filtered version from a Project + + /workflow_trackers/{id}/projects/{project_id}/results: + get: + tags: [Workflow Trackers] + summary: Get a Workflow Tracker's result on a Project description: | - Removes it from the Project and its Albums. It is deleted once it is on no other Project or - Scorecard Template. Requires the right to edit the Project's metrics. - operationId: removeFilteredMetric + A Workflow Tracker's result on a Project's Results Canvas, with the items behind it: what the + Workflow Tracker card shows, and the list its popup opens. The tracker must be on the Project. + + `result_kind` `additive` (counting each signposting or referral) adds up across periods. + `snapshot` (counting each Contact once) is worked out for the window on its own and read as of + `as_of`: the window's last day, or today while that is still to come. `target` is the deadline + targets dated in the window, added up (for a snapshot, the one on its last day), or else the + one-off target, or null. + + `data` lists one page of the items counted, newest first: the Contact, `detail` (who they were + signposted to, or the Project they were referred to), `project_id` (a referral's destination) and + when it happened. For `time_spent`, `number` is hours to 1 decimal place and each item is a + Timesheet entry: whose time it is (`user_id`, `user_name`; or the Contact for an Event guest's), + its `hours`, and the Update, Task or Event it was logged on, which the user must be able to see + for it to be listed. `total_count` counts every item, whatever the count mode. An item the user may + not see (a Contact they can't read, or a referral to a Project they can't see) is counted in + `hidden_count` for that page but never listed. Requires the same rights as viewing that Results + Canvas. + operationId: getWorkflowTrackerProjectResults security: [{tokenAuth: []}] + parameters: + - $ref: '#/components/parameters/ResourceId' + - $ref: '#/components/parameters/CohortTrackerProjectId' + - $ref: '#/components/parameters/CohortTrackerTimeframe' + - $ref: '#/components/parameters/CohortTrackerAsOf' + - $ref: '#/components/parameters/Page' + - $ref: '#/components/parameters/PerPage' responses: - "204": - description: Removed + "200": + description: The result and the items behind it + content: + application/json: + schema: + $ref: '#/components/schemas/WorkflowTrackerResult' + example: + workflow_tracker_id: 7 + name: Signpostings made + project_id: 34 + timeframe: period + starts_on: "2026-07-01" + ends_on: "2026-12-31" + result_kind: additive + as_of: null + number: 12 + target: 20 + page: 1 + page_size: 9 + page_count: 2 + total_count: 12 + hidden_count: 1 + data: + - { contact_id: 501, contact_name: Thandi Mokoena, detail: "Mfuleni Clinic · Nurse Dlamini", project_id: null, happened_at: "2026-09-01T09:00:00Z" } "401": $ref: '#/components/responses/Unauthorized' "403": - description: The user can't edit the Project's metrics + description: The user can't see this Project's Results Canvas "404": $ref: '#/components/responses/NotFound' "422": $ref: '#/components/responses/UnprocessableEntity' - /projects/{project_id}/filtered_metrics/{id}/results: - parameters: - - $ref: '#/components/parameters/FilteredMetricProjectId' - - $ref: '#/components/parameters/FilteredMetricId' + /workflow_trackers/{id}/albums/{bundle_id}/results: get: - tags: [Filtered Metrics] - summary: Get a filtered version's result on a Project + tags: [Workflow Trackers] + summary: Get a Workflow Tracker's result on an Album description: | - The filtered result the Results Canvas shows, for one timeframe ending at `as_of`. Counts only - the responses the user may read, as the canvas does. - operationId: getProjectFilteredMetricResults + As for a Project, across the Album's open Projects: an item, or in `contacts` mode a Contact, + counts once however many of its Projects it relates to, so the result is never the sum of the + Projects'. The tracker must be on one of the Album's Projects. Requires rights to see the Album. + operationId: getWorkflowTrackerAlbumResults security: [{tokenAuth: []}] parameters: - - $ref: '#/components/parameters/FilteredMetricTimeframe' - - $ref: '#/components/parameters/FilteredMetricAsOf' + - $ref: '#/components/parameters/ResourceId' + - $ref: '#/components/parameters/CohortTrackerAlbumId' + - $ref: '#/components/parameters/CohortTrackerTimeframe' + - $ref: '#/components/parameters/CohortTrackerAsOf' + - $ref: '#/components/parameters/Page' + - $ref: '#/components/parameters/PerPage' responses: "200": - description: The result + description: The result and the items behind it content: application/json: schema: - $ref: '#/components/schemas/FilteredMetricResult' + $ref: '#/components/schemas/WorkflowTrackerResult' "401": $ref: '#/components/responses/Unauthorized' "403": - description: The user can't see the Project's Results Canvas + description: The user can't see this Album "404": $ref: '#/components/responses/NotFound' "422": $ref: '#/components/responses/UnprocessableEntity' - /albums/{bundle_id}/filtered_metrics: - parameters: - - $ref: '#/components/parameters/FilteredMetricBundleId' + /cohort_trackers/{id}/projects/{project_id}/results: get: - tags: [Filtered Metrics] - summary: List an Album's filtered versions of metrics - description: Every filtered version on any of the Album's Projects. Visible to anyone who can see the Album. - operationId: listAlbumFilteredMetrics + tags: [Cohort Trackers] + summary: Get a Cohort Tracker's result on a Project + description: | + A Cohort Tracker's result on a Project's Results Canvas, with the Contacts behind it. Only data saved + in the Project counts. The tracker must be on the Project. + + The result is the number of distinct Contacts who meet the tracker's membership setting and all + its criteria, counting only stories, events and survey responses saved in scope and dated in the + window. Results are worked out afresh for each window, so a Year to Date result is not the sum + of the period results. `target` is the tracker's deadline target on the window's last day, or + else its one-off target; targets are never summed across deadlines. + + `data` lists the Contacts in the cohort alphabetically, with `qualifying_value` (named by + `qualifying_value_label`, e.g. an attendance rate as a percentage) where the criteria have one. + A Contact the user may not read is listed as `{restricted: true}` with no details, so the + list always adds up to `count`. Requires the same rights as viewing that Results Canvas. + + A percentage tracker also returns `denominator_count` and `percentage`, as the canvas shows + "84% Children attending 75%+" with "42 of 50 contacts with enough data". The cohort is always + within the denominator. `percentage` is a whole number, or null when `denominator_count` is 0 + (the canvas shows "–"). `cohort=not_in` lists the rest of the denominator. + operationId: getCohortTrackerProjectResults security: [{tokenAuth: []}] parameters: + - $ref: '#/components/parameters/ResourceId' + - $ref: '#/components/parameters/CohortTrackerProjectId' + - $ref: '#/components/parameters/CohortTrackerTimeframe' + - $ref: '#/components/parameters/CohortTrackerAsOf' + - $ref: '#/components/parameters/CohortTrackerCohort' - $ref: '#/components/parameters/Page' - $ref: '#/components/parameters/PerPage' - - $ref: '#/components/parameters/LastSyncDatetime' responses: "200": - description: Paginated list of filtered versions + description: The result and the Contacts behind it content: application/json: schema: - $ref: '#/components/schemas/PaginatedFilteredMetrics' + $ref: '#/components/schemas/CohortTrackerResult' + example: + cohort_tracker_id: 12 + name: Children attending 75%+ + project_id: 34 + timeframe: year_to_date + starts_on: "2026-04-01" + ends_on: "2026-06-30" + count: 42 + eligible_count: 50 + result_type: percentage + denominator: enough_data + denominator_count: 50 + percentage: 84 + target: { number: 75, date: "2026-06-30" } + qualifying_value_label: Attendance rate + cohort: in + page: 1 + page_size: 2 + page_count: 21 + total_count: 42 + data: + - { restricted: false, id: 101, name: Aisha Dlamini, qualifying_value: 82.5 } + - { restricted: true } "401": $ref: '#/components/responses/Unauthorized' "403": - description: The user can't see the Album - "404": - $ref: '#/components/responses/NotFound' + description: The user can't see this Results Canvas - /albums/{bundle_id}/filtered_metrics/{id}: + /projects/{project_id}/filtered_metrics: parameters: - - $ref: '#/components/parameters/FilteredMetricBundleId' - - $ref: '#/components/parameters/FilteredMetricId' + - $ref: '#/components/parameters/FilteredMetricProjectId' get: tags: [Filtered Metrics] - summary: Get a filtered version on an Album - operationId: getAlbumFilteredMetric + summary: List a Project's filtered versions of metrics + description: | + The filtered versions on a Project's Results Canvas. Visible to the Project's or its + Organisation's managers (editors), changemakers (reporters) and analysts (observers): the + same people who can see the Results Canvas. + operationId: listProjectFilteredMetrics security: [{tokenAuth: []}] + parameters: + - $ref: '#/components/parameters/Page' + - $ref: '#/components/parameters/PerPage' + - $ref: '#/components/parameters/LastSyncDatetime' responses: "200": - description: The filtered version + description: Paginated list of filtered versions content: application/json: schema: - $ref: '#/components/schemas/FilteredMetric' + $ref: '#/components/schemas/PaginatedFilteredMetrics' "401": $ref: '#/components/responses/Unauthorized' "403": - description: The user can't see the Album + description: The user can't see the Project's Results Canvas "404": $ref: '#/components/responses/NotFound' - - /albums/{bundle_id}/filtered_metrics/{id}/results: - parameters: - - $ref: '#/components/parameters/FilteredMetricBundleId' - - $ref: '#/components/parameters/FilteredMetricId' - get: + post: tags: [Filtered Metrics] - summary: Get a filtered version's result on an Album - description: The filtered result for the Album's open Projects together, as its Results Canvas shows it. - operationId: getAlbumFilteredMetricResults + summary: Add a filtered version of a metric to a Project + description: | + Edit Project Metrics > Add filtered version. The metric being filtered must already be on the + Project: a Change in one of its columns, or an Indicator under one of its Outcomes. A Change's + filtered version goes directly after it in its column (or at the end of `column` if given); an + Indicator's sits under the same Outcome, directly after it. Albums show every filtered version on + their Projects. + + `response_criteria` filters the responses (stories) the metric was recorded in, as a Progress + Board's "Filter responses/stories by" does: `story_category_ids` (Surveys), `wave_ids` + (Intervals), `date_range` ("dd/mm/yyyy - dd/mm/yyyy", Date Happened, either end optional), + `label_ids` and `author_ids`. Project and Album keys are refused: the responses always come from + the Project or Album it is on. + + `contact_criteria` filters the Contacts tagged in them, in the Contact Filters format (see + `POST /cohort_trackers/preview`). Age (`age_from` / `age_to`) is worked out at the date of each + response; other Bio fields use the Contact's current value; the other sections are judged at the + end of each reporting period. Either may be sent as a JSON string. Requires the right to edit the + Project's metrics. + operationId: createFilteredMetric security: [{tokenAuth: []}] - parameters: - - $ref: '#/components/parameters/FilteredMetricTimeframe' - - $ref: '#/components/parameters/FilteredMetricAsOf' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/FilteredMetricRequest' + example: + filtered_metric: + parent_type: "Change" + parent_id: 4021 + display_name: "Session attendances — Female, under 21" + response_criteria: + wave_ids: ["12"] + contact_criteria: + sub_ratio_ids: ["881"] + age_to: {year: "20", month: "11", day: "30"} responses: - "200": - description: The result + "201": + description: Filtered version added to the Project content: application/json: schema: - $ref: '#/components/schemas/FilteredMetricResult' + $ref: '#/components/schemas/FilteredMetric' "401": $ref: '#/components/responses/Unauthorized' "403": - description: The user can't see the Album + description: The user can't edit the Project's metrics "404": $ref: '#/components/responses/NotFound' "422": $ref: '#/components/responses/UnprocessableEntity' - /media_items: - get: - tags: [Media Gallery] - summary: List Media Gallery files + /projects/{project_id}/filtered_metrics/preview: + parameters: + - $ref: '#/components/parameters/FilteredMetricProjectId' + post: + tags: [Filtered Metrics] + summary: Preview a filtered version description: | - Lists every photo, video, audio file and document attached to Stories and to Contacts' bios in one organisation — the files shown on the **Media Gallery** page (Impact → Media Gallery). - - Only files from Stories and Contacts the user is already allowed to view are returned, so two users can get different results for the same organisation. Filters combine with AND. - - `kind_counts` gives the number of files of each kind for the same filters, ignoring `kind` — the counts on the File type buttons. - operationId: listMediaItems - security: [{tokenAuth: []}, {oauth2: [api]}] - parameters: - - name: charity_id - in: query - required: true - schema: - type: integer - description: Organisation ID - - name: kind - in: query - schema: - type: string - enum: [photo, video, audio, document] - description: File type - - name: search - in: query - schema: - type: string - description: Matches the start of words in the file name, Story title, Contact name and caption - - name: source[] - in: query - schema: - type: array - items: - type: string - enum: [stories, contacts] - style: form - explode: true - description: Story files, Contact bio files, or both (default both) - - name: sort - in: query - schema: - type: string - enum: [newest, oldest] - default: newest - description: By upload date - - name: story_filters - in: query - style: deepObject - explode: true - schema: - type: object - additionalProperties: true - example: { project_ids: [19], story_category_ids: [327] } - description: | - Timeline (Story) Filters, as on the homepage. Keys (arrays of ids unless noted): `project_ids`, `story_category_ids` (Surveys), `bundle_ids` (Albums), `beneficiary_ids` (Contacts tagged in the Story), `label_ids`, `outcome_ids`, `change_ids` (Engagement), `indicator_ids`, `user_ids` (Authors), `charity_ids`, and `created_at_from` (Date Happened range, `YYYY/MM/DD - YYYY/MM/DD`). - - Story files must match them. For Contact bio files, `project_ids` matches the Contact's Project memberships, and any other key means the Contact must appear in at least one matching Story. - - name: contact_filters - in: query - style: deepObject - explode: true - schema: - type: object - additionalProperties: true - example: { group_ids: [4], beneficiary_types: [1] } - description: | - Contact Filters, as on Manage Contacts. Common keys (arrays of ids): `project_ids`, `group_ids`, `beneficiary_types` (Contact types: 1 Person, 2 Object, 3 Organisation, 4 Animal), `beneficiary_state_ids`, `created_by_ids`, `bundle_ids`. - - Contact bio files must match them, and Story files must involve at least one matching Contact. - - $ref: '#/components/parameters/Page' - - $ref: '#/components/parameters/PerPage' - - $ref: '#/components/parameters/LastSyncDatetime' + The Add filtered version dialog's "N of M session attendances in this project currently match", + before it is added: `count` is how many of the metric's tagged responses on the Project pass + the filters to date (a Numerical tracker's total), `total` how many there are with no filters. + Takes the same body as adding one; `display_name` is optional. + operationId: previewFilteredMetric + security: [{tokenAuth: []}] + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/FilteredMetricRequest' + example: + filtered_metric: + parent_type: "Change" + parent_id: 4021 + contact_criteria: + sub_ratio_ids: ["881"] responses: "200": - description: Paginated list of Media Gallery files + description: The count and the unfiltered total content: application/json: schema: - $ref: '#/components/schemas/PaginatedMediaItems' + type: object + properties: + count: + type: number + total: + type: number example: - page: 1 - page_size: 1 - page_count: 1 - total_count: 1 - kind_counts: { all: 1, photo: 1, video: 0, audio: 0, document: 0 } - data: - - id: 512 - kind: photo - file_name: harvest_day.jpg - content_type: image/jpeg - file_size: 248310 - caption: Volunteers at the allotment - source_type: story - source_id: 90211 - source_title: Harvest day at the allotment - project_id: 19 - project_name: Growing Together - uploaded_by_id: 6207 - uploaded_at: "2026-09-12T10:14:00Z" - updated_at: "2026-09-12T10:15:02Z" - thumbnail_url: https://makerble.s3.amazonaws.com/medias/files/000/000/512/thumbnail/harvest_day.jpg + count: 262 + total: 1540 "401": $ref: '#/components/responses/Unauthorized' "403": - description: The user is not a member of that organisation - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - example: - error: forbidden + description: The user can't edit the Project's metrics "404": $ref: '#/components/responses/NotFound' "422": $ref: '#/components/responses/UnprocessableEntity' - /media_items/{id}: + /cohort_trackers/{id}/albums/{bundle_id}/results: get: - tags: [Media Gallery] - summary: Get one Media Gallery file, with a download link + tags: [Cohort Trackers] + summary: Get a Cohort Tracker's result on an Album description: | - Returns one file from the **Media Gallery**, as shown in its preview panel, with a signed `download_url` that downloads the file. + A Cohort Tracker's result on an Album's Results Canvas, with the Contacts behind it. The Album's + Projects are counted together and each Contact once, so the result is never the sum of the + Projects' results. The tracker must be on one of the Album's Projects. - Permissions are checked again on every request. The user must still be able to view the Story or Contact the file belongs to. + The result is the number of distinct Contacts who meet the tracker's membership setting and all + its criteria, counting only stories, events and survey responses saved in scope and dated in the + window. Results are worked out afresh for each window, so a Year to Date result is not the sum + of the period results. `target` is the tracker's deadline target on the window's last day, or + else its one-off target; targets are never summed across deadlines. - The link expires after `download_url_expires_in` seconds, so request the file again for a fresh link rather than storing it. - operationId: getMediaItem + `data` lists the Contacts in the cohort alphabetically, with `qualifying_value` (named by + `qualifying_value_label`, e.g. an attendance rate as a percentage) where the criteria have one. + A Contact the user may not read is listed as `{restricted: true}` with no details, so the + list always adds up to `count`. Requires the same rights as viewing that Results Canvas. + + A percentage tracker also returns `denominator_count` and `percentage`, as the canvas shows + "84% Children attending 75%+" with "42 of 50 contacts with enough data". The cohort is always + within the denominator. `percentage` is a whole number, or null when `denominator_count` is 0 + (the canvas shows "–"). `cohort=not_in` lists the rest of the denominator. + operationId: getCohortTrackerAlbumResults security: [{tokenAuth: []}] parameters: - $ref: '#/components/parameters/ResourceId' + - $ref: '#/components/parameters/CohortTrackerAlbumId' + - $ref: '#/components/parameters/CohortTrackerTimeframe' + - $ref: '#/components/parameters/CohortTrackerAsOf' + - $ref: '#/components/parameters/CohortTrackerCohort' + - $ref: '#/components/parameters/Page' + - $ref: '#/components/parameters/PerPage' responses: "200": - description: The file, its field name and a short-lived download link + description: The result and the Contacts behind it content: application/json: schema: - $ref: '#/components/schemas/MediaItemDetail' + $ref: '#/components/schemas/CohortTrackerResult' example: - id: 512 - kind: document - file_name: consent_form.pdf - content_type: application/pdf - file_size: 84211 - caption: null - source_type: contact - source_id: 30144 - source_title: Jordan T. - project_id: null - project_name: null - uploaded_by_id: 6207 - uploaded_at: "2026-09-12T10:14:00Z" - updated_at: "2026-09-12T10:15:02Z" - thumbnail_url: null - field_name: Consent form (file field) - download_url: https://files.example.com/medias/files/000/000/512/original/consent_form.pdf?X-Amz-Expires=300&X-Amz-Signature=... - download_url_expires_in: 300 + cohort_tracker_id: 12 + name: Children attending 75%+ + album_id: 34 + timeframe: year_to_date + starts_on: "2026-04-01" + ends_on: "2026-06-30" + count: 42 + eligible_count: 50 + result_type: percentage + denominator: enough_data + denominator_count: 50 + percentage: 84 + target: { number: 75, date: "2026-06-30" } + qualifying_value_label: Attendance rate + cohort: in + page: 1 + page_size: 2 + page_count: 21 + total_count: 42 + data: + - { restricted: false, id: 101, name: Aisha Dlamini, qualifying_value: 82.5 } + - { restricted: true } "401": $ref: '#/components/responses/Unauthorized' "403": - description: The file exists, but the user can't view its Story or Contact - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - example: - error: forbidden - "404": - $ref: '#/components/responses/NotFound' + description: The user can't see this Results Canvas - /organisations/{organisation_id}/seats: + /projects/{project_id}/filtered_metrics/{id}: parameters: - - $ref: '#/components/parameters/OrganisationId' + - $ref: '#/components/parameters/FilteredMetricProjectId' + - $ref: '#/components/parameters/FilteredMetricId' get: - tags: [Seats] - summary: List an Organisation's seats per colleague - description: | - The Organisation's (Charity's) current Contracts, with seats bought and used per Billing Role - (Organiser, Practitioner, Helper) on Role-based Pricing or in total on Flat Pricing, and a page - of colleagues. Each colleague has the seat they hold on each Contract, the lowest seat their - roles allow, and a status: `covered`, `no_seat` (a role that needs a seat but no seat), - `seat_too_low` (a seat below what their roles need) or `no_seat_needed` (they still hold a - seat but no longer have a role that needs one). - - This is the Seats per Colleague page under Our Account › Seats. Organisation Admins and - Makerble staff can read it. Nobody loses access because of their seat. - operationId: listSeats + tags: [Filtered Metrics] + summary: Get a filtered version on a Project + operationId: getProjectFilteredMetric security: [{tokenAuth: []}] - parameters: - - $ref: '#/components/parameters/Page' - - $ref: '#/components/parameters/PerPage' responses: "200": - description: The Contracts and a page of colleagues + description: The filtered version content: application/json: schema: - $ref: '#/components/schemas/PaginatedSeats' + $ref: '#/components/schemas/FilteredMetric' "401": $ref: '#/components/responses/Unauthorized' + "403": + description: The user can't see the Project's Results Canvas "404": $ref: '#/components/responses/NotFound' - - /organisations/{organisation_id}/seats/{user_id}: - parameters: - - $ref: '#/components/parameters/OrganisationId' - - name: user_id - in: path - required: true - schema: - type: integer - description: The colleague's user ID - put: - tags: [Seats] - summary: Change a colleague's seat on one Contract + patch: + tags: [Filtered Metrics] + summary: Update a filtered version description: | - Gives a colleague a seat on one of the Organisation's current Contracts, changes it or takes it - away. On a Role-based Pricing Contract send the Billing Role to give, or `null` to take the seat - away. On a Flat Pricing Contract send `has_seat` instead. The old seat is kept in Seat History. - Nothing stops you going over the seats bought; the Organisation then shows as over its seat count. - - Only the Organisation's admins (and Makerble admins) can change seats. The colleague must have a - role in the Organisation or still hold a seat there. Returns the colleague as the list does. - operationId: changeSeat + Renames it or replaces its filters: `response_criteria` and `contact_criteria`, when sent, + replace the stored ones (`{}` clears them). The metric it filters and its placement can't be + changed. The change applies wherever it is used. Requires the right to edit the Project's metrics. + operationId: updateFilteredMetric security: [{tokenAuth: []}] requestBody: required: true content: application/json: schema: - $ref: '#/components/schemas/SeatChangeRequest' - examples: - roleBased: - value: - contract_id: 31 - billing_role_id: 2 - takeAway: - value: - contract_id: 31 - billing_role_id: null - flat: - value: - contract_id: 32 - has_seat: true + $ref: '#/components/schemas/FilteredMetricRequest' + example: + filtered_metric: + display_name: "Session attendances — Female" + contact_criteria: + sub_ratio_ids: ["881"] responses: "200": - description: The colleague's seats after the change + description: Filtered version updated content: application/json: schema: - $ref: '#/components/schemas/SeatColleague' + $ref: '#/components/schemas/FilteredMetric' "401": $ref: '#/components/responses/Unauthorized' "403": - $ref: '#/components/responses/ForbiddenError' + description: The user can't edit the Project's metrics "404": $ref: '#/components/responses/NotFound' "422": $ref: '#/components/responses/UnprocessableEntity' - - /organisations/{organisation_id}/usage: - parameters: - - $ref: '#/components/parameters/OrganisationId' - get: - tags: [Usage] - summary: Get an Organisation's usage this month + delete: + tags: [Filtered Metrics] + summary: Remove a filtered version from a Project description: | - This calendar month's usage (UK time) of each thing an Organisation (Charity) is charged for - when it goes over an allowance, with the allowance, how much of it is used, the usage expected - by the end of the month if it carries on at the same rate, the price over the allowance, and the - charge so far and expected. Amounts are in the currency the Organisation is billed in, before VAT. - - A usage type is listed when the Organisation used it this month or has an allowance for it. - `status` is `within`, `near` (80% or more of the allowance), `over`, `waived` (a waiver means it - isn't charged this month), or null when there is no allowance (charged from the first one). - File storage is what was uploaded this month, in GB, not what is stored. Contacts are the - current total, archived ones included; while it is over the allowance the bundle is charged - every month. A charge is null when no price is set for usage over the allowance, and then - `unpriced` is true and the totals leave it out. - - This is the Usage page under Our Account › Usage. Organisation Admins and Makerble staff can - read it. Going over an allowance never stops anyone working. - operationId: getOrganisationUsage + Removes it from the Project and its Albums. It is deleted once it is on no other Project or + Scorecard Template. Requires the right to edit the Project's metrics. + operationId: removeFilteredMetric security: [{tokenAuth: []}] responses: - "200": - description: This month's usage - content: - application/json: - schema: - $ref: '#/components/schemas/OrganisationUsage' - example: - organisation_id: 42 - month: "2026-11" - currency: GBP - charge_so_far: 50 - expected_charge: 1060 - unpriced: false - data: - - usage_type: story_created - name: Stories (survey responses) - unit: Stories - quantity: 5000 - allowance: 6000 - percent_used: 83 - status: near - expected_quantity: 15000 - unit_price: 0.1 - per_quantity: 1 - tier_min: null - tier_max: null - charge_so_far: 0 - expected_charge: 900 - note: null + "204": + description: Removed "401": $ref: '#/components/responses/Unauthorized' + "403": + description: The user can't edit the Project's metrics "404": $ref: '#/components/responses/NotFound' + "422": + $ref: '#/components/responses/UnprocessableEntity' - /organisations/{organisation_id}/usage/history: + /projects/{project_id}/filtered_metrics/{id}/results: parameters: - - $ref: '#/components/parameters/OrganisationId' + - $ref: '#/components/parameters/FilteredMetricProjectId' + - $ref: '#/components/parameters/FilteredMetricId' get: - tags: [Usage] - summary: Get an Organisation's usage in the previous 12 months + tags: [Filtered Metrics] + summary: Get a filtered version's result on a Project description: | - The 12 calendar months before this one, newest first, from the usage charges worked out at the - end of each month: each usage type the Organisation was charged for, its usage, allowance and - charge, after any waivers. A month with no usage charges has an empty `usage` list. Amounts are - in the currency the Organisation is billed in, before VAT; the usage bills show what was invoiced. - Organisation Admins and Makerble staff can read it. - operationId: getOrganisationUsageHistory + The filtered result the Results Canvas shows, for one timeframe ending at `as_of`. Counts only + the responses the user may read, as the canvas does. + operationId: getProjectFilteredMetricResults security: [{tokenAuth: []}] + parameters: + - $ref: '#/components/parameters/FilteredMetricTimeframe' + - $ref: '#/components/parameters/FilteredMetricAsOf' responses: "200": - description: The previous 12 months + description: The result content: application/json: schema: - $ref: '#/components/schemas/OrganisationUsageHistory' + $ref: '#/components/schemas/FilteredMetricResult' "401": $ref: '#/components/responses/Unauthorized' + "403": + description: The user can't see the Project's Results Canvas "404": $ref: '#/components/responses/NotFound' + "422": + $ref: '#/components/responses/UnprocessableEntity' - /organisations/{organisation_id}/setup_guide: + /albums/{bundle_id}/filtered_metrics: parameters: - - $ref: '#/components/parameters/OrganisationId' + - $ref: '#/components/parameters/FilteredMetricBundleId' get: - tags: [Setup guide] - summary: Get an Organisation's Setup guide - description: | - The Setup guide's items for an Organisation (Charity), in order, with how far each has got in - words (`progress`), what counts as done (`done_when`), and whether it is done or marked "Not - relevant to us". `done_count` and `total_count` leave out items marked not relevant; `finished` - is true once every item is done or not relevant. - - Items (`key`): `teams` (Create your teams; only for Organisations with 11 or more staff), - `workspaces` (Add your workspaces), `welcome_tour` (Set up your team's Welcome Tour), - `checklists` (Set up a checklist on each workspace), and under "Automate your reporting" - (`section`): `reporting_requirements`, `demographics` and `metrics`. Workspaces are Projects; - closed ones, and the one Makerble creates with the Organisation, never count. - - This is the Setup guide page, under Help › Setup guide. The guide is at most seven items, so - it isn't paginated. - operationId: getSetupGuide + tags: [Filtered Metrics] + summary: List an Album's filtered versions of metrics + description: Every filtered version on any of the Album's Projects. Visible to anyone who can see the Album. + operationId: listAlbumFilteredMetrics security: [{tokenAuth: []}] + parameters: + - $ref: '#/components/parameters/Page' + - $ref: '#/components/parameters/PerPage' + - $ref: '#/components/parameters/LastSyncDatetime' responses: "200": - description: The Setup guide + description: Paginated list of filtered versions content: application/json: schema: - $ref: '#/components/schemas/SetupGuide' - example: - organisation_id: 42 - done_count: 3 - total_count: 6 - finished: false - data: - - key: workspaces - title: Add your workspaces - section: null - progress: 2 of 2 workspaces - done_when: Done when you've created at least 2. The one Makerble makes for you doesn't count. - done: true - not_relevant: false - - key: checklists - title: Set up a checklist on each workspace - section: null - progress: 4 of 18 workspaces - done_when: Done when each open workspace has a checklist. Closed workspaces are left out. - done: false - not_relevant: false + $ref: '#/components/schemas/PaginatedFilteredMetrics' "401": $ref: '#/components/responses/Unauthorized' "403": - $ref: '#/components/responses/SetupGuideForbidden' + description: The user can't see the Album "404": $ref: '#/components/responses/NotFound' - /organisations/{organisation_id}/setup_guide/items/{item_key}: + + /albums/{bundle_id}/filtered_metrics/{id}: parameters: - - $ref: '#/components/parameters/OrganisationId' - - name: item_key - in: path - required: true - description: The item's `key`, e.g. `checklists`. - schema: - type: string - enum: [teams, workspaces, welcome_tour, checklists, reporting_requirements, demographics, metrics] - patch: - tags: [Setup guide] - summary: Mark a Setup guide item Not relevant, or undo it - description: | - "Not relevant to us" (`not_relevant: true`) takes the item out of the Organisation's total and - records who chose it and when; `not_relevant: false` is Undo and puts it back. Whether the item - is done is unchanged: Makerble ticks items, nobody ticks them by hand. Answers with the whole - Setup guide, as GET does. - operationId: updateSetupGuideItem + - $ref: '#/components/parameters/FilteredMetricBundleId' + - $ref: '#/components/parameters/FilteredMetricId' + get: + tags: [Filtered Metrics] + summary: Get a filtered version on an Album + operationId: getAlbumFilteredMetric security: [{tokenAuth: []}] - requestBody: - required: true - content: - application/json: - schema: - type: object - required: [not_relevant] - properties: - not_relevant: - type: boolean - example: - not_relevant: true responses: "200": - description: The Setup guide after the change + description: The filtered version content: application/json: schema: - $ref: '#/components/schemas/SetupGuide' + $ref: '#/components/schemas/FilteredMetric' "401": $ref: '#/components/responses/Unauthorized' "403": - $ref: '#/components/responses/SetupGuideForbidden' + description: The user can't see the Album "404": $ref: '#/components/responses/NotFound' - "422": - $ref: '#/components/responses/UnprocessableEntity' - /organisations/{organisation_id}/age_bands: + + /albums/{bundle_id}/filtered_metrics/{id}/results: parameters: - - $ref: '#/components/parameters/OrganisationId' + - $ref: '#/components/parameters/FilteredMetricBundleId' + - $ref: '#/components/parameters/FilteredMetricId' get: - tags: [Age Bands] - summary: Get an Organisation's age bands - description: | - The Organisation's (Charity's) age bands, as set in Organisation Preferences › Age bands. Every - Album and Project without its own bands uses these. Anyone in the Organisation can read them. - operationId: getOrganisationAgeBands + tags: [Filtered Metrics] + summary: Get a filtered version's result on an Album + description: The filtered result for the Album's open Projects together, as its Results Canvas shows it. + operationId: getAlbumFilteredMetricResults security: [{tokenAuth: []}] + parameters: + - $ref: '#/components/parameters/FilteredMetricTimeframe' + - $ref: '#/components/parameters/FilteredMetricAsOf' responses: "200": - description: The age bands + description: The result content: application/json: schema: - $ref: '#/components/schemas/AgeBands' + $ref: '#/components/schemas/FilteredMetricResult' "401": $ref: '#/components/responses/Unauthorized' + "403": + description: The user can't see the Album "404": $ref: '#/components/responses/NotFound' - put: - tags: [Age Bands] - summary: Set an Organisation's age bands + "422": + $ref: '#/components/responses/UnprocessableEntity' + + /media_items: + get: + tags: [Media Gallery] + summary: List Media Gallery files description: | - Replaces the Organisation's age bands with the starting ages sent (whole numbers from 0 to - 120, saved sorted and unique; at least one). Only the Organisation's admins (Charity Editors) - can change them. Every Album and Project without its own bands follows the change. - operationId: setOrganisationAgeBands - security: [{tokenAuth: []}] - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/AgeBandsRequest' - example: - starts: [0, 13, 18, 25] + Lists every photo, video, audio file and document attached to Stories and to Contacts' bios in one organisation — the files shown on the **Media Gallery** page (Impact → Media Gallery). + + Only files from Stories and Contacts the user is already allowed to view are returned, so two users can get different results for the same organisation. Filters combine with AND. + + `kind_counts` gives the number of files of each kind for the same filters, ignoring `kind` — the counts on the File type buttons. + operationId: listMediaItems + security: [{tokenAuth: []}, {oauth2: [api]}] + parameters: + - name: charity_id + in: query + required: true + schema: + type: integer + description: Organisation ID + - name: kind + in: query + schema: + type: string + enum: [photo, video, audio, document] + description: File type + - name: search + in: query + schema: + type: string + description: Matches the start of words in the file name, Story title, Contact name and caption + - name: source[] + in: query + schema: + type: array + items: + type: string + enum: [stories, contacts] + style: form + explode: true + description: Story files, Contact bio files, or both (default both) + - name: sort + in: query + schema: + type: string + enum: [newest, oldest] + default: newest + description: By upload date + - name: story_filters + in: query + style: deepObject + explode: true + schema: + type: object + additionalProperties: true + example: { project_ids: [19], story_category_ids: [327] } + description: | + Timeline (Story) Filters, as on the homepage. Keys (arrays of ids unless noted): `project_ids`, `story_category_ids` (Surveys), `bundle_ids` (Albums), `beneficiary_ids` (Contacts tagged in the Story), `label_ids`, `outcome_ids`, `change_ids` (Engagement), `indicator_ids`, `user_ids` (Authors), `charity_ids`, and `created_at_from` (Date Happened range, `YYYY/MM/DD - YYYY/MM/DD`). + + Story files must match them. For Contact bio files, `project_ids` matches the Contact's Project memberships, and any other key means the Contact must appear in at least one matching Story. + - name: contact_filters + in: query + style: deepObject + explode: true + schema: + type: object + additionalProperties: true + example: { group_ids: [4], beneficiary_types: [1] } + description: | + Contact Filters, as on Manage Contacts. Common keys (arrays of ids): `project_ids`, `group_ids`, `beneficiary_types` (Contact types: 1 Person, 2 Object, 3 Organisation, 4 Animal), `beneficiary_state_ids`, `created_by_ids`, `bundle_ids`. + + Contact bio files must match them, and Story files must involve at least one matching Contact. + - $ref: '#/components/parameters/Page' + - $ref: '#/components/parameters/PerPage' + - $ref: '#/components/parameters/LastSyncDatetime' responses: "200": - description: The age bands after the change + description: Paginated list of Media Gallery files content: application/json: schema: - $ref: '#/components/schemas/AgeBands' + $ref: '#/components/schemas/PaginatedMediaItems' + example: + page: 1 + page_size: 1 + page_count: 1 + total_count: 1 + kind_counts: { all: 1, photo: 1, video: 0, audio: 0, document: 0 } + data: + - id: 512 + kind: photo + file_name: harvest_day.jpg + content_type: image/jpeg + file_size: 248310 + caption: Volunteers at the allotment + source_type: story + source_id: 90211 + source_title: Harvest day at the allotment + project_id: 19 + project_name: Growing Together + uploaded_by_id: 6207 + uploaded_at: "2026-09-12T10:14:00Z" + updated_at: "2026-09-12T10:15:02Z" + thumbnail_url: https://makerble.s3.amazonaws.com/medias/files/000/000/512/thumbnail/harvest_day.jpg "401": $ref: '#/components/responses/Unauthorized' "403": - $ref: '#/components/responses/ForbiddenError' + description: The user is not a member of that organisation + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + example: + error: forbidden "404": $ref: '#/components/responses/NotFound' "422": - $ref: '#/components/responses/UnprocessableEntityList' + $ref: '#/components/responses/UnprocessableEntity' - /organisations/{organisation_id}/age_band_counts: - parameters: - - $ref: '#/components/parameters/OrganisationId' + /media_items/{id}: get: - tags: [Age Bands] - summary: Count an Organisation's Contacts by age band + tags: [Media Gallery] + summary: Get one Media Gallery file, with a download link description: | - What the Age band panel on the Demographics tab of Manage Contacts shows: how many of the - Organisation's Contacts (Beneficiaries) are in each age band, with ages worked out from Date of - Birth as of today. Send `album_id` or `project_id` to count only that Album's or Project's - Contacts by its age bands (`source` says whose bands were used). + Returns one file from the **Media Gallery**, as shown in its preview panel, with a signed `download_url` that downloads the file. - "Under X" appears only when a Contact is younger than the first band, "Date of birth in the - future" only when a Contact's Date of Birth is after today (a data-entry error worth fixing), - and "No date of birth" only when a Contact has none (and not at all when the Organisation - hides untagged Contacts from demographics charts). Bands with fewer Contacts than the Organisation's Minimum Results - Threshold have `contacts: null` and are added up under "Below Threshold". Anyone in the - Organisation can read the counts. - operationId: countContactsByAgeBand + Permissions are checked again on every request. The user must still be able to view the Story or Contact the file belongs to. + + The link expires after `download_url_expires_in` seconds, so request the file again for a fresh link rather than storing it. + operationId: getMediaItem security: [{tokenAuth: []}] parameters: - - name: album_id - in: query - schema: - type: integer - description: Count only this Album's (Bundle's) Contacts, by its age bands - - name: project_id - in: query - schema: - type: integer - description: Count only this Project's Contacts, by its age bands + - $ref: '#/components/parameters/ResourceId' responses: "200": - description: Contacts per age band + description: The file, its field name and a short-lived download link content: application/json: schema: - $ref: '#/components/schemas/AgeBandCounts' + $ref: '#/components/schemas/MediaItemDetail' + example: + id: 512 + kind: document + file_name: consent_form.pdf + content_type: application/pdf + file_size: 84211 + caption: null + source_type: contact + source_id: 30144 + source_title: Jordan T. + project_id: null + project_name: null + uploaded_by_id: 6207 + uploaded_at: "2026-09-12T10:14:00Z" + updated_at: "2026-09-12T10:15:02Z" + thumbnail_url: null + field_name: Consent form (file field) + download_url: https://files.example.com/medias/files/000/000/512/original/consent_form.pdf?X-Amz-Expires=300&X-Amz-Signature=... + download_url_expires_in: 300 "401": $ref: '#/components/responses/Unauthorized' + "403": + description: The file exists, but the user can't view its Story or Contact + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + example: + error: forbidden "404": $ref: '#/components/responses/NotFound' - /albums/{album_id}/age_bands: + /organisations/{organisation_id}/seats: parameters: - - name: album_id - in: path - required: true - schema: - type: integer - description: The Album's (Bundle's) ID + - $ref: '#/components/parameters/OrganisationId' get: - tags: [Age Bands] - summary: Get an Album (Portfolio)'s age bands + tags: [Seats] + summary: List an Organisation's seats per colleague description: | - The age bands an Album (Portfolio) uses, as on its Preferences page: its own, or its Organisation's when it - has none (`source` says which). Anyone who can see the Album can read them. - operationId: getAlbumAgeBands + The Organisation's (Charity's) current Contracts, with seats bought and used per Billing Role + (Organiser, Practitioner, Helper) on Role-based Pricing or in total on Flat Pricing, and a page + of colleagues. Each colleague has the seat they hold on each Contract, the lowest seat their + roles allow, and a status: `covered`, `no_seat` (a role that needs a seat but no seat), + `seat_too_low` (a seat below what their roles need) or `no_seat_needed` (they still hold a + seat but no longer have a role that needs one). + + This is the Seats per Colleague page under Our Account › Seats. Organisation Admins and + Makerble staff can read it. Nobody loses access because of their seat. + operationId: listSeats security: [{tokenAuth: []}] + parameters: + - $ref: '#/components/parameters/Page' + - $ref: '#/components/parameters/PerPage' responses: "200": - description: The age bands + description: The Contracts and a page of colleagues content: application/json: schema: - $ref: '#/components/schemas/AgeBands' + $ref: '#/components/schemas/PaginatedSeats' "401": $ref: '#/components/responses/Unauthorized' "404": $ref: '#/components/responses/NotFound' + + /organisations/{organisation_id}/seats/{user_id}: + parameters: + - $ref: '#/components/parameters/OrganisationId' + - name: user_id + in: path + required: true + schema: + type: integer + description: The colleague's user ID put: - tags: [Age Bands] - summary: Set an Album (Portfolio)'s age bands + tags: [Seats] + summary: Change a colleague's seat on one Contract description: | - Gives the Album its own age bands, or (with `use_organisation_bands: true`) puts it back on - its Organisation's. Starting ages are whole numbers from 0 to 120, saved sorted and unique. - Only the Album's managers can change them. - operationId: setAlbumAgeBands + Gives a colleague a seat on one of the Organisation's current Contracts, changes it or takes it + away. On a Role-based Pricing Contract send the Billing Role to give, or `null` to take the seat + away. On a Flat Pricing Contract send `has_seat` instead. The old seat is kept in Seat History. + Nothing stops you going over the seats bought; the Organisation then shows as over its seat count. + + Only the Organisation's admins (and Makerble admins) can change seats. The colleague must have a + role in the Organisation or still hold a seat there. Returns the colleague as the list does. + operationId: changeSeat security: [{tokenAuth: []}] requestBody: required: true content: application/json: schema: - $ref: '#/components/schemas/AgeBandsRequest' + $ref: '#/components/schemas/SeatChangeRequest' examples: - ownBands: + roleBased: value: - starts: [10, 14, 18, 22] - organisationBands: + contract_id: 31 + billing_role_id: 2 + takeAway: value: - use_organisation_bands: true + contract_id: 31 + billing_role_id: null + flat: + value: + contract_id: 32 + has_seat: true responses: "200": - description: The age bands after the change + description: The colleague's seats after the change content: application/json: schema: - $ref: '#/components/schemas/AgeBands' + $ref: '#/components/schemas/SeatColleague' "401": $ref: '#/components/responses/Unauthorized' "403": @@ -17681,205 +18455,241 @@ paths: "404": $ref: '#/components/responses/NotFound' "422": - $ref: '#/components/responses/UnprocessableEntityList' + $ref: '#/components/responses/UnprocessableEntity' - /projects/{project_id}/age_bands: + /organisations/{organisation_id}/usage: parameters: - - name: project_id - in: path - required: true - schema: - type: integer - description: The Project's ID + - $ref: '#/components/parameters/OrganisationId' get: - tags: [Age Bands] - summary: Get a Project's age bands + tags: [Usage] + summary: Get an Organisation's usage this month description: | - The age bands a Project uses, as on its Preferences page: its own, or its Organisation's when it - has none (`source` says which). Anyone who can see the Project can read them. - operationId: getProjectAgeBands + This calendar month's usage (UK time) of each thing an Organisation (Charity) is charged for + when it goes over an allowance, with the allowance, how much of it is used, the usage expected + by the end of the month if it carries on at the same rate, the price over the allowance, and the + charge so far and expected. Amounts are in the currency the Organisation is billed in, before VAT. + + A usage type is listed when the Organisation used it this month or has an allowance for it. + `status` is `within`, `near` (80% or more of the allowance), `over`, `waived` (a waiver means it + isn't charged this month), or null when there is no allowance (charged from the first one). + File storage is what was uploaded this month, in GB, not what is stored. Contacts are the + current total, archived ones included; while it is over the allowance the bundle is charged + every month. A charge is null when no price is set for usage over the allowance, and then + `unpriced` is true and the totals leave it out. + + This is the Usage page under Our Account › Usage. Organisation Admins and Makerble staff can + read it. Going over an allowance never stops anyone working. + operationId: getOrganisationUsage security: [{tokenAuth: []}] responses: "200": - description: The age bands + description: This month's usage content: application/json: schema: - $ref: '#/components/schemas/AgeBands' + $ref: '#/components/schemas/OrganisationUsage' + example: + organisation_id: 42 + month: "2026-11" + currency: GBP + charge_so_far: 50 + expected_charge: 1060 + unpriced: false + data: + - usage_type: story_created + name: Stories (survey responses) + unit: Stories + quantity: 5000 + allowance: 6000 + percent_used: 83 + status: near + expected_quantity: 15000 + unit_price: 0.1 + per_quantity: 1 + tier_min: null + tier_max: null + charge_so_far: 0 + expected_charge: 900 + note: null "401": $ref: '#/components/responses/Unauthorized' "404": $ref: '#/components/responses/NotFound' - put: - tags: [Age Bands] - summary: Set a Project's age bands + + /organisations/{organisation_id}/usage/history: + parameters: + - $ref: '#/components/parameters/OrganisationId' + get: + tags: [Usage] + summary: Get an Organisation's usage in the previous 12 months description: | - Gives the Project its own age bands, or (with `use_organisation_bands: true`) puts it back on - its Organisation's. Starting ages are whole numbers from 0 to 120, saved sorted and unique. - Only Project Managers and Organisation Admins (whoever can change Project Preferences) can change them. - operationId: setProjectAgeBands + The 12 calendar months before this one, newest first, from the usage charges worked out at the + end of each month: each usage type the Organisation was charged for, its usage, allowance and + charge, after any waivers. A month with no usage charges has an empty `usage` list. Amounts are + in the currency the Organisation is billed in, before VAT; the usage bills show what was invoiced. + Organisation Admins and Makerble staff can read it. + operationId: getOrganisationUsageHistory security: [{tokenAuth: []}] - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/AgeBandsRequest' - examples: - ownBands: - value: - starts: [10, 14, 18, 22] - organisationBands: - value: - use_organisation_bands: true responses: "200": - description: The age bands after the change + description: The previous 12 months content: application/json: schema: - $ref: '#/components/schemas/AgeBands' + $ref: '#/components/schemas/OrganisationUsageHistory' "401": $ref: '#/components/responses/Unauthorized' - "403": - $ref: '#/components/responses/ForbiddenError' "404": $ref: '#/components/responses/NotFound' - "422": - $ref: '#/components/responses/UnprocessableEntityList' - /albums/{album_id}/snapshot_settings: + /organisations/{organisation_id}/setup_guide: parameters: - - name: album_id - in: path - required: true - schema: - type: integer - description: The Album's (Bundle's) ID + - $ref: '#/components/parameters/OrganisationId' get: - tags: [Snapshot] - summary: Get what an Album (Portfolio)'s Snapshot shows + tags: [Setup guide] + summary: Get an Organisation's Setup guide description: | - What the Album's Snapshot shows, as on the Snapshot tab of its Preferences, and every choice - there is: the panels for "Who we're working with" (the Ratio Sets its Contacts are tagged - with, Age band and Split by project), the metrics in each Results Canvas column for "How the - work is going", and the Workflow, Cohort and Formula Trackers, which can go on any tile and on - Workload. Until its managers choose, `customised` is false and the defaults are shown. Anyone - who can see the Album can read it. - operationId: getAlbumSnapshotSettings + The Setup guide's items for an Organisation (Charity), in order, with how far each has got in + words (`progress`), what counts as done (`done_when`), and whether it is done or marked "Not + relevant to us". `done_count` and `total_count` leave out items marked not relevant; `finished` + is true once every item is done or not relevant. + + Items (`key`): `teams` (Create your teams; only for Organisations with 11 or more staff), + `workspaces` (Add your workspaces), `welcome_tour` (Set up your team's Welcome Tour), + `checklists` (Set up a checklist on each workspace), and under "Automate your reporting" + (`section`): `reporting_requirements`, `demographics` and `metrics`. Workspaces are Projects; + closed ones, and the one Makerble creates with the Organisation, never count. + + This is the Setup guide page, under Help › Setup guide. The guide is at most seven items, so + it isn't paginated. + operationId: getSetupGuide security: [{tokenAuth: []}] responses: "200": - description: What the Snapshot shows, and the choices + description: The Setup guide content: application/json: schema: - $ref: '#/components/schemas/SnapshotSettings' + $ref: '#/components/schemas/SetupGuide' + example: + organisation_id: 42 + done_count: 3 + total_count: 6 + finished: false + data: + - key: workspaces + title: Add your workspaces + section: null + progress: 2 of 2 workspaces + done_when: Done when you've created at least 2. The one Makerble makes for you doesn't count. + done: true + not_relevant: false + - key: checklists + title: Set up a checklist on each workspace + section: null + progress: 4 of 18 workspaces + done_when: Done when each open workspace has a checklist. Closed workspaces are left out. + done: false + not_relevant: false "401": $ref: '#/components/responses/Unauthorized' + "403": + $ref: '#/components/responses/SetupGuideForbidden' "404": $ref: '#/components/responses/NotFound' - put: - tags: [Snapshot] - summary: Choose what an Album (Portfolio)'s Snapshot shows + /organisations/{organisation_id}/setup_guide/items/{item_key}: + parameters: + - $ref: '#/components/parameters/OrganisationId' + - name: item_key + in: path + required: true + description: The item's `key`, e.g. `checklists`. + schema: + type: string + enum: [teams, workspaces, welcome_tour, checklists, reporting_requirements, demographics, metrics] + patch: + tags: [Setup guide] + summary: Mark a Setup guide item Not relevant, or undo it description: | - Sets the Snapshot's panels (in display order), its tiles (one per Results Canvas column; null - hides a tile) and up to three Workload tiles, using the `key`s that GET lists under `choices`. - Whatever you don't send stays as it is. Only the Album's managers can change it. - operationId: setAlbumSnapshotSettings + "Not relevant to us" (`not_relevant: true`) takes the item out of the Organisation's total and + records who chose it and when; `not_relevant: false` is Undo and puts it back. Whether the item + is done is unchanged: Makerble ticks items, nobody ticks them by hand. Answers with the whole + Setup guide, as GET does. + operationId: updateSetupGuideItem security: [{tokenAuth: []}] requestBody: required: true content: application/json: schema: - $ref: '#/components/schemas/SnapshotSettingsRequest' - examples: - panels: - value: - panels: [age_band, split_by_project, "ratio_set:12"] - tiles: - value: - tiles: {activities: "Change:31", engagement: null, potential: "WorkflowTracker:4"} - workload: ["CohortTracker:2", null, null] + type: object + required: [not_relevant] + properties: + not_relevant: + type: boolean + example: + not_relevant: true responses: "200": - description: What the Snapshot shows after the change + description: The Setup guide after the change content: application/json: schema: - $ref: '#/components/schemas/SnapshotSettings' + $ref: '#/components/schemas/SetupGuide' "401": $ref: '#/components/responses/Unauthorized' "403": - $ref: '#/components/responses/ForbiddenError' + $ref: '#/components/responses/SetupGuideForbidden' "404": $ref: '#/components/responses/NotFound' "422": - $ref: '#/components/responses/UnprocessableEntityList' - - /projects/{project_id}/snapshot_settings: + $ref: '#/components/responses/UnprocessableEntity' + /organisations/{organisation_id}/age_bands: parameters: - - name: project_id - in: path - required: true - schema: - type: integer - description: The Project's ID + - $ref: '#/components/parameters/OrganisationId' get: - tags: [Snapshot] - summary: Get what a Project's Snapshot shows + tags: [Age Bands] + summary: Get an Organisation's age bands description: | - What the Project's Snapshot shows, as on the Snapshot tab of its Preferences, and every choice - there is: the panels for "Who we're working with" (the Ratio Sets its Contacts are tagged - with, and Age band), the metrics in each Results Canvas column for "How the work is going", - and the Workflow, Cohort and Formula Trackers, which can go on any tile and on Workload. Until - its editors choose, `customised` is false and the defaults are shown. Anyone in the Project's - Organisation can read it. - operationId: getProjectSnapshotSettings + The Organisation's (Charity's) age bands, as set in Organisation Preferences › Age bands. Every + Album and Project without its own bands uses these. Anyone in the Organisation can read them. + operationId: getOrganisationAgeBands security: [{tokenAuth: []}] responses: "200": - description: What the Snapshot shows, and the choices + description: The age bands content: application/json: schema: - $ref: '#/components/schemas/SnapshotSettings' + $ref: '#/components/schemas/AgeBands' "401": $ref: '#/components/responses/Unauthorized' "404": $ref: '#/components/responses/NotFound' put: - tags: [Snapshot] - summary: Choose what a Project's Snapshot shows + tags: [Age Bands] + summary: Set an Organisation's age bands description: | - Sets the Snapshot's panels (in display order), its tiles (one per Results Canvas column; null - hides a tile) and up to three Workload tiles, using the `key`s that GET lists under `choices`. - Whatever you don't send stays as it is. Only Project Managers and Organisation Admins (whoever - can change Project Preferences) can change it. - operationId: setProjectSnapshotSettings + Replaces the Organisation's age bands with the starting ages sent (whole numbers from 0 to + 120, saved sorted and unique; at least one). Only the Organisation's admins (Charity Editors) + can change them. Every Album and Project without its own bands follows the change. + operationId: setOrganisationAgeBands security: [{tokenAuth: []}] requestBody: required: true content: application/json: schema: - $ref: '#/components/schemas/SnapshotSettingsRequest' - examples: - panels: - value: - panels: [age_band, "ratio_set:12"] - tiles: - value: - tiles: {activities: "Change:31", engagement: null} - workload: ["WorkflowTracker:4", null, null] + $ref: '#/components/schemas/AgeBandsRequest' + example: + starts: [0, 13, 18, 25] responses: "200": - description: What the Snapshot shows after the change + description: The age bands after the change content: application/json: schema: - $ref: '#/components/schemas/SnapshotSettings' + $ref: '#/components/schemas/AgeBands' "401": $ref: '#/components/responses/Unauthorized' "403": @@ -17889,533 +18699,478 @@ paths: "422": $ref: '#/components/responses/UnprocessableEntityList' - /focus: + /organisations/{organisation_id}/age_band_counts: + parameters: + - $ref: '#/components/parameters/OrganisationId' get: - tags: [Focus] - summary: Get what needs you, as on your Focus page + tags: [Age Bands] + summary: Count an Organisation's Contacts by age band description: | - Everything that needs you, from every source you haven't switched off, most overdue first, - as on Today › Focus. Today the only source is **Checklist Actions** (`type: checklist_actions`): - for each Contact and Checklist, the first step not yet done, when you are responsible for it - (the Checklist's "Who is responsible?", or the Contact's own choice in its place). "The - colleague who added this checklist" counts when that was you. - - `scope=me` (the default) gives what you are responsible for; `scope=teams` adds what your - Teams are responsible for, and is only available when you are in a Team (`teams: true`). - There is no view of everyone's work: a Checklist's progress gives that. + What the Age band panel on the Demographics tab of Manage Contacts shows: how many of the + Organisation's Contacts (Beneficiaries) are in each age band, with ages worked out from Date of + Birth as of today. Send `album_id` or `project_id` to count only that Album's or Project's + Contacts by its age bands (`source` says whose bands were used). - Each item has `id`, `type`, `title`, `contact` ({id, name}), `context` (e.g. "Checklist Action · - Intake · step 2 of 5", plus who is responsible when it isn't you), `url`, `due_on` (the day the - Checklist was added plus the step's due days, or null), `due_text`, `section` (`overdue`, - `today`, `this_week` for the next 7 days, or `later` for later or undated) and `action` - ({label, url, method}), the row's button. `counts`, `sections` and `sources` describe the whole - list, whatever `section` or page you ask for. Only Contacts you can see are included. - operationId: getFocus + "Under X" appears only when a Contact is younger than the first band, "Date of birth in the + future" only when a Contact's Date of Birth is after today (a data-entry error worth fixing), + and "No date of birth" only when a Contact has none (and not at all when the Organisation + hides untagged Contacts from demographics charts). Bands with fewer Contacts than the Organisation's Minimum Results + Threshold have `contacts: null` and are added up under "Below Threshold". Anyone in the + Organisation can read the counts. + operationId: countContactsByAgeBand security: [{tokenAuth: []}] parameters: - - name: scope - in: query - required: false - schema: - type: string - enum: [me, teams] - description: "`teams` adds what your Teams are responsible for. Falls back to `me` when you are in no Team." - - name: type + - name: album_id in: query - required: false schema: - type: string - description: Only items from this source, e.g. `checklist_actions`. A type with no items gives every item. - - name: section + type: integer + description: Count only this Album's (Bundle's) Contacts, by its age bands + - name: project_id in: query - required: false schema: - type: string - enum: [overdue, today, this_week, later] - description: Only items in this section. - - $ref: '#/components/parameters/Page' - - $ref: '#/components/parameters/PerPage' + type: integer + description: Count only this Project's Contacts, by its age bands responses: "200": - description: What needs you + description: Contacts per age band content: application/json: schema: - $ref: '#/components/schemas/FocusFeed' - example: - scope: me - teams: true - type: null - sources: [{key: checklist_actions, label: Checklist Actions, shown: true}] - counts: {all: 1, checklist_actions: 1} - sections: [{key: overdue, label: Overdue, count: 1}] - page: 1 - page_size: 1 - page_count: 1 - total_count: 1 - data: - - id: checklist_actions-812 - type: checklist_actions - title: Consent form - contact: {id: 4021, name: Ayanda Dlamini} - context: Checklist Action · Youth Programme Intake · step 3 of 6 - url: /beneficiaries/4021 - due_on: "2026-10-11" - raised_on: null - due_text: 15 days overdue - section: overdue - action: {label: Open, url: /beneficiaries/4021, method: get} + $ref: '#/components/schemas/AgeBandCounts' "401": $ref: '#/components/responses/Unauthorized' - "422": - $ref: '#/components/responses/UnprocessableEntity' + "404": + $ref: '#/components/responses/NotFound' - /focus/settings: - patch: - tags: [Focus] - summary: Choose what your Focus page shows - description: | - The sources your Focus page shows, as chosen under its ⚙ "What Focus shows you". Send the keys - of the sources to show; every other source is switched off. Saved for you only: your email and - web notification settings are unchanged. - operationId: updateFocusSettings - security: [{tokenAuth: []}] - requestBody: + /albums/{album_id}/age_bands: + parameters: + - name: album_id + in: path required: true - content: - application/json: - schema: - type: object - required: [shown_sources] - properties: - shown_sources: - type: array - items: - type: string - description: Source keys from `sources` in GET /focus; `[]` shows none. - example: - shown_sources: [checklist_actions] - responses: - "200": - description: The sources after the change - content: - application/json: - schema: - type: object - required: [sources] - properties: - sources: - type: array - items: - $ref: '#/components/schemas/FocusSource' - "401": - $ref: '#/components/responses/Unauthorized' - "422": - $ref: '#/components/responses/UnprocessableEntity' - - /start_page: + schema: + type: integer + description: The Album's (Bundle's) ID get: - tags: [Start page] - summary: Get your start page + tags: [Age Bands] + summary: Get an Album (Portfolio)'s age bands description: | - The Today page you land on after signing in, and whenever you click Home or the Makerble logo, - as chosen under Personal Settings › Preferences › Start page, and the pages you can choose. - Newsfeed (formerly My Home) is the default. Focus and Snapshot are offered while they are in - the Today section of your sidebar, and Autopilot while it is on for one of your organisations. - If you chose a page that is no longer offered to you, `start_page` is `newsfeed`. - operationId: getStartPage + The age bands an Album (Portfolio) uses, as on its Preferences page: its own, or its Organisation's when it + has none (`source` says which). Anyone who can see the Album can read them. + operationId: getAlbumAgeBands security: [{tokenAuth: []}] responses: "200": - description: Your start page and the pages you can choose + description: The age bands content: application/json: schema: - $ref: '#/components/schemas/StartPage' - example: - start_page: focus - options: - - {key: newsfeed, label: Newsfeed, description: "What’s happened across your projects. Formerly My Home."} - - {key: focus, label: Focus, description: "Your next steps across checklists, overdue first."} + $ref: '#/components/schemas/AgeBands' "401": $ref: '#/components/responses/Unauthorized' - patch: - tags: [Start page] - summary: Choose your start page + "404": + $ref: '#/components/responses/NotFound' + put: + tags: [Age Bands] + summary: Set an Album (Portfolio)'s age bands description: | - Choose the Today page you land on after signing in and when you click Home or the Makerble logo, - as Personal Settings › Preferences › Start page does. Saved for you only. If you choose Focus - but can neither see nor create a Checklist, Home takes you to Newsfeed with a note saying why. - operationId: updateStartPage + Gives the Album its own age bands, or (with `use_organisation_bands: true`) puts it back on + its Organisation's. Starting ages are whole numbers from 0 to 120, saved sorted and unique. + Only the Album's managers can change them. + operationId: setAlbumAgeBands security: [{tokenAuth: []}] requestBody: required: true content: application/json: schema: - type: object - required: [start_page] - properties: - start_page: - type: string - enum: [newsfeed, focus, snapshot, autopilot] - description: The key of one of the `options` GET /start_page returns. - example: - start_page: focus + $ref: '#/components/schemas/AgeBandsRequest' + examples: + ownBands: + value: + starts: [10, 14, 18, 22] + organisationBands: + value: + use_organisation_bands: true responses: "200": - description: Your start page after the change + description: The age bands after the change content: application/json: schema: - $ref: '#/components/schemas/StartPage' + $ref: '#/components/schemas/AgeBands' "401": $ref: '#/components/responses/Unauthorized' + "403": + $ref: '#/components/responses/ForbiddenError' + "404": + $ref: '#/components/responses/NotFound' "422": - $ref: '#/components/responses/UnprocessableEntity' + $ref: '#/components/responses/UnprocessableEntityList' - /snapshot: - get: - tags: [Snapshot] - summary: Get an Album (Portfolio)'s or Project's Snapshot - description: | - The numbers Today › Snapshot shows for one Album or Project. **panels** ("Who we're working - with") count its Contacts by Ratio Set, age band or Project, by the Demographics tab's rules: - only Contacts you can view are counted, Contacts without a value are under "No Data" or "No - date of birth" (left out if the Organisation hides untagged Contacts from charts), and groups - below the Organisation's Minimum Results Threshold have `contacts: null` and are added up under - "Below Threshold". `percent` is of all the Album's or Project's Contacts. **tiles** ("How the - work is going", one per Results Canvas column not hidden) and **workload** give each chosen - metric's or tracker's result for the Results Canvas's current period, or all time when there are - no deadlines (`timeframe` says which); `value` is null for a tracker with no single number. - - Name the Album or Project with `album_id` or `project_id`; without either, you get your pinned - one, or else the last one you viewed in Makerble (`404` when there's neither). What appears is - chosen with PUT /albums/{album_id}/snapshot_settings or /projects/{project_id}/snapshot_settings. - operationId: getSnapshot + /projects/{project_id}/age_bands: + parameters: + - name: project_id + in: path + required: true + schema: + type: integer + description: The Project's ID + get: + tags: [Age Bands] + summary: Get a Project's age bands + description: | + The age bands a Project uses, as on its Preferences page: its own, or its Organisation's when it + has none (`source` says which). Anyone who can see the Project can read them. + operationId: getProjectAgeBands security: [{tokenAuth: []}] - parameters: - - name: album_id - in: query - required: false - schema: - type: integer - description: The Album's (Bundle's) ID - - name: project_id - in: query - required: false - schema: - type: integer - description: The Project's ID responses: "200": - description: The Snapshot + description: The age bands content: application/json: schema: - $ref: '#/components/schemas/Snapshot' + $ref: '#/components/schemas/AgeBands' "401": $ref: '#/components/responses/Unauthorized' "404": $ref: '#/components/responses/NotFound' - - /snapshot/pin: put: - tags: [Snapshot] - summary: Pin an Album (Portfolio) or Project as your Snapshot + tags: [Age Bands] + summary: Set a Project's age bands description: | - Makes Today › Snapshot (and GET /snapshot without an id) open this Album or Project for you, - as the **Pin as my Snapshot** button does. It only changes your own Snapshot. - operationId: pinSnapshot + Gives the Project its own age bands, or (with `use_organisation_bands: true`) puts it back on + its Organisation's. Starting ages are whole numbers from 0 to 120, saved sorted and unique. + Only Project Managers and Organisation Admins (whoever can change Project Preferences) can change them. + operationId: setProjectAgeBands security: [{tokenAuth: []}] requestBody: required: true content: application/json: schema: - type: object - properties: - album_id: - type: integer - project_id: - type: integer + $ref: '#/components/schemas/AgeBandsRequest' examples: - project: + ownBands: value: - project_id: 412 + starts: [10, 14, 18, 22] + organisationBands: + value: + use_organisation_bands: true responses: "200": - description: What is now pinned + description: The age bands after the change content: application/json: schema: - type: object - required: [pinned] - properties: - pinned: - $ref: '#/components/schemas/SnapshotOwner' + $ref: '#/components/schemas/AgeBands' "401": $ref: '#/components/responses/Unauthorized' + "403": + $ref: '#/components/responses/ForbiddenError' "404": $ref: '#/components/responses/NotFound' + "422": + $ref: '#/components/responses/UnprocessableEntityList' - /snapshot/share_link: + /albums/{album_id}/snapshot_settings: parameters: - name: album_id - in: query - required: false - schema: - type: integer - description: The Album's (Bundle's) ID. Give this or project_id. - - name: project_id - in: query - required: false + in: path + required: true schema: type: integer - description: The Project's ID. Give this or album_id. + description: The Album's (Bundle's) ID get: tags: [Snapshot] - summary: Get your share link to an Album's (Portfolio's) or Project's Snapshot + summary: Get what an Album (Portfolio)'s Snapshot shows description: | - Your working read-only link to the Snapshot of one Album or Project, made with POST or the - **Share** button on Today › Snapshot. `404` when you have no working link to it, or can't see it. - operationId: getSnapshotShareLink + What the Album's Snapshot shows, as on the Snapshot tab of its Preferences, and every choice + there is: the panels for "Who we're working with" (the Ratio Sets its Contacts are tagged + with, Age band and Split by project), the metrics in each Results Canvas column for "How the + work is going", and the Workflow, Cohort and Formula Trackers, which can go on any tile and on + Workload. Until its managers choose, `customised` is false and the defaults are shown. Anyone + who can see the Album can read it. + operationId: getAlbumSnapshotSettings security: [{tokenAuth: []}] responses: "200": - description: Your working link + description: What the Snapshot shows, and the choices content: application/json: schema: - type: object - required: [share_link] - properties: - share_link: - $ref: '#/components/schemas/SnapshotShareLink' + $ref: '#/components/schemas/SnapshotSettings' "401": $ref: '#/components/responses/Unauthorized' "404": $ref: '#/components/responses/NotFound' - post: + put: tags: [Snapshot] - summary: Share an Album's (Portfolio's) or Project's Snapshot + summary: Choose what an Album (Portfolio)'s Snapshot shows description: | - Makes a read-only link to the Snapshot of an Album or Project you can see, as the **Share** - button on Today › Snapshot does, or returns the working one you already have. Anyone with the - link can open the Snapshot without a Makerble account. It shows the numbers as you see them - (only Contacts you can view are counted, and groups below the Minimum Results Threshold stay - hidden), and it stops working when you turn it off with DELETE or can no longer see the Album - or Project. Each user has their own link to each Album or Project. Give `album_id` or - `project_id` in the query or the body. - operationId: createSnapshotShareLink + Sets the Snapshot's panels (in display order), its tiles (one per Results Canvas column; null + hides a tile) and up to three Workload tiles, using the `key`s that GET lists under `choices`. + Whatever you don't send stays as it is. Only the Album's managers can change it. + operationId: setAlbumSnapshotSettings security: [{tokenAuth: []}] requestBody: - required: false + required: true content: application/json: schema: - type: object - properties: - album_id: - type: integer - project_id: - type: integer + $ref: '#/components/schemas/SnapshotSettingsRequest' examples: - project: + panels: value: - project_id: 412 + panels: [age_band, split_by_project, "ratio_set:12"] + tiles: + value: + tiles: {activities: "Change:31", engagement: null, potential: "WorkflowTracker:4"} + workload: ["CohortTracker:2", null, null] responses: - "201": - description: Your working link + "200": + description: What the Snapshot shows after the change content: application/json: schema: - type: object - required: [share_link] - properties: - share_link: - $ref: '#/components/schemas/SnapshotShareLink' + $ref: '#/components/schemas/SnapshotSettings' "401": $ref: '#/components/responses/Unauthorized' + "403": + $ref: '#/components/responses/ForbiddenError' "404": $ref: '#/components/responses/NotFound' - delete: + "422": + $ref: '#/components/responses/UnprocessableEntityList' + + /projects/{project_id}/snapshot_settings: + parameters: + - name: project_id + in: path + required: true + schema: + type: integer + description: The Project's ID + get: tags: [Snapshot] - summary: Turn off your share link to an Album's (Portfolio's) or Project's Snapshot + summary: Get what a Project's Snapshot shows description: | - Turns off your working link to the Snapshot of an Album or Project, as **Turn off link** on - Today › Snapshot does. Anyone who opens it afterwards is told it isn't working. Only turns off - your own link. `404` when you have no working link to it. - operationId: deleteSnapshotShareLink + What the Project's Snapshot shows, as on the Snapshot tab of its Preferences, and every choice + there is: the panels for "Who we're working with" (the Ratio Sets its Contacts are tagged + with, and Age band), the metrics in each Results Canvas column for "How the work is going", + and the Workflow, Cohort and Formula Trackers, which can go on any tile and on Workload. Until + its editors choose, `customised` is false and the defaults are shown. Anyone in the Project's + Organisation can read it. + operationId: getProjectSnapshotSettings security: [{tokenAuth: []}] responses: "200": - description: The link is turned off + description: What the Snapshot shows, and the choices content: application/json: schema: - type: object - required: [disabled] - properties: - disabled: - type: boolean - example: true + $ref: '#/components/schemas/SnapshotSettings' "401": $ref: '#/components/responses/Unauthorized' "404": $ref: '#/components/responses/NotFound' - - /guidance_panels: - get: - tags: [Guidance Panels] - summary: List the Guidance Panels + put: + tags: [Snapshot] + summary: Choose what a Project's Snapshot shows description: | - Every Guidance Panel: the Show/Hide Guidance introduction at the top of a Manage page (such as - Manage Events or Manage Contact Groups), with its eyebrow, headline, 2 to 5 points, the text shown to - people who can't use the page's main action, the link to its article in the Makerble User Guide, - and its video. Panels are the same for every Organisation. Only Makerble staff with System Access - can read or change them (otherwise `403`), and only with their own token: an API key or a - connected app gets `403`. - operationId: listGuidancePanels + Sets the Snapshot's panels (in display order), its tiles (one per Results Canvas column; null + hides a tile) and up to three Workload tiles, using the `key`s that GET lists under `choices`. + Whatever you don't send stays as it is. Only Project Managers and Organisation Admins (whoever + can change Project Preferences) can change it. + operationId: setProjectSnapshotSettings security: [{tokenAuth: []}] - parameters: - - $ref: '#/components/parameters/Page' - - $ref: '#/components/parameters/PerPage' - - $ref: '#/components/parameters/LastSyncDatetime' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/SnapshotSettingsRequest' + examples: + panels: + value: + panels: [age_band, "ratio_set:12"] + tiles: + value: + tiles: {activities: "Change:31", engagement: null} + workload: ["WorkflowTracker:4", null, null] responses: "200": - description: Paginated list of Guidance Panels, by page name + description: What the Snapshot shows after the change content: application/json: schema: - $ref: '#/components/schemas/PaginatedGuidancePanels' + $ref: '#/components/schemas/SnapshotSettings' "401": $ref: '#/components/responses/Unauthorized' "403": $ref: '#/components/responses/ForbiddenError' + "404": + $ref: '#/components/responses/NotFound' + "422": + $ref: '#/components/responses/UnprocessableEntityList' - /guidance_panels/{key}: - parameters: - - name: key - in: path - required: true - schema: - type: string - description: The panel's key, e.g. `events` or `contact_groups` (see `GET /guidance_panels`) - example: events + /focus: get: - tags: [Guidance Panels] - summary: Get a Guidance Panel and its recent changes + tags: [Focus] + summary: Get what needs you, as on your Focus page description: | - One Guidance Panel, with its last 10 versions, newest first: who changed it, when, and what changed - from what to what. Changes made in Site Overview › Guidance Panels, through this API and through - the MCP all appear here. - operationId: getGuidancePanel + Everything that needs you, from every source you haven't switched off, most overdue first, + as on Today › Focus. Today the only source is **Checklist Actions** (`type: checklist_actions`): + for each Contact and Checklist, the first step not yet done, when you are responsible for it + (the Checklist's "Who is responsible?", or the Contact's own choice in its place). "The + colleague who added this checklist" counts when that was you. + + `scope=me` (the default) gives what you are responsible for; `scope=teams` adds what your + Teams are responsible for, and is only available when you are in a Team (`teams: true`). + There is no view of everyone's work: a Checklist's progress gives that. + + Each item has `id`, `type`, `title`, `contact` ({id, name}), `context` (e.g. "Checklist Action · + Intake · step 2 of 5", plus who is responsible when it isn't you), `url`, `due_on` (the day the + Checklist was added plus the step's due days, or null), `due_text`, `section` (`overdue`, + `today`, `this_week` for the next 7 days, or `later` for later or undated) and `action` + ({label, url, method}), the row's button. `counts`, `sections` and `sources` describe the whole + list, whatever `section` or page you ask for. Only Contacts you can see are included. + operationId: getFocus security: [{tokenAuth: []}] + parameters: + - name: scope + in: query + required: false + schema: + type: string + enum: [me, teams] + description: "`teams` adds what your Teams are responsible for. Falls back to `me` when you are in no Team." + - name: type + in: query + required: false + schema: + type: string + description: Only items from this source, e.g. `checklist_actions`. A type with no items gives every item. + - name: section + in: query + required: false + schema: + type: string + enum: [overdue, today, this_week, later] + description: Only items in this section. + - $ref: '#/components/parameters/Page' + - $ref: '#/components/parameters/PerPage' responses: "200": - description: The Guidance Panel and its last 10 versions + description: What needs you content: application/json: schema: - $ref: '#/components/schemas/GuidancePanelWithVersions' + $ref: '#/components/schemas/FocusFeed' + example: + scope: me + teams: true + type: null + sources: [{key: checklist_actions, label: Checklist Actions, shown: true}] + counts: {all: 1, checklist_actions: 1} + sections: [{key: overdue, label: Overdue, count: 1}] + page: 1 + page_size: 1 + page_count: 1 + total_count: 1 + data: + - id: checklist_actions-812 + type: checklist_actions + title: Consent form + contact: {id: 4021, name: Ayanda Dlamini} + context: Checklist Action · Youth Programme Intake · step 3 of 6 + url: /beneficiaries/4021 + due_on: "2026-10-11" + raised_on: null + due_text: 15 days overdue + section: overdue + action: {label: Open, url: /beneficiaries/4021, method: get} "401": $ref: '#/components/responses/Unauthorized' - "403": - $ref: '#/components/responses/ForbiddenError' - "404": - $ref: '#/components/responses/NotFound' + "422": + $ref: '#/components/responses/UnprocessableEntity' + + /focus/settings: patch: - tags: [Guidance Panels] - summary: Change a Guidance Panel's wording or video + tags: [Focus] + summary: Choose what your Focus page shows description: | - Changes any of the panel's eyebrow, headline, points, staff text, user guide link and Vimeo link. - Fields you leave out stay as they are. `points` replaces the whole list, in the order given. The - page shows the change from its next load, and the change is kept as a version attributed to you. - - The same rules apply as in Site Overview: a headline of at most 80 characters; 2 to 5 points, each - with a `lead` (up to 40 characters, shown in bold) and `text` (up to 200); a `user_guide_url` on a - page in the Makerble User Guide (`https://makerble.atlassian.net/wiki/spaces/MCPD/...`); and a - `vimeo_url` that is empty or one of `https://vimeo.com/`, `https://vimeo.com//` - (unlisted videos) or `https://player.vimeo.com/video/?h=`. An empty `vimeo_url` puts the - page back to its fallback visual. - - `storyboard` is the Intro's animation, drawn from Makerble building blocks when there is no Vimeo - link (see `GuidancePanelStoryboard` for its rules). Send it as an object, or `null` to remove it. - - `feature_tour_id` chooses the feature tour the Intro offers with "Take the tour" (`null` for none). - It sets that tour's `page_key` to this Intro and unlinks any other tour that pointed here, naming it in - `notices`. It is refused when the chosen tour is live and another live tour is already on this Intro: - choose `null` first to take that one off. - A broken rule answers `422` with every message in `errors`, and nothing is changed. - operationId: updateGuidancePanel + The sources your Focus page shows, as chosen under its ⚙ "What Focus shows you". Send the keys + of the sources to show; every other source is switched off. Saved for you only: your email and + web notification settings are unchanged. + operationId: updateFocusSettings security: [{tokenAuth: []}] requestBody: required: true content: application/json: schema: - $ref: '#/components/schemas/GuidancePanelRequest' + type: object + required: [shown_sources] + properties: + shown_sources: + type: array + items: + type: string + description: Source keys from `sources` in GET /focus; `[]` shows none. example: - guidance_panel: - headline: "Plan every session in one place" - points: - - lead: "Plan events" - text: "set rotas and track attendance for every session." - - lead: "Count the time" - text: "spent by contact, coworker, task, event or case." - vimeo_url: "https://vimeo.com/76979871" + shown_sources: [checklist_actions] responses: "200": - description: The changed Guidance Panel and its last 10 versions + description: The sources after the change content: application/json: schema: - $ref: '#/components/schemas/GuidancePanelWithVersions' + type: object + required: [sources] + properties: + sources: + type: array + items: + $ref: '#/components/schemas/FocusSource' "401": $ref: '#/components/responses/Unauthorized' - "403": - $ref: '#/components/responses/ForbiddenError' - "404": - $ref: '#/components/responses/NotFound' "422": - $ref: '#/components/responses/UnprocessableEntityList' + $ref: '#/components/responses/UnprocessableEntity' - /ai_assistant_link: + /start_page: get: - tags: [AI assistants] - summary: Read your AI assistant link + tags: [Start page] + summary: Get your start page description: | - Your own link for connecting an AI assistant such as Claude or ChatGPT to Makerble through the - Makerble MCP, without the link itself, which is shown only when it is made. `link` is null if - you have none. `organisations` are the Organisations you can choose to bill it to. Every call - an assistant makes with the link counts as API usage for the Organisation you chose, and acts - as you, with what you can see and do. The same as User Settings, then AI assistants. These - endpoints need your own token: an API key, an AI assistant link or a connected app gets `403`. - operationId: getAiAssistantLink + The Today page you land on after signing in, and whenever you click Home or the Makerble logo, + as chosen under Personal Settings › Preferences › Start page, and the pages you can choose. + Newsfeed (formerly My Home) is the default. Focus and Snapshot are offered while they are in + the Today section of your sidebar, and Autopilot while it is on for one of your organisations. + If you chose a page that is no longer offered to you, `start_page` is `newsfeed`. + operationId: getStartPage security: [{tokenAuth: []}] responses: "200": - description: Your link, if you have one, and the Organisations it can be billed to + description: Your start page and the pages you can choose content: application/json: schema: - $ref: '#/components/schemas/AiAssistantLinkStatus' + $ref: '#/components/schemas/StartPage' + example: + start_page: focus + options: + - {key: newsfeed, label: Newsfeed, description: "What’s happened across your projects. Formerly My Home."} + - {key: focus, label: Focus, description: "Your next steps across checklists, overdue first."} "401": $ref: '#/components/responses/Unauthorized' - "403": - $ref: '#/components/responses/ForbiddenError' - - post: - tags: [AI assistants] - summary: Get a new AI assistant link + patch: + tags: [Start page] + summary: Choose your start page description: | - Makes your link for connecting an AI assistant to Makerble, billed to `charity_id`, an - Organisation you work in. The response includes the link in `url`, shown only this once: paste - it into your AI assistant as a custom connector (in Claude, Settings then Connectors; in - ChatGPT, Settings then Connectors). Treat it like a password. Any link you had before stops - working. - operationId: createAiAssistantLink + Choose the Today page you land on after signing in and when you click Home or the Makerble logo, + as Personal Settings › Preferences › Start page does. Saved for you only. If you choose Focus + but can neither see nor create a Checklist, Home takes you to Newsfeed with a note saying why. + operationId: updateStartPage security: [{tokenAuth: []}] requestBody: required: true @@ -18423,339 +19178,430 @@ paths: application/json: schema: type: object - required: [charity_id] + required: [start_page] properties: - charity_id: - type: integer - description: The Organisation (Charity) the link's API usage is billed to + start_page: + type: string + enum: [newsfeed, focus, snapshot, autopilot] + description: The key of one of the `options` GET /start_page returns. example: - charity_id: 913 + start_page: focus responses: - "201": - description: Link made + "200": + description: Your start page after the change content: application/json: schema: - $ref: '#/components/schemas/AiAssistantLinkWithUrl' + $ref: '#/components/schemas/StartPage' "401": $ref: '#/components/responses/Unauthorized' - "403": - $ref: '#/components/responses/ForbiddenError' "422": $ref: '#/components/responses/UnprocessableEntity' - delete: - tags: [AI assistants] - summary: Turn off your AI assistant link - description: Any AI assistant using your link stops working straight away. - operationId: deleteAiAssistantLink + /snapshot: + get: + tags: [Snapshot] + summary: Get an Album (Portfolio)'s or Project's Snapshot + description: | + The numbers Today › Snapshot shows for one Album or Project. **panels** ("Who we're working + with") count its Contacts by Ratio Set, age band or Project, by the Demographics tab's rules: + only Contacts you can view are counted, Contacts without a value are under "No Data" or "No + date of birth" (left out if the Organisation hides untagged Contacts from charts), and groups + below the Organisation's Minimum Results Threshold have `contacts: null` and are added up under + "Below Threshold". `percent` is of all the Album's or Project's Contacts. **tiles** ("How the + work is going", one per Results Canvas column not hidden) and **workload** give each chosen + metric's or tracker's result for the Results Canvas's current period, or all time when there are + no deadlines (`timeframe` says which); `value` is null for a tracker with no single number. + + Name the Album or Project with `album_id` or `project_id`; without either, you get your pinned + one, or else the last one you viewed in Makerble (`404` when there's neither). What appears is + chosen with PUT /albums/{album_id}/snapshot_settings or /projects/{project_id}/snapshot_settings. + operationId: getSnapshot security: [{tokenAuth: []}] + parameters: + - name: album_id + in: query + required: false + schema: + type: integer + description: The Album's (Bundle's) ID + - name: project_id + in: query + required: false + schema: + type: integer + description: The Project's ID responses: "200": - description: Link turned off + description: The Snapshot content: application/json: schema: - type: object - required: [link] - properties: - link: - type: object - nullable: true - example: null + $ref: '#/components/schemas/Snapshot' "401": $ref: '#/components/responses/Unauthorized' - "403": - $ref: '#/components/responses/ForbiddenError' + "404": + $ref: '#/components/responses/NotFound' - /api_keys: - get: - tags: [API keys] - summary: List an Organisation's API keys + /snapshot/pin: + put: + tags: [Snapshot] + summary: Pin an Album (Portfolio) or Project as your Snapshot description: | - The Organisation's (Charity's) API keys, including revoked ones, without their secrets. Each key - shows the start of its secret (`secret_hint`) so it can be recognised. Only the Organisation's - admins can manage API keys (otherwise `403`). These endpoints need a person's own token: an API - key or a connected app gets `403`, so a key can't create or revoke keys. - operationId: listApiKeys + Makes Today › Snapshot (and GET /snapshot without an id) open this Album or Project for you, + as the **Pin as my Snapshot** button does. It only changes your own Snapshot. + operationId: pinSnapshot security: [{tokenAuth: []}] - parameters: - - name: charity_id - in: query - required: true - schema: - type: integer - description: The Organisation (Charity) ID - - $ref: '#/components/parameters/Page' - - $ref: '#/components/parameters/PerPage' - - $ref: '#/components/parameters/LastSyncDatetime' + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + album_id: + type: integer + project_id: + type: integer + examples: + project: + value: + project_id: 412 responses: "200": - description: Paginated list of API keys + description: What is now pinned content: application/json: schema: - $ref: '#/components/schemas/PaginatedApiKeys' + type: object + required: [pinned] + properties: + pinned: + $ref: '#/components/schemas/SnapshotOwner' "401": $ref: '#/components/responses/Unauthorized' - "403": - $ref: '#/components/responses/ForbiddenError' + "404": + $ref: '#/components/responses/NotFound' + /snapshot/share_link: + parameters: + - name: album_id + in: query + required: false + schema: + type: integer + description: The Album's (Bundle's) ID. Give this or project_id. + - name: project_id + in: query + required: false + schema: + type: integer + description: The Project's ID. Give this or album_id. + get: + tags: [Snapshot] + summary: Get your share link to an Album's (Portfolio's) or Project's Snapshot + description: | + Your working read-only link to the Snapshot of one Album or Project, made with POST or the + **Share** button on Today › Snapshot. `404` when you have no working link to it, or can't see it. + operationId: getSnapshotShareLink + security: [{tokenAuth: []}] + responses: + "200": + description: Your working link + content: + application/json: + schema: + type: object + required: [share_link] + properties: + share_link: + $ref: '#/components/schemas/SnapshotShareLink' + "401": + $ref: '#/components/responses/Unauthorized' + "404": + $ref: '#/components/responses/NotFound' post: - tags: [API keys] - summary: Create an API key + tags: [Snapshot] + summary: Share an Album's (Portfolio's) or Project's Snapshot description: | - Creates a key for a custom integration. It acts as `user_id`, who must be a colleague in the - Organisation (a User with a role in it; see `GET /users`), and can see and do only what they can. - The response includes the key itself in `secret`, which is shown only this once: store it - somewhere safe. Send it as `Authorization: Bearer `. - operationId: createApiKey + Makes a read-only link to the Snapshot of an Album or Project you can see, as the **Share** + button on Today › Snapshot does, or returns the working one you already have. Anyone with the + link can open the Snapshot without a Makerble account. It shows the numbers as you see them + (only Contacts you can view are counted, and groups below the Minimum Results Threshold stay + hidden), and it stops working when you turn it off with DELETE or can no longer see the Album + or Project. Each user has their own link to each Album or Project. Give `album_id` or + `project_id` in the query or the body. + operationId: createSnapshotShareLink security: [{tokenAuth: []}] requestBody: - required: true + required: false content: application/json: schema: - $ref: '#/components/schemas/ApiKeyRequest' - example: - charity_id: 913 - api_key: - name: "Finance dashboard" - user_id: 4521 + type: object + properties: + album_id: + type: integer + project_id: + type: integer + examples: + project: + value: + project_id: 412 responses: "201": - description: Key created, with its secret - headers: - Location: - description: Full address of the new key, e.g. `https://app.makerble.com/api/v2/api_keys/42` - schema: - type: string - format: uri + description: Your working link content: application/json: schema: - $ref: '#/components/schemas/ApiKeyWithSecret' + type: object + required: [share_link] + properties: + share_link: + $ref: '#/components/schemas/SnapshotShareLink' "401": $ref: '#/components/responses/Unauthorized' - "403": - $ref: '#/components/responses/ForbiddenError' - "422": - $ref: '#/components/responses/UnprocessableEntity' - - /api_keys/{id}: - parameters: - - $ref: '#/components/parameters/ResourceId' - get: - tags: [API keys] - summary: Get an API key - description: The key, without its secret. Another Organisation's key answers `404`. - operationId: getApiKey + "404": + $ref: '#/components/responses/NotFound' + delete: + tags: [Snapshot] + summary: Turn off your share link to an Album's (Portfolio's) or Project's Snapshot + description: | + Turns off your working link to the Snapshot of an Album or Project, as **Turn off link** on + Today › Snapshot does. Anyone who opens it afterwards is told it isn't working. Only turns off + your own link. `404` when you have no working link to it. + operationId: deleteSnapshotShareLink security: [{tokenAuth: []}] responses: "200": - description: The key, without its secret + description: The link is turned off content: application/json: schema: - $ref: '#/components/schemas/ApiKey' + type: object + required: [disabled] + properties: + disabled: + type: boolean + example: true "401": $ref: '#/components/responses/Unauthorized' "404": $ref: '#/components/responses/NotFound' - delete: - tags: [API keys] - summary: Revoke an API key + /guidance_panels: + get: + tags: [Guidance Panels] + summary: List the Guidance Panels description: | - Revokes the key straight away: requests made with it get `401` from then on. This can't be - undone. The key stays in the list, with `active: false` and `revoked_at` set. - operationId: revokeApiKey + Every Guidance Panel: the Show/Hide Guidance introduction at the top of a Manage page (such as + Manage Events or Manage Contact Groups), with its eyebrow, headline, 2 to 5 points, the text shown to + people who can't use the page's main action, the link to its article in the Makerble User Guide, + and its video. Panels are the same for every Organisation. Only Makerble staff with System Access + can read or change them (otherwise `403`), and only with their own token: an API key or a + connected app gets `403`. + operationId: listGuidancePanels security: [{tokenAuth: []}] + parameters: + - $ref: '#/components/parameters/Page' + - $ref: '#/components/parameters/PerPage' + - $ref: '#/components/parameters/LastSyncDatetime' responses: "200": - description: The revoked key + description: Paginated list of Guidance Panels, by page name content: application/json: schema: - $ref: '#/components/schemas/ApiKey' + $ref: '#/components/schemas/PaginatedGuidancePanels' "401": $ref: '#/components/responses/Unauthorized' - "404": - $ref: '#/components/responses/NotFound' + "403": + $ref: '#/components/responses/ForbiddenError' - /eventbrite_connection: + /guidance_panels/{key}: + parameters: + - name: key + in: path + required: true + schema: + type: string + description: The panel's key, e.g. `events` or `contact_groups` (see `GET /guidance_panels`) + example: events get: - tags: [Eventbrite] - summary: Get the Organisation's Eventbrite connection + tags: [Guidance Panels] + summary: Get a Guidance Panel and its recent changes description: | - Whether the Organisation (Charity) is connected to Eventbrite. `status` is `not_connected`, - `choosing_organisation` (signed in, but the Eventbrite sign-in belongs to several Eventbrite - organisations; choose one with `PATCH /eventbrite_connection`), `active`, or `reconnect_required` - (Eventbrite no longer accepts the sign-in, and the Organisation's admins have been emailed). - Signing in to Eventbrite needs a browser, so connecting and reconnecting happen on the - Connect > Eventbrite page in Makerble, given as `page_url`. The Eventbrite token is never returned. - operationId: getEventbriteConnection + One Guidance Panel, with its last 10 versions, newest first: who changed it, when, and what changed + from what to what. Changes made in Site Overview › Guidance Panels, through this API and through + the MCP all appear here. + operationId: getGuidancePanel security: [{tokenAuth: []}] - parameters: - - name: charity_id - in: query - required: true - schema: - type: integer - description: The Organisation (Charity) ID responses: "200": - description: The connection, or `status` `not_connected` + description: The Guidance Panel and its last 10 versions content: application/json: schema: - $ref: '#/components/schemas/EventbriteConnection' + $ref: '#/components/schemas/GuidancePanelWithVersions' "401": $ref: '#/components/responses/Unauthorized' "403": - $ref: '#/components/responses/Forbidden' + $ref: '#/components/responses/ForbiddenError' "404": $ref: '#/components/responses/NotFound' - patch: - tags: [Eventbrite] - summary: Choose the Eventbrite organisation + tags: [Guidance Panels] + summary: Change a Guidance Panel's wording or video description: | - While `status` is `choosing_organisation`, chooses which of `available_organizations` the - connection uses. The connection becomes `active`. - operationId: chooseEventbriteOrganization - security: [{tokenAuth: []}] - requestBody: - required: true - content: - application/json: + Changes any of the panel's eyebrow, headline, points, staff text, user guide link and Vimeo link. + Fields you leave out stay as they are. `points` replaces the whole list, in the order given. The + page shows the change from its next load, and the change is kept as a version attributed to you. + + The same rules apply as in Site Overview: a headline of at most 80 characters; 2 to 5 points, each + with a `lead` (up to 40 characters, shown in bold) and `text` (up to 200); a `user_guide_url` on a + page in the Makerble User Guide (`https://makerble.atlassian.net/wiki/spaces/MCPD/...`); and a + `vimeo_url` that is empty or one of `https://vimeo.com/`, `https://vimeo.com//` + (unlisted videos) or `https://player.vimeo.com/video/?h=`. An empty `vimeo_url` puts the + page back to its fallback visual. + + `storyboard` is the Intro's animation, drawn from Makerble building blocks when there is no Vimeo + link (see `GuidancePanelStoryboard` for its rules). Send it as an object, or `null` to remove it. + + `feature_tour_id` chooses the feature tour the Intro offers with "Take the tour" (`null` for none). + It sets that tour's `page_key` to this Intro and unlinks any other tour that pointed here, naming it in + `notices`. It is refused when the chosen tour is live and another live tour is already on this Intro: + choose `null` first to take that one off. + A broken rule answers `422` with every message in `errors`, and nothing is changed. + operationId: updateGuidancePanel + security: [{tokenAuth: []}] + requestBody: + required: true + content: + application/json: schema: - type: object - required: [charity_id, eventbrite_connection] - properties: - charity_id: - type: integer - eventbrite_connection: - type: object - required: [eventbrite_organization_id] - properties: - eventbrite_organization_id: - type: string + $ref: '#/components/schemas/GuidancePanelRequest' example: - charity_id: 913 - eventbrite_connection: - eventbrite_organization_id: "2" + guidance_panel: + headline: "Plan every session in one place" + points: + - lead: "Plan events" + text: "set rotas and track attendance for every session." + - lead: "Count the time" + text: "spent by contact, coworker, task, event or case." + vimeo_url: "https://vimeo.com/76979871" responses: "200": - description: The connection, now active + description: The changed Guidance Panel and its last 10 versions content: application/json: schema: - $ref: '#/components/schemas/EventbriteConnection' + $ref: '#/components/schemas/GuidancePanelWithVersions' "401": $ref: '#/components/responses/Unauthorized' "403": - $ref: '#/components/responses/Forbidden' + $ref: '#/components/responses/ForbiddenError' "404": $ref: '#/components/responses/NotFound' "422": - $ref: '#/components/responses/UnprocessableEntity' + $ref: '#/components/responses/UnprocessableEntityList' - delete: - tags: [Eventbrite] - summary: Disconnect Eventbrite + /ai_assistant_link: + get: + tags: [AI assistants] + summary: Read your AI assistant link description: | - Makerble stops bringing in changes from Eventbrite. Events, Contacts and Stories already brought - in stay, with their links to Eventbrite. Succeeds again when already disconnected. - operationId: disconnectEventbrite + Your own link for connecting an AI assistant such as Claude or ChatGPT to Makerble through the + Makerble MCP, without the link itself, which is shown only when it is made. `link` is null if + you have none. `organisations` are the Organisations you can choose to bill it to. Every call + an assistant makes with the link counts as API usage for the Organisation you chose, and acts + as you, with what you can see and do. The same as User Settings, then AI assistants. These + endpoints need your own token: an API key, an AI assistant link or a connected app gets `403`. + operationId: getAiAssistantLink security: [{tokenAuth: []}] - parameters: - - name: charity_id - in: query - required: true - schema: - type: integer - description: The Organisation (Charity) ID responses: - "204": - description: Disconnected + "200": + description: Your link, if you have one, and the Organisations it can be billed to + content: + application/json: + schema: + $ref: '#/components/schemas/AiAssistantLinkStatus' "401": $ref: '#/components/responses/Unauthorized' "403": - $ref: '#/components/responses/Forbidden' - "404": - $ref: '#/components/responses/NotFound' + $ref: '#/components/responses/ForbiddenError' - /eventbrite_connection/test: post: - tags: [Eventbrite] - summary: Test the Eventbrite connection + tags: [AI assistants] + summary: Get a new AI assistant link description: | - Checks with Eventbrite that the sign-in still works. `test_succeeded` says whether it did. A - revoked sign-in moves `status` to `reconnect_required`. - operationId: testEventbriteConnection + Makes your link for connecting an AI assistant to Makerble, billed to `charity_id`, an + Organisation you work in. The response includes the link in `url`, shown only this once: paste + it into your AI assistant as a custom connector (in Claude, Settings then Connectors; in + ChatGPT, Settings then Connectors). Treat it like a password. Any link you had before stops + working. + operationId: createAiAssistantLink security: [{tokenAuth: []}] - parameters: - - name: charity_id - in: query - required: true - schema: - type: integer - description: The Organisation (Charity) ID + requestBody: + required: true + content: + application/json: + schema: + type: object + required: [charity_id] + properties: + charity_id: + type: integer + description: The Organisation (Charity) the link's API usage is billed to + example: + charity_id: 913 responses: - "200": - description: The connection, with `test_succeeded` + "201": + description: Link made content: application/json: schema: - $ref: '#/components/schemas/EventbriteConnection' + $ref: '#/components/schemas/AiAssistantLinkWithUrl' "401": $ref: '#/components/responses/Unauthorized' "403": - $ref: '#/components/responses/Forbidden' - "404": - $ref: '#/components/responses/NotFound' + $ref: '#/components/responses/ForbiddenError' + "422": + $ref: '#/components/responses/UnprocessableEntity' - /eventbrite_connection/sync: - post: - tags: [Eventbrite] - summary: Sync with Eventbrite now - description: | - Queues a full catch-up with the Organisation's Eventbrite account, instead of waiting for the one - every 3 hours (changes normally arrive within seconds by webhook). `syncing` is true until it has run; - see `GET /eventbrite_connection/sync_log` for what came in. - operationId: syncEventbriteNow + delete: + tags: [AI assistants] + summary: Turn off your AI assistant link + description: Any AI assistant using your link stops working straight away. + operationId: deleteAiAssistantLink security: [{tokenAuth: []}] - parameters: - - name: charity_id - in: query - required: true - schema: - type: integer - description: The Organisation (Charity) ID responses: - "202": - description: Queued + "200": + description: Link turned off content: application/json: schema: - $ref: '#/components/schemas/EventbriteConnection' + type: object + required: [link] + properties: + link: + type: object + nullable: true + example: null "401": $ref: '#/components/responses/Unauthorized' "403": - $ref: '#/components/responses/Forbidden' - "404": - $ref: '#/components/responses/NotFound' + $ref: '#/components/responses/ForbiddenError' - /eventbrite_connection/sync_log: + /api_keys: get: - tags: [Eventbrite] - summary: List the Eventbrite sync log + tags: [API keys] + summary: List an Organisation's API keys description: | - What Makerble brought in from Eventbrite, updated, skipped or removed, and why, newest first, kept for - 90 days. `needs_review` means a ticket holder's email matched existing Contacts unclearly: a new Contact - was made and the possible duplicates are on the Suggested Merges list (source `eventbrite`). - operationId: listEventbriteSyncLog + The Organisation's (Charity's) API keys, including revoked ones, without their secrets. Each key + shows the start of its secret (`secret_hint`) so it can be recognised. Only the Organisation's + admins can manage API keys (otherwise `403`). These endpoints need a person's own token: an API + key or a connected app gets `403`, so a key can't create or revoke keys. + operationId: listApiKeys security: [{tokenAuth: []}] parameters: - name: charity_id @@ -18769,77 +19615,110 @@ paths: - $ref: '#/components/parameters/LastSyncDatetime' responses: "200": - description: Paginated sync log + description: Paginated list of API keys content: application/json: schema: - $ref: '#/components/schemas/PaginatedEventbriteSyncLog' + $ref: '#/components/schemas/PaginatedApiKeys' "401": $ref: '#/components/responses/Unauthorized' "403": - $ref: '#/components/responses/Forbidden' - "404": - $ref: '#/components/responses/NotFound' + $ref: '#/components/responses/ForbiddenError' - /eventbrite_connection/settings: - patch: - tags: [Eventbrite] - summary: Choose what to bring in from Eventbrite + post: + tags: [API keys] + summary: Create an API key description: | - The Workspace (`project_id`) and Event format (`event_category_id`, one of the Workspace's) new Events go - into; `import_mode` `all_upcoming` (every upcoming Eventbrite event, new ones included) or `selected` - (only picked events, drafts included); the Workspace (`contact_project_id`, or each Event's Workspace when - blank) and Contact Bio Form (`beneficiary_category_id`, one the Workspace uses for creating Contacts) new - Contacts get; and the engagement tracker (`change_id`) and Event attendance survey (`story_category_id`, a - survey running on the Workspace for new Events) check-ins are recorded with. Send only the settings to - change. Saving starts a sync. Nothing comes in until `project_id` and `event_category_id` are set. - operationId: updateEventbriteSettings + Creates a key for a custom integration. It acts as `user_id`, who must be a colleague in the + Organisation (a User with a role in it; see `GET /users`), and can see and do only what they can. + The response includes the key itself in `secret`, which is shown only this once: store it + somewhere safe. Send it as `Authorization: Bearer `. + operationId: createApiKey security: [{tokenAuth: []}] requestBody: required: true content: application/json: schema: - type: object - required: [charity_id, eventbrite_connection] - properties: - charity_id: - type: integer - eventbrite_connection: - $ref: '#/components/schemas/EventbriteSettings' + $ref: '#/components/schemas/ApiKeyRequest' example: charity_id: 913 - eventbrite_connection: - project_id: 120 - event_category_id: 44 - import_mode: all_upcoming - change_id: 3021 - story_category_id: 812 + api_key: + name: "Finance dashboard" + user_id: 4521 responses: - "200": - description: The connection with its new settings + "201": + description: Key created, with its secret + headers: + Location: + description: Full address of the new key, e.g. `https://app.makerble.com/api/v2/api_keys/42` + schema: + type: string + format: uri content: application/json: schema: - $ref: '#/components/schemas/EventbriteConnection' + $ref: '#/components/schemas/ApiKeyWithSecret' "401": $ref: '#/components/responses/Unauthorized' "403": - $ref: '#/components/responses/Forbidden' - "404": - $ref: '#/components/responses/NotFound' + $ref: '#/components/responses/ForbiddenError' "422": $ref: '#/components/responses/UnprocessableEntity' - /eventbrite_connection/events: + /api_keys/{id}: + parameters: + - $ref: '#/components/parameters/ResourceId' get: - tags: [Eventbrite] - summary: List the Eventbrite events to pick from + tags: [API keys] + summary: Get an API key + description: The key, without its secret. Another Organisation's key answers `404`. + operationId: getApiKey + security: [{tokenAuth: []}] + responses: + "200": + description: The key, without its secret + content: + application/json: + schema: + $ref: '#/components/schemas/ApiKey' + "401": + $ref: '#/components/responses/Unauthorized' + "404": + $ref: '#/components/responses/NotFound' + + delete: + tags: [API keys] + summary: Revoke an API key description: | - The upcoming events in the connected Eventbrite organisation, with whether each is (or would be) - brought in, and the Makerble Event it came in as. Drafts and cancelled events are listed but not - selected unless picked. - operationId: listEventbriteEvents + Revokes the key straight away: requests made with it get `401` from then on. This can't be + undone. The key stays in the list, with `active: false` and `revoked_at` set. + operationId: revokeApiKey + security: [{tokenAuth: []}] + responses: + "200": + description: The revoked key + content: + application/json: + schema: + $ref: '#/components/schemas/ApiKey' + "401": + $ref: '#/components/responses/Unauthorized' + "404": + $ref: '#/components/responses/NotFound' + + /eventbrite_connection: + get: + tags: [Eventbrite] + summary: Get the Organisation's Eventbrite connection + description: | + Whether the Organisation (Charity) is connected to Eventbrite. `status` is `not_connected`, + `choosing_organisation` (signed in, but the Eventbrite sign-in belongs to several Eventbrite + organisations; choose one with `PATCH /eventbrite_connection`), `active`, or `reconnect_required` + (Eventbrite no longer accepts the sign-in, and the Organisation's admins have been emailed). + Signing in to Eventbrite needs a browser, so connecting and reconnecting happen on the + Connect > Eventbrite page in Makerble, given as `page_url`. The Eventbrite token is never returned. + operationId: getEventbriteConnection security: [{tokenAuth: []}] parameters: - name: charity_id @@ -18850,33 +19729,25 @@ paths: description: The Organisation (Charity) ID responses: "200": - description: The Eventbrite events + description: The connection, or `status` `not_connected` content: application/json: schema: - type: object - properties: - data: - type: array - items: - $ref: '#/components/schemas/EventbriteEventChoice' + $ref: '#/components/schemas/EventbriteConnection' "401": $ref: '#/components/responses/Unauthorized' "403": $ref: '#/components/responses/Forbidden' "404": $ref: '#/components/responses/NotFound' - "502": - description: Eventbrite couldn't list the events - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - put: + + patch: tags: [Eventbrite] - summary: Pick the Eventbrite events to bring in - description: Switches `import_mode` to `selected` and brings in only these Eventbrite events. - operationId: chooseEventbriteEvents + summary: Choose the Eventbrite organisation + description: | + While `status` is `choosing_organisation`, chooses which of `available_organizations` the + connection uses. The connection becomes `active`. + operationId: chooseEventbriteOrganization security: [{tokenAuth: []}] requestBody: required: true @@ -18884,20 +19755,23 @@ paths: application/json: schema: type: object - required: [charity_id, eventbrite_event_ids] + required: [charity_id, eventbrite_connection] properties: charity_id: type: integer - eventbrite_event_ids: - type: array - items: - type: string + eventbrite_connection: + type: object + required: [eventbrite_organization_id] + properties: + eventbrite_organization_id: + type: string example: charity_id: 913 - eventbrite_event_ids: ["750011223344"] + eventbrite_connection: + eventbrite_organization_id: "2" responses: "200": - description: The connection, with the picked events in settings + description: The connection, now active content: application/json: schema: @@ -18908,24 +19782,16 @@ paths: $ref: '#/components/responses/Forbidden' "404": $ref: '#/components/responses/NotFound' + "422": + $ref: '#/components/responses/UnprocessableEntity' - /eventbrite_connection/mappings/{object_type}: - parameters: - - name: object_type - in: path - required: true - schema: - type: string - enum: [event, attendee] - description: "`event` for Eventbrite events onto Makerble Events; `attendee` for ticket holders onto Contacts" - get: + delete: tags: [Eventbrite] - summary: Get an Eventbrite field mapping + summary: Disconnect Eventbrite description: | - Which Makerble field each Eventbrite field is copied into. Defaults are filled in on first use. For - `attendee`, order form questions appear as `answer:` fields once Eventbrite has been read - (see `POST /eventbrite_connection/refresh_questions`). - operationId: getEventbriteFieldMapping + Makerble stops bringing in changes from Eventbrite. Events, Contacts and Stories already brought + in stay, with their links to Eventbrite. Succeeds again when already disconnected. + operationId: disconnectEventbrite security: [{tokenAuth: []}] parameters: - name: charity_id @@ -18935,12 +19801,8 @@ paths: type: integer description: The Organisation (Charity) ID responses: - "200": - description: The mapping, with the fields each Eventbrite field can go into - content: - application/json: - schema: - $ref: '#/components/schemas/EventbriteFieldMapping' + "204": + description: Disconnected "401": $ref: '#/components/responses/Unauthorized' "403": @@ -18948,59 +19810,45 @@ paths: "404": $ref: '#/components/responses/NotFound' - put: + /eventbrite_connection/test: + post: tags: [Eventbrite] - summary: Replace an Eventbrite field mapping + summary: Test the Eventbrite connection description: | - Only compatible types can be paired, each field can be in only one pair, and a pair can be paused. - Eventbrite fields left out are not copied. Event fields replace the Makerble value; Contact fields - only fill in blanks. - operationId: setEventbriteFieldMapping + Checks with Eventbrite that the sign-in still works. `test_succeeded` says whether it did. A + revoked sign-in moves `status` to `reconnect_required`. + operationId: testEventbriteConnection security: [{tokenAuth: []}] - requestBody: - required: true - content: - application/json: - schema: - type: object - required: [charity_id, mappings] - properties: - charity_id: - type: integer - mappings: - type: array - items: - $ref: '#/components/schemas/EventbriteFieldPair' - example: - charity_id: 913 - mappings: - - eventbrite_field: name - makerble_field: name - - eventbrite_field: venue - makerble_field: location - paused: true + parameters: + - name: charity_id + in: query + required: true + schema: + type: integer + description: The Organisation (Charity) ID responses: "200": - description: The mapping, with the fields each Eventbrite field can go into + description: The connection, with `test_succeeded` content: application/json: schema: - $ref: '#/components/schemas/EventbriteFieldMapping' + $ref: '#/components/schemas/EventbriteConnection' "401": $ref: '#/components/responses/Unauthorized' "403": $ref: '#/components/responses/Forbidden' "404": $ref: '#/components/responses/NotFound' - "422": - $ref: '#/components/responses/UnprocessableEntity' - /eventbrite_connection/refresh_questions: + /eventbrite_connection/sync: post: tags: [Eventbrite] - summary: Re-read the order form questions from Eventbrite - description: Reads the questions on the order forms of recent events brought in, and returns the ticket holder mapping. - operationId: refreshEventbriteQuestions + summary: Sync with Eventbrite now + description: | + Queues a full catch-up with the Organisation's Eventbrite account, instead of waiting for the one + every 3 hours (changes normally arrive within seconds by webhook). `syncing` is true until it has run; + see `GET /eventbrite_connection/sync_log` for what came in. + operationId: syncEventbriteNow security: [{tokenAuth: []}] parameters: - name: charity_id @@ -19010,12 +19858,12 @@ paths: type: integer description: The Organisation (Charity) ID responses: - "200": - description: The mapping, with the fields each Eventbrite field can go into + "202": + description: Queued content: application/json: schema: - $ref: '#/components/schemas/EventbriteFieldMapping' + $ref: '#/components/schemas/EventbriteConnection' "401": $ref: '#/components/responses/Unauthorized' "403": @@ -19023,15 +19871,15 @@ paths: "404": $ref: '#/components/responses/NotFound' - /webhook_endpoints: + /eventbrite_connection/sync_log: get: - tags: [Webhooks] - summary: List an Organisation's webhook endpoints + tags: [Eventbrite] + summary: List the Eventbrite sync log description: | - The Organisation's (Charity's) webhook endpoints, without their secrets. Only the - Organisation's admins can manage webhooks, and only once an admin has ticked **Turn on Webhooks** - in the Organisation's Settings (otherwise `403`). - operationId: listWebhookEndpoints + What Makerble brought in from Eventbrite, updated, skipped or removed, and why, newest first, kept for + 90 days. `needs_review` means a ticket holder's email matched existing Contacts unclearly: a new Contact + was made and the possible duplicates are on the Suggested Merges list (source `eventbrite`). + operationId: listEventbriteSyncLog security: [{tokenAuth: []}] parameters: - name: charity_id @@ -19045,209 +19893,287 @@ paths: - $ref: '#/components/parameters/LastSyncDatetime' responses: "200": - description: Paginated list of webhook endpoints + description: Paginated sync log content: application/json: schema: - $ref: '#/components/schemas/PaginatedWebhookEndpoints' + $ref: '#/components/schemas/PaginatedEventbriteSyncLog' "401": $ref: '#/components/responses/Unauthorized' "403": - $ref: '#/components/responses/WebhooksNotTurnedOn' + $ref: '#/components/responses/Forbidden' "404": $ref: '#/components/responses/NotFound' - post: - tags: [Webhooks] - summary: Register a webhook endpoint + /eventbrite_connection/settings: + patch: + tags: [Eventbrite] + summary: Choose what to bring in from Eventbrite description: | - Starts sending the chosen events to an HTTPS URL. Leave out `event_types` to send every - event, or give one event for a trigger that fires on that event only. An Organisation can - have at most 10 endpoints added this way, and separately at most 100 created by automation - platforms such as Power Automate (one per flow). The response includes the signing `secret`, - which is shown only this once, and a `Location` header with the endpoint's full address: - send `DELETE` to it to unsubscribe. - - Power Automate flows can't check the signature themselves. They rely instead on the callback - address being secret, which Microsoft generates for each flow. - operationId: createWebhookEndpoint + The Workspace (`project_id`) and Event format (`event_category_id`, one of the Workspace's) new Events go + into; `import_mode` `all_upcoming` (every upcoming Eventbrite event, new ones included) or `selected` + (only picked events, drafts included); the Workspace (`contact_project_id`, or each Event's Workspace when + blank) and Contact Bio Form (`beneficiary_category_id`, one the Workspace uses for creating Contacts) new + Contacts get; and the engagement tracker (`change_id`) and Event attendance survey (`story_category_id`, a + survey running on the Workspace for new Events) check-ins are recorded with. Send only the settings to + change. Saving starts a sync. Nothing comes in until `project_id` and `event_category_id` are set. + operationId: updateEventbriteSettings security: [{tokenAuth: []}] requestBody: required: true content: application/json: schema: - $ref: '#/components/schemas/WebhookEndpointRequest' + type: object + required: [charity_id, eventbrite_connection] + properties: + charity_id: + type: integer + eventbrite_connection: + $ref: '#/components/schemas/EventbriteSettings' example: - webhook_endpoint: - charity_id: 913 - url: "https://crm.example.org/makerble" - description: "Dynamics sync" - event_types: ["contact.created", "contact.updated"] + charity_id: 913 + eventbrite_connection: + project_id: 120 + event_category_id: 44 + import_mode: all_upcoming + change_id: 3021 + story_category_id: 812 responses: - "201": - description: Endpoint created, with its secret - headers: - Location: - description: Full address of the new endpoint, e.g. `https://app.makerble.com/api/v2/webhook_endpoints/42` - schema: - type: string - format: uri + "200": + description: The connection with its new settings content: application/json: schema: - $ref: '#/components/schemas/WebhookEndpointWithSecret' + $ref: '#/components/schemas/EventbriteConnection' "401": $ref: '#/components/responses/Unauthorized' "403": - $ref: '#/components/responses/WebhooksNotTurnedOn' + $ref: '#/components/responses/Forbidden' "404": $ref: '#/components/responses/NotFound' "422": $ref: '#/components/responses/UnprocessableEntity' - /webhook_endpoints/{id}: - parameters: - - $ref: '#/components/parameters/ResourceId' + /eventbrite_connection/events: get: - tags: [Webhooks] - summary: Get a webhook endpoint - operationId: getWebhookEndpoint + tags: [Eventbrite] + summary: List the Eventbrite events to pick from + description: | + The upcoming events in the connected Eventbrite organisation, with whether each is (or would be) + brought in, and the Makerble Event it came in as. Drafts and cancelled events are listed but not + selected unless picked. + operationId: listEventbriteEvents security: [{tokenAuth: []}] + parameters: + - name: charity_id + in: query + required: true + schema: + type: integer + description: The Organisation (Charity) ID responses: "200": - description: The endpoint, without its secret + description: The Eventbrite events content: application/json: schema: - $ref: '#/components/schemas/WebhookEndpoint' + type: object + properties: + data: + type: array + items: + $ref: '#/components/schemas/EventbriteEventChoice' "401": $ref: '#/components/responses/Unauthorized' "403": - $ref: '#/components/responses/WebhooksNotTurnedOn' + $ref: '#/components/responses/Forbidden' "404": $ref: '#/components/responses/NotFound' - patch: - tags: [Webhooks] - summary: Change, pause or resume a webhook endpoint - description: | - Send only the fields to change. `active: false` pauses the endpoint; `active: true` - resumes it, and also turns back on an endpoint Makerble switched off after repeated - failure (clearing `disabled_at` and `failure_count`). Changes made while it was off are - not sent afterwards. - operationId: updateWebhookEndpoint + "502": + description: Eventbrite couldn't list the events + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + put: + tags: [Eventbrite] + summary: Pick the Eventbrite events to bring in + description: Switches `import_mode` to `selected` and brings in only these Eventbrite events. + operationId: chooseEventbriteEvents security: [{tokenAuth: []}] requestBody: required: true content: application/json: schema: - $ref: '#/components/schemas/WebhookEndpointRequest' + type: object + required: [charity_id, eventbrite_event_ids] + properties: + charity_id: + type: integer + eventbrite_event_ids: + type: array + items: + type: string example: - webhook_endpoint: - active: true + charity_id: 913 + eventbrite_event_ids: ["750011223344"] responses: "200": - description: The updated endpoint + description: The connection, with the picked events in settings content: application/json: schema: - $ref: '#/components/schemas/WebhookEndpoint' + $ref: '#/components/schemas/EventbriteConnection' "401": $ref: '#/components/responses/Unauthorized' "403": - $ref: '#/components/responses/WebhooksNotTurnedOn' + $ref: '#/components/responses/Forbidden' "404": $ref: '#/components/responses/NotFound' - "422": - $ref: '#/components/responses/UnprocessableEntity' - delete: - tags: [Webhooks] - summary: Delete a webhook endpoint + + /eventbrite_connection/mappings/{object_type}: + parameters: + - name: object_type + in: path + required: true + schema: + type: string + enum: [event, attendee] + description: "`event` for Eventbrite events onto Makerble Events; `attendee` for ticket holders onto Contacts" + get: + tags: [Eventbrite] + summary: Get an Eventbrite field mapping description: | - Deletes the endpoint and its delivery log. Makerble stops sending to it at once. Deleting is - idempotent: an endpoint that is already deleted, or that the user can't see, also answers - `204`, so an automation platform can unsubscribe safely more than once. - operationId: deleteWebhookEndpoint + Which Makerble field each Eventbrite field is copied into. Defaults are filled in on first use. For + `attendee`, order form questions appear as `answer:` fields once Eventbrite has been read + (see `POST /eventbrite_connection/refresh_questions`). + operationId: getEventbriteFieldMapping security: [{tokenAuth: []}] + parameters: + - name: charity_id + in: query + required: true + schema: + type: integer + description: The Organisation (Charity) ID responses: - "204": - description: Deleted, or already gone + "200": + description: The mapping, with the fields each Eventbrite field can go into + content: + application/json: + schema: + $ref: '#/components/schemas/EventbriteFieldMapping' "401": $ref: '#/components/responses/Unauthorized' "403": - $ref: '#/components/responses/WebhooksNotTurnedOn' + $ref: '#/components/responses/Forbidden' + "404": + $ref: '#/components/responses/NotFound' - /webhook_endpoints/{id}/rotate_secret: - parameters: - - $ref: '#/components/parameters/ResourceId' - post: - tags: [Webhooks] - summary: Rotate a webhook endpoint's secret + put: + tags: [Eventbrite] + summary: Replace an Eventbrite field mapping description: | - Replaces the signing secret and returns the new one, shown only this once. Deliveries - are signed with it straight away. - operationId: rotateWebhookEndpointSecret + Only compatible types can be paired, each field can be in only one pair, and a pair can be paused. + Eventbrite fields left out are not copied. Event fields replace the Makerble value; Contact fields + only fill in blanks. + operationId: setEventbriteFieldMapping security: [{tokenAuth: []}] + requestBody: + required: true + content: + application/json: + schema: + type: object + required: [charity_id, mappings] + properties: + charity_id: + type: integer + mappings: + type: array + items: + $ref: '#/components/schemas/EventbriteFieldPair' + example: + charity_id: 913 + mappings: + - eventbrite_field: name + makerble_field: name + - eventbrite_field: venue + makerble_field: location + paused: true responses: "200": - description: The endpoint with its new secret + description: The mapping, with the fields each Eventbrite field can go into content: application/json: schema: - $ref: '#/components/schemas/WebhookEndpointWithSecret' + $ref: '#/components/schemas/EventbriteFieldMapping' "401": $ref: '#/components/responses/Unauthorized' "403": - $ref: '#/components/responses/WebhooksNotTurnedOn' + $ref: '#/components/responses/Forbidden' "404": $ref: '#/components/responses/NotFound' + "422": + $ref: '#/components/responses/UnprocessableEntity' - /webhook_endpoints/{id}/test: - parameters: - - $ref: '#/components/parameters/ResourceId' + /eventbrite_connection/refresh_questions: post: - tags: [Webhooks] - summary: Send a test event - description: | - Queues a `webhook.test` event (`data: { "test": true, "message": "This is a test event from Makerble." }`) for the endpoint. Check the - delivery log a few seconds later for the result. - operationId: sendWebhookTestEvent + tags: [Eventbrite] + summary: Re-read the order form questions from Eventbrite + description: Reads the questions on the order forms of recent events brought in, and returns the ticket holder mapping. + operationId: refreshEventbriteQuestions security: [{tokenAuth: []}] + parameters: + - name: charity_id + in: query + required: true + schema: + type: integer + description: The Organisation (Charity) ID responses: - "202": - description: The queued delivery + "200": + description: The mapping, with the fields each Eventbrite field can go into content: application/json: schema: - $ref: '#/components/schemas/WebhookDelivery' + $ref: '#/components/schemas/EventbriteFieldMapping' "401": $ref: '#/components/responses/Unauthorized' "403": - $ref: '#/components/responses/WebhooksNotTurnedOn' + $ref: '#/components/responses/Forbidden' "404": $ref: '#/components/responses/NotFound' - /webhook_endpoints/{id}/deliveries: - parameters: - - $ref: '#/components/parameters/ResourceId' + /webhook_endpoints: get: tags: [Webhooks] - summary: List a webhook endpoint's deliveries - description: The delivery log, newest first, kept for 30 days. Payloads are not included. - operationId: listWebhookDeliveries + summary: List an Organisation's webhook endpoints + description: | + The Organisation's (Charity's) webhook endpoints, without their secrets. Only the + Organisation's admins can manage webhooks, and only once an admin has ticked **Turn on Webhooks** + in the Organisation's Settings (otherwise `403`). + operationId: listWebhookEndpoints security: [{tokenAuth: []}] parameters: + - name: charity_id + in: query + required: true + schema: + type: integer + description: The Organisation (Charity) ID - $ref: '#/components/parameters/Page' - $ref: '#/components/parameters/PerPage' - $ref: '#/components/parameters/LastSyncDatetime' responses: "200": - description: Paginated list of deliveries + description: Paginated list of webhook endpoints content: application/json: schema: - $ref: '#/components/schemas/PaginatedWebhookDeliveries' + $ref: '#/components/schemas/PaginatedWebhookEndpoints' "401": $ref: '#/components/responses/Unauthorized' "403": @@ -19255,27 +20181,225 @@ paths: "404": $ref: '#/components/responses/NotFound' - /webhook_endpoints/{id}/deliveries/{delivery_id}/replay: - parameters: - - $ref: '#/components/parameters/ResourceId' - - name: delivery_id - in: path - required: true - schema: - type: integer - description: The delivery's ID post: tags: [Webhooks] - summary: Send a delivery again + summary: Register a webhook endpoint description: | - Sends the delivery again with the same event `id`, so a receiver that already processed - it can ignore it. `data` shows the record as it is now. - operationId: replayWebhookDelivery + Starts sending the chosen events to an HTTPS URL. Leave out `event_types` to send every + event, or give one event for a trigger that fires on that event only. An Organisation can + have at most 10 endpoints added this way, and separately at most 100 created by automation + platforms such as Power Automate (one per flow). The response includes the signing `secret`, + which is shown only this once, and a `Location` header with the endpoint's full address: + send `DELETE` to it to unsubscribe. + + Power Automate flows can't check the signature themselves. They rely instead on the callback + address being secret, which Microsoft generates for each flow. + operationId: createWebhookEndpoint security: [{tokenAuth: []}] - responses: - "202": - description: The delivery, queued again - content: + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/WebhookEndpointRequest' + example: + webhook_endpoint: + charity_id: 913 + url: "https://crm.example.org/makerble" + description: "Dynamics sync" + event_types: ["contact.created", "contact.updated"] + responses: + "201": + description: Endpoint created, with its secret + headers: + Location: + description: Full address of the new endpoint, e.g. `https://app.makerble.com/api/v2/webhook_endpoints/42` + schema: + type: string + format: uri + content: + application/json: + schema: + $ref: '#/components/schemas/WebhookEndpointWithSecret' + "401": + $ref: '#/components/responses/Unauthorized' + "403": + $ref: '#/components/responses/WebhooksNotTurnedOn' + "404": + $ref: '#/components/responses/NotFound' + "422": + $ref: '#/components/responses/UnprocessableEntity' + + /webhook_endpoints/{id}: + parameters: + - $ref: '#/components/parameters/ResourceId' + get: + tags: [Webhooks] + summary: Get a webhook endpoint + operationId: getWebhookEndpoint + security: [{tokenAuth: []}] + responses: + "200": + description: The endpoint, without its secret + content: + application/json: + schema: + $ref: '#/components/schemas/WebhookEndpoint' + "401": + $ref: '#/components/responses/Unauthorized' + "403": + $ref: '#/components/responses/WebhooksNotTurnedOn' + "404": + $ref: '#/components/responses/NotFound' + patch: + tags: [Webhooks] + summary: Change, pause or resume a webhook endpoint + description: | + Send only the fields to change. `active: false` pauses the endpoint; `active: true` + resumes it, and also turns back on an endpoint Makerble switched off after repeated + failure (clearing `disabled_at` and `failure_count`). Changes made while it was off are + not sent afterwards. + operationId: updateWebhookEndpoint + security: [{tokenAuth: []}] + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/WebhookEndpointRequest' + example: + webhook_endpoint: + active: true + responses: + "200": + description: The updated endpoint + content: + application/json: + schema: + $ref: '#/components/schemas/WebhookEndpoint' + "401": + $ref: '#/components/responses/Unauthorized' + "403": + $ref: '#/components/responses/WebhooksNotTurnedOn' + "404": + $ref: '#/components/responses/NotFound' + "422": + $ref: '#/components/responses/UnprocessableEntity' + delete: + tags: [Webhooks] + summary: Delete a webhook endpoint + description: | + Deletes the endpoint and its delivery log. Makerble stops sending to it at once. Deleting is + idempotent: an endpoint that is already deleted, or that the user can't see, also answers + `204`, so an automation platform can unsubscribe safely more than once. + operationId: deleteWebhookEndpoint + security: [{tokenAuth: []}] + responses: + "204": + description: Deleted, or already gone + "401": + $ref: '#/components/responses/Unauthorized' + "403": + $ref: '#/components/responses/WebhooksNotTurnedOn' + + /webhook_endpoints/{id}/rotate_secret: + parameters: + - $ref: '#/components/parameters/ResourceId' + post: + tags: [Webhooks] + summary: Rotate a webhook endpoint's secret + description: | + Replaces the signing secret and returns the new one, shown only this once. Deliveries + are signed with it straight away. + operationId: rotateWebhookEndpointSecret + security: [{tokenAuth: []}] + responses: + "200": + description: The endpoint with its new secret + content: + application/json: + schema: + $ref: '#/components/schemas/WebhookEndpointWithSecret' + "401": + $ref: '#/components/responses/Unauthorized' + "403": + $ref: '#/components/responses/WebhooksNotTurnedOn' + "404": + $ref: '#/components/responses/NotFound' + + /webhook_endpoints/{id}/test: + parameters: + - $ref: '#/components/parameters/ResourceId' + post: + tags: [Webhooks] + summary: Send a test event + description: | + Queues a `webhook.test` event (`data: { "test": true, "message": "This is a test event from Makerble." }`) for the endpoint. Check the + delivery log a few seconds later for the result. + operationId: sendWebhookTestEvent + security: [{tokenAuth: []}] + responses: + "202": + description: The queued delivery + content: + application/json: + schema: + $ref: '#/components/schemas/WebhookDelivery' + "401": + $ref: '#/components/responses/Unauthorized' + "403": + $ref: '#/components/responses/WebhooksNotTurnedOn' + "404": + $ref: '#/components/responses/NotFound' + + /webhook_endpoints/{id}/deliveries: + parameters: + - $ref: '#/components/parameters/ResourceId' + get: + tags: [Webhooks] + summary: List a webhook endpoint's deliveries + description: The delivery log, newest first, kept for 30 days. Payloads are not included. + operationId: listWebhookDeliveries + security: [{tokenAuth: []}] + parameters: + - $ref: '#/components/parameters/Page' + - $ref: '#/components/parameters/PerPage' + - $ref: '#/components/parameters/LastSyncDatetime' + responses: + "200": + description: Paginated list of deliveries + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedWebhookDeliveries' + "401": + $ref: '#/components/responses/Unauthorized' + "403": + $ref: '#/components/responses/WebhooksNotTurnedOn' + "404": + $ref: '#/components/responses/NotFound' + + /webhook_endpoints/{id}/deliveries/{delivery_id}/replay: + parameters: + - $ref: '#/components/parameters/ResourceId' + - name: delivery_id + in: path + required: true + schema: + type: integer + description: The delivery's ID + post: + tags: [Webhooks] + summary: Send a delivery again + description: | + Sends the delivery again with the same event `id`, so a receiver that already processed + it can ignore it. `data` shows the record as it is now. + operationId: replayWebhookDelivery + security: [{tokenAuth: []}] + responses: + "202": + description: The delivery, queued again + content: application/json: schema: $ref: '#/components/schemas/WebhookDelivery' @@ -19772,6 +20896,24 @@ components: $ref: '#/components/schemas/Error' example: error: "Only an Organisation Admin can manage Event Formats." + + PortalLinksForbidden: + description: You don't have permission for this project's Portal links + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + example: + error: "You don't have permission to send Portal links in this project." + + 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." SetupGuideForbidden: description: You aren't an Organisation Admin of this Organisation, or its Setup guide is switched off content: @@ -19898,606 +21040,1118 @@ components: schema: $ref: '#/components/schemas/Error' example: - error: "You don't have permission to add users to project 619." - UnprocessableEntity: - description: Validation failed - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - UnprocessableEntityList: - description: Validation failed - content: - application/json: - schema: + error: "You don't have permission to add users to project 619." + UnprocessableEntity: + description: Validation failed + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + UnprocessableEntityList: + description: Validation failed + content: + application/json: + schema: + type: object + properties: + errors: + type: array + items: + type: string + example: + errors: ["Name can't be blank"] + ForbiddenError: + description: The user may not do this + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + example: + error: forbidden + WebhooksNotTurnedOn: + description: | + The user is a member of the Organisation but not an Organisation Admin, or webhooks are not + turned on for the Organisation yet. `error` says which, in words that can be shown to the + user. For a request from an automation platform such as Power Automate, the first reads + "Only an Organisation Admin can create Makerble triggers". + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + examples: + notAnAdmin: + value: + error: "Only an Organisation Admin can manage Webhooks" + notTurnedOn: + value: + error: "Webhooks are not turned on for this organisation" + + schemas: + SetupGuide: + type: object + properties: + organisation_id: + type: integer + done_count: + type: integer + description: Items done, leaving out those marked not relevant. + total_count: + type: integer + description: Items shown, leaving out those marked not relevant. + finished: + type: boolean + description: True once every item is done or marked not relevant. + data: + type: array + items: + $ref: '#/components/schemas/SetupGuideItem' + SetupGuideItem: + type: object + properties: + key: + type: string + enum: [teams, workspaces, welcome_tour, checklists, reporting_requirements, demographics, metrics] + title: + type: string + section: + type: string + nullable: true + description: The heading the item sits under, e.g. "Automate your reporting", or null. + progress: + type: string + description: How far it has got, in words, e.g. "3 of 5 workspaces". Always the current picture, even once done. + done_when: + type: string + done: + type: boolean + description: True once Makerble has seen it done. It stays done. + not_relevant: + type: boolean + SavedFilter: + type: object + properties: + id: + type: integer + name: + type: string + type: + type: string + enum: [contacts, events, cases] + description: What the filter filters + organisation_id: + type: integer + nullable: true + shared: + type: boolean + description: Whether the owner shared it with colleagues + project_ids: + type: array + items: + type: integer + description: The projects named in the filter's criteria. The filter can be added only to these projects' toolbars. + can_add_shortcut: + type: boolean + description: Whether you can add it to a project's toolbar + created_at: + type: string + format: date-time + updated_at: + type: string + format: date-time + PaginatedSavedFilters: + type: object + properties: + page: + type: integer + page_size: + type: integer + page_count: + type: integer + total_count: + type: integer + data: + type: array + items: + $ref: '#/components/schemas/SavedFilter' + SavedFilterDetail: + allOf: + - $ref: '#/components/schemas/SavedFilter' + - type: object + properties: + shortcut_views: + type: array + description: The views a shortcut to this filter can open + items: + type: object + properties: + key: + type: string + example: contacts_overview + label: + type: string + example: Overview + group: + type: string + description: In-built views, or Custom tables + shortcut_projects: + type: array + description: The projects you can add this filter to + items: + type: object + properties: + id: + type: integer + name: + type: string + SavedFilterShortcutInput: + type: object + required: [project_id, view_key] + properties: + project_id: + type: integer + description: One of the Saved Filter's `shortcut_projects` + view_key: + type: string + description: One of the Saved Filter's `shortcut_views` + name: + type: string + description: The shortcut's label on the toolbar. Defaults to the Saved Filter's name. + SavedFilterShortcut: + type: object + properties: + id: + type: integer + name: + type: string + project_id: + type: integer + saved_filter_id: + type: integer + view_key: + type: string + created_at: + type: string + format: date-time + updated_at: + type: string + format: date-time + AnnouncementNameChange: + type: object + required: [old_name, new_name] + properties: + old_name: + type: string + maxLength: 40 + example: Projects + new_name: + type: string + maxLength: 40 + example: Workspaces + AnnouncementImageUpload: + type: object + required: [filename, data] + properties: + filename: + type: string + example: workspaces.png + data: + type: string + format: byte + description: The file's contents in base64. + AnnouncementInput: + type: object + properties: + scope_type: + type: string + enum: [Charity, Project, Team] + description: | + On create only: whose announcement it is, an Organisation (`Charity`), a Workspace + (`Project`) or a Team, with `scope_id`. Leave out for one of Makerble's own. + scope_id: + type: integer + description: On create only, with `scope_type`. + training_material_id: + type: integer + nullable: true + description: >- + For an Organisation's, Workspace's or Team's announcement: one of that Organisation's Training materials + to link to. Send null to clear it. + feature_tour_id: + type: integer + nullable: true + description: >- + For one of Makerble's own announcements: a feature tour (from GET /feature_tours). While the tour is live, + the popup's button is "Take the tour", which starts it on its first page instead of showing `button_label`. + Send null to clear it. + feature_launch_id: + type: integer + nullable: true + description: >- + For one of Makerble's own announcements: the feature launch it announces (from GET /feature_launches). + Wherever the announcement leaves `body`, `learn_more_url`, `button_deep_link` or `feature_tour_id` empty, + the popup and What's new use the launch's `short_description`, `user_guide_url`, `deep_link` and + `feature_tour_id`. Send null to clear it. + title: + type: string + maxLength: 90 + description: The headline, in sentence case. Required. + body: + type: string + nullable: true + maxLength: 280 + description: >- + The message. Required, unless the announcement is for a feature launch (`feature_launch_id`) that has a + `short_description`, which is shown instead while this is empty. + visual_type: + type: string + enum: [name_change, vimeo, image, intro_animation, storyboard, none] + description: >- + The name-change animation (Makerble's own only), a Vimeo video, an uploaded image (with `image` and + `image_alt`), a feature's Intro animation (`intro_animation`, with `intro_key`; Makerble's own only), an + animation of its own (`storyboard`; Makerble's own only), or nothing. Changing it from `image` removes the + image and its alt text. + name_changes: + type: array + minItems: 1 + maxItems: 3 + description: For `name_change`, 1 to 3 old and new names, played in this order. Ignored for the other visuals. + items: + $ref: '#/components/schemas/AnnouncementNameChange' + vimeo_url: + type: string + description: For `vimeo`, https://vimeo.com/, https://vimeo.com// or https://player.vimeo.com/video/?h=. Ignored for the other visuals. + image: + description: | + For `image`: a screenshot or illustration shown whole (never cropped) in the popup. A PNG, JPG, GIF or + WebP file of up to 5 MB; the type is read from the file itself. Send it as a file in a + `multipart/form-data` request, or in JSON as `{ "filename": "workspaces.png", "data": "" }`. + Required when creating an `image` announcement; leave it out on update to keep the saved image. + oneOf: + - type: string + format: binary + - $ref: '#/components/schemas/AnnouncementImageUpload' + image_alt: + type: string + maxLength: 250 + description: For `image`, required. What the image shows, read out by screen readers. + intro_key: + type: string + description: | + For `intro_animation`: the key of the Intro (guidance panel) whose animation the popup plays, such as + `checklists`. It must have a storyboard. The popup plays the Intro's storyboard as it is when shown, so a + later change to the Intro's animation changes the announcement's too; if the Intro loses its animation, the + popup shows no visual. The usual choice for a feature's announcement. + storyboard: + type: object + additionalProperties: true + description: | + For `storyboard`: an animation of the announcement's own, for when the Intro's doesn't fit (for example when + only one part of a feature is new). The same format and rules as an Intro's storyboard (`archetype`, + `loop_seconds`, `alt`, `steps`); one that breaks them is refused with 422, naming the problem. + learn_more_url: + type: string + nullable: true + description: | + Optional. For Makerble's own, a page in the Makerble User Guide + (https://makerble.atlassian.net/wiki/spaces/MCPD/...). For a place's, any https page; one + outside the User Guide is marked as opening outside Makerble. + button_label: + type: string + maxLength: 24 + description: Defaults to "Got it". + button_deep_link: + type: string + nullable: true + description: | + Makerble's own only. Where the button goes: the `name` of a deep link from List Deep Links, such as + `checklists`. The button then opens that page in the person's own organisation and closes the popup; give it a + label that says where it goes ("Explore Checklists"). For someone who can't open the page, it only closes the + popup. A live `feature_tour_id` takes priority. Send null to clear it. + audience: + type: string + enum: [everyone, colleagues, administrators] + description: | + `everyone`: every signed-in user. `colleagues`: everyone except Contacts with a login + (active participants). `administrators`: Organisation Admins of at least one organisation. + Ignored for a place's announcement, which is always for the colleagues there. Ignored too + when `roles` has any. + roles: + type: array + items: + type: string + enum: [organisation_admin, editor, reporter, observer, team_leader, active_participant, survey_portal_user] + description: | + Makerble's own only (System Access users). Narrows who sees it to anyone holding at least one + of these roles, in place of `audience`: `organisation_admin` (Organisation Admin), `editor` + (Workspace editor, Project Editor), `reporter`, `observer` (of an Organisation or a + Workspace), `team_leader`, `active_participant` (Contact with a login) and + `survey_portal_user`. Contacts with a login and Survey Portal users are left out unless their + own role is listed, even when they hold another. An empty list (the default) leaves it to + `audience`. Sent, it replaces the list. + audience_rules: + type: object + additionalProperties: true + description: | + Makerble's own only (System Access users). Behaviour rules: a JSON expression over the named + facts from List Announcement Facts, saying who sees it beyond its audience or roles, e.g. + only people whose organisation hasn't set up Distance Travelled. Each rule is exactly one of + `{"fact": key, "params": {...}}` (params optional), `{"all": [rules]}`, `{"any": [rules]}` + or `{"not": rule}`; at most 5 deep and 10 facts. `{}` (the default) means no rules. An + unknown fact, param or shape is refused with 422, naming the rule. + example: + all: + - fact: distance_travelled_not_set_up + params: + across: all_organisations + page_keys: + type: array + items: + type: string + description: | + Makerble's own only (System Access users). The pages it shows on, by the key of each page's + Show/Hide Guidance panel: for example `contacts` (Manage Contacts), `events`, `checklists` or + `surveys`. Someone sees it when they open one of those pages, including when they move between + pages without reloading. Pages without a guidance panel have no key and can't be chosen. An + empty list (the default) means any page. An unknown key is refused with 422, listing the keys + available. Sent, it replaces + the list. + example: [contacts] + starts_on: + type: string + format: date + description: Required to schedule. + ends_on: + type: string + format: date + description: Required to schedule; not before `starts_on`. + status: + type: string + enum: [draft, scheduled] + description: On create, defaults to `draft`. On update, defaults to the current status. + schedule_on_next_free_days: + type: boolean + description: | + Makerble's own only (422 for an Organisation's, Workspace's or Team's). Schedules the + announcement from the first day, from today, on which no other Makerble announcement starts, + keeping its own length (14 days if it has no dates yet). Any `status`, `starts_on` and `ends_on` + sent are replaced. People see at most one Makerble announcement a day, so this keeps + announcements from queuing behind each other. Use it to schedule a feature's announcement + once the feature is live on production. + AnnouncementFact: + type: object + properties: + key: + type: string + description: 'What a rule names, e.g. `{"fact": "distance_travelled_not_set_up"}`' + label: + type: string + description: Completes "people ..." in Site Overview's "Who sees this" + description: + type: string + params: + type: object + description: Each param by name, with the values it accepts, its default and what it means + additionalProperties: type: object properties: - errors: + values: type: array items: type: string - example: - errors: ["Name can't be blank"] - ForbiddenError: - description: The user may not do this - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - example: - error: forbidden - WebhooksNotTurnedOn: - description: | - The user is a member of the Organisation but not an Organisation Admin, or webhooks are not - turned on for the Organisation yet. `error` says which, in words that can be shown to the - user. For a request from an automation platform such as Power Automate, the first reads - "Only an Organisation Admin can create Makerble triggers". - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - examples: - notAnAdmin: - value: - error: "Only an Organisation Admin can manage Webhooks" - notTurnedOn: - value: - error: "Webhooks are not turned on for this organisation" - - schemas: - SetupGuide: + default: + type: string + description: + type: string + DeepLink: type: object properties: - organisation_id: + name: + type: string + example: checklists + description: The link's name. Never changes, since User Guide articles link to it. + label: + type: string + example: Checklists + group: + type: string + example: Checklists + role: + type: string + enum: [user, member, editor] + description: The role the person needs in their organisation to open the page. + record: + type: boolean + description: True when the link opens one record (the first the person can see), falling back to a page. + PaginatedDeepLinks: + type: object + properties: + page: type: integer - done_count: + page_size: + type: integer + page_count: + type: integer + total_count: + type: integer + data: + type: array + items: + $ref: '#/components/schemas/DeepLink' + PaginatedAnnouncementFacts: + type: object + properties: + page: + type: integer + page_size: + type: integer + page_count: type: integer - description: Items done, leaving out those marked not relevant. total_count: type: integer - description: Items shown, leaving out those marked not relevant. - finished: - type: boolean - description: True once every item is done or marked not relevant. data: type: array items: - $ref: '#/components/schemas/SetupGuideItem' - SetupGuideItem: - type: object - properties: - key: + $ref: '#/components/schemas/AnnouncementFact' + Announcement: + type: object + properties: + id: + type: integer + scope_type: + type: string + enum: [Charity, Project, Team, null] + nullable: true + description: | + Whose announcement it is: an Organisation (`Charity`), a Workspace (`Project`) or a Team. + Null for Makerble's own. Its audience is that place's colleagues: an Organisation's + colleagues, a Workspace's editors, reporters and observers, or a Team's members and leaders. + scope_id: + type: integer + nullable: true + training_material_id: + type: integer + nullable: true + description: >- + One of the place's Organisation's Training materials that the announcement links to (shown only to + colleagues it is shared with), or null + feature_tour_id: + type: integer + nullable: true + description: >- + The feature tour the popup's button starts with "Take the tour" while the tour is live, or null + feature_launch_id: + type: integer + nullable: true + description: >- + The feature launch the announcement is for, or null. Its message, User Guide link, deep link and feature tour + are shown wherever the announcement's own are empty. + title: + type: string + body: + type: string + nullable: true + description: The announcement's own message; null when it shows its feature launch's short description + visual_type: + type: string + enum: [name_change, vimeo, image, intro_animation, storyboard, none] + name_changes: + type: array + items: + $ref: '#/components/schemas/AnnouncementNameChange' + vimeo_url: type: string - enum: [teams, workspaces, welcome_tour, checklists, reporting_requirements, demographics, metrics] - title: + nullable: true + learn_more_url: type: string - section: + nullable: true + button_label: + type: string + audience: + type: string + enum: [everyone, colleagues, administrators] + roles: + type: array + items: + type: string + description: The roles that narrow who sees it, in place of `audience`; empty for none. See Create an Announcement. + audience_rules: + type: object + additionalProperties: true + description: Behaviour rules over named facts; `{}` for none. See Create an Announcement. + page_keys: + type: array + items: + type: string + description: The guidance panel keys of the pages it shows on; empty for any page. See Create an Announcement. + image_url: type: string nullable: true - description: The heading the item sits under, e.g. "Automate your reporting", or null. - progress: + description: For the `image` visual, a link to the uploaded image; null otherwise. + image_alt: type: string - description: How far it has got, in words, e.g. "3 of 5 workspaces". Always the current picture, even once done. - done_when: + nullable: true + description: For the `image` visual, the image's alt text; null otherwise. + intro_key: type: string - done: - type: boolean - description: True once Makerble has seen it done. It stays done. - not_relevant: - type: boolean - SavedFilter: + nullable: true + description: For `intro_animation`, the key of the Intro whose animation it plays; null otherwise. + storyboard: + type: object + nullable: true + additionalProperties: true + description: For `storyboard`, the announcement's own animation storyboard; null otherwise. + starts_on: + type: string + format: date + nullable: true + ends_on: + type: string + format: date + nullable: true + status: + type: string + enum: [draft, scheduled] + description: What is stored. See `current_status` for whether it is showing. + current_status: + type: string + enum: [draft, scheduled, live, ended] + description: "`live` while today is within the dates of a scheduled announcement, `ended` after them." + seen_count: + type: integer + description: People who have closed it. + seen_counts_by_source: + type: object + description: >- + Of those who have seen it, how many first saw it in the popup and how many by opening it in + Wishlist › What's new. + properties: + popup: + type: integer + whats_new: + type: integer + required: [popup, whats_new] + learn_more_click_count: + type: integer + description: People who clicked its "Learn more" link. + button_deep_link: + type: string + nullable: true + description: The deep link the button opens, or null when it only closes the popup. + button_click_count: + type: integer + description: People who clicked the button through to its page. + created_by_id: + type: integer + nullable: true + updated_by_id: + type: integer + nullable: true + created_at: + type: string + format: date-time + updated_at: + type: string + format: date-time + TrainingMaterialInput: type: object properties: - id: - type: integer name: type: string - type: + maxLength: 120 + description: For example "How to add a new school". Required. + url: type: string - enum: [contacts, events, cases] - description: What the filter filters - organisation_id: - type: integer + maxLength: 2048 + description: The document's link, starting https://. Required. + description: + type: string + maxLength: 280 nullable: true - shared: + description: One or two lines saying who it is for + material_type: + type: string + enum: [document, video] + description: Shown as an icon. Defaults to document. + all_organisation: type: boolean - description: Whether the owner shared it with colleagues + description: For everyone in the Organisation + team_ids: + type: array + items: { type: integer } + description: The Organisation's Teams it is for project_ids: type: array - items: - type: integer - description: The projects named in the filter's criteria. The filter can be added only to these projects' toolbars. - can_add_shortcut: - type: boolean - description: Whether you can add it to a project's toolbar - created_at: + items: { type: integer } + description: The Organisation's Workspaces (Projects) it is for + owner_id: + type: integer + description: The person to ask about it. An Organisation Admin of the Organisation, or the caller. + Unavailability: + type: object + description: A range when a colleague can't work for an Organisation (Staff availability page) + properties: + id: { type: integer } + user_id: { type: integer } + charity_id: { type: integer } + starts_at: { type: string, format: date-time } + ends_at: type: string format: date-time - updated_at: + description: For an all-day range, the end of `to_date` in the Organisation's timezone + all_day: { type: boolean } + from_date: { type: string, format: date, description: In the Organisation's timezone } + to_date: { type: string, format: date } + from_time: { type: string, nullable: true, description: 'HH:MM, or null for an all-day range' } + to_time: { type: string, nullable: true } + timezone: { type: string, example: Europe/London } + reason_type: { type: string, enum: [annual_leave, sick_leave, training, other] } + reason_label: { type: string, example: Annual leave } + summary: { type: string, example: '3/12/2026 13:00–17:30 · Training' } + private_note: type: string - format: date-time - PaginatedSavedFilters: + nullable: true + description: Only returned to the colleague themselves and to Charity Editors + created_at: { type: string, format: date-time } + updated_at: { type: string, format: date-time } + UnavailabilityInput: type: object properties: - page: - type: integer - page_size: - type: integer - page_count: - type: integer - total_count: - type: integer - data: + from_date: { type: string, format: date } + to_date: { type: string, format: date } + all_day: { type: boolean, default: true } + from_time: { type: string, description: 'HH:MM, for a part day' } + to_time: { type: string, description: 'HH:MM, for a part day' } + reason_type: { type: string, enum: [annual_leave, sick_leave, training, other] } + private_note: { type: string, maxLength: 150 } + unassign_event_ids: type: array - items: - $ref: '#/components/schemas/SavedFilter' - SavedFilterDetail: + items: { type: integer } + description: Events from `conflicting_events` to take the colleague off in the same call + UnavailabilityWithConflicts: allOf: - - $ref: '#/components/schemas/SavedFilter' + - $ref: '#/components/schemas/Unavailability' - type: object properties: - shortcut_views: - type: array - description: The views a shortcut to this filter can open - items: - type: object - properties: - key: - type: string - example: contacts_overview - label: - type: string - example: Overview - group: - type: string - description: In-built views, or Custom tables - shortcut_projects: + conflicting_events: type: array - description: The projects you can add this filter to + description: Upcoming events the colleague is an Event Worker on during this range items: type: object properties: - id: - type: integer - name: - type: string - SavedFilterShortcutInput: - type: object - required: [project_id, view_key] - properties: - project_id: - type: integer - description: One of the Saved Filter's `shortcut_projects` - view_key: - type: string - description: One of the Saved Filter's `shortcut_views` - name: - type: string - description: The shortcut's label on the toolbar. Defaults to the Saved Filter's name. - SavedFilterShortcut: + id: { type: integer } + name: { type: string } + start_datetime: { type: string, format: date-time } + end_datetime: { type: string, format: date-time } + event_category_name: { type: string, nullable: true, description: The Event Format } + project_id: { type: integer } + project_name: { type: string, nullable: true } + editable: { type: boolean, description: Whether the caller may edit the event, and so unassign the colleague } + unassigned: { type: boolean, description: Whether this call took the colleague off the event } + TrainingMaterial: type: object + description: A link to one of an Organisation's own training documents or videos, and who it is for properties: id: type: integer + organisation_id: + type: integer name: type: string - project_id: - type: integer - saved_filter_id: + url: + type: string + description: + type: string + nullable: true + material_type: + type: string + enum: [document, video] + all_organisation: + type: boolean + team_ids: + type: array + items: { type: integer } + project_ids: + type: array + items: { type: integer } + description: The Workspaces (Projects) it is for + owner_id: type: integer - view_key: + nullable: true + owner_name: + type: string + nullable: true + description: Shown to viewers as "Questions? Ask [name]" + reviewed_at: type: string + format: date-time + description: When it was added or last marked as reviewed + review_due: + type: boolean + nullable: true + description: Last reviewed more than 12 months ago. Null unless the caller can manage the Organisation's Training materials. created_at: type: string format: date-time updated_at: type: string format: date-time - AnnouncementNameChange: - type: object - required: [old_name, new_name] - properties: - old_name: - type: string - maxLength: 40 - example: Projects - new_name: - type: string - maxLength: 40 - example: Workspaces - AnnouncementImageUpload: - type: object - required: [filename, data] - properties: - filename: - type: string - example: workspaces.png - data: - type: string - format: byte - description: The file's contents in base64. - AnnouncementInput: + Tour: type: object + description: A Welcome Tour and its stops in order properties: - scope_type: - type: string - enum: [Charity, Project, Team] - description: | - On create only: whose announcement it is, an Organisation (`Charity`), a Workspace - (`Project`) or a Team, with `scope_id`. Leave out for one of Makerble's own. - scope_id: + id: type: integer - description: On create only, with `scope_type`. - training_material_id: + name: + type: string + organisation_id: type: integer - nullable: true - description: >- - For an Organisation's, Workspace's or Team's announcement: one of that Organisation's Training materials - to link to. Send null to clear it. - feature_tour_id: + team_id: type: integer nullable: true + description: The Team it is for; null for the Organisation's default tour + audience: + type: string + description: The Team's name, or "Everyone in the organisation (default)" + watch_checklist_ids: + type: array + items: + type: integer description: >- - For one of Makerble's own announcements: a feature tour (from GET /feature_tours). While the tour is live, - the popup's button is "Take the tour", which starts it on its first page instead of showing `button_label`. - Send null to clear it. - feature_launch_id: + The Checklists that Watch the journey shows straight after the tour, in order (up to 2). Empty means + people see up to 2 Checklists on their workspaces, most recently updated first. + training_material_id: type: integer nullable: true description: >- - For one of Makerble's own announcements: the feature launch it announces (from GET /feature_launches). - Wherever the announcement leaves `body`, `learn_more_url`, `button_deep_link` or `feature_tour_id` empty, - the popup and What's new use the launch's `short_description`, `user_guide_url`, `deep_link` and - `feature_tour_id`. Send null to clear it. - title: + The Training material the tour's last stop links to as the Full guide (shown only to people it is shared + with), or null + mode: type: string - maxLength: 90 - description: The headline, in sentence case. Required. - body: + enum: [required, optional] + description: required is shown as Mandatory + status: type: string - nullable: true - maxLength: 280 - description: >- - The message. Required, unless the announcement is for a feature launch (`feature_launch_id`) that has a - `short_description`, which is shown instead while this is empty. - visual_type: + enum: [draft, live] + start_skippable: + type: boolean + description: Whether people can skip the tour when it is first offered + later_limit: + type: integer + minimum: 1 + maximum: 10 + description: How many times someone can choose "I'll do this later" on a mandatory tour + created_at: type: string - enum: [name_change, vimeo, image, intro_animation, storyboard, none] - description: >- - The name-change animation (Makerble's own only), a Vimeo video, an uploaded image (with `image` and - `image_alt`), a feature's Intro animation (`intro_animation`, with `intro_key`; Makerble's own only), an - animation of its own (`storyboard`; Makerble's own only), or nothing. Changing it from `image` removes the - image and its alt text. - name_changes: + format: date-time + updated_at: + type: string + format: date-time + stops: type: array - minItems: 1 - maxItems: 3 - description: For `name_change`, 1 to 3 old and new names, played in this order. Ignored for the other visuals. items: - $ref: '#/components/schemas/AnnouncementNameChange' - vimeo_url: - type: string - description: For `vimeo`, https://vimeo.com/, https://vimeo.com// or https://player.vimeo.com/video/?h=. Ignored for the other visuals. - image: - description: | - For `image`: a screenshot or illustration shown whole (never cropped) in the popup. A PNG, JPG, GIF or - WebP file of up to 5 MB; the type is read from the file itself. Send it as a file in a - `multipart/form-data` request, or in JSON as `{ "filename": "workspaces.png", "data": "" }`. - Required when creating an `image` announcement; leave it out on update to keep the saved image. - oneOf: - - type: string - format: binary - - $ref: '#/components/schemas/AnnouncementImageUpload' - image_alt: - type: string - maxLength: 250 - description: For `image`, required. What the image shows, read out by screen readers. - intro_key: - type: string - description: | - For `intro_animation`: the key of the Intro (guidance panel) whose animation the popup plays, such as - `checklists`. It must have a storyboard. The popup plays the Intro's storyboard as it is when shown, so a - later change to the Intro's animation changes the announcement's too; if the Intro loses its animation, the - popup shows no visual. The usual choice for a feature's announcement. - storyboard: - type: object - additionalProperties: true - description: | - For `storyboard`: an animation of the announcement's own, for when the Intro's doesn't fit (for example when - only one part of a feature is new). The same format and rules as an Intro's storyboard (`archetype`, - `loop_seconds`, `alt`, `steps`); one that breaks them is refused with 422, naming the problem. - learn_more_url: + $ref: '#/components/schemas/TourStop' + TourStop: + type: object + properties: + id: + type: integer + position: + type: integer + group_name: type: string nullable: true - description: | - Optional. For Makerble's own, a page in the Makerble User Guide - (https://makerble.atlassian.net/wiki/spaces/MCPD/...). For a place's, any https page; one - outside the User Guide is marked as opening outside Makerble. - button_label: + stop_key: type: string - maxLength: 24 - description: Defaults to "Got it". - button_deep_link: + enum: [navbar_spaces, navbar_user, focus_table, contacts_table, contacts_search, contacts_filters, events_table, event_guests] + stop_label: type: string nullable: true - description: | - Makerble's own only. Where the button goes: the `name` of a deep link from List Deep Links, such as - `checklists`. The button then opens that page in the person's own organisation and closes the popup; give it a - label that says where it goes ("Explore Checklists"). For someone who can't open the page, it only closes the - popup. A live `feature_tour_id` takes priority. Send null to clear it. - audience: + description: Which part of which page the stop focuses on + action: type: string - enum: [everyone, colleagues, administrators] - description: | - `everyone`: every signed-in user. `colleagues`: everyone except Contacts with a login - (active participants). `administrators`: Organisation Admins of at least one organisation. - Ignored for a place's announcement, which is always for the colleagues there. Ignored too - when `roles` has any. - roles: - type: array - items: - type: string - enum: [organisation_admin, editor, reporter, observer, team_leader, active_participant, survey_portal_user] - description: | - Makerble's own only (System Access users). Narrows who sees it to anyone holding at least one - of these roles, in place of `audience`: `organisation_admin` (Organisation Admin), `editor` - (Workspace editor, Project Editor), `reporter`, `observer` (of an Organisation or a - Workspace), `team_leader`, `active_participant` (Contact with a login) and - `survey_portal_user`. Contacts with a login and Survey Portal users are left out unless their - own role is listed, even when they hold another. An empty list (the default) leaves it to - `audience`. Sent, it replaces the list. - audience_rules: - type: object - additionalProperties: true - description: | - Makerble's own only (System Access users). Behaviour rules: a JSON expression over the named - facts from List Announcement Facts, saying who sees it beyond its audience or roles, e.g. - only people whose organisation hasn't set up Distance Travelled. Each rule is exactly one of - `{"fact": key, "params": {...}}` (params optional), `{"all": [rules]}`, `{"any": [rules]}` - or `{"not": rule}`; at most 5 deep and 10 facts. `{}` (the default) means no rules. An - unknown fact, param or shape is refused with 422, naming the rule. - example: - all: - - fact: distance_travelled_not_set_up - params: - across: all_organisations - page_keys: - type: array - items: - type: string - description: | - Makerble's own only (System Access users). The pages it shows on, by the key of each page's - Show/Hide Guidance panel: for example `contacts` (Manage Contacts), `events`, `checklists` or - `surveys`. Someone sees it when they open one of those pages, including when they move between - pages without reloading. Pages without a guidance panel have no key and can't be chosen. An - empty list (the default) means any page. An unknown key is refused with 422, listing the keys - available. Sent, it replaces - the list. - example: [contacts] - starts_on: + enum: [next, click, ""] + description: Whether the stop waits for Next or asks the person to click something + title: type: string - format: date - description: Required to schedule. - ends_on: + body: type: string - format: date - description: Required to schedule; not before `starts_on`. - status: + nullable: true + action_text: type: string - enum: [draft, scheduled] - description: On create, defaults to `draft`. On update, defaults to the current status. - schedule_on_next_free_days: + nullable: true + description: What to click, on a click stop + after_text: + type: string + nullable: true + description: Shown after the click + skippable: type: boolean - description: | - Makerble's own only (422 for an Organisation's, Workspace's or Team's). Schedules the - announcement from the first day, from today, on which no other Makerble announcement starts, - keeping its own length (14 days if it has no dates yet). Any `status`, `starts_on` and `ends_on` - sent are replaced. People see at most one Makerble announcement a day, so this keeps - announcements from queuing behind each other. Use it to schedule a feature's announcement - once the feature is live on production. - AnnouncementFact: + description: Whether a click stop shows Skip this stop + included: + type: boolean + description: Whether the tour shows this stop. An unticked stop keeps its wording for when it is ticked again. + default_body: + type: string + nullable: true + description: Makerble's wording for this stop, shown when `body` is empty + TourInput: type: object properties: - key: + name: type: string - description: 'What a rule names, e.g. `{"fact": "distance_travelled_not_set_up"}`' - label: + organisation_id: + type: integer + team_id: + type: integer + nullable: true + mode: type: string - description: Completes "people ..." in Site Overview's "Who sees this" - description: + enum: [required, optional] + status: type: string - params: - type: object - description: Each param by name, with the values it accepts, its default and what it means - additionalProperties: + enum: [draft, live] + start_skippable: + type: boolean + later_limit: + type: integer + minimum: 1 + maximum: 10 + watch_checklist_ids: + type: array + maxItems: 2 + items: + type: integer + description: Up to 2 Checklists of the tour's Organisation for Watch the journey, in order. Send [] to clear them. + training_material_id: + type: integer + nullable: true + description: >- + One of the Organisation's Training materials, linked as the Full guide on the tour's last stop. Send null to + clear it. + stops: + type: array + items: type: object properties: - values: - type: array - items: - type: string - default: + id: + type: integer + position: + type: integer + group_name: type: string - description: + stop_key: type: string - DeepLink: + description: For an Organisation Admin, names the stop instead of `id`, and adds it if the tour doesn't have it + title: + type: string + body: + type: string + nullable: true + description: The stop's wording; empty means Makerble's default. Up to 280 characters for an Organisation Admin. + included: + type: boolean + description: Whether the tour shows this stop + action_text: + type: string + after_text: + type: string + skippable: + type: boolean + _destroy: + type: boolean + PaginatedTours: + allOf: + - $ref: '#/components/schemas/PaginationEnvelope' + - type: object + properties: + data: + type: array + items: + $ref: '#/components/schemas/Tour' + FeatureTourFunnel: type: object + description: A feature tour's funnel properties: + id: + type: integer name: type: string - example: checklists - description: The link's name. Never changes, since User Guide articles link to it. - label: - type: string - example: Checklists - group: + status: type: string - example: Checklists - role: + enum: [draft, amends_needed, live] + counts_since: type: string - enum: [user, member, editor] - description: The role the person needs in their organisation to open the page. - record: - type: boolean - description: True when the link opens one record (the first the person can see), falling back to a page. - PaginatedDeepLinks: - type: object - properties: - page: - type: integer - page_size: - type: integer - page_count: - type: integer - total_count: - type: integer - data: + format: date + nullable: true + description: The day stop-by-stop counts were first recorded; null until anyone has taken a step + totals: + type: object + properties: + started: + type: integer + description: Everyone who has taken the tour + completed: + type: integer + in_progress: + type: integer + ended_early: + type: integer + stops: type: array items: - $ref: '#/components/schemas/DeepLink' - PaginatedAnnouncementFacts: + type: object + properties: + id: + type: integer + position: + type: integer + stop_key: + type: string + title: + type: string + description: The stop's own title, or Makerble's default + reached: + type: integer + completed: + type: integer + skipped_by_user: + type: integer + skipped_by_system: + type: integer + FeatureLaunchEmailInput: type: object + required: [feature_launch_ids] properties: - page: - type: integer - page_size: - type: integer - page_count: - type: integer - total_count: - type: integer - data: + feature_launch_ids: type: array + description: The feature launches to show, 1 to 10, in this order (from GET /feature_launches). items: - $ref: '#/components/schemas/AnnouncementFact' - Announcement: + type: integer + user_email: + type: string + description: Show it as this Makerble user gets it. Leave it out for someone without a Makerble account. + intro: + type: string + description: An opening paragraph, shown before the feature launches. + subject: + type: string + description: The subject. Leave it out to name the features ("What’s new in Makerble - Registers and Albums"). + FeatureLaunchEmailPreview: + type: object + required: [subject, to, html, text] + properties: + subject: + type: string + to: + type: string + description: Who it would go to. + html: + type: string + description: The HTML version, a 600px email with inline styles. + text: + type: string + description: The plain-text version. + FeatureLaunch: type: object + description: A feature launch and its launch content properties: id: type: integer - scope_type: + name: + type: string + maxLength: 80 + description: The feature's name as people see it in Makerble, such as Registers. Unique, ignoring case. + tier: + type: string + enum: [minor, standard, major] + description: How big the launch is. Major is a new feature or a substantial new capability. + short_description: type: string - enum: [Charity, Project, Team, null] nullable: true - description: | - Whose announcement it is: an Organisation (`Charity`), a Workspace (`Project`) or a Team. - Null for Makerble's own. Its audience is that place's colleagues: an Organisation's - colleagues, a Workspace's editors, reporters and observers, or a Team's members and leaders. - scope_id: - type: integer + maxLength: 280 + description: The announcement message. An announcement for the launch shows it when its own `body` is empty. + email_description: + type: string nullable: true - training_material_id: - type: integer + maxLength: 600 + description: >- + 2 to 4 sentences for the feature launch emails, in the words people see in Makerble: what it is, why it + matters and how to start. + user_guide_url: + type: string + nullable: true + maxLength: 2048 + description: A page in the Makerble User Guide (https://makerble.atlassian.net/wiki/spaces/MCPD/...). + blog_url: + type: string + nullable: true + maxLength: 2048 + description: The blog post about the feature, a web address starting https://. + deep_link: + type: string nullable: true - description: >- - One of the place's Organisation's Training materials that the announcement links to (shown only to - colleagues it is shared with), or null + description: The name of a deep link (from GET /deep_links) that opens the feature in the person's own organisation. feature_tour_id: type: integer nullable: true - description: >- - The feature tour the popup's button starts with "Take the tour" while the tour is live, or null - feature_launch_id: - type: integer - nullable: true - description: >- - The feature launch the announcement is for, or null. Its message, User Guide link, deep link and feature tour - are shown wherever the announcement's own are empty. - title: - type: string - body: + description: The feature tour (from GET /feature_tours) that introduces it. + intro_key: type: string nullable: true - description: The announcement's own message; null when it shows its feature launch's short description - visual_type: + description: The key of the feature's Intro (from GET /guidance_panels). + email_visual: type: string - enum: [name_change, vimeo, image, intro_animation, storyboard, none] - name_changes: - type: array - items: - $ref: '#/components/schemas/AnnouncementNameChange' - vimeo_url: + enum: [gif, still_frame, image, none] + description: >- + What the email shows: a GIF or a still frame made from the feature's animation, an uploaded image + (`email_image`), or nothing. + email_visual_alt: type: string nullable: true - learn_more_url: + maxLength: 250 + description: What the visual shows, for screen readers. Required unless `email_visual` is `none`. + email_primary_link: type: string nullable: true - button_label: - type: string - audience: - type: string - enum: [everyone, colleagues, administrators] - roles: + enum: [deep_link, tour, user_guide, blog, null] + description: >- + Which link the email's main button uses: the deep link, Take the tour, the User Guide page or the blog + post. The launch must have that link. + email_text_links: type: array + maxItems: 2 items: type: string - description: The roles that narrow who sees it, in place of `audience`; empty for none. See Create an Announcement. - audience_rules: - type: object - additionalProperties: true - description: Behaviour rules over named facts; `{}` for none. See Create an Announcement. - page_keys: + enum: [deep_link, tour, user_guide, blog] + description: Up to two more links the email shows as text, each one the launch has and not the main button. + jira_keys: type: array items: type: string - description: The guidance panel keys of the pages it shows on; empty for any page. See Create an Announcement. - image_url: - type: string - nullable: true - description: For the `image` visual, a link to the uploaded image; null otherwise. - image_alt: - type: string - nullable: true - description: For the `image` visual, the image's alt text; null otherwise. - intro_key: - type: string - nullable: true - description: For `intro_animation`, the key of the Intro whose animation it plays; null otherwise. - storyboard: - type: object - nullable: true - additionalProperties: true - description: For `storyboard`, the announcement's own animation storyboard; null otherwise. - starts_on: + example: CP-9271 + description: The Jira issues that built the feature. + released_on: type: string format: date nullable: true - ends_on: + description: The day the feature reached production. + email_image_url: type: string - format: date nullable: true - status: - type: string - enum: [draft, scheduled] - description: What is stored. See `current_status` for whether it is showing. - current_status: + description: The uploaded image for an `image` visual, or null + email_gif_url: type: string - enum: [draft, scheduled, live, ended] - description: "`live` while today is within the dates of a scheduled announcement, `ended` after them." - seen_count: - type: integer - description: People who have closed it. - seen_counts_by_source: - type: object - description: >- - Of those who have seen it, how many first saw it in the popup and how many by opening it in - Wishlist › What's new. - properties: - popup: - type: integer - whats_new: - type: integer - required: [popup, whats_new] - learn_more_click_count: - type: integer - description: People who clicked its "Learn more" link. - button_deep_link: + nullable: true + description: The GIF made from the feature's animation, or null until it is made + email_still_frame_url: type: string nullable: true - description: The deep link the button opens, or null when it only closes the popup. - button_click_count: - type: integer - description: People who clicked the button through to its page. + description: The still frame made from the feature's animation, or null until it is made + announcement_ids: + type: array + items: + type: integer + description: The announcements for this launch created_by_id: type: integer nullable: true @@ -20510,194 +22164,128 @@ components: updated_at: type: string format: date-time - TrainingMaterialInput: + FeatureLaunchInput: type: object properties: name: type: string - maxLength: 120 - description: For example "How to add a new school". Required. - url: - type: string - maxLength: 2048 - description: The document's link, starting https://. Required. - description: - type: string - maxLength: 280 - nullable: true - description: One or two lines saying who it is for - material_type: - type: string - enum: [document, video] - description: Shown as an icon. Defaults to document. - all_organisation: - type: boolean - description: For everyone in the Organisation - team_ids: - type: array - items: { type: integer } - description: The Organisation's Teams it is for - project_ids: - type: array - items: { type: integer } - description: The Organisation's Workspaces (Projects) it is for - owner_id: - type: integer - description: The person to ask about it. An Organisation Admin of the Organisation, or the caller. - Unavailability: - type: object - description: A range when a colleague can't work for an Organisation (Staff availability page) - properties: - id: { type: integer } - user_id: { type: integer } - charity_id: { type: integer } - starts_at: { type: string, format: date-time } - ends_at: + maxLength: 80 + description: >- + The feature's name as people see it in Makerble, such as Registers. Unique, ignoring case. Required on + create. + tier: type: string - format: date-time - description: For an all-day range, the end of `to_date` in the Organisation's timezone - all_day: { type: boolean } - from_date: { type: string, format: date, description: In the Organisation's timezone } - to_date: { type: string, format: date } - from_time: { type: string, nullable: true, description: 'HH:MM, or null for an all-day range' } - to_time: { type: string, nullable: true } - timezone: { type: string, example: Europe/London } - reason_type: { type: string, enum: [annual_leave, sick_leave, training, other] } - reason_label: { type: string, example: Annual leave } - summary: { type: string, example: '3/12/2026 13:00–17:30 · Training' } - private_note: + enum: [minor, standard, major] + description: How big the launch is. Major is a new feature or a substantial new capability. + short_description: type: string nullable: true - description: Only returned to the colleague themselves and to Charity Editors - created_at: { type: string, format: date-time } - updated_at: { type: string, format: date-time } - UnavailabilityInput: - type: object - properties: - from_date: { type: string, format: date } - to_date: { type: string, format: date } - all_day: { type: boolean, default: true } - from_time: { type: string, description: 'HH:MM, for a part day' } - to_time: { type: string, description: 'HH:MM, for a part day' } - reason_type: { type: string, enum: [annual_leave, sick_leave, training, other] } - private_note: { type: string, maxLength: 150 } - unassign_event_ids: - type: array - items: { type: integer } - description: Events from `conflicting_events` to take the colleague off in the same call - UnavailabilityWithConflicts: - allOf: - - $ref: '#/components/schemas/Unavailability' - - type: object - properties: - conflicting_events: - type: array - description: Upcoming events the colleague is an Event Worker on during this range - items: - type: object - properties: - id: { type: integer } - name: { type: string } - start_datetime: { type: string, format: date-time } - end_datetime: { type: string, format: date-time } - event_category_name: { type: string, nullable: true, description: The Event Format } - project_id: { type: integer } - project_name: { type: string, nullable: true } - editable: { type: boolean, description: Whether the caller may edit the event, and so unassign the colleague } - unassigned: { type: boolean, description: Whether this call took the colleague off the event } - TrainingMaterial: - type: object - description: A link to one of an Organisation's own training documents or videos, and who it is for - properties: - id: - type: integer - organisation_id: - type: integer - name: - type: string - url: - type: string - description: + maxLength: 280 + description: The announcement message. An announcement for the launch shows it when its own `body` is empty. + email_description: type: string nullable: true - material_type: - type: string - enum: [document, video] - all_organisation: - type: boolean - team_ids: - type: array - items: { type: integer } - project_ids: - type: array - items: { type: integer } - description: The Workspaces (Projects) it is for - owner_id: - type: integer + maxLength: 600 + description: >- + 2 to 4 sentences for the feature launch emails, in the words people see in Makerble: what it is, why it + matters and how to start. + user_guide_url: + type: string nullable: true - owner_name: + maxLength: 2048 + description: A page in the Makerble User Guide (https://makerble.atlassian.net/wiki/spaces/MCPD/...). + blog_url: type: string nullable: true - description: Shown to viewers as "Questions? Ask [name]" - reviewed_at: + maxLength: 2048 + description: The blog post about the feature, a web address starting https://. + deep_link: type: string - format: date-time - description: When it was added or last marked as reviewed - review_due: - type: boolean nullable: true - description: Last reviewed more than 12 months ago. Null unless the caller can manage the Organisation's Training materials. - created_at: + description: The name of a deep link (from GET /deep_links) that opens the feature in the person's own organisation. + feature_tour_id: + type: integer + nullable: true + description: The feature tour (from GET /feature_tours) that introduces it. + intro_key: type: string - format: date-time - updated_at: + nullable: true + description: The key of the feature's Intro (from GET /guidance_panels). + email_visual: type: string - format: date-time - Tour: - type: object - description: A Welcome Tour and its stops in order - properties: - id: - type: integer - name: + enum: [gif, still_frame, image, none] + description: >- + What the email shows: a GIF or a still frame made from the feature's animation, an uploaded image + (`email_image`), or nothing. + email_visual_alt: type: string - organisation_id: - type: integer - team_id: - type: integer nullable: true - description: The Team it is for; null for the Organisation's default tour - audience: + maxLength: 250 + description: What the visual shows, for screen readers. Required unless `email_visual` is `none`. + email_primary_link: type: string - description: The Team's name, or "Everyone in the organisation (default)" - watch_checklist_ids: + nullable: true + enum: [deep_link, tour, user_guide, blog, null] + description: >- + Which link the email's main button uses: the deep link, Take the tour, the User Guide page or the blog + post. The launch must have that link. + email_text_links: type: array + maxItems: 2 items: - type: integer - description: >- - The Checklists that Watch the journey shows straight after the tour, in order (up to 2). Empty means - people see up to 2 Checklists on their workspaces, most recently updated first. - training_material_id: - type: integer + type: string + enum: [deep_link, tour, user_guide, blog] + description: Up to two more links the email shows as text, each one the launch has and not the main button. + jira_keys: + type: array + items: + type: string + example: CP-9271 + description: The Jira issues that built the feature. + released_on: + type: string + format: date nullable: true + description: The day the feature reached production. + email_image: description: >- - The Training material the tour's last stop links to as the Full guide (shown only to people it is shared - with), or null - mode: + For an `image` visual: a PNG, JPG, GIF or WebP file of up to 5 MB, as a multipart file or as base64 data + with a filename. + oneOf: + - type: string + format: binary + - $ref: '#/components/schemas/AnnouncementImageUpload' + PaginatedFeatureLaunches: + allOf: + - $ref: '#/components/schemas/PaginationEnvelope' + - type: object + properties: + data: + type: array + items: + $ref: '#/components/schemas/FeatureLaunch' + FeatureTour: + type: object + description: A feature tour and its stops in order + properties: + id: + type: integer + key: + type: string + description: A unique name in lowercase words joined by underscores, used by announcements and agents + name: type: string - enum: [required, optional] - description: required is shown as Mandatory status: type: string - enum: [draft, live] - start_skippable: + enum: [draft, amends_needed, live] + description: Only a live tour is shown to anyone. `amends_needed` is a draft that came back from review + page_key: + type: string + nullable: true + description: The page whose Intro offers the tour with "Take the tour" while it is live; null for none + auto_prompt: type: boolean - description: Whether people can skip the tour when it is first offered - later_limit: - type: integer - minimum: 1 - maximum: 10 - description: How many times someone can choose "I'll do this later" on a mandatory tour + description: Whether the tour is offered once, the first time someone opens its page created_at: type: string format: date-time @@ -20707,153 +22295,62 @@ components: stops: type: array items: - $ref: '#/components/schemas/TourStop' - TourStop: + $ref: '#/components/schemas/FeatureTourStop' + FeatureTourStop: type: object properties: id: type: integer position: type: integer - group_name: - type: string - nullable: true stop_key: type: string - enum: [navbar_spaces, navbar_user, focus_table, contacts_table, contacts_search, contacts_filters, events_table, event_guests] + description: One of the stops Makerble knows, the same stops Welcome Tours use stop_label: type: string nullable: true description: Which part of which page the stop focuses on + group_name: + type: string + nullable: true + description: The feature the stop belongs to, such as Contacts or Registers; "Other" when it has none, null for a stop Makerble no longer knows action: type: string enum: [next, click, ""] description: Whether the stop waits for Next or asks the person to click something title: type: string - body: - type: string nullable: true - action_text: + description: The stop's own title; null shows `default_title` + body: type: string nullable: true - description: What to click, on a click stop - after_text: + description: The stop's own wording; null shows `default_body` + default_title: type: string nullable: true - description: Shown after the click - skippable: - type: boolean - description: Whether a click stop shows Skip this stop - included: - type: boolean - description: Whether the tour shows this stop. An unticked stop keeps its wording for when it is ticked again. + description: Makerble's title for this stop default_body: type: string nullable: true - description: Makerble's wording for this stop, shown when `body` is empty - TourInput: + description: Makerble's wording for this stop + FeatureTourInput: type: object properties: - name: - type: string - organisation_id: - type: integer - team_id: - type: integer - nullable: true - mode: - type: string - enum: [required, optional] - status: + key: type: string - enum: [draft, live] - start_skippable: - type: boolean - later_limit: - type: integer - minimum: 1 - maximum: 10 - watch_checklist_ids: - type: array - maxItems: 2 - items: - type: integer - description: Up to 2 Checklists of the tour's Organisation for Watch the journey, in order. Send [] to clear them. - training_material_id: - type: integer - nullable: true - description: >- - One of the Organisation's Training materials, linked as the Full guide on the tour's last stop. Send null to - clear it. - stops: - type: array - items: - type: object - properties: - id: - type: integer - position: - type: integer - group_name: - type: string - stop_key: - type: string - description: For an Organisation Admin, names the stop instead of `id`, and adds it if the tour doesn't have it - title: - type: string - body: - type: string - nullable: true - description: The stop's wording; empty means Makerble's default. Up to 280 characters for an Organisation Admin. - included: - type: boolean - description: Whether the tour shows this stop - action_text: - type: string - after_text: - type: string - skippable: - type: boolean - _destroy: - type: boolean - PaginatedTours: - allOf: - - $ref: '#/components/schemas/PaginationEnvelope' - - type: object - properties: - data: - type: array - items: - $ref: '#/components/schemas/Tour' - FeatureTourFunnel: - type: object - description: A feature tour's funnel - properties: - id: - type: integer name: type: string status: type: string enum: [draft, amends_needed, live] - counts_since: + description: Only a live tour is shown to anyone. `amends_needed` is a draft that came back from review + page_key: type: string - format: date nullable: true - description: The day stop-by-stop counts were first recorded; null until anyone has taken a step - totals: - type: object - properties: - started: - type: integer - description: Everyone who has taken the tour - completed: - type: integer - in_progress: - type: integer - ended_early: - type: integer + description: The key of a page's Intro, such as contacts. Send null or "" for none. + auto_prompt: + type: boolean stops: type: array items: @@ -20861,259 +22358,311 @@ components: properties: id: type: integer + description: Changes this stop; leave it out to add a stop position: type: integer stop_key: type: string title: type: string - description: The stop's own title, or Makerble's default - reached: - type: integer - completed: - type: integer - skipped_by_user: - type: integer - skipped_by_system: - type: integer - FeatureLaunchEmailInput: + nullable: true + description: Up to 120 characters; empty means Makerble's default + body: + type: string + nullable: true + description: Up to 600 characters; empty means Makerble's default + _destroy: + type: boolean + TourStopDefinition: type: object - required: [feature_launch_ids] + description: One of the stops Makerble knows, for building a Welcome Tour or a feature tour properties: - feature_launch_ids: - type: array - description: The feature launches to show, 1 to 10, in this order (from GET /feature_launches). - items: - type: integer - user_email: + key: type: string - description: Show it as this Makerble user gets it. Leave it out for someone without a Makerble account. - intro: + description: The stop's key, sent as `stop_key` when adding it to a tour + label: type: string - description: An opening paragraph, shown before the feature launches. - subject: + description: Which part of which page the stop focuses on + group_name: type: string - description: The subject. Leave it out to name the features ("What’s new in Makerble - Registers and Albums"). - FeatureLaunchEmailPreview: - type: object - required: [subject, to, html, text] - properties: - subject: + description: The feature the stop belongs to, such as Contacts or Registers; "Other" when it has none + page: type: string - to: + description: The page the stop opens, as a page name and its key, a path, or in words when it is worked out for each person + action: type: string - description: Who it would go to. - html: + enum: [next, click] + description: Whether the stop waits for Next or asks the person to click something + action_label: type: string - description: The HTML version, a 600px email with inline styles. - text: + description: '`action` in words: "Next button" or "Waits for a click"' + default_title: type: string - description: The plain-text version. - FeatureLaunch: + nullable: true + description: Makerble's title for the stop + default_body: + type: string + nullable: true + description: Makerble's wording for the stop + empty: + type: object + nullable: true + description: What the stop shows someone who can open its page but has nothing on it yet; null when it is skipped instead + properties: + title: + type: string + body: + type: string + page: + type: string + nullable: true + description: The page the empty variant opens, when it isn't the stop's own page + shown_to: + type: string + description: Who sees the stop, e.g. "Only for Organisation Editors" or "Skipped for someone without a Checklist" + feature_tour_count: + type: integer + description: How many feature tours use the stop + welcome_tour_count: + type: integer + description: How many Welcome Tours use the stop + TourStopWordingInput: type: object - description: A feature launch and its launch content properties: - id: + default_title: + type: string + maxLength: 120 + description: Makerble's title for the stop; empty goes back to the original + default_body: + type: string + maxLength: 600 + description: Makerble's text for the stop; empty goes back to the original + PaginatedTourStopDefinitions: + allOf: + - $ref: '#/components/schemas/PaginationEnvelope' + - type: object + properties: + data: + type: array + items: + $ref: '#/components/schemas/TourStopDefinition' + PaginatedFeatureTours: + allOf: + - $ref: '#/components/schemas/PaginationEnvelope' + - type: object + properties: + data: + type: array + items: + $ref: '#/components/schemas/FeatureTour' + PaginatedTourProgress: + allOf: + - $ref: '#/components/schemas/PaginationEnvelope' + - type: object + properties: + summary: + $ref: '#/components/schemas/TourProgressSummary' + data: + type: array + items: + $ref: '#/components/schemas/TourProgress' + TourProgressSummary: + type: object + description: The tiles on the Who has finished page + properties: + finished: + type: integer + part_way: + type: integer + not_started: + type: integer + description: Not started, or skipped an optional tour + average_minutes: + type: number + nullable: true + description: Average minutes to finish, counting only tours finished without "I'll do this later" + TourProgress: + type: object + description: One colleague and how far they have got + properties: + user_id: type: integer name: type: string - maxLength: 80 - description: The feature's name as people see it in Makerble, such as Registers. Unique, ignoring case. - tier: - type: string - enum: [minor, standard, major] - description: How big the launch is. Major is a new feature or a substantial new capability. - short_description: + team: type: string nullable: true - maxLength: 280 - description: The announcement message. An announcement for the launch shows it when its own `body` is empty. - email_description: + description: The first of the Organisation's Teams they joined + status: type: string - nullable: true - maxLength: 600 - description: >- - 2 to 4 sentences for the feature launch emails, in the words people see in Makerble: what it is, why it - matters and how to start. - user_guide_url: + enum: [not_started, in_progress, deferred, completed, skipped] + description: deferred means they chose "I'll do this later" + tour: type: string - nullable: true - maxLength: 2048 - description: A page in the Makerble User Guide (https://makerble.atlassian.net/wiki/spaces/MCPD/...). - blog_url: + description: As the page shows it, for example "Paused at stop 3 of 7" or "Finished" + later_used: type: string nullable: true - maxLength: 2048 - description: The blog post about the feature, a web address starting https://. - deep_link: + description: How many times they chose "I'll do this later" of how many allowed, on a mandatory tour + last_active_at: type: string + format: date-time nullable: true - description: The name of a deep link (from GET /deep_links) that opens the feature in the person's own organisation. - feature_tour_id: - type: integer - nullable: true - description: The feature tour (from GET /feature_tours) that introduces it. - intro_key: + reminded_at: type: string + format: date-time nullable: true - description: The key of the feature's Intro (from GET /guidance_panels). - email_visual: - type: string - enum: [gif, still_frame, image, none] - description: >- - What the email shows: a GIF or a still frame made from the feature's animation, an uploaded image - (`email_image`), or nothing. - email_visual_alt: + description: When they were last sent a reminder + TourReminder: + type: object + properties: + user_id: + type: integer + reminded_at: type: string - nullable: true - maxLength: 250 - description: What the visual shows, for screen readers. Required unless `email_visual` is `none`. - email_primary_link: + format: date-time + next_reminder_from: type: string - nullable: true - enum: [deep_link, tour, user_guide, blog, null] - description: >- - Which link the email's main button uses: the deep link, Take the tour, the User Guide page or the blog - post. The launch must have that link. - email_text_links: - type: array - maxItems: 2 - items: - type: string - enum: [deep_link, tour, user_guide, blog] - description: Up to two more links the email shows as text, each one the launch has and not the main button. - jira_keys: + format: date-time + description: The earliest another reminder can be sent to them + WelcomeJourneySettings: + type: object + properties: + organisation_id: + type: integer + photo_skippable: + type: boolean + description: Whether people can skip adding a profile picture + watch_skippable: + type: boolean + description: Whether people can skip Watch the journey, the Checklists shown after the Welcome Tour + tour_ids: type: array items: - type: string - example: CP-9271 - description: The Jira issues that built the feature. - released_on: + type: integer + PaginatedAnnouncements: + allOf: + - $ref: '#/components/schemas/PaginationEnvelope' + - type: object + properties: + data: + type: array + items: + $ref: '#/components/schemas/Announcement' + WhatsNewItem: + type: object + description: An announcement in the signed-in user's Wishlist › What's new, with whether they have seen it + properties: + id: + type: integer + title: + type: string + description: The headline. + body: + type: string + starts_on: type: string format: date - nullable: true - description: The day the feature reached production. - email_image_url: + ends_on: + type: string + format: date + section: + type: string + enum: [new_since_joined, before_joined] + visual_type: + type: string + enum: [name_change, vimeo, image, intro_animation, storyboard, none] + image_url: type: string nullable: true - description: The uploaded image for an `image` visual, or null - email_gif_url: + image_alt: type: string nullable: true - description: The GIF made from the feature's animation, or null until it is made - email_still_frame_url: + vimeo_url: type: string nullable: true - description: The still frame made from the feature's animation, or null until it is made - announcement_ids: - type: array - items: - type: integer - description: The announcements for this launch - created_by_id: - type: integer + learn_more_url: + type: string nullable: true - updated_by_id: + description: A page in the Makerble User Guide. + button_label: + type: string + includes_tour: + type: boolean + description: Whether its button starts a feature tour, which it does while the tour is live. + feature_tour_id: type: integer nullable: true - created_at: + description: The live feature tour its button starts, or null. + asked_for: + type: boolean + description: Whether it answered one of the user's requests in Wishlist › Your wishlist. + seen: + type: boolean + description: Whether the user has seen it, in the popup or by opening it in What's new. + seen_at: type: string format: date-time + nullable: true updated_at: type: string format: date-time - FeatureLaunchInput: + required: [id, title, body, starts_on, section, visual_type, includes_tour, asked_for, seen, seen_at] + PaginatedWhatsNew: + allOf: + - $ref: '#/components/schemas/PaginationEnvelope' + - type: object + properties: + data: + type: array + items: + $ref: '#/components/schemas/WhatsNewItem' + Wish: type: object + description: A feature request or feedback from Wishlist › Your wishlist properties: - name: - type: string - maxLength: 80 - description: >- - The feature's name as people see it in Makerble, such as Registers. Unique, ignoring case. Required on - create. - tier: - type: string - enum: [minor, standard, major] - description: How big the launch is. Major is a new feature or a substantial new capability. - short_description: - type: string - nullable: true - maxLength: 280 - description: The announcement message. An announcement for the launch shows it when its own `body` is empty. - email_description: + id: + type: integer + kind: type: string - nullable: true - maxLength: 600 - description: >- - 2 to 4 sentences for the feature launch emails, in the words people see in Makerble: what it is, why it - matters and how to start. - user_guide_url: + enum: [feature_request, feedback] + body: type: string - nullable: true - maxLength: 2048 - description: A page in the Makerble User Guide (https://makerble.atlassian.net/wiki/spaces/MCPD/...). - blog_url: + status: type: string - nullable: true - maxLength: 2048 - description: The blog post about the feature, a web address starting https://. - deep_link: + description: Where it is, as the person sees it, e.g. "Received", "Read by the Makerble team" or "Shipped". + helpdesk_key: type: string nullable: true - description: The name of a deep link (from GET /deep_links) that opens the feature in the person's own organisation. - feature_tour_id: + description: The Helpdesk ticket a feature request became (e.g. MC-2501), once it exists. + charity_id: type: integer nullable: true - description: The feature tour (from GET /feature_tours) that introduces it. - intro_key: - type: string + description: The organisation it's about. + announcement_id: + type: integer nullable: true - description: The key of the feature's Intro (from GET /guidance_panels). - email_visual: + description: The Announcement that answered it, if one has. + created_at: type: string - enum: [gif, still_frame, image, none] - description: >- - What the email shows: a GIF or a still frame made from the feature's animation, an uploaded image - (`email_image`), or nothing. - email_visual_alt: + format: date-time + updated_at: type: string - nullable: true - maxLength: 250 - description: What the visual shows, for screen readers. Required unless `email_visual` is `none`. - email_primary_link: + format: date-time + WishInput: + type: object + required: [kind, body] + properties: + kind: type: string - nullable: true - enum: [deep_link, tour, user_guide, blog, null] - description: >- - Which link the email's main button uses: the deep link, Take the tour, the User Guide page or the blog - post. The launch must have that link. - email_text_links: - type: array - maxItems: 2 - items: - type: string - enum: [deep_link, tour, user_guide, blog] - description: Up to two more links the email shows as text, each one the launch has and not the main button. - jira_keys: - type: array - items: - type: string - example: CP-9271 - description: The Jira issues that built the feature. - released_on: + enum: [feature_request, feedback] + body: type: string - format: date - nullable: true - description: The day the feature reached production. - email_image: - description: >- - For an `image` visual: a PNG, JPG, GIF or WebP file of up to 5 MB, as a multipart file or as base64 data - with a filename. - oneOf: - - type: string - format: binary - - $ref: '#/components/schemas/AnnouncementImageUpload' - PaginatedFeatureLaunches: + maxLength: 2000 + charity_id: + type: integer + description: One of your organisations. Needed only if you belong to more than one. + PaginatedWishes: allOf: - $ref: '#/components/schemas/PaginationEnvelope' - type: object @@ -21121,632 +22670,604 @@ components: data: type: array items: - $ref: '#/components/schemas/FeatureLaunch' - FeatureTour: + $ref: '#/components/schemas/Wish' + RoadmapItem: type: object - description: A feature tour and its stops in order + description: Something in Wishlist › Coming soon properties: id: type: integer - key: + title: type: string - description: A unique name in lowercase words joined by underscores, used by announcements and agents - name: + body: type: string - status: + stage: type: string - enum: [draft, amends_needed, live] - description: Only a live tour is shown to anyone. `amends_needed` is a draft that came back from review - page_key: + enum: [building_now, up_next] + stage_label: type: string - nullable: true - description: The page whose Intro offers the tour with "Take the tour" while it is live; null for none - auto_prompt: + enum: [Building now, Up next] + position: + type: integer + description: Its order within its stage. + published: type: boolean - description: Whether the tour is offered once, the first time someone opens its page + stale: + type: boolean + description: Unchanged for 60 days. created_at: type: string format: date-time updated_at: type: string format: date-time - stops: - type: array - items: - $ref: '#/components/schemas/FeatureTourStop' - FeatureTourStop: + RoadmapItemInput: type: object properties: - id: - type: integer - position: - type: integer - stop_key: - type: string - description: One of the stops Makerble knows, the same stops Welcome Tours use - stop_label: - type: string - nullable: true - description: Which part of which page the stop focuses on - group_name: - type: string - nullable: true - description: The feature the stop belongs to, such as Contacts or Registers; "Other" when it has none, null for a stop Makerble no longer knows - action: - type: string - enum: [next, click, ""] - description: Whether the stop waits for Next or asks the person to click something title: type: string - nullable: true - description: The stop's own title; null shows `default_title` + maxLength: 90 body: type: string - nullable: true - description: The stop's own wording; null shows `default_body` - default_title: - type: string - nullable: true - description: Makerble's title for this stop - default_body: + maxLength: 280 + stage: type: string - nullable: true - description: Makerble's wording for this stop - FeatureTourInput: + enum: [building_now, up_next] + published: + type: boolean + PaginatedRoadmapItems: + allOf: + - $ref: '#/components/schemas/PaginationEnvelope' + - type: object + properties: + data: + type: array + items: + $ref: '#/components/schemas/RoadmapItem' + BulkProjectMove: type: object + description: A move of many Contacts through Projects, and how far it has got properties: - key: - type: string - name: - type: string + id: + type: integer status: type: string - enum: [draft, amends_needed, live] - description: Only a live tour is shown to anyone. `amends_needed` is a draft that came back from review - page_key: + enum: [pending, running, completed, failed, undone] + total_count: + type: integer + description: Contacts the move will try to change (the selection, less Headline Only Contacts) + processed_count: + type: integer + description: Contacts reached so far + changed_count: + type: integer + description: Contacts whose Projects or status changed + skip_counts: + type: object + additionalProperties: { type: integer } + description: Skipped Contacts by reason, e.g. headline_only, not_allowed or error + background: + type: boolean + description: True when the move runs in the background (more than 50 Contacts) + summary: type: string nullable: true - description: The key of a page's Intro, such as contacts. Send null or "" for none. - auto_prompt: - type: boolean - stops: + description: The finished message, e.g. "12 contacts changed. 3 skipped …"; null until it has finished + StartPage: + type: object + required: [start_page, options] + properties: + start_page: + type: string + enum: [newsfeed, focus, snapshot, autopilot] + description: The key of your start page; newsfeed when you have never chosen + options: type: array + description: The pages you can choose, in the order the Today section lists them items: type: object + required: [key, label, description] properties: - id: - type: integer - description: Changes this stop; leave it out to add a stop - position: - type: integer - stop_key: + key: type: string - title: + description: e.g. focus + label: type: string - nullable: true - description: Up to 120 characters; empty means Makerble's default - body: + description: Its name under Today, e.g. Focus + description: type: string - nullable: true - description: Up to 600 characters; empty means Makerble's default - _destroy: - type: boolean - TourStopDefinition: + description: The line under it in Personal Settings › Preferences + FocusSource: type: object - description: One of the stops Makerble knows, for building a Welcome Tour or a feature tour + required: [key, label, shown] properties: key: type: string - description: The stop's key, sent as `stop_key` when adding it to a tour + description: e.g. checklist_actions label: type: string - description: Which part of which page the stop focuses on - group_name: + description: Its name under ⚙ What Focus shows you, e.g. Checklist Actions + shown: + type: boolean + description: False when you have switched it off + FocusItem: + type: object + required: [id, type, title, context, contact, url, due_on, raised_on, due_text, section, action] + properties: + id: type: string - description: The feature the stop belongs to, such as Contacts or Registers; "Other" when it has none - page: + description: Unique across every source, e.g. checklist_actions-812 + type: type: string - description: The page the stop opens, as a page name and its key, a path, or in words when it is worked out for each person - action: + description: The source it came from, e.g. checklist_actions + title: type: string - enum: [next, click] - description: Whether the stop waits for Next or asks the person to click something - action_label: + description: What it is, e.g. the Checklist step + context: type: string - description: '`action` in words: "Next button" or "Waits for a click"' - default_title: + description: Where it belongs, e.g. "Checklist Action · Intake · step 2 of 5", plus who is responsible when it isn't you + contact: + type: object + nullable: true + description: The Contact it is about, when there is one + required: [id, name] + properties: + id: + type: integer + name: + type: string + url: type: string + description: Where the row leads + due_on: + type: string + format: date nullable: true - description: Makerble's title for the stop - default_body: + description: The day it is due, or null + raised_on: type: string + format: date nullable: true - description: Makerble's wording for the stop - empty: + description: For something with no due date, the day it was raised + due_text: + type: string + description: e.g. "15 days overdue", "Due today", "Due in 4 days", "No due date" + section: + type: string + enum: [overdue, today, this_week, later] + action: type: object - nullable: true - description: What the stop shows someone who can open its page but has nothing on it yet; null when it is skipped instead + description: The row's one button + required: [label, url, method] properties: - title: + label: type: string - body: + description: e.g. Open + url: type: string - page: + method: type: string - nullable: true - description: The page the empty variant opens, when it isn't the stop's own page - shown_to: - type: string - description: Who sees the stop, e.g. "Only for Organisation Editors" or "Skipped for someone without a Checklist" - feature_tour_count: - type: integer - description: How many feature tours use the stop - welcome_tour_count: - type: integer - description: How many Welcome Tours use the stop - TourStopWordingInput: + description: The HTTP method, e.g. get + FocusFeed: type: object + required: [scope, teams, type, sources, counts, sections, page, page_size, page_count, total_count, data] properties: - default_title: + scope: type: string - maxLength: 120 - description: Makerble's title for the stop; empty goes back to the original - default_body: + enum: [me, teams] + teams: + type: boolean + description: You are in a Team, so scope=teams is available + type: type: string - maxLength: 600 - description: Makerble's text for the stop; empty goes back to the original - PaginatedTourStopDefinitions: - allOf: - - $ref: '#/components/schemas/PaginationEnvelope' - - type: object - properties: - data: - type: array - items: - $ref: '#/components/schemas/TourStopDefinition' - PaginatedFeatureTours: - allOf: - - $ref: '#/components/schemas/PaginationEnvelope' - - type: object - properties: - data: - type: array - items: - $ref: '#/components/schemas/FeatureTour' - PaginatedTourProgress: - allOf: - - $ref: '#/components/schemas/PaginationEnvelope' - - type: object + nullable: true + description: The type filtered by, or null for every type + sources: + type: array + items: + $ref: '#/components/schemas/FocusSource' + counts: + type: object + description: "`all`, and the number of items of each type that has any, e.g. {all: 4, checklist_actions: 4}" + required: [all] + additionalProperties: + type: integer properties: - summary: - $ref: '#/components/schemas/TourProgressSummary' - data: - type: array - items: - $ref: '#/components/schemas/TourProgress' - TourProgressSummary: - type: object - description: The tiles on the Who has finished page - properties: - finished: + all: + type: integer + sections: + type: array + description: The sections that have items, in order + items: + type: object + required: [key, label, count] + properties: + key: + type: string + enum: [overdue, today, this_week, later] + label: + type: string + count: + type: integer + page: type: integer - part_way: + page_size: type: integer - not_started: + page_count: type: integer - description: Not started, or skipped an optional tour - average_minutes: - type: number - nullable: true - description: Average minutes to finish, counting only tours finished without "I'll do this later" - TourProgress: - type: object - description: One colleague and how far they have got - properties: - user_id: + total_count: type: integer - name: - type: string - team: - type: string - nullable: true - description: The first of the Organisation's Teams they joined - status: + data: + type: array + items: + $ref: '#/components/schemas/FocusItem' + + ImpactStoreSearchResult: + type: object + description: A published ImpactStore item found by **Search the ImpactStore**. + properties: + id: + type: integer + type: type: string - enum: [not_started, in_progress, deferred, completed, skipped] - description: deferred means they chose "I'll do this later" - tour: + enum: [survey, contact_form, case_form, impact_framework, report_template, toolkit, project_type] + type_label: type: string - description: As the page shows it, for example "Paused at stop 3 of 7" or "Finished" - later_used: + description: The front-end name of the type, e.g. Contact Form + name: type: string - nullable: true - description: How many times they chose "I'll do this later" of how many allowed, on a mandatory tour - last_active_at: + description: type: string - format: date-time nullable: true - reminded_at: + description: One line of plain text (always null for a Case Form) + causes: + type: array + items: + type: string + description: Cause and subcause names, causes first + used_by_count: + type: integer + description: How many organisations use it + explore_url: type: string - format: date-time nullable: true - description: When they were last sent a reminder - TourReminder: - type: object - properties: - user_id: + description: Its page on Explore (null for a Project Type) + matched_words: type: integer - reminded_at: - type: string - format: date-time - next_reminder_from: - type: string - format: date-time - description: The earliest another reminder can be sent to them - WelcomeJourneySettings: + description: How many of the query's words it matched + + PaginatedImpactStoreSearch: type: object properties: - organisation_id: + page: type: integer - photo_skippable: - type: boolean - description: Whether people can skip adding a profile picture - watch_skippable: - type: boolean - description: Whether people can skip Watch the journey, the Checklists shown after the Welcome Tour - tour_ids: + page_size: + type: integer + page_count: + type: integer + total_count: + type: integer + data: type: array items: - type: integer - PaginatedAnnouncements: - allOf: - - $ref: '#/components/schemas/PaginationEnvelope' - - type: object - properties: - data: - type: array - items: - $ref: '#/components/schemas/Announcement' - WhatsNewItem: + $ref: '#/components/schemas/ImpactStoreSearchResult' + + LibrarySearchResult: type: object - description: An announcement in the signed-in user's Wishlist › What's new, with whether they have seen it + description: A library item found by **Search the library**. Metrics also have `metric_type` and `choices`; Lists have `choices`. + additionalProperties: true properties: id: type: integer - title: - type: string - description: The headline. - body: + type: type: string - starts_on: + enum: [survey, metric, activity_tracker, outcome, list, unit, field, contact_form, case_form, impact_framework, toolkit, project_type, idea] + name: type: string - format: date - ends_on: + nullable: true + description: type: string - format: date - section: + nullable: true + description: One line of plain text + owner: type: string - enum: [new_since_joined, before_joined] - visual_type: + enum: [your organisation, public library, Makerble] + + ExploreSurvey: + type: object + description: A Survey (Story Category) listed on Explore Surveys + properties: + id: + type: integer + name: type: string - enum: [name_change, vimeo, image, intro_animation, storyboard, none] - image_url: + description: type: string nullable: true - image_alt: + shared_by: type: string nullable: true - vimeo_url: + description: The organisation (or person) that published it + tag: type: string nullable: true - learn_more_url: - type: string + enum: [Verdicts, Validated, null] + question_count: + type: integer + estimated_minutes: + type: integer nullable: true - description: A page in the Makerble User Guide. - button_label: + description: About how long it takes to answer, worked out from its questions + themes: + type: array + items: + type: string + audiences: + type: array + description: Who answers it + items: + type: string + contact_mode: type: string - includes_tour: + enum: [one_contact, several_contacts] + description: How the survey is shown when someone tries it on a toolkit page, About one contact (`one_contact`) or for Several or no contacts (`several_contacts`) + repeats_at_intervals: type: boolean - description: Whether its button starts a feature tour, which it does while the tour is live. - feature_tour_id: + validated: + type: boolean + description: An industry-recognised, validated scale + verdicts: + type: boolean + description: Verdicts are set up, so it classifies each respondent automatically + libraries_count: type: integer - nullable: true - description: The live feature tour its button starts, or null. - asked_for: + description: How many organisations have it in one of their projects + yours: type: boolean - description: Whether it answered one of the user's requests in Wishlist › Your wishlist. - seen: + description: Your organisation published it + added_to_a_project: type: boolean - description: Whether the user has seen it, in the popup or by opening it in What's new. - seen_at: + description: It is already in one of your organisation's projects + + ExploreFacetGroup: + type: object + properties: + key: type: string - format: date-time - nullable: true - updated_at: + description: The filter's query parameter, e.g. theme. Each Explore endpoint lists its own. + label: type: string - format: date-time - required: [id, title, body, starts_on, section, visual_type, includes_tour, asked_for, seen, seen_at] - PaginatedWhatsNew: - allOf: - - $ref: '#/components/schemas/PaginationEnvelope' - - type: object - properties: - data: - type: array - items: - $ref: '#/components/schemas/WhatsNewItem' - Wish: + options: + type: array + items: + type: object + properties: + value: + type: string + label: + type: string + count: + type: integer + description: How many Surveys this option would return, given the other filters already chosen + selected: + type: boolean + + PaginatedExploreSurveys: type: object - description: A feature request or feedback from Wishlist › Your wishlist properties: - id: + page: type: integer - kind: - type: string - enum: [feature_request, feedback] - body: - type: string - status: - type: string - description: Where it is, as the person sees it, e.g. "Received", "Read by the Makerble team" or "Shipped". - helpdesk_key: - type: string - nullable: true - description: The Helpdesk ticket a feature request became (e.g. MC-2501), once it exists. - charity_id: + page_size: type: integer - nullable: true - description: The organisation it's about. - announcement_id: + page_count: type: integer - nullable: true - description: The Announcement that answered it, if one has. - created_at: - type: string - format: date-time - updated_at: - type: string - format: date-time - WishInput: - type: object - required: [kind, body] - properties: - kind: - type: string - enum: [feature_request, feedback] - body: - type: string - maxLength: 2000 - charity_id: + total_count: type: integer - description: One of your organisations. Needed only if you belong to more than one. - PaginatedWishes: + data: + type: array + items: + $ref: '#/components/schemas/ExploreSurvey' + facets: + type: array + items: + $ref: '#/components/schemas/ExploreFacetGroup' + + ExploreReportTemplatePreview: allOf: - - $ref: '#/components/schemas/PaginationEnvelope' + - $ref: '#/components/schemas/ExploreReportTemplate' - type: object properties: - data: + questions: type: array items: - $ref: '#/components/schemas/Wish' - RoadmapItem: + type: object + properties: + title: + type: string + answer_formats: + type: array + items: + type: string + enum: [narrative, number, chart] + + ExploreReportTemplate: type: object - description: Something in Wishlist › Coming soon properties: id: type: integer - title: + slug: type: string - body: + name: type: string - stage: + description: type: string - enum: [building_now, up_next] - stage_label: + nullable: true + recipient: type: string - enum: [Building now, Up next] - position: + nullable: true + enum: [funder, trustees, local_authority, corporate_partner, internal, null] + theme: + type: string + nullable: true + question_count: type: integer - description: Its order within its stage. - published: + answer_formats: + type: array + items: + type: string + enum: [narrative, number, chart] + shared_by: + type: string + libraries_count: + type: integer + description: How many organisations have it in their library + yours: type: boolean - stale: + description: Whether one of the caller's organisations owns it + in_your_library: type: boolean - description: Unchanged for 60 days. - created_at: - type: string - format: date-time - updated_at: - type: string - format: date-time - RoadmapItemInput: + description: Whether it is in the library of one of the caller's organisations + + PaginatedExploreReportTemplates: type: object properties: - title: - type: string - maxLength: 90 - body: - type: string - maxLength: 280 - stage: - type: string - enum: [building_now, up_next] - published: - type: boolean - PaginatedRoadmapItems: + page: + type: integer + page_size: + type: integer + page_count: + type: integer + total_count: + type: integer + data: + type: array + items: + $ref: '#/components/schemas/ExploreReportTemplate' + facets: + type: array + items: + $ref: '#/components/schemas/ExploreFacetGroup' + + ExploreDropdownPreview: allOf: - - $ref: '#/components/schemas/PaginationEnvelope' + - $ref: '#/components/schemas/ExploreDropdown' - type: object properties: - data: + choices: type: array items: - $ref: '#/components/schemas/RoadmapItem' - BulkProjectMove: + type: string + + ExploreDropdown: type: object - description: A move of many Contacts through Projects, and how far it has got properties: id: type: integer - status: + title: type: string - enum: [pending, running, completed, failed, undone] - total_count: - type: integer - description: Contacts the move will try to change (the selection, less Headline Only Contacts) - processed_count: - type: integer - description: Contacts reached so far - changed_count: + choice_count: type: integer - description: Contacts whose Projects or status changed - skip_counts: - type: object - additionalProperties: { type: integer } - description: Skipped Contacts by reason, e.g. headline_only, not_allowed or error - background: - type: boolean - description: True when the move runs in the background (more than 50 Contacts) - summary: - type: string - nullable: true - description: The finished message, e.g. "12 contacts changed. 3 skipped …"; null until it has finished - StartPage: - type: object - required: [start_page, options] - properties: - start_page: - type: string - enum: [newsfeed, focus, snapshot, autopilot] - description: The key of your start page; newsfeed when you have never chosen - options: + designed_for: type: array - description: The pages you can choose, in the order the Today section lists them items: - type: object - required: [key, label, description] - properties: - key: - type: string - description: e.g. focus - label: - type: string - description: Its name under Today, e.g. Focus - description: - type: string - description: The line under it in Personal Settings › Preferences - FocusSource: - type: object - required: [key, label, shown] - properties: - key: - type: string - description: e.g. checklist_actions - label: + type: string + enum: [surveys_and_trackers, forms] + themes: + type: array + items: + type: string + enum: [scales, demographics] + shared_by: type: string - description: Its name under ⚙ What Focus shows you, e.g. Checklist Actions - shown: + nullable: true + used_in_count: + type: integer + description: How many surveys, trackers and forms use it + yours: type: boolean - description: False when you have switched it off - FocusItem: + description: Whether the caller or one of the caller's organisations owns it + + PaginatedExploreDropdowns: type: object - required: [id, type, title, context, contact, url, due_on, raised_on, due_text, section, action] properties: - id: - type: string - description: Unique across every source, e.g. checklist_actions-812 - type: - type: string - description: The source it came from, e.g. checklist_actions - title: - type: string - description: What it is, e.g. the Checklist step - context: - type: string - description: Where it belongs, e.g. "Checklist Action · Intake · step 2 of 5", plus who is responsible when it isn't you - contact: - type: object - nullable: true - description: The Contact it is about, when there is one - required: [id, name] - properties: - id: - type: integer - name: - type: string - url: - type: string - description: Where the row leads - due_on: - type: string - format: date - nullable: true - description: The day it is due, or null - raised_on: - type: string - format: date - nullable: true - description: For something with no due date, the day it was raised - due_text: - type: string - description: e.g. "15 days overdue", "Due today", "Due in 4 days", "No due date" - section: - type: string - enum: [overdue, today, this_week, later] - action: - type: object - description: The row's one button - required: [label, url, method] + page: + type: integer + page_size: + type: integer + page_count: + type: integer + total_count: + type: integer + data: + type: array + items: + $ref: '#/components/schemas/ExploreDropdown' + facets: + type: array + items: + $ref: '#/components/schemas/ExploreFacetGroup' + + ExploreImpactFrameworkPreview: + allOf: + - $ref: '#/components/schemas/ExploreImpactFramework' + - type: object properties: - label: - type: string - description: e.g. Open - url: - type: string - method: - type: string - description: The HTTP method, e.g. get - FocusFeed: + stages: + type: array + items: + type: object + properties: + title: + type: string + items: + type: array + items: + type: string + + ExploreImpactFramework: type: object - required: [scope, teams, type, sources, counts, sections, page, page_size, page_count, total_count, data] properties: - scope: + id: + type: integer + name: type: string - enum: [me, teams] - teams: - type: boolean - description: You are in a Team, so scope=teams is available - type: + description: type: string nullable: true - description: The type filtered by, or null for every type - sources: + themes: type: array items: - $ref: '#/components/schemas/FocusSource' - counts: - type: object - description: "`all`, and the number of items of each type that has any, e.g. {all: 4, checklist_actions: 4}" - required: [all] - additionalProperties: - type: integer - properties: - all: - type: integer - sections: + type: string + framework_sets: type: array - description: The sections that have items, in order + description: The platform-wide Framework Sets it belongs to items: type: object - required: [key, label, count] properties: - key: + id: + type: integer + name: type: string - enum: [overdue, today, this_week, later] - label: + short_code: type: string - count: - type: integer + nullable: true + outcome_count: + type: integer + progress_tracker_count: + type: integer + shared_by: + type: string + nullable: true + libraries_count: + type: integer + description: How many organisations use it on a project + yours: + type: boolean + description: Whether the caller or one of the caller's organisations owns it + + PaginatedExploreImpactFrameworks: + type: object + properties: page: type: integer page_size: @@ -21758,43 +23279,44 @@ components: data: type: array items: - $ref: '#/components/schemas/FocusItem' + $ref: '#/components/schemas/ExploreImpactFramework' + facets: + type: array + items: + $ref: '#/components/schemas/ExploreFacetGroup' - ImpactStoreSearchResult: + ExploreIdeaPreview: + allOf: + - $ref: '#/components/schemas/ExploreIdea' + - type: object + properties: + text: + type: string + + ExploreIdea: type: object - description: A published ImpactStore item found by **Search the ImpactStore**. properties: id: type: integer - type: - type: string - enum: [survey, contact_form, case_form, impact_framework, report_template, toolkit, project_type] - type_label: - type: string - description: The front-end name of the type, e.g. Contact Form - name: - type: string - description: + title: type: string - nullable: true - description: One line of plain text (always null for a Case Form) - causes: + themes: type: array items: type: string - description: Cause and subcause names, causes first - used_by_count: + reading_minutes: type: integer - description: How many organisations use it - explore_url: + shared_by: type: string nullable: true - description: Its page on Explore (null for a Project Type) - matched_words: + saved_count: type: integer - description: How many of the query's words it matched + description: How many collections it has been saved to + yours: + type: boolean + description: Whether the caller or one of the caller's organisations owns it - PaginatedImpactStoreSearch: + PaginatedExploreIdeas: type: object properties: page: @@ -21808,109 +23330,57 @@ components: data: type: array items: - $ref: '#/components/schemas/ImpactStoreSearchResult' + $ref: '#/components/schemas/ExploreIdea' + facets: + type: array + items: + $ref: '#/components/schemas/ExploreFacetGroup' - LibrarySearchResult: - type: object - description: A library item found by **Search the library**. Metrics also have `metric_type` and `choices`; Lists have `choices`. - additionalProperties: true - properties: - id: - type: integer - type: - type: string - enum: [survey, metric, activity_tracker, outcome, list, unit, field, contact_form, case_form, impact_framework, toolkit, project_type, idea] - name: - type: string - nullable: true - description: - type: string - nullable: true - description: One line of plain text - owner: - type: string - enum: [your organisation, public library, Makerble] + ExploreMetricPreview: + allOf: + - $ref: '#/components/schemas/ExploreMetric' + - type: object + properties: + description: + type: string + nullable: true + details: + type: object + description: The metric's key facts, by label + additionalProperties: + type: string + choices: + type: array + items: + type: string - ExploreSurvey: + ExploreMetric: type: object - description: A Survey (Story Category) listed on Explore Surveys properties: + kind: + type: string + enum: [change, indicator, financial_value] id: type: integer name: type: string - description: + stage: type: string - nullable: true - shared_by: + enum: [activities, engagement, ability, behaviour, effect, financial_values] + whats_inside: type: string - nullable: true - description: The organisation (or person) that published it - tag: + description: The tracker type or scale, e.g. "5-level scale" or "Activity tracker · count" + shared_by: type: string nullable: true - enum: [Verdicts, Validated, null] - question_count: - type: integer - estimated_minutes: - type: integer - nullable: true - description: About how long it takes to answer, worked out from its questions - themes: - type: array - items: - type: string - audiences: - type: array - description: Who answers it - items: - type: string - contact_mode: - type: string - enum: [one_contact, several_contacts] - description: How the survey is shown when someone tries it on a toolkit page, About one contact (`one_contact`) or for Several or no contacts (`several_contacts`) - repeats_at_intervals: - type: boolean - validated: - type: boolean - description: An industry-recognised, validated scale - verdicts: - type: boolean - description: Verdicts are set up, so it classifies each respondent automatically libraries_count: type: integer - description: How many organisations have it in one of their projects + description: How many organisations use it on a project yours: type: boolean - description: Your organisation published it - added_to_a_project: - type: boolean - description: It is already in one of your organisation's projects - - ExploreFacetGroup: - type: object - properties: - key: - type: string - enum: [theme, audience, time, feature] - label: - type: string - options: - type: array - items: - type: object - properties: - value: - type: string - label: - type: string - count: - type: integer - description: How many Surveys this option would return, given the other filters already chosen - selected: - type: boolean + description: Whether the caller or one of the caller's organisations owns it - PaginatedExploreSurveys: + PaginatedExploreMetrics: type: object properties: page: @@ -21924,7 +23394,7 @@ components: data: type: array items: - $ref: '#/components/schemas/ExploreSurvey' + $ref: '#/components/schemas/ExploreMetric' facets: type: array items: @@ -29032,6 +30502,130 @@ 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 + + PortalLink: + type: object + properties: + contact_id: + type: integer + name: + type: string + link_status: + type: string + enum: [active, deactivated, none] + description: none means the Contact has never been sent a link + last_sent_at: + type: string + format: date-time + nullable: true + last_sent_channel: + type: string + enum: [email, sms] + nullable: true + can_email: + type: boolean + can_sms: + type: boolean + + PaginatedPortalLinks: + allOf: + - $ref: '#/components/schemas/PaginationEnvelope' + - type: object + properties: + data: + type: array + items: + $ref: '#/components/schemas/PortalLink' + PaginatedEventFormats: allOf: - $ref: '#/components/schemas/PaginationEnvelope' diff --git a/server.js b/server.js index df5d69e..bd633fa 100644 --- a/server.js +++ b/server.js @@ -951,6 +951,11 @@ function buildDocsPage() { GETOutcomes GETLibrary GETExplore Surveys + GETExplore Report Templates + GETExplore Dropdowns + GETExplore Impact Frameworks + GETExplore Ideas + GETExplore Metrics GETImpactStore POSTFramework Sets POSTSuggested Merges @@ -968,6 +973,8 @@ function buildDocsPage() { GETEvents GETEvent Formats + GETEvent Catalogues + POSTContacts' Portal PATCHStaff Capacity GETStaff Matching POSTStaff Unavailability @@ -2957,6 +2964,163 @@ function buildDocsPage() {
+ +
+
Reporting
+

Explore Report Templates

+
+

Explore Report Templates lists the Report Templates in the Makerble® ImpactStore™: funder reports, trustee updates, contract monitoring returns and other reports, each set out as the questions to answer. The API gives the same search, filters, counts and sort as the Explore Report Templates page. Every caller sees the same Report Templates; only yours and in_your_library depend on your organisations.

+

Filters take option keys, as arrays (theme[]=community) or comma-separated (theme=community,governance). Options in one filter match any of them; different filters must all match.

+
+
+ ${endpointCard("GET", "/explore/report_templates", "Explore Report Templates", true, [ + { name: "query", type: "string", required: false, desc: "Words in the Report Template's name or description, or who it's for or its theme" }, + { name: "recipient", type: "string", required: false, desc: "Who it's for: funder, trustees, local_authority (Commissioner or contract), corporate_partner, internal" }, + { name: "theme", type: "string", required: false, desc: "children_and_young_people, community, employment, governance, health_and_wellbeing, volunteering" }, + { name: "output", type: "string", required: false, desc: "Answer formats any of its questions ask for: narrative, number, chart" }, + { name: "sort", type: "string", required: false, desc: "added (in the most organisations' libraries first, default), new or az" }, + { name: "page", type: "integer", required: false, desc: "Page number" }, + { name: "per_page", type: "integer", required: false, desc: "Report Templates per page (default 10, max 200)" }, + { name: "last_synced_datetime", type: "string", required: false, desc: "ISO 8601 — only Report Templates updated after this" } + ], [ + { code: "200", cls: "response-2xx", desc: "Report Templates with id, slug, name, description, recipient, theme, question_count, answer_formats, shared_by, libraries_count (organisations with it in their library), yours and in_your_library, plus facets: each filter's options with how many Report Templates each would return given the other filters" } + ])} + ${endpointCard("GET", "/explore/report_templates/{id}", "Preview an Explore Report Template", true, [ + { name: "id", in: "path", type: "integer", required: true, desc: "The Report Template's id from Explore Report Templates" } + ], [ + { code: "200", cls: "response-2xx", desc: "The Report Template's fields as above plus questions, each with its title and the answer_formats it asks for, in order" }, + { code: "404", cls: "response-4xx", desc: "Not in the ImpactStore" } + ], "To use a Report Template, add it to your organisation's library in Makerble with Add to your library on Explore Report Templates.")} +
+
+ + +
+
Forms and surveys
+

Explore Dropdowns

+
+

Explore Dropdowns lists the Dropdowns (answer-choice lists, Ratio Sets) shared to the Makerble® ImpactStore™ and approved: standard scales and category lists that make results compare cleanly across organisations. The API gives the same search, filters, counts and sort as the Explore Dropdowns page. Every caller sees the same Dropdowns; only yours depends on your organisations.

+

Filters take option keys, as arrays (theme[]=scales) or comma-separated (choices=up_to_10,11_to_100). Options in one filter match any of them; different filters must all match.

+
+
+ ${endpointCard("GET", "/explore/dropdowns", "Explore Dropdowns", true, [ + { name: "query", type: "string", required: false, desc: "Words in the Dropdown's title or any of its answer choices" }, + { name: "designed_for", type: "string", required: false, desc: "surveys_and_trackers, forms (bio, event and project forms)" }, + { name: "choices", type: "string", required: false, desc: "Number of answer choices: up_to_10, 11_to_100, over_100" }, + { name: "theme", type: "string", required: false, desc: "scales, demographics" }, + { name: "chip", type: "string", required: false, desc: "A Popular chip: Scales, Demographics, Equality monitoring" }, + { name: "sort", type: "string", required: false, desc: "added (used in the most surveys, trackers and forms first, default), new or az" }, + { name: "page", type: "integer", required: false, desc: "Page number" }, + { name: "per_page", type: "integer", required: false, desc: "Dropdowns per page (default 10, max 200)" }, + { name: "last_synced_datetime", type: "string", required: false, desc: "ISO 8601 — only Dropdowns updated after this" } + ], [ + { code: "200", cls: "response-2xx", desc: "Dropdowns with id, title, choice_count, designed_for, themes, shared_by, used_in_count (surveys, trackers and forms using it) and yours, plus facets: each filter's options with how many Dropdowns each would return given the other filters" } + ])} + ${endpointCard("GET", "/explore/dropdowns/{id}", "Preview an Explore Dropdown", true, [ + { name: "id", in: "path", type: "integer", required: true, desc: "The Dropdown's id from Explore Dropdowns" } + ], [ + { code: "200", cls: "response-2xx", desc: "The Dropdown's fields as above plus every one of its answer choices, in order" }, + { code: "404", cls: "response-4xx", desc: "Not listed on Explore Dropdowns (not shared or not approved)" } + ], "To use a Dropdown, copy it into your organisation in Makerble with Add to organisation on Explore Dropdowns.")} +
+
+ + +
+
Impact framework
+

Explore Impact Frameworks

+
+

Explore Impact Frameworks lists the public, approved Impact Frameworks (Templates) in the Makerble® ImpactStore™: sets of outcomes and progress trackers across the stages of change. The API gives the same search, filters, counts and sort as the Explore Impact Frameworks page. Every caller sees the same Impact Frameworks; only yours depends on your organisations.

+

Filters take option keys, as arrays (theme[]=inclusion) or comma-separated (size=up_to_5,6_to_10). Options in one filter match any of them; different filters must all match.

+
+
+ ${endpointCard("GET", "/explore/impact_frameworks", "Explore Impact Frameworks", true, [ + { name: "query", type: "string", required: false, desc: "Words in the Impact Framework's name or description" }, + { name: "theme", type: "string", required: false, desc: "mental_health_and_wellbeing, children_and_young_people, employment_and_skills, community_and_culture, health, organisational, global_goals, inclusion, education_and_training, leadership" }, + { name: "set", type: "string", required: false, desc: "Part of a Framework Set: a platform-wide Framework Set's id (listed in facets), or none" }, + { name: "size", type: "string", required: false, desc: "Number of outcomes: up_to_5, 6_to_10, over_10" }, + { name: "chip", type: "string", required: false, desc: "A Popular chip: SDGs, Inclusion, Employment, Wellbeing" }, + { name: "sort", type: "string", required: false, desc: "added (on the most organisations' projects first, default), new or az" }, + { name: "page", type: "integer", required: false, desc: "Page number" }, + { name: "per_page", type: "integer", required: false, desc: "Impact Frameworks per page (default 10, max 200)" }, + { name: "last_synced_datetime", type: "string", required: false, desc: "ISO 8601 — only Impact Frameworks updated after this" } + ], [ + { code: "200", cls: "response-2xx", desc: "Impact Frameworks with id, name, description, themes, framework_sets (each with id, name and short_code), outcome_count, progress_tracker_count, shared_by, libraries_count (organisations using it on a project) and yours, plus facets" } + ])} + ${endpointCard("GET", "/explore/impact_frameworks/{id}", "Preview an Explore Impact Framework", true, [ + { name: "id", in: "path", type: "integer", required: true, desc: "The Impact Framework's id from Explore Impact Frameworks" } + ], [ + { code: "200", cls: "response-2xx", desc: "The Impact Framework's fields as above plus stages, each stage of change with its title (Activities, Engagement, Ability, Behaviour or Effect) and its outcomes and progress trackers as items" }, + { code: "404", cls: "response-4xx", desc: "Not public and approved" } + ], "To use an Impact Framework, add it to projects in Makerble with Add to projects on Explore Impact Frameworks.")} +
+
+ + +
+
Learning
+

Explore Ideas

+
+

Explore Ideas lists the approved Ideas (Tips) shared with everyone in the Makerble® ImpactStore™: what other organisations tried, how it went and what they would change. The API gives the same search, filters, counts and sort as the Explore Ideas page. shared_by, person and yours depend on you: your colleagues, the people you follow and you.

+

Filters take option keys, as arrays (theme[]=leadership) or comma-separated (shared_by=colleagues,following). Options in one filter match any of them; different filters must all match.

+
+
+ ${endpointCard("GET", "/explore/ideas", "Explore Ideas", true, [ + { name: "query", type: "string", required: false, desc: "Words in the Idea's title or text" }, + { name: "shared_by", type: "string", required: false, desc: "anyone, colleagues, following, me" }, + { name: "theme", type: "string", required: false, desc: "mental_health_and_wellbeing, children_and_young_people, employment_and_skills, community_and_culture, health, organisational, global_goals, inclusion, education_and_training, leadership" }, + { name: "audience", type: "string", required: false, desc: "public_impact, personal, professional" }, + { name: "person", type: "string", required: false, desc: "User ids of colleagues or people you follow; any other id is ignored" }, + { name: "chip", type: "string", required: false, desc: "A Popular chip: Community, Young people, Training, Leadership" }, + { name: "sort", type: "string", required: false, desc: "added (saved to the most collections first, default), new or az" }, + { name: "page", type: "integer", required: false, desc: "Page number" }, + { name: "per_page", type: "integer", required: false, desc: "Ideas per page (default 10, max 200)" }, + { name: "last_synced_datetime", type: "string", required: false, desc: "ISO 8601 — only Ideas updated after this" } + ], [ + { code: "200", cls: "response-2xx", desc: "Ideas with id, title, themes, reading_minutes, shared_by, saved_count (collections it is saved to) and yours, plus facets" } + ])} + ${endpointCard("GET", "/explore/ideas/{id}", "Read an Explore Idea", true, [ + { name: "id", in: "path", type: "integer", required: true, desc: "The Idea's id from Explore Ideas" } + ], [ + { code: "200", cls: "response-2xx", desc: "The Idea's fields as above plus its text, without formatting" }, + { code: "404", cls: "response-4xx", desc: "Not approved and shared with everyone" } + ], "To keep an Idea, save it to a collection in Makerble with Save idea on Explore Ideas.")} +
+
+ + +
+
Impact framework
+

Explore Metrics

+
+

Explore Metrics lists the published, approved metrics of the Makerble® ImpactStore™ across the stages of change: progress trackers (kind change: Activities and Engagement), outcome indicators (indicator: Ability, Behaviour and Effect) and Financial Values (financial_value). The API gives the same search, filters, counts and sort as the Explore Metrics page. Every caller sees the same metrics; only yours depends on your organisations.

+

Filters take option keys, as arrays (stage[]=ability) or comma-separated (answer_format=scale,yes_no). Options in one filter match any of them; different filters must all match.

+
+
+ ${endpointCard("GET", "/explore/metrics", "Explore Metrics", true, [ + { name: "query", type: "string", required: false, desc: "Words in the metric's name or description" }, + { name: "stage", type: "string", required: false, desc: "activities, engagement, ability, behaviour, effect, financial_values" }, + { name: "answer_format", type: "string", required: false, desc: "count, scale, yes_no, value" }, + { name: "audience", type: "string", required: false, desc: "public_impact, personal, professional" }, + { name: "shared_by", type: "string", required: false, desc: "makerble, others" }, + { name: "chip", type: "string", required: false, desc: "A Popular chip: Wellbeing, Employment, Housing, Attendance, SDGs" }, + { name: "sort", type: "string", required: false, desc: "added (on the most organisations' projects first, default), new or az" }, + { name: "page", type: "integer", required: false, desc: "Page number" }, + { name: "per_page", type: "integer", required: false, desc: "Metrics per page (default 10, max 200)" }, + { name: "last_synced_datetime", type: "string", required: false, desc: "ISO 8601 — only metrics updated after this" } + ], [ + { code: "200", cls: "response-2xx", desc: "Metrics with kind, id, name, stage, whats_inside (e.g. 5-level scale), shared_by, libraries_count and yours, plus facets" } + ])} + ${endpointCard("GET", "/explore/metrics/{kind}/{id}", "Preview an Explore Metric", true, [ + { name: "kind", in: "path", type: "string", required: true, desc: "change, indicator or financial_value" }, + { name: "id", in: "path", type: "integer", required: true, desc: "The metric's id from Explore Metrics" } + ], [ + { code: "200", cls: "response-2xx", desc: "The metric's fields as above plus description, details (its key facts by label) and the choices of a scale or yes-or-no indicator" }, + { code: "404", cls: "response-4xx", desc: "Not published and approved" } + ], "To use a tracker or indicator, add it to a project in Makerble with Add to a project on Explore Metrics.")} +
+
+
Impact framework
@@ -4427,6 +4591,101 @@ function buildDocsPage() {
+ +
+
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" } + ])} +
+
+ + +
+
Events
+

Contacts' Portal

+
+

Each Contact has their own link to the Contacts' Portal, where they see the Event Catalogues their project lets them see and book onto events. These endpoints do what a project's Portal Links page does: list the Contacts who can see at least one Event Catalogue, and send them their link by email or SMS. The link itself is never returned, because it signs the Contact in to their Portal.

+

To give a Contact Portal access, first let them see an Event Catalogue (PATCH /event_catalogues/{id}/projects/{project_id}/access), then send them their link. Project Managers, Reporters and Organisation Admins and Reporters can list; only Project Managers and Organisation Admins can send.

+
+
+ ${endpointCard("GET", "/projects/{project_id}/portal_links", "List Contacts' Portal links in a project", true, [ + { name: "project_id", in: "path", type: "integer", required: true, desc: "Project ID" }, + { name: "page", type: "integer", required: false, desc: "Page number" }, + { name: "per_page", type: "integer", required: false, desc: "Records per page" } + ], [ + { code: "200", cls: "response-2xx", desc: "Each Contact's link_status (active, deactivated or none), last_sent_at, last_sent_channel, can_email and can_sms" }, + { code: "403", cls: "response-4xx", desc: "Not a Project Manager or Reporter of the project, or an Organisation Admin or Reporter" }, + { code: "404", cls: "response-4xx", desc: "Not found" } + ])} + ${endpointCard("POST", "/projects/{project_id}/portal_links/send", "Send Contacts their Portal link", true, [ + { name: "project_id", in: "path", type: "integer", required: true, desc: "Project ID" }, + { name: "contact_ids", type: "array", required: true, desc: "Contacts in the project who can see an Event Catalogue" }, + { name: "channel", type: "string", required: true, desc: "email or sms" } + ], [ + { code: "200", cls: "response-2xx", desc: "sent (how many) and skipped (names of Contacts with no email address or mobile number)" }, + { 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 can't see any Event Catalogue yet, or none can receive it" } + ])} +
+
+
Site content
From 84fc6f06e46fcb537f1dc3d0e07e0c69aad3ba70 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 23 Nov 2026 14:20:32 +0000 Subject: [PATCH 14/15] Use the method class without an inline style for the Health nav link --- server.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server.js b/server.js index bd633fa..9a2abbe 100644 --- a/server.js +++ b/server.js @@ -1010,7 +1010,7 @@ function buildDocsPage() { From 00314d1841cea70ad8cfe4d923c8ca47b0761f8b Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 23 Nov 2026 14:21:00 +0000 Subject: [PATCH 15/15] Say connected apps can call the same endpoints as an API key Draft #16 marked 26 operations as open to connected apps. Since then the list has grown to the 74 an Organisation API key can call (documented in #194), so a partial set of marks would read as the whole list. --- openapi.yaml | 54 ++++++++++++++++++++++++++-------------------------- server.js | 2 +- 2 files changed, 28 insertions(+), 28 deletions(-) diff --git a/openapi.yaml b/openapi.yaml index b826fb3..cdff17f 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -44,7 +44,7 @@ info: | Token expired, revoked, or the user is no longer in the connected organisation | `401 {"error":"invalid_token"}` | | Endpoint not yet available to connected apps | `403 {"error":"not_available_to_connected_apps"}` | - A connected app sees only the organisation the user chose, with that user's permissions there. It can call the operations that list `oauth2` under Security; more are added as they are reviewed. Users and Organisation Admins can disconnect an app at any time from **Settings → Connected Apps**, and it stops working straight away. The scope is always `api`. + A connected app sees only the organisation the user chose, with that user's permissions there. It can call the same endpoints as an Organisation API key (see Organisation API keys above), and gets `403` with `not_available_to_connected_apps` from any other. Users and Organisation Admins can disconnect an app at any time from **Settings → Connected Apps**, and it stops working straight away. The scope is always `api`. ## Creating Users via the API `POST /users` requires a separate API Key (`auth_code`). Request one at [api-key-request@makerble.com](mailto:api-key-request@makerble.com). @@ -543,7 +543,7 @@ paths: tags: [Users] summary: List all Users operationId: listUsers - security: [{tokenAuth: []}, {oauth2: [api]}] + security: [{tokenAuth: []}] parameters: - $ref: '#/components/parameters/Page' - $ref: '#/components/parameters/PerPage' @@ -638,7 +638,7 @@ paths: tags: [Users] summary: Get a single User operationId: getUser - security: [{tokenAuth: []}, {oauth2: [api]}] + security: [{tokenAuth: []}] parameters: - $ref: '#/components/parameters/ResourceId' responses: @@ -858,7 +858,7 @@ paths: summary: Get user permissions description: Returns the authenticated user's permissions across all Projects and Organisations. operationId: getUserPermissions - security: [{tokenAuth: []}, {oauth2: [api]}] + security: [{tokenAuth: []}] responses: "200": description: Permissions object @@ -947,7 +947,7 @@ paths: summary: Get a single Organisation description: Returns a single Charity (Organisation). Each Charity owns one or more Projects. operationId: getCharity - security: [{tokenAuth: []}, {oauth2: [api]}] + security: [{tokenAuth: []}] parameters: - $ref: '#/components/parameters/ResourceId' responses: @@ -3572,7 +3572,7 @@ paths: | Reporter | `reporter` | Changemaker | Create Stories | | Observer | `observer` | Analyst | Read-only | operationId: listProjects - security: [{tokenAuth: []}, {oauth2: [api]}] + security: [{tokenAuth: []}] parameters: - $ref: '#/components/parameters/Page' - $ref: '#/components/parameters/PerPage' @@ -3682,7 +3682,7 @@ paths: tags: [Projects] summary: Get a single Project operationId: getProject - security: [{tokenAuth: []}, {oauth2: [api]}] + security: [{tokenAuth: []}] parameters: - $ref: '#/components/parameters/ResourceId' responses: @@ -4351,7 +4351,7 @@ paths: comes back with `restricted: true` and `value: null`, and a hidden built-in field (`dob`, `mobile`, `email`, `address`) is `null` and named in `restricted_fields`. operationId: listBeneficiaries - security: [{tokenAuth: []}, {oauth2: [api]}] + security: [{tokenAuth: []}] parameters: - $ref: '#/components/parameters/Page' - $ref: '#/components/parameters/PerPage' @@ -4678,7 +4678,7 @@ paths: Returns the per-record custom field values (Custom Forms answers) for all Beneficiaries. An answer the Organisation's Field Visibility settings hide from you comes back with `restricted: true` and `value: null`. operationId: listBeneficiaryAdvancedCustomFields - security: [{tokenAuth: []}, {oauth2: [api]}] + security: [{tokenAuth: []}] parameters: - $ref: '#/components/parameters/Page' - $ref: '#/components/parameters/PerPage' @@ -4699,7 +4699,7 @@ paths: summary: Get Impact Box data (Progress Trackers per Contact) description: Aggregated metric progress per Beneficiary — the data shown in the Progress Trackers box on a Contact Profile page. operationId: getBeneficiaryImpactBoxData - security: [{tokenAuth: []}, {oauth2: [api]}] + security: [{tokenAuth: []}] parameters: - $ref: '#/components/parameters/Page' - $ref: '#/components/parameters/PerPage' @@ -5116,7 +5116,7 @@ paths: authenticated user can see are included. Use project_ids to narrow the results to specific projects; it can never widen them to projects the user cannot see. operationId: listProjectBeneficiaries - security: [{tokenAuth: []}, {oauth2: [api]}] + security: [{tokenAuth: []}] parameters: - name: project_ids in: query @@ -5281,7 +5281,7 @@ paths: tags: [Beneficiary Categories] summary: List all Beneficiary Categories (Contact Bio Forms) operationId: listBeneficiaryCategories - security: [{tokenAuth: []}, {oauth2: [api]}] + security: [{tokenAuth: []}] parameters: - $ref: '#/components/parameters/Page' - $ref: '#/components/parameters/PerPage' @@ -5301,7 +5301,7 @@ paths: tags: [Beneficiary Categories] summary: Get a single Beneficiary Category operationId: getBeneficiaryCategory - security: [{tokenAuth: []}, {oauth2: [api]}] + security: [{tokenAuth: []}] parameters: - $ref: '#/components/parameters/ResourceId' responses: @@ -5321,7 +5321,7 @@ paths: tags: [Beneficiary Categories] summary: Get current active fields for Beneficiary Categories operationId: getBeneficiaryCategoryCurrentFields - security: [{tokenAuth: []}, {oauth2: [api]}] + security: [{tokenAuth: []}] responses: "200": description: Current field definitions @@ -6320,7 +6320,7 @@ paths: summary: List all Beneficiary Types description: Returns the four types — Person (1), Organisation (2), Animal (3), Object (4). The ID is required when creating a Beneficiary. operationId: listBeneficiaryTypes - security: [{tokenAuth: []}, {oauth2: [api]}] + security: [{tokenAuth: []}] parameters: - $ref: '#/components/parameters/Page' - $ref: '#/components/parameters/PerPage' @@ -6361,7 +6361,7 @@ paths: tags: [Beneficiary Types] summary: List Beneficiary Type–Category associations operationId: listBeneficiaryTypesCategories - security: [{tokenAuth: []}, {oauth2: [api]}] + security: [{tokenAuth: []}] parameters: - $ref: '#/components/parameters/Page' - $ref: '#/components/parameters/PerPage' @@ -6683,7 +6683,7 @@ paths: summary: Get verdict scores for a Survey Campaign description: Verdict scores grouped by Beneficiary for a specific Survey within a Project. operationId: getStoryCategoryVerdicts - security: [{tokenAuth: []}, {oauth2: [api]}] + security: [{tokenAuth: []}] parameters: - name: id in: path @@ -6956,7 +6956,7 @@ paths: tags: [Project Story Categories] summary: List all Survey Campaigns (Project Story Categories) operationId: listProjectStoryCategories - security: [{tokenAuth: []}, {oauth2: [api]}] + security: [{tokenAuth: []}] parameters: - $ref: '#/components/parameters/Page' - $ref: '#/components/parameters/PerPage' @@ -7311,7 +7311,7 @@ paths: 2. **Story Change Beneficiary** — tagged via a Participation Change 3. **Story Indicator Beneficiary** — tagged via an Indicator response operationId: listStoryBeneficiaries - security: [{tokenAuth: []}, {oauth2: [api]}] + security: [{tokenAuth: []}] parameters: - $ref: '#/components/parameters/Page' - $ref: '#/components/parameters/PerPage' @@ -7362,7 +7362,7 @@ paths: summary: List Story Change Beneficiaries description: Per-Beneficiary Participation Change records. Only applies to Participation type Changes. operationId: listStoryChangeBeneficiaries - security: [{tokenAuth: []}, {oauth2: [api]}] + security: [{tokenAuth: []}] parameters: - $ref: '#/components/parameters/Page' - $ref: '#/components/parameters/PerPage' @@ -7408,7 +7408,7 @@ paths: summary: List Story Indicator Beneficiaries description: Per-Beneficiary indicator responses. Each record = one Contact's answer to one Indicator in one Story. operationId: listStoryIndicatorBeneficiaries - security: [{tokenAuth: []}, {oauth2: [api]}] + security: [{tokenAuth: []}] parameters: - $ref: '#/components/parameters/Page' - $ref: '#/components/parameters/PerPage' @@ -7644,7 +7644,7 @@ paths: A Case must match every question given. A question the user can't filter by is ignored. operationId: listCases - security: [{tokenAuth: []}, {oauth2: [api]}] + security: [{tokenAuth: []}] parameters: - $ref: '#/components/parameters/Page' - $ref: '#/components/parameters/PerPage' @@ -7753,7 +7753,7 @@ paths: tags: [Cases] summary: List Project–Beneficiary–Case associations operationId: listProjectsBeneficiariesCases - security: [{tokenAuth: []}, {oauth2: [api]}] + security: [{tokenAuth: []}] parameters: - $ref: '#/components/parameters/Page' - $ref: '#/components/parameters/PerPage' @@ -7777,7 +7777,7 @@ paths: Supported field types: Text (short/long) · Number · Date & time · Time · Attachment · Select · Tickbox operationId: listCustomFieldCategories - security: [{tokenAuth: []}, {oauth2: [api]}] + security: [{tokenAuth: []}] parameters: - $ref: '#/components/parameters/Page' - $ref: '#/components/parameters/PerPage' @@ -9294,7 +9294,7 @@ paths: Additional Recipients, whose emails aren't personalised. Without `send_emails`, no email is on. The anonymous device-fetch variant never includes it. operationId: getReferralLinkDetailDefinition - security: [{tokenAuth: []}, {oauth2: [api]}] + security: [{tokenAuth: []}] parameters: - $ref: '#/components/parameters/ResourceId' responses: @@ -9688,7 +9688,7 @@ paths: is still added to any project. The `error` gives the reason and the counts. - Default Event Formats (Appointments, Classes, Conferences, Gatherings, Meetings, Other Events, Sessions, Workshops) can be deleted under the same rules. - security: [{tokenAuth: []}, {oauth2: [api]}] + security: [{tokenAuth: []}] parameters: - $ref: '#/components/parameters/ResourceId' responses: @@ -18207,7 +18207,7 @@ paths: `kind_counts` gives the number of files of each kind for the same filters, ignoring `kind` — the counts on the File type buttons. operationId: listMediaItems - security: [{tokenAuth: []}, {oauth2: [api]}] + security: [{tokenAuth: []}] parameters: - name: charity_id in: query diff --git a/server.js b/server.js index 9a2abbe..e257632 100644 --- a/server.js +++ b/server.js @@ -1135,7 +1135,7 @@ function buildDocsPage() {
ℹ - A connected app sees only the organisation the user chose, with that user's permissions there. Endpoints that accept it list oauth2 under Security in the OpenAPI spec; more are added as they are reviewed. Users and Organisation Admins can disconnect an app at any time from Settings → Connected Apps, and it stops working straight away. + A connected app sees only the organisation the user chose, with that user's permissions there. It can call the same endpoints as an Organisation API key, and gets 403 with not_available_to_connected_apps from any other. Users and Organisation Admins can disconnect an app at any time from Settings → Connected Apps, and it stops working straight away.