Skip to main content

Authentication

Create tokens under Settings > API & Webhooks. The clear secret is displayed once after creation; store it in a secret manager.

Scopes​

  • read: verify the token and read availability, services, providers, customers, and reservations.
  • write: use mutation endpoints. Write access also includes read access.

A read token reads personal data: customers' names, emails, and phones, the booking-form answers, and the staff's internal notes of the reservations. It never reads the access token of a customer, which signs the links of their reservations. Give tokens only to systems that are allowed to handle that data.

Write tokens

A write token can create, change, and delete services, customers, and reservations. Give it only to integrations you trust, and use a read token when the integration only reads data.

Bearer token​

curl "https://example.com/wp-json/thebooking/v1/API/auth/verify/" \
-H "Authorization: Bearer $TBK_API_TOKEN"

API key header​

curl "https://example.com/wp-json/thebooking/v1/API/auth/verify/" \
-H "X-TBK-API-Key: $TBK_API_TOKEN"

Do not send both headers. Never place tokens in URLs or browser-side source code.

Verify response​

{
"status": "OK",
"response": {
"name": "Automation production",
"scopes": ["read", "write"],
"siteUrl": "https://example.com"
}
}

Token usage records the last usage time and source IP. Revoke tokens that are no longer required.