Import any Bookable OpenAPI specification into Postman to explore endpoints, test requests, and prototype integrations without writing code first.
| Spec | Download |
|---|---|
| TMS Gateway API | OperatorApi.yml |
| Bookings API | BookingApi.yml |
| Register Webhook Events | WebhookApi.yml |
| Handling Webhook Events | BookableWebhookApi.yaml |
All specs follow the OpenAPI 3.0 format and can be imported into Postman individually or together.
- Open Postman and click Import (
Ctrl+O/⌘+O). - Choose how you want to import:
- File — download the YAML file from the repository and upload it directly
- Link — paste the raw URL of the spec file
- Click Continue, then Import.
Postman will create a new collection with all endpoints, request bodies, and parameter schemas pre-populated.
Repeat for each spec you want to import. You can keep them as separate collections or merge them.
After importing, set up collection-level variables so every request shares the same base URL and credentials. These variables apply to any Bookable collection.
- Click the collection name in the left panel.
- Go to the Variables tab.
- Add the following variables:
| Variable | Initial value | Description |
|---|---|---|
baseUrl | https://api-sandbox.bookabletech.com | Switch to https://api.bookabletech.com for production |
clientId | (your client_id) | From the Bookable Portal |
clientSecret | (your client_secret) | From the Bookable Portal |
accessToken | (leave blank) | Populated automatically by the pre-request script |
- Click Save.
If a collection's requests use a hardcoded base URL after import, update them to {{baseUrl}}.
Add this script to the Pre-request Script tab of any Bookable collection. It automatically fetches and caches a token before every request, refreshing it when it is about to expire.
// Bookable — auto token refresh pre-request script
const tokenUrl = pm.variables.get('baseUrl')
.replace('api-sandbox', 'auth-sandbox')
.replace('api.bookabletech', 'auth.bookabletech')
+ '/oauth/token';
const tokenExpiresAt = pm.collectionVariables.get('tokenExpiresAt');
const accessToken = pm.collectionVariables.get('accessToken');
// Reuse cached token if still valid (with 60s buffer)
if (accessToken && tokenExpiresAt && Date.now() < parseInt(tokenExpiresAt) - 60000) {
return;
}
pm.sendRequest(
{
url: tokenUrl,
method: 'POST',
header: { 'Content-Type': 'application/json' },
body: {
mode: 'raw',
raw: JSON.stringify({
grant_type: 'client_credentials',
client_id: pm.variables.get('clientId'),
client_secret: pm.variables.get('clientSecret'),
audience: 'api.bookabletech.com',
}),
},
},
(err, response) => {
if (err) { console.error('Token fetch error:', err); return; }
const body = response.json();
pm.collectionVariables.set('accessToken', body.access_token);
pm.collectionVariables.set('tokenExpiresAt', String(Date.now() + body.expires_in * 1000));
}
);The script derives the correct auth URL from baseUrl automatically, so it works for both sandbox and production without changes.
- Click the collection name and go to the Authorization tab.
- Set Type to Bearer Token.
- Set Token to
{{accessToken}}. - Click Save.
All requests in the collection inherit this setting. Individual requests can override it if needed.
Update the baseUrl variable on the collection to switch environments. The pre-request script and auth URL update automatically.
| Environment | baseUrl |
|---|---|
| Sandbox | https://api-sandbox.bookabletech.com |
| Production | https://api.bookabletech.com |
- Authentication — OAuth 2.0 token flow and code examples
- API Reference — OpenAPI specs
- Quickstart — make your first booking