Your Business API (v1)

The same business brain the chat and the MCP server use: open times, bookings, moves, cancels, blocked time, payments, refunds, revenue, booking counts and customers. Every write takes an Idempotency-Key.

Base URL https://book.prmio.com/v1 · OpenAPI 3.1 JSON

Keys

Make keys on your dashboard (API & webhooks). A key is shown once and stored only as a fingerprint. sk_test_ / sk_live_ can read and change; rk_test_ / rk_live_ can only read. Revoke any key at once. Every key only ever sees its own business.

curl https://book.prmio.com/v1/bookings -H "Authorization: Bearer sk_test_…"

Retries never double-book

Send an Idempotency-Key header on every write. The same key and the same body return the first answer (header Idempotent-Replayed: true). The same key with a different body is a 422 idempotency_error.

Errors, pages, limits

Errors: {"error":{"type","code","message","param","request_id"}} with codes like slot_unavailable, outside_hours, not_found, key_read_only. Lists: limit (1-100) and starting_after = the next_cursor you got. Each key has a rate limit (headers RateLimit-Limit, RateLimit-Remaining, RateLimit-Reset; a 429 has Retry-After). Every call is logged on your dashboard.

Webhooks (Standard Webhooks)

Events: booking.created, booking.updated, booking.cancelled, payment.succeeded, payment.refunded, customer.created. Body: {"type","timestamp","data"}. Headers: webhook-id, webhook-timestamp, webhook-signature: v1,<base64> = HMAC-SHA256 of id.timestamp.body with your whsec_ secret (the part after whsec_, base64-decoded). Answer any 2xx. We retry failures with backoff and jitter for about 3 days; answering 410 stops them for that endpoint; after repeated failures the endpoint pauses and you're alerted. Every attempt is in the delivery log, with a Resend button.

import crypto from 'node:crypto';
function verify(secret, headers, body) {
  const key = Buffer.from(secret.replace('whsec_', ''), 'base64');
  const signed = headers['webhook-id'] + '.' + headers['webhook-timestamp'] + '.' + body;
  const want = crypto.createHmac('sha256', key).update(signed).digest('base64');
  return headers['webhook-signature'].split(' ').some((s) => s === 'v1,' + want);
}

Incoming: your systems (or Zapier / Make) push changes to POST https://book.prmio.com/v1/incoming/<business>, signed the same way with your incoming secret (dashboard → API & webhooks).

Business

GET /v1/business The business (name, services, hours, time zone)
GET /v1/services Services with price and length

Bookings

GET /v1/availability Open times for a service
ParameterInAbout
service *queryService id (from /services)
datequeryA day, YYYY-MM-DD (business time). Without it: the next openings.
partyqueryPeople
limitqueryHow many
GET /v1/bookings List bookings
ParameterInAbout
fromqueryISO date-time
toqueryISO date-time
statusquerybooked, cancelled, done, no_show
customerqueryA customer_ref
limitquery1-100
starting_afterqueryThe next_cursor from the last page
orderqueryasc or desc
POST /v1/bookings Book
ParameterInAbout
Idempotency-KeyheaderA unique string per write; a retry with the same key never repeats the change.
{
  "service": "private-session",
  "start": "2026-11-25T10:00",
  "customer": {
    "name": "Ana Diaz",
    "phone": "+15555550101"
  }
}
GET /v1/bookings/{booking_ref} One booking
ParameterInAbout
booking_ref *pathBK-XXXXXX
PATCH /v1/bookings/{booking_ref} Move a booking
ParameterInAbout
booking_ref *pathBK-XXXXXX
Idempotency-KeyheaderA unique string per write; a retry with the same key never repeats the change.
POST /v1/bookings/{booking_ref}/cancel Cancel a booking (paid deposits are refunded)
ParameterInAbout
booking_ref *pathBK-XXXXXX
Idempotency-KeyheaderA unique string per write; a retry with the same key never repeats the change.

Schedule

GET /v1/schedule A day's bookings and blocked time
ParameterInAbout
datequeryYYYY-MM-DD (default: today)
POST /v1/blocks Block time
ParameterInAbout
Idempotency-KeyheaderA unique string per write; a retry with the same key never repeats the change.
DELETE /v1/blocks/{block_ref} Unblock
ParameterInAbout
block_ref *pathBLK-XXXXXX
Idempotency-KeyheaderA unique string per write; a retry with the same key never repeats the change.

Payments

