From be34476db3ebb0b5337610a646ee28206b44e792 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 16 Nov 2026 18:34:04 +0000 Subject: [PATCH] CP-9182: Document AI assistant links and invitation-pending Add GET, POST and DELETE /ai_assistant_link: a person's own link for connecting an AI assistant to Makerble through the MCP, billed as API usage to an Organisation they choose. Add a section, nav link and endpoint cards to the docs page. Document sign in's new 401 invitation-pending answer, and that an AI assistant link can't manage API keys. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01F1a5xq3zbj2YJF6VRZ5B8t --- openapi.yaml | 171 ++++++++++++++++++++++++++++++++++++++++++++++++++- server.js | 30 ++++++++- 2 files changed, 198 insertions(+), 3 deletions(-) diff --git a/openapi.yaml b/openapi.yaml index 297b358..1bd9bd4 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -389,7 +389,22 @@ paths: email: user@example.com authentication_token: "sJxyz_abc123longtoken" "401": - $ref: '#/components/responses/Unauthorized' + description: | + Wrong email address or password (`invalid-credentials`), or the person hasn't accepted + their invitation yet and so has no password of their own (`invitation-pending`, with a + `message` to show them: they set their password from their invitation email). + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + examples: + invalidCredentials: + value: + error: invalid-credentials + invitationPending: + value: + error: invitation-pending + message: "You haven't set a password yet. Open your invitation email to set one." /users: get: @@ -15823,6 +15838,93 @@ paths: "422": $ref: '#/components/responses/UnprocessableEntityList' + /ai_assistant_link: + get: + tags: [AI assistants] + summary: Read your AI assistant link + 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 + security: [{tokenAuth: []}] + responses: + "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/ForbiddenError' + + post: + tags: [AI assistants] + summary: Get a new AI assistant link + 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 + security: [{tokenAuth: []}] + 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: + "201": + description: Link made + content: + application/json: + schema: + $ref: '#/components/schemas/AiAssistantLinkWithUrl' + "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 + security: [{tokenAuth: []}] + responses: + "200": + description: Link turned off + content: + application/json: + schema: + type: object + required: [link] + properties: + link: + type: object + nullable: true + example: null + "401": + $ref: '#/components/responses/Unauthorized' + "403": + $ref: '#/components/responses/ForbiddenError' + /api_keys: get: tags: [API keys] @@ -25434,6 +25536,73 @@ components: type: string format: date-time + AiAssistantLink: + type: object + required: [id, organisation_id, organisation_name, created_at, last_used_at] + properties: + id: + type: integer + organisation_id: + type: integer + description: The Organisation (Charity) the link's API usage is billed to + organisation_name: + type: string + created_at: + type: string + format: date-time + last_used_at: + type: string + format: date-time + nullable: true + description: When an assistant last used the link, to within a few minutes + + AiAssistantLinkStatus: + type: object + required: [link, organisations] + properties: + link: + type: object + nullable: true + description: Your link, without the link itself, or null if you have none + required: [id, organisation_id, organisation_name, created_at, last_used_at] + properties: + id: + type: integer + organisation_id: + type: integer + organisation_name: + type: string + created_at: + type: string + format: date-time + last_used_at: + type: string + format: date-time + nullable: true + organisations: + type: array + description: The Organisations you can bill the link to + items: + type: object + required: [id, name] + properties: + id: + type: integer + name: + type: string + + AiAssistantLinkWithUrl: + type: object + required: [link, url] + properties: + link: + $ref: '#/components/schemas/AiAssistantLink' + url: + type: string + format: uri + description: The link to paste into your AI assistant. Shown only in the response that made it. + example: "https://mcp.makerble.com/mcp?key=mk_live_Ab12Cd34Ef56Gh78Ij90Kl12Mn34Op56&env=production" + ApiKeyWithSecret: allOf: - $ref: '#/components/schemas/ApiKey' diff --git a/server.js b/server.js index 9d3aa4b..38ed8e7 100644 --- a/server.js +++ b/server.js @@ -977,6 +977,7 @@ function buildDocsPage() { POSTWebhooks GETEventbrite POSTAPI keys + POSTAI assistant link GETSeats GETUsage GETSetup guide @@ -1091,7 +1092,7 @@ function buildDocsPage() {
Responses
200Returns user_id, email, and authentication_token
-
401Invalid credentials
+
401Invalid credentials (invalid-credentials), or invitation-pending with a message when the person hasn't accepted their invitation yet and so has no password of their own
@@ -4075,7 +4076,7 @@ function buildDocsPage() {

An API key lets a custom integration call the API for one Organisation without using a person's own token. An Organisation Admin creates one in Makerble under Data In & Out → Integrations → API keys, or with POST /api_keys below. The key itself (mk_live_…) is shown only once, when it is created.

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.

-

Managing keys: only the Organisation's admins can list, create and revoke its keys, and only with their own X-User-Email and X-User-Token: an API key or a connected app can't create or revoke keys.

+

Managing keys: only the Organisation's admins can list, create and revoke its keys, and only with their own X-User-Email and X-User-Token: an API key, an AI assistant link or a connected app can't create or revoke keys.

${endpointCard("GET", "/api_keys", "List an Organisation's API keys", true, [ @@ -4111,6 +4112,31 @@ function buildDocsPage() {
+ + +
Integrations