Bookings · Developers
Build on Bookings
Follow bookings from your own plugin, sell services through a commerce provider, add a calendar provider, or script the schedule with a staff session.
What you can build
Your own booking front end
Plugins that follow bookings
justflows.bookings.* events: bookings, holds, payments, and credits, with identifiers and times only.Another store or calendar
AI agents
bookings_* MCP tools cover the schedule, classes, credits, and reports, with the admin's checks and without sensitive details.Base URL
https://your-site.example/api/bookings/v1Paths in this reference are relative to the base URL. A route only ever sees and changes the current site’s records: an id, token, or key from another site is unknown here.
Who can call a route
| Kind | Paths | How |
|---|---|---|
staff | everything outside /public and /account | A signed-in session (jf_session), an API key, or an MCP agent with the route's capability. Writes send the CSRF token as x-csrf-token. |
public | /public/… | No session. Writes skip the CSRF token but must come from a page on this site (the host's trusted-origin check), and leave the honeypot field website empty. |
customer | /account/… | The signed-in customer, on their own bookings and credits and the participants they may act for. Writes send the CSRF token. |
plugin | /linked/… | Another plugin only, through ctx.plugins.call. A commerce provider reports payment outcomes and credits here, only for itself. |
const API = "https://your-site.example/api/bookings/v1";
// 1. Free start times for a service.
const { slots } = await (await fetch(`${API}/public/availability?service=${serviceId}&from=2026-12-14`)).json();
// 2. Hold one while the visitor fills in their details.
const { hold } = await (await fetch(`${API}/public/holds`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ serviceId, start: slots[0].start, key: crypto.randomUUID() }),
})).json();
// 3. Turn the hold into a booking. A paid service answers with paymentUrl.
const { booking } = await (await fetch(`${API}/public/bookings`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ holdId: hold.id, name: "Sam Jansen", email: "sam@example.com", consent: true }),
})).json();
if (booking.paymentUrl) location.href = booking.paymentUrl;const API = "https://your-site.example/api/bookings/v1";
const csrf = document.cookie.match(/(?:^|; )jf_csrf=([^;]+)/)?.[1];
// Today's live bookings, then check the first one in.
const { items } = await (await fetch(`${API}/bookings?from=2026-12-14&to=2026-12-14&status=live`, { credentials: "include" })).json();
await fetch(`${API}/bookings/${items[0].id}/transition`, {
method: "POST",
credentials: "include",
headers: { "Content-Type": "application/json", "x-csrf-token": csrf },
body: JSON.stringify({ to: "checked_in" }),
});Errors
Failures use one envelope with a stable code. Input problems (422) list each field in details.fields. Messages are English and may change; codes do not.
{ "error": { "code": "invalid", "message": "Some fields need attention.", "details": { "fields": [{ "field": "email", "message": "Enter an email address." }] } } }| Code | Meaning |
|---|---|
unauthorized (401) | The route needs a signed-in customer. |
forbidden (403) | The session lacks the capability, the request came from another site, or Bookings is off for this website. |
not_found (404) | No such record here, or one the session may not see. Both look the same. |
invalid (422) | A field is missing or wrong; see details.fields. |
slot_taken, slot_unavailable, hold_expired | The time was taken, no longer fits the rules, or the hold lapsed. Pick another time. |
version_conflict | Someone saved first. Read the record again and resend with the new expectedVersion. |
policy_notice | A customer change inside the service's cancellation or reschedule notice. |
no_credit, limit_reached, no_guest_pass, options_not_covered | Booking with credits was refused: none left, a plan limit, no guest pass, or options that cost extra. |
booking_blocked (403) | Online booking is paused for this customer after strikes; details.until says until when. |
session_full, enrolment_closed, ineligible | Class places: full, outside enrolment dates, or the participant does not meet the class's rules. |
payments_forbidden (403) | Confirming without the payment the service asks for needs bookings:payments. |
payments_unavailable (503) | The service is paid and its commerce plugin is not answering. Nothing was reserved. |
Rate limits
Limits are per IP address.
| Routes | Limit |
|---|---|
| Staff reads | 240 a minute |
| Staff writes | 120 a minute |
| Public reads (services, availability, timetable) | 120 a minute |
| Public writes: holds, bookings, class holds, class waiting lists, enrolments | 30 per 10 minutes |
| Appointment waiting list, guest-link changes, waiting-list offers | 20 per 10 minutes |
| Calendar feeds | 60 a minute |
| Calendar change notifications | 120 a minute |
| Account reads | 60 a minute |
| Account writes and check-in | 30 per 10 minutes; participant changes 60 per 10 minutes; invitations 10 an hour |
Lists, paging, and repeats
- Lists cap
limitat 500.GET /bookingspages withnext: send it back asafter; it isnullat the end. Filters apply before the limit. - Holds take a
key; the same key returns the same hold. Series, credit grants, and adjustments takekeytoo, and payment and credit messages carryeventKey. A repeat with the same key changes nothing. - Saves of services, classes, and other versioned records take
expectedVersion.
What a session sees
A booking always shows its number, status, times, service, team member, location, and payment and credit state. Contact details (customerEmail, customerPhone, userId) need bookings:customers; notesPrivate needs the right to change that booking; paymentProvider, paymentLabel, paymentRef, paymentUrl, and entitlementId need bookings:payments. Hidden parts are null and named in hidden.
Limits
| What | Limit |
|---|---|
| Availability window | 31 days, 1 000 slots |
| List page | 500 |
| Report period | 366 days, 20 000 bookings |
| Recurring series | 2–52 occurrences |
| Linked calendars | 5 per owner, 200 per site; 2 000 busy periods each |