Authentication overview

Choose between OAuth2 or an API key, with an example header for each.

The Booking Experts API supports three ways to authenticate. Which one you use depends on who installs your app and which endpoints you call.

MethodHeaderUse it whenGives access to
OAuth2Authorization: Bearer <access_token>Other organizations install your app. Required for public appsOne organization per token, limited to the administrations and permissions the user approved
API keyX-API-KEY: <api_key>You build an app for your own organization, or you're testingOne organization per key, limited to the administrations and permissions of the installation
👍

Use OAuth2 for anything other organizations will install

API keys are meant for your own organization and for testing. Public apps must use OAuth2.


OAuth2

When an organization installs your app, Booking Experts redirects to your redirect URI with an authorization code. You exchange the code for an access token and a refresh token. See OAuth2 Flow for the full flow.

curl --request GET "https://api.bookingexperts.com/v3/subscription" \
  --header "Accept: application/vnd.api+json" \
  --header "Authorization: Bearer YOUR_ACCESS_TOKEN"
  • Access tokens are valid for 1 week (expires_in: 604800). Use the refresh token to get a new one.
  • Only the authorization_code grant is supported.
  • Redirect URIs must use HTTPS.

API key

When the app's authentication method is API key, every installation gets its own key. You find it on the installation page of the app.

curl --request GET "https://api.bookingexperts.com/v3/subscription" \
  --header "Accept: application/vnd.api+json" \
  --header "X-API-KEY: YOUR_API_KEY"

The key has the same permissions as your app and works for the organization where the app is installed. See API Key.


Permissions (scopes)

OAuth2 tokens and API keys only work for endpoints your app has permission for. Scopes have the form <resource>|<action>:

  • read for GET requests, such as reservation|read
  • write for POST and PATCH requests, such as reservation|write
  • delete for DELETE requests, such as reservation|delete

Some scopes are namespaced, such as channel::booking|read, and a few use manage, such as checkout_portal|manage. Each endpoint's reference page lists the scopes it needs.

To check which scopes your token or key has, call GET subscription and read current_scopes.


Environments

EnvironmentBase URL
Productionhttps://api.bookingexperts.com
Staginghttps://api.staging.bookingexperts.com

Tokens and API keys only work in the environment where they were issued.

Webhooks and commands include an X-BE-Env header with the value production or staging, so you can tell which environment sent the request.


Rate limits

Each installation of your app gets a bucket of 100 requests per 3 minutes. Installations don't share their limit. App API key requests are limited per app. See the API introduction for details.


Authentication errors

All authentication errors return 403 Forbidden:

CodeCause
INVALID_TOKENThe token or API key is missing, invalid or revoked
NO_VALID_SCOPEThe token or key doesn't have a scope the endpoint needs. The detail lists the scopes that would work
APPLICATION_HALTEDYour app has been blocked and can't use the API
{
  "errors": [
    {
      "status": "403",
      "code": "INVALID_TOKEN",
      "title": "Forbidden",
      "detail": "The token you specified is invalid or revoked"
    }
  ]
}

Did this page help you?