From dcc28d69a73feaf3df536abec8b899cdb618f49c Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 20 Nov 2026 08:43:27 +0000 Subject: [PATCH] Say Story Category Response works with Organisation API keys Companion to CP-9292, which lets an Organisation API key or connected app call stories#story_category_response, limited to its organisation. Merge only once that change is live in production. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01F1a5xqndA8DezGCVEArzG5 --- openapi.yaml | 13 +------------ server.js | 8 ++++---- 2 files changed, 5 insertions(+), 16 deletions(-) diff --git a/openapi.yaml b/openapi.yaml index 90b5053..b2484e6 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -6070,7 +6070,7 @@ paths: description: | Returns Stories enriched with named Indicators, Changes, and Custom Fields — ideal for reporting and data exports. - Not yet available with an Organisation API key or a connected app (OAuth): they get `403` with `not_available_to_connected_apps`. Call it with a person's `X-User-Email` and `X-User-Token`. With an API key, read the same answers from `GET /stories` (each Story's `story_indicator_beneficiaries`, `story_change_beneficiaries` and `custom_fields`, filtered on `story_category_id` and `project_id`), and look up question names with `GET /indicators` and `GET /scale_indicator_choices`. + Works with an Organisation API key or a connected app (OAuth) too: they get only their Organisation's Stories, even when the colleague behind the key belongs to other Organisations. operationId: listStoryCategoryResponses security: [{tokenAuth: []}] parameters: @@ -6107,17 +6107,6 @@ paths: $ref: '#/components/schemas/PaginatedStoryCategoryResponses' "401": $ref: '#/components/responses/Unauthorized' - "403": - description: Called with an Organisation API key or a connected app, which can't use this endpoint yet - content: - application/json: - schema: - type: object - properties: - error: - type: string - example: - error: not_available_to_connected_apps /story_categories: get: diff --git a/server.js b/server.js index fce1338..2babcb0 100644 --- a/server.js +++ b/server.js @@ -2239,9 +2239,8 @@ function buildDocsPage() { { 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" }, - { code: "403", cls: "response-4xx", desc: "not_available_to_connected_apps: called with an Organisation API key or a connected app" } - ], `Not yet available with an Organisation API key or a connected app: they get 403 with not_available_to_connected_apps. Call it with a person's X-User-Email and X-User-Token, or, with an API key, read the same answers from GET /stories (each Story's story_indicator_beneficiaries, story_change_beneficiaries and custom_fields, filtered on story_category_id and project_id) and look up question names with GET /indicators and GET /scale_indicator_choices.`)} + { code: "200", cls: "response-2xx", desc: "Stories enriched with named Indicators, Changes, and Custom Field values — ideal for reporting" } + ], `Works with an Organisation API key or a connected app too: they get only their Organisation's Stories, even when the colleague behind the key belongs to other Organisations.`)} ${endpointCard("GET", "/stories/{id}/attachments", "Get attachments for a Story", true, [ { name: "id", in: "path", type: "integer", required: true, desc: "Story ID" } ], [{ code: "200", cls: "response-2xx", desc: "Paginated media attachments" }])} @@ -4274,7 +4273,7 @@ function buildDocsPage() {

Using a key: send Authorization: Bearer mk_live_… on every request. The key acts as the colleague chosen when it was created: it can see and do only what they can, in its Organisation only. It can call the same endpoints as a connected app (OAuth); any other answers 403 with not_available_to_connected_apps. A revoked key, or one whose colleague has left the Organisation, gets 401. Calls made with an Organisation's API keys count towards its monthly API usage.

Which endpoints a key can call: an Organisation API key is limited to one Organisation, so it can only call endpoints that have been checked to return that Organisation's data and nothing else. Those are listed below. Any other endpoint answers 403 with not_available_to_connected_apps, even when the same request works with a person's X-User-Email and X-User-Token. A person's own token can call every endpoint, and sees everything that person can see in every Organisation they belong to. More endpoints are added to this list as they are checked; if you need one that isn't here, contact Makerble support.

- Endpoints an Organisation API key or connected app can call (74) + Endpoints an Organisation API key or connected app can call (75)
  • GET /access_logs
  • GET /audit_trail
  • @@ -4329,6 +4328,7 @@ function buildDocsPage() {
  • GET /stories/{id}
  • GET /stories/{id}/attachments
  • GET /stories/attachments
  • +
  • GET /stories/story_category_response
  • POST /stories/create2
  • GET /story_beneficiaries
  • GET /story_categories