Developers

Server API (secret keys)

Read a business's services, bookings, orders and customers from your own server, and send customers and enquiries in.

The server API is for code that runs on a server: a website's back end, a CMS plugin, a script or another app. It uses a secret API key that the business makes itself in the BeniBrain dashboard, so nobody at BeniBrain needs to be involved.

Getting a key

  1. In BeniBrain, open Settings → Developers → API keys.
  2. Click Make a key, name it (for example "My website") and choose Read only or Read and write.
  3. Copy the key straight away. It's shown once; BeniBrain only keeps a hash of it.

Keys start with bb_sk_. A business can have up to 10, see when each was last used, and revoke any of them at once. Keep keys on your server: the API doesn't allow browser (CORS) requests, so a key can't be used from a web page. To show services, free times or the shop in the browser, use the public storefront and booking endpoints with the business's public key instead (see Overview & auth).

Authentication

Send the key as a bearer token on every request. X-API-Key also works.

Example — list this week's bookings
curl "https://benibrain.com/api/v1/bookings?from=2026-11-16&to=2026-11-23" \
  -H "Authorization: Bearer bb_sk_your_key_here"

Endpoints

Base URL: https://benibrain.com/api. Every response is JSON and every request is limited to the key's own business.

MethodPathWhat it does
GET/v1/businessThe business's name, website, country, currency, time zone and public key.
GET/v1/servicesActive services with price, length, deposit and images.
GET/v1/services/{id}One service.
GET/v1/productsActive products with price, SKU, image and stock (when tracked). Paged.
GET/v1/products/{id}One product.
GET/v1/bookingsBookings, oldest first. Filters: from, to (by start time), status (comma-separated), customerId. Paged.
GET/v1/bookings/{id}One booking.
GET/v1/ordersShop orders, newest first. Filters: from, to (by created time), status. Paged.
GET/v1/orders/{id}One order with its items.
GET/v1/customersCustomers, newest first. Filter: search (name, email or phone). Paged.
GET/v1/customers/{id}One customer.
POST/v1/customersAdd a customer, or update the one with that email. Needs a read and write key.
POST/v1/enquiriesSend a contact-form message to the business's Inbox. Needs a read and write key.

Lists and dates

Lists return { "data": [...], "limit": 50, "offset": 0 }. Use limit (1–200, default 50) and offset to page through. Dates accept 2026-11-20 or a full time like2026-11-20T09:00:00Z; times in responses are ISO 8601 in UTC. Prices are in the business's currency as normal amounts (for example 45 for £45.00).

Adding customers

POST /v1/customers takes email (required), name, phone, address, notes and tags. Email is the key: if a customer with that email exists, their record is updated (notes are added, tags are merged) rather than duplicated.

Example — add a customer from a sign-up form
curl -X POST "https://benibrain.com/api/v1/customers" \
  -H "Authorization: Bearer bb_sk_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{"name":"Sam Lee","email":"sam@example.com","phone":"07700 900123","tags":["newsletter"]}'

Contact forms

POST /v1/enquiries takes name, email (required), message (required), and optionally phone and subject. It creates or finds the customer and opens a new conversation in the business's Inbox, and fires the conversation.created and message.received webhooks. When the business replies from the Inbox, the reply is emailed to the customer.

Example — forward a website contact form
curl -X POST "https://benibrain.com/api/v1/enquiries" \
  -H "Authorization: Bearer bb_sk_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{"name":"Sam Lee","email":"sam@example.com","subject":"Quote","message":"Can you service a ride-on mower next week?"}'

Errors and limits

StatusMeaning
400Something in the request is wrong. The error message says what.
401No key, a malformed key, or a key that's been revoked.
403A read-only key tried to change something, or the business's account isn't active.
404Not found, or it belongs to a different business.
429More than 120 requests in a minute with one key. Wait for the Retry-After seconds.

Staying up to date

Rather than asking repeatedly for new bookings or orders, register a webhook in Settings → Developers → Webhooks and BeniBrain will tell your server the moment something changes. See Webhooks.