API Documentation
Technical documentation for the CockpitMod API Gateway module.
API Gateway add-on required
The CockpitMod REST API is available exclusively to subscribers of the Dirs21 API Gateway module (€29/mo). Activate the module in your account to receive your API credentials.
Authentication
All API requests must include a Bearer token in the Authorization header. Obtain your token from your CockpitMod account under Settings → API Gateway → Credentials. Tokens expire after 24 hours; use the /auth/refresh endpoint to obtain a new token.
Base URL
https://api.cockpitmod.org/v1
Rate limits
Default rate limit: 500 requests per minute per API key. Rate limit headers are included in all responses: X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset.
Endpoints
| Endpoint | Method | Description |
|---|---|---|
| /reservations | GET | List reservations from your Dirs21 account |
| /reservations/{id} | GET | Get a single reservation by ID |
| /guests | GET | List guest profiles |
| /rates | GET | List current rate plans |
| /availability | GET | Query room availability by date range |
| /webhooks | POST | Register a webhook endpoint |
| /webhooks/{id} | DELETE | Remove a webhook registration |
| /auth/refresh | POST | Refresh an expiring Bearer token |
Webhooks
Register a webhook URL to receive real-time notifications of Dirs21 events: reservation.created, reservation.modified, reservation.cancelled, guest.created, rate.changed. Webhook payloads are signed with HMAC-SHA256 using your webhook secret, which is shown once at registration time.