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/tokensHeaders
| Key | Value | Required |
|---|---|---|
| Content-Type | application/json | Required |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| client_id | string | Required | Your BookBed workspace client ID. |
| client_secret | string | Required | Workspace client secret. Treat as a password. |
Response
| Field | Type | Description |
|---|---|---|
| access_token | string | JWT to be sent as `Authorization: Bearer …`. |
| expires_in | number | Lifetime 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
}