b59 book API and MCP
Read a booking page, find a free time and book it from a script or an AI agent. The address of a page is the last part of b59.link/book/p/<slug>.
Sign up with an email code
There is no separate sign-up. Ask for a code:
curl -X POST https://b59.link/api/book/v1/auth \
-H "Content-Type: application/json" \
-d '{"email": "you@example.com"}'{"otp_sent": true, "email": "you@example.com", "expires_in_seconds": 600,
"next": "Call auth again with the same email and the 6-digit otp from the email."}Then send the code back. A new email gets an account here, the same one as signing in on the website:
curl -X POST https://b59.link/api/book/v1/auth \
-H "Content-Type: application/json" \
-d '{"email": "you@example.com", "otp": "123456"}'{"session_key": "b59bk_...", "token_type": "Bearer", "expires_at": "2026-12-04T10:00:00+00:00",
"email": "you@example.com", "new_account": true}Send Authorization: Bearer <session_key> on later calls.
| Rule | Value | Note |
|---|---|---|
| Code | 6 digits, 10 minutes | Too many tries answers 429 too_many_tries; wait and ask again. |
| Session key | 30 days | POST /v1/auth/logout ends it sooner. Stored hashed, so it can't be shown again. |
| Bookings | 10 per account per UTC day | API and MCP together. A subscription lifts it; booking on the page itself is never limited. |
REST API
Base address: https://b59.link/api/book. Times are UTC.
| Route | Sign-in | What it does |
|---|---|---|
| POST /v1/auth | no | Email for a code; email and otp for a session key. |
| POST /v1/auth/logout | yes | Ends the session key in the header. |
| GET /p/{slug} | no | A page's public details and plans. |
| GET /p/{slug}/terms | no | The text and version of the page's terms. |
| GET /p/{slug}/slots | no | Free start times in UTC. |
| POST /v1/p/{slug}/book | yes | Book. Fields: plan, starts_at, name, and when needed note, tz, terms_version, phone. |
| GET /v1/usage | yes | Today's count, the limit and when it resets. |
Book a time from /p/{slug}/slots with a plan id from /p/{slug}:
curl -X POST https://b59.link/api/book/v1/p/your-page/book \
-H "Authorization: Bearer b59bk_..." \
-H "Content-Type: application/json" \
-d '{"plan": "intro", "starts_at": "2026-12-01T09:00:00+00:00", "name": "Ann Lee", "tz": "Asia/Kolkata"}'A free plan is confirmed at once. A paid plan holds the time for about 30 minutes and answers checkout_url: give it to the person, as only their payment confirms the booking. If the page has terms, show them to the person and send terms_version only once they have agreed.
Past the daily limit the answer is 429 with daily_limit, resets_at and subscribe_url. Errors otherwise use the usual status codes with a message in detail.
MCP server
Address: https://b59.link/api/book/mcp, JSON-RPC 2.0 over HTTP with plain JSON replies. Sign in with the auth tool, or with the two calls above, and send the session key as a header:
{
"mcpServers": {
"b59-book": {
"type": "http",
"url": "https://b59.link/api/book/mcp",
"headers": { "Authorization": "Bearer b59bk_..." }
}
}
}Reading pages and free times needs no key:
curl -X POST https://b59.link/api/book/mcp \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "id": 1, "method": "tools/call",
"params": {"name": "list_free_times", "arguments": {"slug": "your-page"}}}'| Tool | Sign-in | What it does |
|---|---|---|
| auth | no | Pass email to get a 6-digit code by email, then email and otp to get a session key. A new email gets an account here. |
| get_booking_page | no | A page's title, plans, hours and contact, and its terms when it has any. |
| list_free_times | no | The page's free start times in UTC. |
| create_booking | yes | Book a free time under the signed-in email. A free plan is confirmed at once; a paid plan holds the time and answers a checkout_url for the person to pay. |
| get_usage | yes | Bookings made through the API and MCP today (UTC), the limit and when the count resets. |
Clients that connect with OAuth (directory connectors) use https://b59.link/api/book/mcp/oauth: its 401 points to the metadata, they register themselves, and the person signs in with the same email code at /book/oauth/authorize. Only PKCE S256 is accepted. The access token is an ordinary 30-day session key.
The same tools in function-calling format: https://b59.link/api/book/mcp/schema. For agents, a short version of this page is at /book/llms.txt.