Levitate Book

API reference · v1

Levitate Book API

A small REST API over JSON. Everything the booking page does, you can do from your own code: read availability, create and change bookings, manage services and staff, and get webhooks when anything happens.

Base URL: https://book.levitate.ws/v1. Times are ISO 8601 in UTC (2026-12-02T16:00:00Z); each organisation has a time_zone for display. Money is in cents.

Authentication

Create an API key under API & webhooks in your dashboard (Pro and Team plans). Send it as a bearer token. Keys belong to one organisation and can do everything a manager can.

curl https://book.levitate.ws/v1/org -H "Authorization: Bearer lb_live_xxxxxxxxxxxxxxxx"
Keep keys on your server. The browser-safe public endpoints need no key and are what the widget uses.

Errors & limits

Errors use HTTP status codes and a consistent body. The message is written for people and safe to show to your users.

{ "error": { "code": "slot_unavailable", "message": "Sorry, that time was just taken. Please pick another." } }
FieldTypeDescription
400 invalid_requestA field is missing or wrong.
401 unauthorizedMissing or invalid key.
402 plan_limitThe plan doesn't include this (for example API access on Free).
404 not_foundNo such object in this organisation.
409 slot_unavailableThe time is no longer free. Fetch availability again.
429 rate_limited1,200 requests a minute per key; public booking 20 an hour per IP.

Lists take limit (1–200, default 50) and offset, and return { data, has_more, next_offset }.

Widget & booking page

Every organisation has a hosted page at https://book.levitate.ws/<slug>. To add booking to any website, paste:

<script src="https://book.levitate.ws/widget.js" data-org="your-slug" async></script>

That adds a floating Book now button that opens the booking flow in an overlay. Options on the script tag:

FieldTypeDescription
data-orgstringYour booking slug (required).
data-labelstringButton text. Default “Book now”.
data-positionstring<code>right</code> (default), <code>left</code>, or <code>none</code> to hide the floating button.
data-colorhexButton colour. Defaults to your brand colour.

To embed the flow inline, add a container anywhere after loading the script, or make any link open the overlay:

<div data-levitate-book="your-slug"></div>
<a href="https://book.levitate.ws/your-slug" data-levitate-open="your-slug">Book an appointment</a>

Preselect a service or staff member with ?service=12&staff=3 on the page URL, or data-service / data-staff on the container.

Availability

GET/v1/availability

Free start times for one service, grouped by day in the organisation's time zone. Takes each staff member's hours, time off, existing bookings and the service's buffer into account.

FieldTypeDescription
service_idintegerRequired.
staff_idintegerOnly this staff member. Omit for anyone.
fromdate<code>YYYY-MM-DD</code> in the org's zone. Default today.
daysinteger1–62, default 7.
{
  "time_zone": "America/New_York", "from": "2026-12-01", "days": 7,
  "slots": {
    "2026-12-01": [ { "start": "2026-12-01T14:00:00.000Z", "staff": [3, 5] }, ... ],
    "2026-12-02": []
  }
}

Bookings

POST/v1/bookings

Books an offered time. Pass a start exactly as returned by availability. Without staff_id we choose the free staff member with the fewest bookings that day.

FieldTypeDescription
service_idintegerRequired.
startdatetimeRequired. A start time from availability.
staff_idintegerOptional.
customer.namestringRequired.
customer.emailstringEmail or phone is required. Confirmations go to the email.
customer.phonestring
notesstringUp to 1,000 characters.
curl -X POST https://book.levitate.ws/v1/bookings \
  -H "Authorization: Bearer lb_live_…" -H "Content-Type: application/json" \
  -d '{ "service_id": 12, "start": "2026-12-02T16:00:00.000Z",
        "customer": { "name": "Ana Ruiz", "email": "ana@example.com" } }'
{
  "id": 481, "status": "confirmed", "source": "api",
  "start": "2026-12-02T16:00:00.000Z", "end": "2026-12-02T16:45:00.000Z", "time_zone": "America/New_York",
  "service": { "id": 12, "name": "Skin fade", "price_cents": 3800 },
  "staff": { "id": 3, "name": "Marcus" },
  "customer": { "id": 77, "name": "Ana Ruiz", "email": "ana@example.com", "phone": "" },
  "notes": "", "created_at": "…", "cancelled_at": null,
  "manage_url": "https://book.levitate.ws/b/…"
}
GET/v1/bookings
FieldTypeDescription
from / todatetimeFilter by start time.
staff_idinteger
statusstring<code>confirmed</code>, <code>cancelled</code>, <code>completed</code>, <code>no_show</code>
qstringSearch customer name, email or phone.
GET/v1/bookings/:id
POST/v1/bookings/:id/cancel

Optional reason. The customer is emailed and booking.cancelled fires.

POST/v1/bookings/:id/reschedule

