Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
171 changes: 170 additions & 1 deletion openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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]
Expand Down Expand Up @@ -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'
Expand Down
30 changes: 28 additions & 2 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -977,6 +977,7 @@ function buildDocsPage() {
<a href="#webhooks" class="nav-link"><span class="nav-method method-POST">POST</span>Webhooks</a>
<a href="#eventbrite" class="nav-link"><span class="nav-method method-GET">GET</span>Eventbrite</a>
<a href="#api-keys" class="nav-link"><span class="nav-method method-POST">POST</span>API keys</a>
<a href="#ai-assistant-link" class="nav-link"><span class="nav-method method-POST">POST</span>AI assistant link</a>
<a href="#seats" class="nav-link"><span class="nav-method method-GET">GET</span>Seats</a>
<a href="#usage" class="nav-link"><span class="nav-method method-GET">GET</span>Usage</a>
<a href="#setup-guide" class="nav-link"><span class="nav-method method-GET">GET</span>Setup guide</a>
Expand Down Expand Up @@ -1091,7 +1092,7 @@ function buildDocsPage() {
</table>
<div class="subsection-label">Responses</div>
<div class="response-row"><span class="response-code response-2xx">200</span><span class="response-desc">Returns <code>user_id</code>, <code>email</code>, and <code>authentication_token</code></span></div>
<div class="response-row"><span class="response-code response-4xx">401</span><span class="response-desc">Invalid credentials</span></div>
<div class="response-row"><span class="response-code response-4xx">401</span><span class="response-desc">Invalid credentials (<code>invalid-credentials</code>), or <code>invitation-pending</code> with a <code>message</code> when the person hasn't accepted their invitation yet and so has no password of their own</span></div>
</div>
</div>
</div>
Expand Down Expand Up @@ -4075,7 +4076,7 @@ function buildDocsPage() {
<div class="section-desc">
<p>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 <strong>Data In &amp; Out → Integrations → API keys</strong>, or with <code>POST /api_keys</code> below. The key itself (<code>mk_live_…</code>) is shown only once, when it is created.</p>
<p><strong>Using a key:</strong> send <code>Authorization: Bearer mk_live_…</code> 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 <code>403</code> with <code>not_available_to_connected_apps</code>. A revoked key, or one whose colleague has left the Organisation, gets <code>401</code>. Calls made with an Organisation's API keys count towards its monthly API usage.</p>
<p><strong>Managing keys:</strong> only the Organisation's admins can list, create and revoke its keys, and only with their own <code>X-User-Email</code> and <code>X-User-Token</code>: an API key or a connected app can't create or revoke keys.</p>
<p><strong>Managing keys:</strong> only the Organisation's admins can list, create and revoke its keys, and only with their own <code>X-User-Email</code> and <code>X-User-Token</code>: an API key, an AI assistant link or a connected app can't create or revoke keys.</p>
</div>
<div class="endpoint-list">
${endpointCard("GET", "/api_keys", "List an Organisation's API keys", true, [
Expand Down Expand Up @@ -4111,6 +4112,31 @@ function buildDocsPage() {
</div>
</section>

<!-- AI assistant link -->
<section class="section" id="ai-assistant-link">
<div class="section-eyebrow">Integrations</div>
<h2 class="section-title">AI assistant link</h2>
<div class="section-desc">
<p>Your own link for connecting an AI assistant such as Claude or ChatGPT to Makerble through the <a href="https://mcp.makerble.com/connect">Makerble MCP</a>. In Makerble it is under <strong>User Settings → AI assistants</strong>. You choose which Organisation it is billed to: every call an assistant makes with it counts towards that Organisation's monthly API usage.</p>
<p><strong>What the link can do:</strong> it acts as you, with everything you can see and do in Makerble, so every MCP tool works. It can't create, list or revoke API keys, and can't change your email address or password (<code>403</code> with <code>not_available_to_ai_assistants</code>). It stops working when you turn it off, get a new one, or leave the Organisation it is billed to.</p>
<p>These endpoints need your own <code>X-User-Email</code> and <code>X-User-Token</code>: an API key, an AI assistant link or a connected app gets <code>403</code>.</p>
</div>
<div class="endpoint-list">
${endpointCard("GET", "/ai_assistant_link", "Read your AI assistant link", true, [], [
{ code: "200", cls: "response-2xx", desc: "Your link without its secret (or null), and the Organisations you can bill it to" }
])}
${endpointCard("POST", "/ai_assistant_link", "Get a new AI assistant link", true, [
{ name: "charity_id", in: "body", type: "integer", required: true, desc: "The Organisation the link's API usage is billed to (one you work in)" }
], [
{ code: "201", cls: "response-2xx", desc: "Created — includes the link in url, shown only this once. Any earlier link stops working" },
{ code: "422", cls: "response-4xx", desc: "Not an Organisation you work in" }
])}
${endpointCard("DELETE", "/ai_assistant_link", "Turn off your AI assistant link", true, [], [
{ code: "200", cls: "response-2xx", desc: "Turned off — any assistant using it stops working at once" }
])}
</div>
</section>

<!-- Webhooks -->
<section class="section" id="webhooks">
<div class="section-eyebrow">Integrations</div>
Expand Down
Loading