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"
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." } }
| Field | Type | Description |
|---|---|---|
| 400 invalid_request | A field is missing or wrong. | |
| 401 unauthorized | Missing or invalid key. | |
| 402 plan_limit | The plan doesn't include this (for example API access on Free). | |
| 404 not_found | No such object in this organisation. | |
| 409 slot_unavailable | The time is no longer free. Fetch availability again. | |
| 429 rate_limited | 1,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:
| Field | Type | Description |
|---|---|---|
| data-org | string | Your booking slug (required). |
| data-label | string | Button text. Default “Book now”. |
| data-position | string | <code>right</code> (default), <code>left</code>, or <code>none</code> to hide the floating button. |
| data-color | hex | Button 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
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.
| Field | Type | Description |
|---|---|---|
| service_id | integer | Required. |
| staff_id | integer | Only this staff member. Omit for anyone. |
| from | date | <code>YYYY-MM-DD</code> in the org's zone. Default today. |
| days | integer | 1–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
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.
| Field | Type | Description |
|---|---|---|
| service_id | integer | Required. |
| start | datetime | Required. A start time from availability. |
| staff_id | integer | Optional. |
| customer.name | string | Required. |
| customer.email | string | Email or phone is required. Confirmations go to the email. |
| customer.phone | string | |
| notes | string | Up 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/…"
}
| Field | Type | Description |
|---|---|---|
| from / to | datetime | Filter by start time. |
| staff_id | integer | |
| status | string | <code>confirmed</code>, <code>cancelled</code>, <code>completed</code>, <code>no_show</code> |
| q | string | Search customer name, email or phone. |
Optional reason. The customer is emailed and booking.cancelled fires.
Body: start and optional staff_id. The time must be free.
Customers
Customers are created automatically from bookings (matched by email, then phone). Includes visits and last_visit. Search with q.
Organisation
Name, slug, time zone, currency, brand colour, plan and booking rules (lead_minutes, horizon_days, slot_step, cancel_hours).
Services
| Field | Type | Description |
|---|---|---|
| name | string | Required. |
| minutes | integer | 5–720. Required. |
| buffer_minutes | integer | Clean-up time after, 0–240. |
| price_cents | integer | null | Null hides the price. |
| description | string | |
| staff_ids | integer[] | Who performs it. Default: all active staff. |
| active | boolean | Inactive services can't be booked online. |
Services with past bookings are deactivated instead of deleted, so history stays intact.
Staff & hours
Each staff member with service_ids and weekly hours.
| Field | Type | Description |
|---|---|---|
| name | string | Required. |
| string | Gets new-booking notifications. | |
| color | hex | Calendar colour. |
| service_ids | integer[] | Default: all active services. |
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
| Field | Type | Description |
|---|---|---|
| url | string | HTTPS endpoint. |
| events | string[] | <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.
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.
| Field | Type | Description |
|---|---|---|
| external_ref | string | Your id for this business. Required. |
| name | string | Business name. Required. |
| category | string | e.g. <code>barber</code>, <code>nails</code>, <code>spa</code>. See <code>GET /v1/meta/categories</code>. |
| time_zone | string | IANA zone, e.g. <code>America/New_York</code>. |
| owner.email | string | Required. Becomes the owner. |
| owner.name | string | |
| plan | string | <code>free</code>, <code>pro</code> (default) or <code>team</code>. |
| phone, address, website | string | Shown 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", ... }
Change plan or set suspended: true to pause online booking (for example when your client stops paying).
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.
Business details, bookable services and staff.
Same parameters as availability.
Same body as creating a booking. Returns { booking, manage_url }.
The customer's own booking, from the token in their manage link. Also POST …/cancel, POST …/reschedule and GET …/availability.