Μετάβαση στο περιεχόμενο

Authentication

The Bookingmood API accepts two kinds of credentials, both sent in the HTTP Authorization header as a bearer token:

  • API keys, for your own scripts and integrations with one organization.

  • OAuth access tokens, for apps and agents that users connect to their account.

API keys

Create and manage API keys under Settings › API keys in the admin dashboard.

A new API key is shown once, so store it safely. If you lose it, rotate it to get a new one. Rotating keeps its ID and request history, and the old key stops working immediately.

OAuth

Apps and agents can ask users for access instead of an API key. Bookingmood is an OAuth 2.1 authorization server: clients find its endpoints at https://www.bookingmood.com/.well-known/oauth-authorization-server.

  • Use the authorization code flow with PKCE (S256), also with a client secret. Public clients register with Dynamic Client Registration at /oauth/register, or use an HTTPS URL to a client ID metadata document as their client ID. Contact us for a confidential client with a secret, for an app that runs on a server.

  • Redirect URIs use HTTPS. Native apps can also use HTTP on a loopback address, or a scheme of their own like cursor://.

  • Ask for the scopes below. Without a scope parameter the app asks for all of them, and the user chooses what to allow. Add offline_access for a refresh token.

  • Access tokens last an hour. Refresh tokens last 30 days and can be used once: each refresh returns a new one. Using a refresh token again within 30 seconds returns tokens too, for clients that refresh twice at once. Using it again later disconnects the app.

  • The token response lists the organizations the tokens reach, with their id and name.

A user can connect organizations they're an admin of, and the app acts on their behalf: changes show in the activity log as the app, for that user. A token covers every organization the user connected, so reads span all of them. Set the organization_id search parameter to work in one, which creating products and inviting members require when there are several.

Users see and disconnect their apps under Settings › Connected apps. Organization admins see the apps that have access to their organization next to its API keys. An app loses access to an organization as soon as its user is no longer an admin there, and the webhooks it created there are disabled. Connecting the app again enables them again.

For a step-by-step example, see Build an app with OAuth.

Scopes

An API key can have full access, or read or write access to specific areas: bookings, channels, messages, organization, products, reviews and webhooks. OAuth tokens use the same scopes, like bookings:read or products:write. Write access includes read access. A request outside the scopes of its credential gets a 403 response, and resources embedded from outside its scopes come back empty. A webhook can only subscribe to events of data its credential may read.

Example
curl "https://api.bookingmood.com/v1/products" \
  -H "Authorization: Bearer YOUR_API_KEY"