Skip to content
Booked Help centre

API keys and the MCP server

Issue a scoped key, call the API with it, and connect an AI assistant.

An API key lets your own code — a script, an integration, or an AI assistant — read and manage a Booked site without a browser session. Keys are issued by the merchant, scoped to exactly what you need, and revocable in one click.

Issuing a key

  1. Open Settings → API keysYou need edit access to Settings, given under System › Team. An API key can never open this screen, so a key cannot mint or list other keys.
  2. Click New key and name itName it after the thing using it — "Claude assistant", "Nightly export" — so it is obvious what breaks when you revoke it.
  3. Tick only what it needsPermissions are per area, split into Read and Write. A key with no Write anywhere cannot change a thing.
  4. Copy the keyIt is shown once and never again. Lose it and you make a new secret for the same key from the same screen; the old one stops working at that moment.
Write access books real appointments

A key with bookings:write can create, change and cancel appointments that staff and customers will act on, and a key with full control can rewrite services, questions, templates and settings. Issue read-only keys unless you specifically need to write, and grant only the areas the integration touches.

Using it

Send the key as a bearer token. Some hosts strip Authorization before PHP sees it, so Booked also accepts X-Booked-Key — sending both is the reliable move.

Shell
curl 'https://yoursite.co.uk/wp-json/get-booked/v1/bookings' \
  -H 'Authorization: Bearer gbk_8wscer4i_…' \
  -H 'X-Booked-Key: gbk_8wscer4i_…'

Scopes

A key's access comes from its scopes alone. The access of the person who created it is not lent to the key. A key made by an administrator with only bookings:read can read bookings and nothing else — it cannot reach settings, and it cannot write. Every area has a read and a write scope, and Settings › API keys offers two presets: Read everything and Full control.

AreaScopesCovers
Appointmentsbookings:read / :writeBookings, availability, the waiting list, unfinished bookings, booking links, notes, documents, stats and insights.
Customerscustomers:read / :writeCustomer records, their history and answers, and the block list.
Servicesservices:read / :writeServices and their consultation questions, categories, packages, and the form's look.
Locationslocations:read / :writeBranches and their hours.
Staffemployees:read / :writeStaff, their hours, breaks and time off. Never their logins.
Booking formforms:read / :writeThe form's steps, eligibility and routing questions, bundles and upsells, slot templates and custom code.
Emails & textsmessages:read / :writeEvery email and text template, reminders, follow-ups, and the log of what was sent.
Settingssettings:read / :writeCompany details, booking rules, features, import and export, and the activity log.
Team & loginsteam:read / :writeWho can sign in and what each login may see: access, branches, the desk sign-in, PINs and passwords. Owner-level at write.

Tick every box and the key can do what the owner can do in Booked, with three exceptions that no scope reaches: it cannot list, make or revoke keys; it cannot change the plan, billing or licence; and it cannot spend the assistant's own credits. Those routes answer 403 to any key, whatever it was issued with.

The team is a ninth area, Team & logins, off unless you tick it. At read a key can list who may sign in and what each login sees. At write it can do everything the Team screen does: make a login (emailed a link, or given a username and password on the spot), pick a preset or set each screen, hold it to a branch, mark it desk sign-in only, set a PIN or a password, and remove it. A key with it at write can hand out any access, including everything, so treat it as you would an owner's password.

Two rules follow from that, and both are enforced on the server:

  • Reads need a :read scope, writes need :write. A GET with only write scope is refused, and vice versa.
  • An unmapped area is denied. A key can never reach a part of the API its scopes do not name, and the three areas above are mapped to nothing. The refusal arrives before the route runs, as a 403 naming the permission to add.

What you get back

StatusMeans
200Fine.
401No key, a malformed key, or one that has been revoked.
403The key is valid but lacks the scope for this area or method.
429Rate limited — 120 requests per key per minute.

Connecting an AI assistant

Booked is an MCP server itself, so an assistant that speaks the Model Context Protocol can work with a site directly. There is nothing to install: point the assistant at the site's MCP address with a key, and it gets a set of tools rather than raw HTTP. Settings › API keys shows the exact address and step-by-step setup for Claude, Claude Code, ChatGPT, Cursor and Gemini CLI.

JSON
{
  "mcpServers": {
    "booked": {
      "url": "https://yoursite.co.uk/wp-json/get-booked/v1/mcp",
      "headers": {
        "Authorization": "Bearer gbk_8wscer4i_…"
      }
    }
  }
}
Shell
# Claude Code
claude mcp add --transport http booked https://yoursite.co.uk/wp-json/get-booked/v1/mcp \
  --header "Authorization: Bearer gbk_8wscer4i_…"

Apps that only take a server address, with no headers, can carry the key in the address instead: …/mcp?key=gbk_…. Anyone who sees that address holds the key, so use a read-only key there.

ToolNeeds
list_services, list_locations, list_employeesthe matching :read
check_availability, list_bookings, get_bookingbookings:read
create_booking, update_booking, cancel_bookingbookings:write
list_customerscustomers:read
update_customercustomers:write
get_serviceservices:read
create_service, update_service — including a service's consultation questions (intake_form)services:write
get_booking_formforms:read
update_booking_form — including the eligibility and routing questions (triage)forms:write
list_message_templatesmessages:read
update_message_templatemessages:write
api — any management route, by method and paththat route's area, :read for GET and :write for the rest
api_reference — the routes, what each takes, and the record shapesnothing

Everything else goes through api. Staff and their hours, branches, categories, packages, follow-ups, booking links, the waiting list, settings, features: the assistant calls api_reference once to learn the routes and the shape of each record, then api with a method and a path such as PUT employees/4. A PUT or PATCH on a record changes only the fields it sends and the rest of the record is kept; POST creates; DELETE is permanent. The tool refuses anything outside the key's areas with the permission to add, and anything no key may reach with a sentence saying so.

Each tool asks for its own scope, and the api tool asks for the scope of the route it is given. Every change lands in Settings › Activity log under the person who issued the key, named as made via API key "…", so a rewritten template or a moved appointment is never mistaken for the owner's own doing.

The scopes do the enforcing, not the assistant's good behaviour: a tool the key is not scoped for returns a permission error however the model is prompted. Give an assistant a read-only key and it can answer questions about the diary but cannot touch it; give it full control and it can set the whole of Booked up for you, short of other keys and the plan.

Check availability before booking

The assistant should call check_availability and offer real times rather than inventing one. A time that is not returned there cannot be booked, and the attempt will simply fail.

Looking after keys

  • One key per integration. Then revoking one does not break the others.
  • Edit rather than reissue. A key can be renamed or given more or less to do at any time; the change applies from its next request and nothing that holds the key has to change. Making a new secret keeps the key's id, name and permissions and invalidates the old secret at once.
  • Check Last used. A key that has never been used, or has not been used in months, should probably be revoked.
  • Revoking is instant and cannot be undone — the row stays so the audit trail survives, but the key stops working on the next request.
  • Keys are stored hashed. Nobody, including Booked, can read one back out of the database. That is also why we cannot show it to you twice.