GET /v1/payments List payments
ParameterInAbout
bookingqueryA booking_ref
limitquery1-100
starting_afterquerycursor
POST /v1/payments Take a payment (a pay link on the business's own payment platform, or record one taken in person)
ParameterInAbout
Idempotency-KeyheaderA unique string per write; a retry with the same key never repeats the change.
POST /v1/payments/{payment_ref}/refund Refund (all, or amount_cents)
ParameterInAbout
payment_ref *pathPAY-XXXXXX
Idempotency-KeyheaderA unique string per write; a retry with the same key never repeats the change.

Metrics

GET /v1/metrics/revenue Revenue (payments in, minus refunds)
ParameterInAbout
periodquerytoday, yesterday, this_week, last_week, this_month, last_month, last_7_days, last_30_days, this_year, or custom (with from and to)
fromqueryYYYY-MM-DD
toqueryYYYY-MM-DD
GET /v1/metrics/bookings Booking counts
ParameterInAbout
periodquerytoday, yesterday, this_week, last_week, this_month, last_month, last_7_days, last_30_days, this_year, or custom (with from and to)
fromqueryYYYY-MM-DD
toqueryYYYY-MM-DD
GET /v1/metrics/ai_cost What the AI assistant cost
ParameterInAbout
periodquerytoday, yesterday, this_week, last_week, this_month, last_month, last_7_days, last_30_days, this_year, or custom (with from and to)

Customers

GET /v1/customers Customers
ParameterInAbout
queryqueryName, phone or email
limitquery1-100
starting_afterquerycursor
GET /v1/customers/{customer_ref} One customer with their bookings
ParameterInAbout
customer_ref *pathCUS-XXXXXX

Memory

POST /v1/customer_sessions A customer signs in: a code is texted to their mobile (the same answer whether or not the number is a customer here)
POST /v1/customer_sessions/verify The code → a customer token (Bearer ctk_…, 12 hours, this business only). It reaches only open times, the customer's own bookings, the waitlist and their memory
GET /v1/me The signed-in customer (customer token)
GET /v1/me/memory What is remembered about the signed-in customer: their usual (from their bookings) and their booking preferences
DELETE /v1/me/memory "Forget me": every card deleted, signed out everywhere; earlier bookings no longer count toward the usual
GET /v1/customers/{ref}/memory What is remembered about one customer (owner keys)
ParameterInAbout
ref *pathcustomer_ref
DELETE /v1/customers/{ref}/memory Forget one customer (full owner keys)
ParameterInAbout
ref *pathcustomer_ref

Waitlist

POST /v1/waitlist Join the waitlist for a full class or a taken time (a customer token, or an owner key with customer)

Insights

GET /v1/insights Fill rate (by class, time of day, staff), busiest and slowest times, staff, no-shows, new vs returning customers, booked value, the waitlist. as_of rebuilds them as they stood at the end of that day
ParameterInAbout
periodquerytoday, yesterday, this_week, last_week, this_month, last_month, last_7_days, last_30_days, this_year, or custom (with from and to)
fromqueryYYYY-MM-DD (custom)
toqueryYYYY-MM-DD (custom)
as_ofqueryYYYY-MM-DD or a date-time
GET /v1/insights/pacing This week now vs this week as it stood at an earlier moment: booked value (% up or down), fill rate, morning fill rate, anything notable
ParameterInAbout
since *queryYYYY-MM-DD (the end of that day) or a date-time

Webhooks

GET /v1/webhook_endpoints Your webhook endpoints
POST /v1/webhook_endpoints Add an endpoint (the whsec_ secret is shown once)
ParameterInAbout
Idempotency-KeyheaderA unique string per write; a retry with the same key never repeats the change.
DELETE /v1/webhook_endpoints/{endpoint_ref} Delete an endpoint
ParameterInAbout
endpoint_ref *pathWHE-XXXXXX
POST /v1/webhook_endpoints/{endpoint_ref}/resume Resume a paused endpoint
ParameterInAbout
endpoint_ref *pathWHE-XXXXXX
GET /v1/webhook_deliveries Delivery log (every attempt)
ParameterInAbout
endpointqueryendpoint_ref
limitquery1-100
POST /v1/webhook_deliveries/{delivery_id}/resend Send a delivery again
ParameterInAbout
delivery_id *pathdlv_…
POST /v1/incoming/{business} Incoming webhook: your system pushes changes to us (Standard Webhooks signature with your incoming whsec_ secret, no API key)
ParameterInAbout
business *pathThe business handle
webhook-id *header
webhook-timestamp *header
webhook-signature *header
{
  "type": "booking.created",
  "data": {
    "service": "express-wash",
    "start": "2026-11-25T10:00:00-08:00",
    "customer": {
      "name": "Sam Lee",
      "phone": "+15555550177"
    },
    "external_id": "their-123"
  }
}