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.
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
| Parameter | In | About |
|---|
service * | query | Service id (from /services) |
date | query | A day, YYYY-MM-DD (business time). Without it: the next openings. |
party | query | People |
limit | query | How many |
GET /v1/bookings List bookings
| Parameter | In | About |
|---|
from | query | ISO date-time |
to | query | ISO date-time |
status | query | booked, cancelled, done, no_show |
customer | query | A customer_ref |
limit | query | 1-100 |
starting_after | query | The next_cursor from the last page |
order | query | asc or desc |
POST /v1/bookings Book
| Parameter | In | About |
|---|
Idempotency-Key | header | A 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
| Parameter | In | About |
|---|
booking_ref * | path | BK-XXXXXX |
PATCH /v1/bookings/{booking_ref} Move a booking
| Parameter | In | About |
|---|
booking_ref * | path | BK-XXXXXX |
Idempotency-Key | header | A 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)
| Parameter | In | About |
|---|
booking_ref * | path | BK-XXXXXX |
Idempotency-Key | header | A 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
| Parameter | In | About |
|---|
date | query | YYYY-MM-DD (default: today) |
POST /v1/blocks Block time
| Parameter | In | About |
|---|
Idempotency-Key | header | A unique string per write; a retry with the same key never repeats the change. |
DELETE /v1/blocks/{block_ref} Unblock
| Parameter | In | About |
|---|
block_ref * | path | BLK-XXXXXX |
Idempotency-Key | header | A unique string per write; a retry with the same key never repeats the change. |
Payments
GET /v1/payments List payments
| Parameter | In | About |
|---|
booking | query | A booking_ref |
limit | query | 1-100 |
starting_after | query | cursor |
POST /v1/payments Take a payment (a pay link on the business's own payment platform, or record one taken in person)
| Parameter | In | About |
|---|
Idempotency-Key | header | A 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)
| Parameter | In | About |
|---|
payment_ref * | path | PAY-XXXXXX |
Idempotency-Key | header | A unique string per write; a retry with the same key never repeats the change. |
Metrics
GET /v1/metrics/revenue Revenue (payments in, minus refunds)
| Parameter | In | About |
|---|
period | query | today, yesterday, this_week, last_week, this_month, last_month, last_7_days, last_30_days, this_year, or custom (with from and to) |
from | query | YYYY-MM-DD |
to | query | YYYY-MM-DD |
GET /v1/metrics/bookings Booking counts
| Parameter | In | About |
|---|
period | query | today, yesterday, this_week, last_week, this_month, last_month, last_7_days, last_30_days, this_year, or custom (with from and to) |
from | query | YYYY-MM-DD |
to | query | YYYY-MM-DD |
GET /v1/metrics/ai_cost What the AI assistant cost
| Parameter | In | About |
|---|
period | query | today, 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
| Parameter | In | About |
|---|
query | query | Name, phone or email |
limit | query | 1-100 |
starting_after | query | cursor |
GET /v1/customers/{customer_ref} One customer with their bookings
| Parameter | In | About |
|---|
customer_ref * | path | CUS-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)
| Parameter | In | About |
|---|
ref * | path | customer_ref |
DELETE /v1/customers/{ref}/memory Forget one customer (full owner keys)
| Parameter | In | About |
|---|
ref * | path | customer_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
| Parameter | In | About |
|---|
period | query | today, yesterday, this_week, last_week, this_month, last_month, last_7_days, last_30_days, this_year, or custom (with from and to) |
from | query | YYYY-MM-DD (custom) |
to | query | YYYY-MM-DD (custom) |
as_of | query | YYYY-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
| Parameter | In | About |
|---|
since * | query | YYYY-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)
| Parameter | In | About |
|---|
Idempotency-Key | header | A unique string per write; a retry with the same key never repeats the change. |
DELETE /v1/webhook_endpoints/{endpoint_ref} Delete an endpoint
| Parameter | In | About |
|---|
endpoint_ref * | path | WHE-XXXXXX |
POST /v1/webhook_endpoints/{endpoint_ref}/resume Resume a paused endpoint
| Parameter | In | About |
|---|
endpoint_ref * | path | WHE-XXXXXX |
GET /v1/webhook_deliveries Delivery log (every attempt)
| Parameter | In | About |
|---|
endpoint | query | endpoint_ref |
limit | query | 1-100 |
POST /v1/webhook_deliveries/{delivery_id}/resend Send a delivery again
| Parameter | In | About |
|---|
delivery_id * | path | dlv_… |
POST /v1/incoming/{business} Incoming webhook: your system pushes changes to us (Standard Webhooks signature with your incoming whsec_ secret, no API key)
| Parameter | In | About |
|---|
business * | path | The 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"
}
}