Body: start and optional staff_id. The time must be free.

Customers

GET/v1/customers

Customers are created automatically from bookings (matched by email, then phone). Includes visits and last_visit. Search with q.

Organisation

GET/v1/org

Name, slug, time zone, currency, brand colour, plan and booking rules (lead_minutes, horizon_days, slot_step, cancel_hours).

Services

GET/v1/services
POST/v1/services
FieldTypeDescription
namestringRequired.
minutesinteger5–720. Required.
buffer_minutesintegerClean-up time after, 0–240.
price_centsinteger | nullNull hides the price.
descriptionstring
staff_idsinteger[]Who performs it. Default: all active staff.
activebooleanInactive services can't be booked online.
PATCH/v1/services/:id
DELETE/v1/services/:id

Services with past bookings are deactivated instead of deleted, so history stays intact.

Staff & hours

GET/v1/staff

Each staff member with service_ids and weekly hours.

POST/v1/staff
FieldTypeDescription
namestringRequired.
emailstringGets new-booking notifications.
colorhexCalendar colour.
service_idsinteger[]Default: all active services.
PATCH/v1/staff/:id
PUT/v1/staff/:id/hours

Replaces the weekly hours. weekday 0 is Sunday. Several ranges on one day make breaks.

{ "hours": [ { "weekday": 1, "start": "09:00", "end": "13:00" },
             { "weekday": 1, "start": "14:00", "end": "18:00" } ] }

Webhooks

POST/v1/webhooks
FieldTypeDescription
urlstringHTTPS endpoint.
eventsstring[]<code>booking.created</code>, <code>booking.cancelled</code>, <code>booking.rescheduled</code>. Default all.

The response includes the signing secret once. Also GET /v1/webhooks and DELETE /v1/webhooks/:id.

Payload

POST https://your-app.example.com/hooks/levitate
Levitate-Event: booking.created
Levitate-Signature: t=1764691200,v1=5f2b…

{ "id": "evt_…", "type": "booking.created", "created": "2026-12-01T15:00:00Z",
  "data": { …booking object… } }

Verifying signatures

Compute HMAC-SHA256 of "<t>.<raw body>" with your secret and compare it to v1. Reject events older than five minutes.

import crypto from "node:crypto";
function verify(rawBody, header, secret) {
  const { t, v1 } = Object.fromEntries(header.split(",").map((p) => p.split("=")));
  const expected = crypto.createHmac("sha256", secret).update(`${t}.${rawBody}`).digest("hex");
  const fresh = Math.abs(Date.now() / 1000 - Number(t)) < 300;
  return fresh && crypto.timingSafeEqual(Buffer.from(expected), Buffer.from(v1));
}

Respond with any 2xx within 8 seconds. Failed deliveries are retried after 1, 5, 30, 120 and 720 minutes. Recent deliveries are listed in your dashboard.

Partner API

For website builders and agencies who give booking to their own clients. Authenticate with a partner key (lb_partner_…). Partner organisations are billed to the partner.

POST/v1/partner/orgs

Creates an organisation with its owner, pre-filled from its category and ready to take bookings. Idempotent: the same external_ref returns the same organisation.

FieldTypeDescription
external_refstringYour id for this business. Required.
namestringBusiness name. Required.
categorystringe.g. <code>barber</code>, <code>nails</code>, <code>spa</code>. See <code>GET /v1/meta/categories</code>.
time_zonestringIANA zone, e.g. <code>America/New_York</code>.
owner.emailstringRequired. Becomes the owner.
owner.namestring
planstring<code>free</code>, <code>pro</code> (default) or <code>team</code>.
phone, address, websitestringShown on the booking page.
{ "id": 31, "slug": "maria-s-nails", "booking_url": "https://book.levitate.ws/maria-s-nails",
  "embed": "<script src=\"https://book.levitate.ws/widget.js\" data-org=\"maria-s-nails\" async></script>",
  "external_ref": "site_884", "plan": "pro", ... }
GET/v1/partner/orgs/:external_ref
PATCH/v1/partner/orgs/:external_ref

Change plan or set suspended: true to pause online booking (for example when your client stops paying).

POST/v1/partner/orgs/:external_ref/login-link

Returns a one-time sign-in url valid for 10 minutes, so your client opens their booking dashboard from your app without a second password. Optional email picks a team member; default is the owner.

Public endpoints

No key, CORS open, rate limited by IP. These power the booking page and widget, and are safe to call from a browser.

GET/v1/public/orgs/:slug

Business details, bookable services and staff.

GET/v1/public/orgs/:slug/availability

Same parameters as availability.

POST/v1/public/orgs/:slug/bookings

Same body as creating a booking. Returns { booking, manage_url }.

GET/v1/public/bookings/:token

The customer's own booking, from the token in their manage link. Also POST …/cancel, POST …/reschedule and GET …/availability.