Skip to content

Authentication

API keys, scopes and plans, test and live keys, and rolling a key without downtime.

Every request carries a key or an OAuth access token as a bearer token:

GET /public/v1/venues/7/bookings HTTP/1.1
Host: api.example
Authorization: Bearer bz_test_ab12cd34_…

A request without one, or with a key that is wrong, revoked or expired, gets 401 with the code auth.key_invalid and WWW-Authenticate: Bearer realm="boozie".

Kinds of credential#

CredentialLooks likeMade byCovers
Venue keybz_test_… / bz_live_…The venue's owner, in the back office under DevelopersOne venue
Host-bound keythe sameThe owner, binding a venue key to one host (a sales manager)One venue, plus /hosts/me… for that host
Organisation keythe sameAn organisation admin, under Developers → OrganisationSome or all of an organisation's venues. See Organisations
OAuth access tokenbz_at_test_… / bz_at_live_…Your app, when a venue installs itThe venues the installer picked. See OAuth apps
Sandbox keybz_test_…You, from the portalYour own sandbox venue, every scope, 30 days

A key's secret is shown once, when it is made. Boozie keeps only a hash, so a lost key can't be recovered: make a new one and revoke the old one.

The back office's Developers page appears once Boozie has turned on Developer access for the venue. Ask us if you don't see it. A request for a venue whose Developer access is off gets 403 auth.developer_access_off.

Choosing the venue#

Every venue endpoint has the venue in its path: /venues/{venueId}/…. A venue key works only for its own venue; any other venueId gets 404 not_found, as if the venue didn't exist. Organisation keys and OAuth tokens can cover several venues, and GET /venues lists them.

Scopes#

A key holds a list of scopes. An endpoint that needs a scope the key doesn't have answers 403 auth.scope_missing, and the problem's detail names the scope.

ScopeLets the key
venue:readRead the venue: details, tables, hours, menu and sessions
bookings:readRead bookings
bookings:writeMake and change bookings (time, table, guests, remark)
bookings:statusConfirm, reject and cancel bookings; mark arrivals
guestlist:readRead the guest list
guestlist:writeAdd guest-list names and mark them arrived or no-show
customers:piiSee customers' names, phone numbers and emails (without it they are left out)
reviews:readRead reviews
reviews:writeReply to reviews
analytics:readRead the analytics summaries
hosts:readRead the key's host's own customer book, link and numbers (a host-bound key only)
webhooks:manageManage webhook endpoints and see their deliveries

Give each integration only the scopes it needs. A door-check app needs guestlist:read guestlist:write bookings:read bookings:status, not analytics:read.

Scopes and the venue's plan#

Some scopes need a feature of the venue's Boozie plan:

  • Booking: bookings:* and guestlist:*.
  • Analytics: analytics:read.

What a key can do is its scopes ∩ the venue's plan. A key can hold a scope the plan lacks: its requests then get 403 auth.plan_feature until the venue moves to a plan with that feature. Nothing changes on the key itself, so an upgrade takes effect at once.

Test and live#

Test keys (bz_test_…)Live keys (bz_live_…)
Work onthe sandbox and other test environmentsproduction
Base URLhttps://api-dev-799b.up.railway.app/public/v1announced when production opens
Datatest data; the sandbox resets every nightreal venues and real guests

A key used on the wrong environment gets 401 auth.key_invalid, with a detail saying test keys work on the sandbox and live keys on production. The prefix tells you what a key is before you send it, so check it in your configuration.

Rate limits#

Each key may make 60 requests a minute, with bursts of up to 120 (twice its limit). Boozie can raise the limit for a key that needs more. An OAuth app's installation gets 120 requests a minute by default, shared by all its venues. Every answer says where you stand:

RateLimit-Policy: 120;w=60;burst=120;rate=60
RateLimit-Limit: 60
RateLimit-Remaining: 117
RateLimit-Reset: 42

Over the limit the answer is 429 rate_limited with Retry-After in seconds. Wait that long, then retry. See conventions.

Rolling a key#

Roll a key every few months, and at once if it may have leaked. In the back office, Roll makes a new secret for the same key, same name and scopes:

  1. Press Roll and copy the new secret.
  2. The old secret keeps working for 24 hours.
  3. Deploy the new secret within that day. After 24 hours the old secret stops.

If a key has leaked, Revoke it instead: it stops at once.

Keeping keys safe#

  • Keep keys on your server, in a secrets store or environment variables. Never put a key in a mobile app, a browser or a public repository.
  • Use a separate key for each integration and each environment, so you can revoke one without stopping the others.
  • Boozie logs each key's last use. A key you don't recognise or don't use any more should be revoked.

Next: OAuth apps