Skip to content

M1 API Reference

The M1 Villa Management API provides endpoints for managing villas, owners, staff, documents, and onboarding workflows.

Production: https://obv.inspiringlivingsolutions.com/api
Development: http://localhost:4002/api

All endpoints require authentication via Clerk session.

Authorization: Bearer <clerk_session_token>
GET /villas

Query Parameters:

ParameterTypeDescription
pagenumberPage number
limitnumberItems per page
statusstringFilter by status
searchstringSearch term

Response:

{
"data": [
{
"id": "uuid",
"name": "Villa Sunrise",
"status": "ACTIVE",
"propertyType": "VILLA",
"bedrooms": 4,
"location": "Koh Samui"
}
],
"pagination": {
"page": 1,
"limit": 10,
"total": 50
}
}
GET /villas/:id
POST /villas

Body:

{
"name": "Villa Name",
"propertyType": "VILLA",
"villaStyle": "MODERN",
"bedrooms": 4,
"bathrooms": 5,
"maxGuests": 8
}
PATCH /villas/:id
DELETE /villas/:id

GET /owners
GET /owners/:id
POST /owners

Body (Individual):

{
"ownerType": "INDIVIDUAL",
"firstName": "John",
"lastName": "Smith",
"email": "[email protected]",
"phone": "+66812345678"
}

Body (Company):

{
"ownerType": "COMPANY",
"companyName": "ABC Holdings",
"registrationNumber": "123456789",
"contactPerson": "Jane Doe",
"email": "[email protected]"
}

GET /staff
GET /staff/:id
POST /staff
POST /villas/:villaId/staff

Body:

{
"staffId": "uuid",
"role": "HOUSEKEEPER",
"isPrimary": true
}

GET /villas/:villaId/documents
POST /villas/:villaId/documents
Content-Type: multipart/form-data

Body:

  • file: Document file
  • documentType: Type of document
  • title: Document title
DELETE /documents/:id

GET /villas/:villaId/photos
POST /villas/:villaId/photos
Content-Type: multipart/form-data
PATCH /photos/:id/cover

GET /villas/:villaId/onboarding

Response:

{
"overallStatus": "IN_PROGRESS",
"completionPercentage": 60,
"steps": [
{
"step": "BASIC_INFO",
"status": "COMPLETED"
},
{
"step": "OWNER_DETAILS",
"status": "IN_PROGRESS"
}
]
}
PATCH /villas/:villaId/onboarding/steps/:step

GET /villas/:villaId/ota-credentials
POST /villas/:villaId/ota-credentials

Body:

{
"platform": "AIRBNB",
"username": "[email protected]",
"password": "encrypted_password",
"propertyId": "12345"
}

{
"error": {
"code": "VALIDATION_ERROR",
"message": "Invalid input",
"details": [
{
"field": "email",
"message": "Invalid email format"
}
]
}
}
CodeHTTP StatusDescription
UNAUTHORIZED401Not authenticated
FORBIDDEN403No permission
NOT_FOUND404Resource not found
VALIDATION_ERROR400Invalid input
SERVER_ERROR500Internal error