#
Trainers & Bookings API
Discover trainers, book sessions, join group classes, subscribe to programmes, and manage bookings. All endpoints require X-API-Key and Authorization: Bearer <token>.
#
Trainer Discovery
#
List Trainers
GET /trainers
List all trainers with pagination and search.
#
Trainer Detail
GET /trainers/:id
Get a trainer's full profile including services, classes, and programmes.
{
"success": true,
"data": {
"trainer": {
"id": 5,
"name": "Coach Mike",
"bio": "Certified personal trainer with 10 years experience...",
"image": "https://...",
"services": [
{ "id": 1, "name": "1-on-1 Training", "duration": 60, "price": 75 }
],
"classes": [
{ "id": 10, "name": "Group HIIT", "scheduledDate": "2026-03-01" }
],
"programmes": [
{ "id": 3, "name": "12-Week Transformation", "price": 299 }
]
}
}
}
#
Trainer Services
GET /trainers/:id/services
Get all services offered by a trainer.
{
"success": true,
"data": {
"services": [
{
"id": 1,
"name": "1-on-1 Training",
"description": "Personalised training session",
"duration": 60,
"price": 75.00,
"currency": "GBP"
},
{
"id": 2,
"name": "Online Coaching Call",
"description": "30-minute video check-in",
"duration": 30,
"price": 35.00,
"currency": "GBP"
}
]
}
}
#
Trainer Classes
GET /trainers/:id/classes
Get both recorded classes and upcoming group classes for a trainer.
{
"success": true,
"data": {
"recordedClasses": [
{ "id": 42, "name": "HIIT Blast", "duration": 30, "intensity": "high" }
],
"upcomingGroupClasses": [
{ "id": 10, "name": "Group HIIT", "scheduledDate": "2026-03-01", "spotsLeft": 8 }
]
}
}
#
Trainer Availability
GET /trainers/:id/availability
Get the trainer's weekly availability and bookable time slots.
#
Booking
#
Book 1-on-1 Session
POST /trainers/:id/book
Book a one-on-one training session with a trainer.
{
"serviceId": 1,
"slotId": 42,
"notes": "Focus on upper body"
}
{
"success": true,
"data": {
"booking": {
"id": 1,
"trainerId": 5,
"userId": 1,
"status": "confirmed",
"scheduledDate": "2026-03-05",
"scheduledTime": "10:00",
"service": { "name": "1-on-1 Training" }
}
}
}
#
Join Group Class
POST /trainers/classes/:classId/join
Join a scheduled group training class.
{
"paymentAmount": 15.00
}
#
Subscribe to Programme
POST /trainers/:id/programmes/subscribe
Subscribe to a multi-week structured programme.
{
"programmeId": 3,
"startDate": "2026-03-01",
"paymentAmount": 299.00
}
#
My Bookings with Trainer
GET /trainers/:id/my-bookings
Bearer
Get the current user's bookings with a specific trainer.
{
"success": true,
"data": {
"sessions": [
{
"id": 1,
"status": "confirmed",
"scheduledDate": "2026-03-05",
"scheduledTime": "10:00",
"service": { "name": "1-on-1 Training" }
}
],
"groupClasses": [],
"programmes": []
}
}
#
My Bookings
A unified view of all the user's bookings across sessions, group classes, and programmes.
#
Summary
GET /my-bookings/summary
Get counts and the next upcoming booking.
{
"success": true,
"data": {
"upcomingSessions": 2,
"upcomingGroupClasses": 1,
"activeProgrammes": 1,
"nextBooking": {
"type": "session",
"trainerName": "Coach Mike",
"date": "2026-03-05",
"time": "10:00"
}
}
}
#
1-on-1 Sessions
#
Group Classes
#
Programmes
#
Trainer Portal
Self-service endpoints for trainers to manage their business. Requires X-API-Key + Bearer token + trainer role.
Role requirement
Trainer portal endpoints require the authenticated user to have the trainer role. Trainers are created by the platform admin first, then register via /trainer-auth/register.
#
Profile
#
Availability
#
Bookings
#
Group Classes
#
Programmes
#
Client Management
#
Dashboard
GET /trainer-portal/dashboard
Get dashboard statistics: today's bookings, weekly summary, revenue, and upcoming sessions.
#
Booking Flow
Browse trainers with GET /trainers or find a specific one with GET /trainers/:id. View their services, classes, and programmes.
Call GET /trainers/:id/availability to see available time slots for the desired date range and service.
Select a time slot and book with POST /trainers/:id/book. The user receives a confirmed booking.
When it is time, the trainer launches the session from the trainer portal (POST /trainer-portal/bookings/:id/launch). Both parties join the LiveKit video room.
Users can view and cancel bookings through /my-bookings. Trainers manage bookings through /trainer-portal/bookings.
#
Invite Codes
#
Check Invite
POST /invite/check
Public
Validate a trainer invite code. No authentication required.
{
"code": "COACH-MIKE-2026"
}