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
255 changes: 255 additions & 0 deletions openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,10 @@ tags:
Seats per Colleague: which seat each colleague holds on each of an Organisation's current
Contracts, and changing one. A colleague's roles decide the lowest seat (Billing Role) they
need on Role-based Pricing. Only the Organisation's admins can change seats.
- name: Guidance Panels
description: |
The Show/Hide Guidance introduction at the top of each Manage page. Makerble staff with System
Access change the wording and video; every change is kept as a version.
- name: API keys
description: |
Keys an Organisation's admins create for the custom integrations they build. Each key belongs
Expand Down Expand Up @@ -11784,6 +11788,113 @@ paths:
"404":
$ref: '#/components/responses/NotFound'

/guidance_panels:
get:
tags: [Guidance Panels]
summary: List the Guidance Panels
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
security: [{tokenAuth: []}]
parameters:
- $ref: '#/components/parameters/Page'
- $ref: '#/components/parameters/PerPage'
- $ref: '#/components/parameters/LastSyncDatetime'
responses:
"200":
description: Paginated list of Guidance Panels, by page name
content:
application/json:
schema:
$ref: '#/components/schemas/PaginatedGuidancePanels'
"401":
$ref: '#/components/responses/Unauthorized'
"403":
$ref: '#/components/responses/ForbiddenError'

/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: [Guidance Panels]
summary: Get a Guidance Panel and its recent changes
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
security: [{tokenAuth: []}]
responses:
"200":
description: The Guidance Panel and its last 10 versions
content:
application/json:
schema:
$ref: '#/components/schemas/GuidancePanelWithVersions'
"401":
$ref: '#/components/responses/Unauthorized'
"403":
$ref: '#/components/responses/ForbiddenError'
"404":
$ref: '#/components/responses/NotFound'
patch:
tags: [Guidance Panels]
summary: Change a Guidance Panel's wording or video
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/<id>`, `https://vimeo.com/<id>/<hash>`
(unlisted videos) or `https://player.vimeo.com/video/<id>?h=<hash>`. An empty `vimeo_url` puts the
page back to its fallback visual. A broken rule answers `422` with every message in `errors`.
operationId: updateGuidancePanel
security: [{tokenAuth: []}]
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/GuidancePanelRequest'
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"
responses:
"200":
description: The changed Guidance Panel and its last 10 versions
content:
application/json:
schema:
$ref: '#/components/schemas/GuidancePanelWithVersions'
"401":
$ref: '#/components/responses/Unauthorized'
"403":
$ref: '#/components/responses/ForbiddenError'
"404":
$ref: '#/components/responses/NotFound'
"422":
$ref: '#/components/responses/UnprocessableEntityList'

/api_keys:
get:
tags: [API keys]
Expand Down Expand Up @@ -19010,6 +19121,150 @@ components:
type: integer
description: The colleague the key acts as

GuidancePanelPoint:
type: object
description: One point on a Guidance Panel, shown as its bold `lead` followed by its `text`
properties:
lead:
type: string
example: "Plan events"
text:
type: string
example: "set rotas and track attendance for every session."

GuidancePanelUser:
type: object
nullable: true
description: The User who made the change, or null when it wasn't made by a User (e.g. the seed task)
properties:
id:
type: integer
name:
type: string

GuidancePanel:
type: object
description: |
The Show/Hide Guidance introduction at the top of a Manage page. Its main action, and who may use it,
belong to the page, so they are not part of the panel.
properties:
key:
type: string
description: Identifies the panel, e.g. `events`
example: events
page_name:
type: string
description: The page's name on screen
example: Events
module:
type: string
enum: [spaces, crm, scheduling, surveys, impact, settings]
description: The sidebar section the page is in, which sets the panel's colour
eyebrow:
type: string
nullable: true
example: "Makerble® Events"
headline:
type: string
example: "For moments that have a lasting impact"
points:
type: array
items:
$ref: '#/components/schemas/GuidancePanelPoint'
staff_text:
type: string
nullable: true
description: Shown instead of the page's main action to people who can't use it
user_guide_url:
type: string
description: The page's article in the Makerble User Guide, linked as "Learn more about <page> →"
vimeo_url:
type: string
nullable: true
fallback_visual:
type: string
nullable: true
description: The CSS animation, or the page's current image, shown when there is no Vimeo link
visual:
type: string
enum: [vimeo, animation, image, none]
description: What the panel shows beside its text now
updated_at:
type: string
format: date-time
updated_by:
$ref: '#/components/schemas/GuidancePanelUser'

GuidancePanelVersion:
type: object
description: One change to a Guidance Panel
properties:
id:
type: integer
event:
type: string
enum: [create, update]
created_at:
type: string
format: date-time
user:
$ref: '#/components/schemas/GuidancePanelUser'
changed:
type: array
description: The parts that changed, in words, e.g. `["Headline", "Points"]`
items:
type: string
changes:
type: object
additionalProperties: true
description: 'Each changed field with its value before and after, e.g. `{"headline": ["Old", "New"]}`'

GuidancePanelWithVersions:
allOf:
- $ref: '#/components/schemas/GuidancePanel'
- type: object
properties:
versions:
type: array
description: The last 10 versions, newest first
items:
$ref: '#/components/schemas/GuidancePanelVersion'

