Documentation
Booking
booking.hold
REST
ShippingPOST /api/v1/booking/holdMCP tool
Livebooking.holdExposed on: REST API · Booking MCP server. Part of the Booking domain.
Operating contract
Takes the slot off sale for a few minutes so it is still there when the customer says yes. A voice call takes twenty seconds to read a time back, and for those twenty seconds the same slot is being offered to everybody else — this is what stops two callers being sold one bay.
CALL THIS THE MOMENT YOU OFFER A SPECIFIC TIME, then pass hold_token and the SAME session_key to booking.book. Booking without a hold still works; it is just a race you might lose after the customer has committed.
session_key is one opaque id you mint for THIS conversation and reuse for every call in it — a call id, a chat id, anything stable and unguessable. Re-holding with the same key replaces this conversation's own hold instead of fighting it, so changing the customer's mind about a time costs nothing.
held: false with reason: "taken" means somebody got there first: re-run booking.availability and offer a different time. reason: "unavailable" is OUR problem — go on and book anyway; the booking itself re-checks the slot.
A hold expires by itself. Nothing has to release it, and letting one lapse is not an error.
Who may call it
- Permission
- NoneA reservation on a public slot, made by a member of the public in the middle of booking. It writes no shop record — a hold is a row that expires by itself — and the storefront takes the identical one with no login at all.
- Plan
- Every planNo plan gate. Available on every Service VIN plan.
- Retries
naturalNaturally idempotent — running it twice leaves the same world as running it once. A retrying integration needs no key.- Rate class
writeCounted against the write budget, which is tighter than a read.
Input
| Field | Type | Description |
|---|---|---|
| service_idsrequired | string[] | The services to book, as `id` values from booking.services. One id books one service; several book one visit covering all of them, and the slot is sized for the whole visit. |
| vehicle_typerequired | string | The customer's vehicle size, one of `vehicle_types` from booking.services. One of:car, truck, suv, van, coupe, motorcycle, commercial, exotic |
| startrequired | string | The exact `start` of the slot, copied from booking.availability. An ISO 8601 instant. |
| session_keyrequired | stringmax 128 chars, min 8 chars | One opaque, unguessable id for this conversation. Reuse it all call. |
| staff_id | stringuuid | Hold this installer, when the customer picked one — an id from `staff_ids` or `installers`, as returned by booking.availability. |
| ttl_minutes | integer1–30 | How long to hold it, 1-30 minutes. Defaults to the shop's setting. |
Output
| Field | Type | Description |
|---|---|---|
| held | boolean | — |
| hold_token | string | null | — |
| expires_at | string | null | — |
| reason | string | null | — |
Examples
Built from this capability's own schema — required fields and the ones carrying a default, and nothing invented. Paste one and it validates.
export SERVICEVIN_API_KEY=svk_live_…
curl -X POST https://www.servicevin.com/api/v1/booking/hold \
-H "Authorization: Bearer $SERVICEVIN_API_KEY" \
-H "Content-Type: application/json" \
-d '{"service_ids":["…"],"vehicle_type":"car","start":"…","session_key":"…"}'const res = await fetch("https://www.servicevin.com/api/v1/booking/hold", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.SERVICEVIN_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"service_ids": [
"…"
],
"vehicle_type": "car",
"start": "…",
"session_key": "…"
}),
});
// Success and failure are both envelopes. Switch on error.code, never
// on error.message — the codes are stable, the messages are for people.
const payload = await res.json();
if (!res.ok) throw new Error(payload.error.code);
const data = payload.data;import os, requests
res = requests.post(
"https://www.servicevin.com/api/v1/booking/hold",
headers={"Authorization": f"Bearer {os.environ['SERVICEVIN_API_KEY']}"},
json={
"service_ids": [
"…"
],
"vehicle_type": "car",
"start": "…",
"session_key": "…"
},
timeout=30,
)
payload = res.json()
if not res.ok:
raise RuntimeError(payload["error"]["code"])
data = payload["data"]{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "booking.hold",
"arguments": {
"service_ids": [
"…"
],
"vehicle_type": "car",
"start": "…",
"session_key": "…"
}
}
}Refusals
The four gates run in this order on every surface, and the order is not arbitrary — see Authentication.
| Status | Code | When |
|---|---|---|
| 404 | not_found | The id is unknown, or the feature is not enabled for this account. Deliberately the same answer for both. |
| 403 | insufficient_scope | The credential is read-only and this capability writes. |
| 422 | validation_error | An argument was wrong. The message names the field. |
| 429 | rate_limited | Too many write calls. Back off and retry. |
| 500 | internal_error | Something failed on our side. Nothing was changed. |