REST API
Complete reference for the Facilities REST API.
Last updated: 2026-01-26 Where to find it: Facilities API Who can use it: Developers, integrators Prerequisites: API credentials Help link: /rest
Base URL
| Environment | URL |
|---|---|
| Production | https://facilities-api.digiwedge.com/api |
| UAT | https://facilities-api.uat.digiwedge.com/api |
| Local | http://localhost:3106/api |
Authentication
All endpoints require a valid JWT token:
curl -H "Authorization: Bearer <token>" \
https://facilities-api.uat.digiwedge.com/api/facility-resources?tenantId=1
Facility Resources
List Resources
GET /facility-resources
Query Parameters:
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| tenantId | number | Yes | - | Tenant scope |
| clubId | number | No | - | Club scope |
| type | string | No | - | Filter by ResourceType |
| search | string | No | - | Case-insensitive name search |
| skip | number | No | 0 | Pagination offset |
| take | number | No | 25 | Pagination limit (max 100) |
| includeInactive | boolean | No | false | Include soft-deleted |
Response: 200 OK
[
{
"id": 1,
"tenantId": 1,
"clubId": 10,
"name": "Simulator Bay 1",
"type": "SIMULATOR",
"active": true,
"maintenanceRequired": false
}
]
Get Resource
GET /facility-resources/:id
Query Parameters:
| Parameter | Type | Required |
|---|---|---|
| tenantId | number | Yes |
| clubId | number | No |
Response: 200 OK
{
"id": 1,
"tenantId": 1,
"clubId": 10,
"name": "Simulator Bay 1",
"type": "SIMULATOR",
"description": "TrackMan simulator",
"capacity": 4,
"active": true,
"maintenanceRequired": false,
"createdAt": "2025-01-01T00:00:00Z",
"updatedAt": "2025-01-01T00:00:00Z"
}
Create Resource
POST /facility-resources
Body:
{
"tenantId": 1,
"clubId": 10,
"name": "Simulator Bay 1",
"type": "SIMULATOR",
"description": "TrackMan simulator",
"capacity": 4
}
Response: 201 Created
Update Resource
PUT /facility-resources/:id?tenantId=1
Body:
{
"name": "Simulator Bay 1 - Premium",
"maintenanceRequired": true
}
Response: 200 OK
Delete Resource (Soft)
DELETE /facility-resources/:id?tenantId=1
Response: 200 OK
Maintenance Logs
List Logs
GET /maintenance-logs?tenantId=1&resourceId=42
Get Log
GET /maintenance-logs/:id?tenantId=1
Create Log
POST /maintenance-logs?tenantId=1&clubId=10
Body:
{
"resourceId": 42,
"maintenanceType": "GREENS",
"description": "Aeration",
"startTime": "2025-01-15T06:00:00Z",
"endTime": "2025-01-15T14:00:00Z",
"recordedBy": "super@club.test"
}
Update Log
PUT /maintenance-logs/:id?tenantId=1
Delete Log
DELETE /maintenance-logs/:id?tenantId=1
Resource Usage
List Usage
GET /resource-usage?tenantId=1&resourceId=42
Get Usage
GET /resource-usage/:id?tenantId=1
Create Usage
POST /resource-usage?tenantId=1&clubId=10
Body:
{
"resourceId": 42,
"bookingId": 12345,
"assignedAt": "2025-01-15T08:00:00Z"
}
Update Usage
PUT /resource-usage/:id?tenantId=1
Delete Usage
DELETE /resource-usage/:id?tenantId=1
Facility Reservations
Booking endpoints for reserving facility resources. See Facility Reservations for full request/response details.
List Reservations
GET /facility-reservations?tenantId=1&clubId=10&resourceId=42&status=ACTIVE&startFrom=2025-01-15T08:00:00Z
Create Reservation
POST /facility-reservations
Body:
{
"tenantId": "t-1",
"clubId": "c-1",
"resourceId": "r-42",
"memberId": "m-9",
"startTime": "2025-01-15T10:00:00Z",
"endTime": "2025-01-15T11:00:00Z",
"source": "WEB",
"externalBookingId": "scl-booking-123"
}
Reschedule Reservation
POST /facility-reservations/:id/reschedule?tenantId=1&clubId=10
Body:
{
"startTime": "2025-01-15T11:00:00Z",
"endTime": "2025-01-15T12:00:00Z",
"reason": "Member request",
"version": 3
}
Cancel Reservation
POST /facility-reservations/:id/cancel?tenantId=1&clubId=10
Body:
{
"reason": "Member cancelled",
"version": 3
}
Mark No-show
POST /facility-reservations/:id/no-show?tenantId=1&clubId=10&version=3
Reservation Series
List Series
GET /facility-reservations/series?tenantId=1&clubId=10&status=ACTIVE
Create Series
POST /facility-reservations/series
Body:
{
"tenantId": "t-1",
"clubId": "c-1",
"resourceId": "r-42",
"memberId": "m-9",
"rule": "FREQ=WEEKLY;BYDAY=MO,WE,FR",
"timeZone": "Africa/Johannesburg",
"startTime": "2025-01-15T10:00:00Z",
"endTime": "2025-01-15T11:00:00Z"
}
Update Series
PUT /facility-reservations/series/:id?tenantId=1&clubId=10
Body:
{
"rule": "FREQ=WEEKLY;BYDAY=TU,TH",
"version": 2
}
Cancel / Pause / Resume
POST /facility-reservations/series/:id/cancel?tenantId=1&clubId=10&version=2
POST /facility-reservations/series/:id/pause?tenantId=1&clubId=10&version=2
POST /facility-reservations/series/:id/resume?tenantId=1&clubId=10&version=3
Availability
Check Availability
POST /facility-resources/availability
Body:
{
"tenantId": 1,
"clubId": 10,
"type": "SIMULATOR",
"start": "2025-01-15T10:00:00Z",
"end": "2025-01-15T12:00:00Z"
}
Response: 200 OK
[
{
"resourceId": 5,
"name": "Simulator Bay 1",
"type": "SIMULATOR",
"available": true
}
]
Error Responses
| Status | Description |
|---|---|
| 400 | Bad Request |
| 401 | Unauthorized |
| 404 | Not Found |
| 500 | Internal Server Error |
{
"statusCode": 400,
"message": "tenantId must be a number",
"error": "Bad Request"
}
Expected outcome
- Successful REST API integration.
- CRUD operations work for all resource types.
- Proper error handling is implemented.
Related
- API Surface — API overview
- GraphQL API — GraphQL API
- Facility Resources — Resource management