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
79 changes: 73 additions & 6 deletions openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2750,6 +2750,10 @@ paths:
Setting a field the Organisation's Field Visibility settings hide from you (a custom field, a dropdown answer
in `sub_ratio_ids`, `date_of_birth` or `address`) is refused with `422` and an `errors` list naming each field;
no Contact is created.

A Weekly availability field takes a list of days and times (see WeeklyAvailabilityTime). An answer whose `to`
isn't after its `from`, or that isn't a list of days and times, is refused with `422` and an `errors` list
saying why; no Contact is created.
operationId: createBeneficiary
security: [{tokenAuth: []}]
requestBody:
Expand All @@ -2771,6 +2775,10 @@ paths:
beneficiary_category_ids: [294]
custom_fields:
"173": "some value"
"9051":
- day: monday
from: "15:30"
to: "18:00"
responses:
"200":
description: Beneficiary created
Expand All @@ -2787,7 +2795,7 @@ paths:
get:
tags: [Beneficiaries]
summary: Get a single Beneficiary (Contact)
description: "Returns a Contact's full profile including all custom fields. Opening a Contact this way is recorded in its Access Log, the audit trail of who has viewed it, under the caller's name and marked as via the API (or via MCP when the Makerble MCP server sends `X-Makerble-Client: makerble-mcp`). Views by the same caller less than 30 minutes apart are counted together. Use the list endpoint when you only need to find or scan Contacts."
description: "Returns a Contact's full profile including all custom fields, and `weekly_availability`: the most recent answer to a Weekly availability field on their Contact Forms, with the Contact Form it came from and when it was saved. Opening a Contact this way is recorded in its Access Log, the audit trail of who has viewed it, under the caller's name and marked as via the API (or via MCP when the Makerble MCP server sends `X-Makerble-Client: makerble-mcp`). Views by the same caller less than 30 minutes apart are counted together. Use the list endpoint when you only need to find or scan Contacts."
operationId: getBeneficiary
security: [{tokenAuth: []}]
parameters:
Expand Down Expand Up @@ -19298,6 +19306,60 @@ components:
type: string
description: Built-in fields (`dob`, `mobile`, `email`, `address`) hidden from you by Field Visibility; each is returned as null
example: ["mobile"]
weekly_availability:
allOf:
- $ref: '#/components/schemas/ContactWeeklyAvailability'
nullable: true
description: The Contact's Weekly availability, or null if they haven't answered a Weekly availability field

ContactWeeklyAvailability:
type: object
description: >-
The most recently saved answer to any Weekly availability field on the Contact's Contact Forms. Use it to
suggest appointment times the Contact can attend.
properties:
times:
type: array
nullable: true
description: The days and times, in the organisation's timezone. Null when `restricted` is true.
items:
$ref: '#/components/schemas/WeeklyAvailabilityTime'
source_form_id:
type: integer
nullable: true
description: The Contact Form (Beneficiary Category) the answer came from
example: 412
source_field_id:
type: integer
description: The Weekly availability custom field the answer came from
example: 9051
answered_at:
type: string
format: date-time
description: When the answer was saved
example: "2026-11-10T09:30:00.000+00:00"
restricted:
type: boolean
description: True when Field Visibility hides the source field from you; `times` is then null
example: false

WeeklyAvailabilityTime:
type: object
required: [day, from, to]
description: >-
One row of a Weekly availability answer. Times are HH:MM in 15-minute steps, in the organisation's timezone,
and `to` must be after `from`. Overlapping rows on the same day are joined when saved.
properties:
day:
type: string
enum: [monday, tuesday, wednesday, thursday, friday, saturday, sunday]
example: monday
from:
type: string
example: "15:30"
to:
type: string
example: "18:00"

BeneficiaryCreateRequest:
type: object
Expand Down Expand Up @@ -19334,9 +19396,14 @@ components:
type: integer
custom_fields:
type: object
additionalProperties:
type: string
description: "Dictionary of custom_field_id → value"
additionalProperties: {}
description: "Dictionary of custom_field_id → value. Most fields take a string. A Weekly availability field (`weekly_availability`) takes a list of days and times, for example `[{\"day\": \"monday\", \"from\": \"15:30\", \"to\": \"18:00\"}]` (see WeeklyAvailabilityTime); an answer that can't be read is refused with 422."
example:
"173": "Employed"
"9051":
- day: monday
from: "15:30"
to: "18:00"

