Authentication

Create token

Exchange API credentials for a short-lived bearer token.

All requests against the BookBed API must include a bearer token in the Authorization header. Tokens expire after 24 hours; long-lived refresh tokens can be obtained via the dashboard.

Endpoint

POST/v1/auth/tokens

Headers

KeyValueRequired
Content-Typeapplication/jsonRequired

Request body

FieldTypeRequiredDescription
client_idstringRequiredYour BookBed workspace client ID.
client_secretstringRequiredWorkspace client secret. Treat as a password.

Response

FieldTypeDescription
access_tokenstringJWT to be sent as `Authorization: Bearer …`.
expires_innumberLifetime of the token in seconds (default 86400).

Example usage

Request

curl https://api.bookbed.io/v1/auth/tokens \
  -H "Content-Type: application/json" \
  -d '{
    "client_id": "ws_…",
    "client_secret": "sk_…"
  }'

Response

{
  "access_token": "eyJhbGciOi…",
  "token_type": "Bearer",
  "expires_in": 86400
}