GuidancePanelRequest:
type: object
properties:
guidance_panel:
type: object
properties:
eyebrow:
type: string
headline:
type: string
maxLength: 80
points:
type: array
minItems: 2
maxItems: 5
items:
$ref: '#/components/schemas/GuidancePanelPoint'
staff_text:
type: string
maxLength: 300
user_guide_url:
type: string
vimeo_url:
type: string

PaginatedGuidancePanels:
allOf:
- $ref: '#/components/schemas/PaginationEnvelope'
- type: object
properties:
data:
type: array
items:
$ref: '#/components/schemas/GuidancePanel'

PaginatedApiKeys:
allOf:
- $ref: '#/components/schemas/PaginationEnvelope'
Expand Down
46 changes: 46 additions & 0 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -963,6 +963,10 @@ function buildDocsPage() {
<a href="#events" class="nav-link"><span class="nav-method method-GET">GET</span>Events</a>
<a href="#event-formats" class="nav-link"><span class="nav-method method-GET">GET</span>Event Formats</a>
</div>
<div class="nav-section">
<div class="nav-section-label">Site content</div>
<a href="#guidance-panels" class="nav-link"><span class="nav-method method-PATCH">PATCH</span>Guidance Panels</a>
</div>
<div class="nav-section">
<div class="nav-section-label">Integrations</div>
<a href="#webhooks" class="nav-link"><span class="nav-method method-POST">POST</span>Webhooks</a>
Expand Down Expand Up @@ -3461,6 +3465,48 @@ function buildDocsPage() {
</div>
</section>

<!-- Guidance Panels -->
<section class="section" id="guidance-panels">
<div class="section-eyebrow">Site content</div>
<h2 class="section-title">Guidance Panels</h2>
<div class="section-desc">
<p>A Guidance Panel is the Show/Hide Guidance introduction at the top of a Manage page, such as Manage Events or Manage Contact Groups: an eyebrow, a one-line headline, 2 to 5 points that each start with a short bold lead, the sentence shown to people who can't use the page's main button, a <strong>Learn more</strong> link to the page's article in the Makerble User Guide, and an optional Vimeo video. Panels are the same for every Organisation.</p>
<p><strong>Who can use these endpoints:</strong> only Makerble staff with System Access, with their own <code>X-User-Email</code> and <code>X-User-Token</code>. Anyone else, an API key and a connected app all get <code>403</code>. The same changes can be made in Site Overview › Guidance Panels, and every change, wherever it is made, is kept as a version that can be seen and restored.</p>
<p><strong>Rules:</strong> a headline of at most 80 characters; 2 to 5 points, each with a <code>lead</code> (up to 40 characters) and <code>text</code> (up to 200); a <code>user_guide_url</code> in the Makerble User Guide (<code>https://makerble.atlassian.net/wiki/spaces/MCPD/…</code>); and a <code>vimeo_url</code> that is empty or one of <code>https://vimeo.com/&lt;id&gt;</code>, <code>https://vimeo.com/&lt;id&gt;/&lt;hash&gt;</code> (unlisted) or <code>https://player.vimeo.com/video/&lt;id&gt;?h=&lt;hash&gt;</code>.</p>
</div>
<div class="endpoint-list">
${endpointCard("GET", "/guidance_panels", "List the Guidance Panels", true, [
{ 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 of panels, by page name" },
{ code: "403", cls: "response-4xx", desc: "No System Access, or called with an API key or connected app" }
])}
${endpointCard("GET", "/guidance_panels/{key}", "Get a Guidance Panel and its recent changes", true, [
{ name: "key", in: "path", type: "string", required: true, desc: "The panel's key, e.g. <code>events</code>" }
], [
{ code: "200", cls: "response-2xx", desc: "The panel, with its last 10 versions: who, when, and what changed from what to what" },
{ code: "403", cls: "response-4xx", desc: "No System Access" },
{ code: "404", cls: "response-4xx", desc: "No panel with that key" }
])}
${endpointCard("PATCH", "/guidance_panels/{key}", "Change a Guidance Panel's wording or video", true, [
{ name: "key", in: "path", type: "string", required: true, desc: "The panel's key, e.g. <code>events</code>" },
{ name: "guidance_panel[eyebrow]", in: "body", type: "string", required: false, desc: "e.g. Makerble® Events" },
{ name: "guidance_panel[headline]", in: "body", type: "string", required: false, desc: "One line, at most 80 characters" },
{ name: "guidance_panel[points]", in: "body", type: "array", required: false, desc: "2 to 5 <code>{lead, text}</code>, in order; replaces the whole list" },
{ name: "guidance_panel[staff_text]", in: "body", type: "string", required: false, desc: "Shown instead of the main action to people who can't use it" },
{ name: "guidance_panel[user_guide_url]", in: "body", type: "string", required: false, desc: "A page in the Makerble User Guide" },
{ name: "guidance_panel[vimeo_url]", in: "body", type: "string", required: false, desc: "A Vimeo link, or empty to show the page's own image or animation" }
], [
{ code: "200", cls: "response-2xx", desc: "The changed panel and its last 10 versions; the page shows the change from its next load" },
{ code: "403", cls: "response-4xx", desc: "No System Access" },
{ code: "404", cls: "response-4xx", desc: "No panel with that key" },
{ code: "422", cls: "response-4xx", desc: "A rule was broken: every message is in <code>errors</code>" }
])}
</div>
</section>

<!-- API keys -->
<section class="section" id="api-keys">
<div class="section-eyebrow">Integrations</div>
Expand Down
Loading