BeneficiaryType:
allOf:
Expand Down Expand Up @@ -19475,9 +19542,9 @@ components:
type:
type: string
example: "text"
description: "Field type: text, date, time, file, etc."
description: "Field type: text, date, time, file, weekly_availability, etc."
value:
description: Field value (string for most types; object for file attachments). Null when `restricted` is true.
description: Field value (string for most types; object for file attachments; a list of {day, from, to} for weekly_availability). Null when `restricted` is true.
example: "Employed"
restricted:
type: boolean
Expand Down
8 changes: 4 additions & 4 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -1608,13 +1608,13 @@ function buildDocsPage() {
${endpointCard("GET", "/beneficiaries/{id}", "Get a single Contact", true, [
{ name: "id", in: "path", type: "integer", required: true, desc: "Contact ID" }
], [
{ code: "200", cls: "response-2xx", desc: "Full Contact profile with all custom fields" },
{ code: "200", cls: "response-2xx", desc: "Full Contact profile with all custom fields, and <code>weekly_availability</code>" },
{ code: "404", cls: "response-4xx", desc: "Not found" }
], "Opening a Contact this way is recorded in its <strong>Access Log</strong>, the audit trail of who has viewed it, under your name and marked as via the API (or via MCP when the Makerble MCP server sends <code>X-Makerble-Client: makerble-mcp</code>). Views less than 30 minutes apart are counted together. Use <code>GET /beneficiaries</code> when you only need to find or scan Contacts. Fields hidden from you by <strong>Field Visibility</strong> come back with <code>restricted: true</code> and a null value (custom fields), or null and named in <code>restricted_fields</code> (<code>dob</code>, <code>mobile</code>, <code>email</code>, <code>address</code>).")}
], "Opening a Contact this way is recorded in its <strong>Access Log</strong>, the audit trail of who has viewed it, under your name and marked as via the API (or via MCP when the Makerble MCP server sends <code>X-Makerble-Client: makerble-mcp</code>). Views less than 30 minutes apart are counted together. Use <code>GET /beneficiaries</code> when you only need to find or scan Contacts. Fields hidden from you by <strong>Field Visibility</strong> come back with <code>restricted: true</code> and a null value (custom fields), or null and named in <code>restricted_fields</code> (<code>dob</code>, <code>mobile</code>, <code>email</code>, <code>address</code>). <code>weekly_availability</code> is the Contact's <strong>Weekly availability</strong>: the most recently saved answer to a Weekly availability field on their Contact Forms, as <code>times</code> (<code>[{day, from, to}]</code>, in the organisation's timezone) with <code>source_form_id</code>, <code>source_field_id</code> and <code>answered_at</code>, or null. When Field Visibility hides that field from you, <code>times</code> is null and <code>restricted</code> is true.")}
${endpointCard("POST", "/beneficiaries", "Create a Contact", true, [], [
{ code: "200", cls: "response-2xx", desc: "Contact created" },
{ code: "422", cls: "response-4xx", desc: "Validation failed (name and owner_id are required), or a field hidden from you by Field Visibility was sent" }
], "Required fields: <code>beneficiary.name</code>, <code>beneficiary.owner_id</code> (User ID of the record owner). Submit custom field values as <code>custom_fields: {\"field_id\": \"value\"}</code>. Setting a field hidden from you by Field Visibility is refused with 422 and an <code>errors</code> list naming it.")}
{ code: "422", cls: "response-4xx", desc: "Validation failed (name and owner_id are required), a field hidden from you by Field Visibility was sent, or a Weekly availability answer can't be read" }
], "Required fields: <code>beneficiary.name</code>, <code>beneficiary.owner_id</code> (User ID of the record owner). Submit custom field values as <code>custom_fields: {\"field_id\": \"value\"}</code>. A Weekly availability field takes a list of days and times: <code>[{\"day\": \"monday\", \"from\": \"15:30\", \"to\": \"18:00\"}]</code>, times HH:MM in 15-minute steps with <code>to</code> after <code>from</code>; overlapping times on a day are joined. Setting a field hidden from you by Field Visibility is refused with 422 and an <code>errors</code> list naming it.")}
${endpointCard("GET", "/beneficiaries/{beneficiary_id}/summary", "Get the AI summary of a Contact (SummaryMaker)", true, [
{ name: "beneficiary_id", in: "path", type: "integer", required: true, desc: "Contact ID" }
], [
Expand Down
Loading