API
Booking Services
Create and list booking service categories; contact form endpoint.
Base path: /api/v1/services
Used by: cms-booki-web-app · Role: guest (public)
organizationId: Not required — services are global, not tenant-scoped
POST /api/v1/services — Create Booking Service
Auth: Public
Description: Create a new booking service category.
Request
{
"name": "Haircut"
}
Fields:
name(string, required): Service name (2–100 chars)
Response (201 Created)
{
"message": "Booking service created successfully."
}
Error Responses
422 Unprocessable Entity — Validation failure:
{
"statusCode": 422,
"message": "Name must be at least 2 characters long."
}
cURL Example
curl -X POST http://localhost:4001/api/v1/services \
-H "Content-Type: application/json" \
-d '{"name": "Haircut"}'
GET /api/v1/services — List Booking Services
Auth: Public
Description: Retrieve all available booking service categories.
Request
Query Parameters (optional):
page(number, default: 1)limit(number, default: 10, max: 100)search(string, max 100 chars)sort(string, default:_id)order(string, default:desc):ascordesc
GET /api/v1/services?page=1&limit=10
Response (200 OK)
{
"items": [
{
"_id": "69dcbe3f1a79a4eac35bc717",
"name": "Personal Care & Beauty"
},
{
"_id": "69dcbe3f1a79a4eac35bc718",
"name": "Haircut"
}
],
"pages": 1,
"pageRange": "1-2 of 2"
}
cURL Example
curl -X GET "http://localhost:4001/api/v1/services?page=1&limit=10"
POST /api/v1/services/contact-us — Send Contact Form
Auth: Public
Description: Submit a contact form inquiry for a booking service. Sends a notification to admin emails.
Request
{
"name": "Jane Doe",
"email": "jane@example.com",
"service": "Haircut",
"message": "I'd like to know available slots for next week."
}
Fields:
name(string, required): Full name (2–255 chars)email(string, required): Valid email address (lowercase)service(string, required): Service ID (24-hex) or service name (2–255 chars)message(string, required): Inquiry message (10–1000 chars)
Response (200 OK)
{
"message": "Contact form submitted successfully."
}
Error Responses
422 Unprocessable Entity — Validation failure:
{
"statusCode": 422,
"message": "Message must be at least 10 characters long."
}
cURL Example
curl -X POST http://localhost:4001/api/v1/services/contact-us \
-H "Content-Type: application/json" \
-d '{
"name": "Jane Doe",
"email": "jane@example.com",
"service": "Haircut",
"message": "I'\''d like to know available slots for next week."
}'
