API reference (v1)

Read and change a business’s appointments, clients and catalogue from your own software. The machine-readable description is the OpenAPI 3.1 document; load it into any OpenAPI tool to try requests or generate a client.

Authentication

The business’s owner or admin creates a key in Settings → Calendar feeds & API and chooses its scopes. Send it as a bearer token on every request:

Authorization: Bearer sp_live_…

A key belongs to one business and can never do more than the person who made it can do in the app. Scopes: read:appointments, write:appointments, read:clients, write:clients, read:services, read:staff, read:availability, read:sales, read:exports.

Conventions

Endpoints

MethodPathWhat it doesScope
GET/locationsList locationsany
GET/locations/{id}Get a locationany
GET/servicesList servicesread:services
GET/services/{id}Get a serviceread:services
GET/staffList staffread:staff
GET/staff/{id}Get a staff memberread:staff
POST/availabilitySearch bookable timesread:availability
GET/appointmentsList appointmentsread:appointments
POST/appointmentsBook an appointmentwrite:appointments
GET/appointments/{id}Get an appointmentread:appointments
POST/appointments/{id}/cancelCancel an appointmentwrite:appointments
POST/appointments/{id}/rescheduleMove an appointmentwrite:appointments
GET/clientsList clientsread:clients
POST/clientsCreate a clientwrite:clients
GET/clients/{id}Get a clientread:clients
PATCH/clients/{id}Update a clientwrite:clients
GET/salesList salesread:sales
GET/sales/{id}Get a saleread:sales
GET/exportsList data warehouse snapshotsread:exports
GET/exports/{date}Download a data warehouse snapshotread:exports

Errors

Errors are application/problem+json with a stable code:

UNAUTHENTICATED401No key, an unknown key or a revoked key.
INSUFFICIENT_SCOPE403The key was not given the scope this needs.
FORBIDDEN403The key’s creator can no longer do this (permissions or locations).
NOT_FOUND404Nothing with that id in this business.
INVALID_INPUT400The body or query failed validation.
INVALID_CURSOR400The cursor is not one we issued.
IDEMPOTENCY_KEY_REQUIRED400POSTs that change things need an Idempotency-Key.
SLOT_TAKEN409Someone else has that time. Search availability again.
VERSION_CONFLICT409The appointment changed since the version you sent.
INVALID_TRANSITION409For example, cancelling a completed appointment.
DUPLICATE409A client with that email or phone exists.
IDEMPOTENCY_IN_PROGRESS409The first request with this key is still running.
IDEMPOTENCY_KEY_REUSED422The key was used with a different request.
RATE_LIMITED429Over 600 requests a minute for this key. See Retry-After.

Webhooks

Add an https endpoint in Settings and choose events: appointment.booked, appointment.rescheduled, appointment.cancelled, appointment.status_changed, client.created, order.paid, order.voided, membership.started, membership.paused, membership.resumed, membership.cancelled, waitlist.joined. Each is a POST of { id, type, createdAt, businessId, apiVersion, data }, where data holds ids (fetch the object for details). Answer with any 2xx within 10 seconds. Failures are retried with growing gaps for about a day; delivery order is not guaranteed, so de-duplicate on id.

Check the X-Salon-Signature header (t=…,v1=…) against your endpoint’s secret before trusting a request:

import { createHmac, timingSafeEqual } from 'node:crypto';

// rawBody: the request body exactly as received (a string), before JSON.parse.
function verify(secret, rawBody, header) {
  const parts = Object.fromEntries(header.split(',').map((p) => p.split('=')));
  const t = Number(parts.t);
  if (!t || Math.abs(Date.now() / 1000 - t) > 300) return false; // older than 5 minutes
  const expected = createHmac('sha256', secret).update(`${t}.${rawBody}`).digest();
  const given = Buffer.from(parts.v1 ?? '', 'hex');
  return given.length === expected.length && timingSafeEqual(given, expected);
}