{
    "openapi": "3.0.3",
    "info": {
        "title": "MUDAR Connect API",
        "version": "1.0",
        "description": "Connectivity API for channel managers and property systems: products, availability, rates and restrictions, bookings, webhooks, reviews, promotions, images and guest messages."
    },
    "servers": [
        {
            "url": "https://connect.aldardasawi.om/api/v1"
        }
    ],
    "components": {
        "securitySchemes": {
            "bearer": {
                "type": "http",
                "scheme": "bearer"
            }
        }
    },
    "paths": {
        "/properties": {
            "get": {
                "summary": "List the properties you can manage in this environment.",
                "tags": [
                    "Properties"
                ],
                "operationId": "properties_list",
                "security": [
                    {
                        "bearer": []
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "example": {
                                    "data": [
                                        {
                                            "id": 42,
                                            "code": "al-bahr-hotel",
                                            "name": "Al Bahr Hotel",
                                            "status": "open",
                                            "currency": "OMR"
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Missing or invalid token"
                    },
                    "404": {
                        "description": "Not found or not connected"
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "429": {
                        "description": "Rate limited"
                    }
                }
            }
        },
        "/properties/{pid}": {
            "get": {
                "summary": "Property details.",
                "tags": [
                    "Properties"
                ],
                "operationId": "properties_get",
                "security": [
                    {
                        "bearer": []
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    },
                    "401": {
                        "description": "Missing or invalid token"
                    },
                    "404": {
                        "description": "Not found or not connected"
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "429": {
                        "description": "Rate limited"
                    }
                },
                "parameters": [
                    {
                        "name": "pid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ]
            },
            "patch": {
                "summary": "Open or close the property for online sales.",
                "tags": [
                    "Properties"
                ],
                "operationId": "properties_update",
                "security": [
                    {
                        "bearer": []
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    },
                    "401": {
                        "description": "Missing or invalid token"
                    },
                    "404": {
                        "description": "Not found or not connected"
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "429": {
                        "description": "Rate limited"
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "example": {
                                "status": "closed"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "pid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ]
            }
        },
        "/connections/requests": {
            "post": {
                "summary": "Ask a hotel to connect to you (production). The hotel approves it in MUDAR.",
                "tags": [
                    "Properties"
                ],
                "operationId": "connections_request",
                "security": [
                    {
                        "bearer": []
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "example": {
                                    "data": {
                                        "property_id": 42,
                                        "status": "pending"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Missing or invalid token"
                    },
                    "404": {
                        "description": "Not found or not connected"
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "429": {
                        "description": "Rate limited"
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "example": {
                                "property_code": "al-bahr-hotel"
                            }
                        }
                    }
                }
            }
        },
        "/connections": {
            "get": {
                "summary": "Your connection requests and their status.",
                "tags": [
                    "Properties"
                ],
                "operationId": "connections_list",
                "security": [
                    {
                        "bearer": []
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    },
                    "401": {
                        "description": "Missing or invalid token"
                    },
                    "404": {
                        "description": "Not found or not connected"
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "429": {
                        "description": "Rate limited"
                    }
                }
            }
        },
        "/properties/{pid}/room-types": {
            "get": {
                "summary": "List room types.",
                "tags": [
                    "Products"
                ],
                "operationId": "room_types_list",
                "security": [
                    {
                        "bearer": []
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    },
                    "401": {
                        "description": "Missing or invalid token"
                    },
                    "404": {
                        "description": "Not found or not connected"
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "429": {
                        "description": "Rate limited"
                    }
                },
                "parameters": [
                    {
                        "name": "pid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ]
            },
            "post": {
                "summary": "Create a room type. MUDAR creates the sellable rooms (inventory) or maps mudar_room_type.",
                "tags": [
                    "Products"
                ],
                "operationId": "room_types_create",
                "security": [
                    {
                        "bearer": []
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "example": {
                                    "data": {
                                        "code": "DBL",
                                        "name_en": "Deluxe Double",
                                        "max_occupancy": 2,
                                        "inventory": 10,
                                        "sellable_rooms": 10,
                                        "status": "active"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Missing or invalid token"
                    },
                    "404": {
                        "description": "Not found or not connected"
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "429": {
                        "description": "Rate limited"
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "example": {
                                "code": "DBL",
                                "name_en": "Deluxe Double",
                                "name_ar": "غرفة مزدوجة ديلوكس",
                                "max_occupancy": 2,
                                "inventory": 10
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "pid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ]
            }
        },
        "/properties/{pid}/room-types/{code}": {
            "put": {
                "summary": "Update a room type (names, occupancy, inventory, status).",
                "tags": [
                    "Products"
                ],
                "operationId": "room_types_update",
                "security": [
                    {
                        "bearer": []
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    },
                    "401": {
                        "description": "Missing or invalid token"
                    },
                    "404": {
                        "description": "Not found or not connected"
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "429": {
                        "description": "Rate limited"
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "example": {
                                "inventory": 12,
                                "status": "active"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "pid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "code",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ]
            }
        },
        "/properties/{pid}/rate-plans": {
            "get": {
                "summary": "List rate plans.",
                "tags": [
                    "Products"
                ],
                "operationId": "rate_plans_list",
                "security": [
                    {
                        "bearer": []
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    },
                    "401": {
                        "description": "Missing or invalid token"
                    },
                    "404": {
                        "description": "Not found or not connected"
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "429": {
                        "description": "Rate limited"
                    }
                },
                "parameters": [
                    {
                        "name": "pid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ]
            },
            "post": {
                "summary": "Create a rate plan for a room type.",
                "tags": [
                    "Products"
                ],
                "operationId": "rate_plans_create",
                "security": [
                    {
                        "bearer": []
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    },
                    "401": {
                        "description": "Missing or invalid token"
                    },
                    "404": {
                        "description": "Not found or not connected"
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "429": {
                        "description": "Rate limited"
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "example": {
                                "code": "DBL-BAR",
                                "room_type_code": "DBL",
                                "name_en": "Best available rate",
                                "refundable": true,
                                "meal_plan": "RO"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "pid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ]
            }
        },
        "/properties/{pid}/rate-plans/{code}": {
            "put": {
                "summary": "Update a rate plan.",
                "tags": [
                    "Products"
                ],
                "operationId": "rate_plans_update",
                "security": [
                    {
                        "bearer": []
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    },
                    "401": {
                        "description": "Missing or invalid token"
                    },
                    "404": {
                        "description": "Not found or not connected"
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "429": {
                        "description": "Rate limited"
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "example": {
                                "status": "inactive"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "pid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "code",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ]
            }
        },
        "/properties/{pid}/availability": {
            "post": {
                "summary": "Set rooms available to sell per room type and date range (0 = closed).",
                "tags": [
                    "Availability & rates"
                ],
                "operationId": "availability_set",
                "security": [
                    {
                        "bearer": []
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "example": {
                                    "data": {
                                        "updated_days": 22
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Missing or invalid token"
                    },
                    "404": {
                        "description": "Not found or not connected"
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "429": {
                        "description": "Rate limited"
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "example": {
                                "items": [
                                    {
                                        "room_type_code": "DBL",
                                        "date_from": "2027-01-10",
                                        "date_to": "2027-01-31",
                                        "available": 5
                                    }
                                ]
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "pid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ]
            }
        },
        "/properties/{pid}/rates": {
            "post": {
                "summary": "Set nightly rates (OMR) and restrictions per rate plan and date range. Omitted fields are unchanged.",
                "tags": [
                    "Availability & rates"
                ],
                "operationId": "rates_set",
                "security": [
                    {
                        "bearer": []
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "example": {
                                    "data": {
                                        "updated_days": 22
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Missing or invalid token"
                    },
                    "404": {
                        "description": "Not found or not connected"
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "429": {
                        "description": "Rate limited"
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "example": {
                                "items": [
                                    {
                                        "rate_plan_code": "DBL-BAR",
                                        "date_from": "2027-01-10",
                                        "date_to": "2027-01-31",
                                        "rate": 45.5,
                                        "min_stay": 2,
                                        "closed_to_arrival": false,
                                        "stop_sell": false
                                    }
                                ]
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "pid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ]
            }
        },
        "/properties/{pid}/ari": {
            "get": {
                "summary": "Read stored availability, rates and restrictions (max 92 days): ?from=YYYY-MM-DD&to=YYYY-MM-DD",
                "tags": [
                    "Availability & rates"
                ],
                "operationId": "ari_get",
                "security": [
                    {
                        "bearer": []
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    },
                    "401": {
                        "description": "Missing or invalid token"
                    },
                    "404": {
                        "description": "Not found or not connected"
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "429": {
                        "description": "Rate limited"
                    }
                },
                "parameters": [
                    {
                        "name": "pid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ]
            }
        },
        "/bookings/feed": {
            "get": {
                "summary": "Unacknowledged booking events (created / modified / cancelled), oldest first. ?limit=50",
                "tags": [
                    "Bookings"
                ],
                "operationId": "bookings_feed",
                "security": [
                    {
                        "bearer": []
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "example": {
                                    "data": [
                                        {
                                            "event_id": 981,
                                            "event_type": "booking.created",
                                            "property_id": 42,
                                            "booking": {
                                                "id": 5531,
                                                "status": "confirmed",
                                                "room_type_code": "DBL",
                                                "check_in": "2027-01-12",
                                                "check_out": "2027-01-14",
                                                "guest": {
                                                    "name": "Sara Al Harthy"
                                                },
                                                "amounts": {
                                                    "currency": "OMR",
                                                    "total": 96.3
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Missing or invalid token"
                    },
                    "404": {
                        "description": "Not found or not connected"
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "429": {
                        "description": "Rate limited"
                    }
                }
            }
        },
        "/bookings/feed/ack": {
            "post": {
                "summary": "Acknowledge events you have stored, so they leave the feed.",
                "tags": [
                    "Bookings"
                ],
                "operationId": "bookings_ack",
                "security": [
                    {
                        "bearer": []
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "example": {
                                    "data": {
                                        "acknowledged": 1
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Missing or invalid token"
                    },
                    "404": {
                        "description": "Not found or not connected"
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "429": {
                        "description": "Rate limited"
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "example": {
                                "event_ids": [
                                    981
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/properties/{pid}/bookings": {
            "get": {
                "summary": "Bookings by arrival date: ?from=YYYY-MM-DD&to=YYYY-MM-DD",
                "tags": [
                    "Bookings"
                ],
                "operationId": "bookings_list",
                "security": [
                    {
                        "bearer": []
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    },
                    "401": {
                        "description": "Missing or invalid token"
                    },
                    "404": {
                        "description": "Not found or not connected"
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "429": {
                        "description": "Rate limited"
                    }
                },
                "parameters": [
                    {
                        "name": "pid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ]
            }
        },
        "/bookings/{id}": {
            "get": {
                "summary": "One booking.",
                "tags": [
                    "Bookings"
                ],
                "operationId": "bookings_get",
                "security": [
                    {
                        "bearer": []
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    },
                    "401": {
                        "description": "Missing or invalid token"
                    },
                    "404": {
                        "description": "Not found or not connected"
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "429": {
                        "description": "Rate limited"
                    }
                },
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ]
            }
        },
        "/bookings/{id}/confirm": {
            "post": {
                "summary": "Store your confirmation number on the booking.",
                "tags": [
                    "Bookings"
                ],
                "operationId": "bookings_confirm",
                "security": [
                    {
                        "bearer": []
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    },
                    "401": {
                        "description": "Missing or invalid token"
                    },
                    "404": {
                        "description": "Not found or not connected"
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "429": {
                        "description": "Rate limited"
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "example": {
                                "confirmation_number": "CM-77812"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ]
            }
        },
        "/webhook": {
            "get": {
                "summary": "Your webhook URL and signing secret for this environment.",
                "tags": [
                    "Webhooks"
                ],
                "operationId": "webhook_get",
                "security": [
                    {
                        "bearer": []
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    },
                    "401": {
                        "description": "Missing or invalid token"
                    },
                    "404": {
                        "description": "Not found or not connected"
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "429": {
                        "description": "Rate limited"
                    }
                }
            },
            "put": {
                "summary": "Set the https URL that receives booking events (signed with X-Mudar-Signature).",
                "tags": [
                    "Webhooks"
                ],
                "operationId": "webhook_set",
                "security": [
                    {
                        "bearer": []
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    },
                    "401": {
                        "description": "Missing or invalid token"
                    },
                    "404": {
                        "description": "Not found or not connected"
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "429": {
                        "description": "Rate limited"
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "example": {
                                "url": "https://cm.example.com/mudar/webhook"
                            }
                        }
                    }
                }
            }
        },
        "/webhook/test": {
            "post": {
                "summary": "Send a signed ping event now and return the result.",
                "tags": [
                    "Webhooks"
                ],
                "operationId": "webhook_test",
                "security": [
                    {
                        "bearer": []
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "example": {
                                    "data": {
                                        "delivered": true,
                                        "http_status": 200
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Missing or invalid token"
                    },
                    "404": {
                        "description": "Not found or not connected"
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "429": {
                        "description": "Rate limited"
                    }
                }
            }
        },
        "/properties/{pid}/reviews": {
            "get": {
                "summary": "Guest reviews (verified stays only). ?limit=50",
                "tags": [
                    "Reviews"
                ],
                "operationId": "reviews_list",
                "security": [
                    {
                        "bearer": []
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    },
                    "401": {
                        "description": "Missing or invalid token"
                    },
                    "404": {
                        "description": "Not found or not connected"
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "429": {
                        "description": "Rate limited"
                    }
                },
                "parameters": [
                    {
                        "name": "pid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ]
            }
        },
        "/reviews/{id}/reply": {
            "post": {
                "summary": "Publish the hotel reply to a review.",
                "tags": [
                    "Reviews"
                ],
                "operationId": "reviews_reply",
                "security": [
                    {
                        "bearer": []
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    },
                    "401": {
                        "description": "Missing or invalid token"
                    },
                    "404": {
                        "description": "Not found or not connected"
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "429": {
                        "description": "Rate limited"
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "example": {
                                "text": "Thank you for staying with us!"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ]
            }
        },
        "/properties/{pid}/promotions": {
            "get": {
                "summary": "Automatic offers and promo codes.",
                "tags": [
                    "Promotions"
                ],
                "operationId": "promotions_list",
                "security": [
                    {
                        "bearer": []
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    },
                    "401": {
                        "description": "Missing or invalid token"
                    },
                    "404": {
                        "description": "Not found or not connected"
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "429": {
                        "description": "Rate limited"
                    }
                },
                "parameters": [
                    {
                        "name": "pid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ]
            },
            "post": {
                "summary": "Create an offer (kind=offer) or a promo code (kind=code). Discount applies to the room total.",
                "tags": [
                    "Promotions"
                ],
                "operationId": "promotions_create",
                "security": [
                    {
                        "bearer": []
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    },
                    "401": {
                        "description": "Missing or invalid token"
                    },
                    "404": {
                        "description": "Not found or not connected"
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "429": {
                        "description": "Rate limited"
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "example": {
                                "kind": "offer",
                                "name_en": "Stay 3, save 15%",
                                "name_ar": "أقم 3 ليالٍ ووفّر 15%",
                                "discount_type": "percent",
                                "discount_value": 15,
                                "min_nights": 3,
                                "room_type_codes": [
                                    "DBL"
                                ],
                                "stay_from": "2027-02-01",
                                "stay_to": "2027-03-31",
                                "book_until": "2027-03-15",
                                "active": true
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "pid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ]
            }
        },
        "/properties/{pid}/promotions/{id}": {
            "put": {
                "summary": "Update a promotion.",
                "tags": [
                    "Promotions"
                ],
                "operationId": "promotions_update",
                "security": [
                    {
                        "bearer": []
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    },
                    "401": {
                        "description": "Missing or invalid token"
                    },
                    "404": {
                        "description": "Not found or not connected"
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "429": {
                        "description": "Rate limited"
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "example": {
                                "active": false
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "pid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ]
            }
        },
        "/promotions/{id}": {
            "delete": {
                "summary": "Delete a promotion (used ones are deactivated).",
                "tags": [
                    "Promotions"
                ],
                "operationId": "promotions_delete",
                "security": [
                    {
                        "bearer": []
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    },
                    "401": {
                        "description": "Missing or invalid token"
                    },
                    "404": {
                        "description": "Not found or not connected"
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "429": {
                        "description": "Rate limited"
                    }
                },
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ]
            }
        },
        "/properties/{pid}/images": {
            "get": {
                "summary": "Property gallery images.",
                "tags": [
                    "Images"
                ],
                "operationId": "images_list",
                "security": [
                    {
                        "bearer": []
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    },
                    "401": {
                        "description": "Missing or invalid token"
                    },
                    "404": {
                        "description": "Not found or not connected"
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "429": {
                        "description": "Rate limited"
                    }
                },
                "parameters": [
                    {
                        "name": "pid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ]
            },
            "post": {
                "summary": "Add an image from an https URL (JPEG/PNG/WebP, max 8 MB).",
                "tags": [
                    "Images"
                ],
                "operationId": "images_create",
                "security": [
                    {
                        "bearer": []
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    },
                    "401": {
                        "description": "Missing or invalid token"
                    },
                    "404": {
                        "description": "Not found or not connected"
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "429": {
                        "description": "Rate limited"
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "example": {
                                "url": "https://cdn.example.com/hotel/pool.jpg",
                                "caption": "Pool"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "pid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ]
            }
        },
        "/images/{id}": {
            "delete": {
                "summary": "Delete an image.",
                "tags": [
                    "Images"
                ],
                "operationId": "images_delete",
                "security": [
                    {
                        "bearer": []
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    },
                    "401": {
                        "description": "Missing or invalid token"
                    },
                    "404": {
                        "description": "Not found or not connected"
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "429": {
                        "description": "Rate limited"
                    }
                },
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ]
            }
        },
        "/bookings/{id}/messages": {
            "get": {
                "summary": "WhatsApp messages exchanged with the guest of a booking.",
                "tags": [
                    "Messages"
                ],
                "operationId": "messages_list",
                "security": [
                    {
                        "bearer": []
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    },
                    "401": {
                        "description": "Missing or invalid token"
                    },
                    "404": {
                        "description": "Not found or not connected"
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "429": {
                        "description": "Rate limited"
                    }
                },
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ]
            },
            "post": {
                "summary": "Send a WhatsApp message to the guest from the hotel number (simulated in sandbox).",
                "tags": [
                    "Messages"
                ],
                "operationId": "messages_send",
                "security": [
                    {
                        "bearer": []
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    },
                    "401": {
                        "description": "Missing or invalid token"
                    },
                    "404": {
                        "description": "Not found or not connected"
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "429": {
                        "description": "Rate limited"
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "example": {
                                "text": "Your room is ready. Welcome!"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ]
            }
        },
        "/sandbox/properties": {
            "post": {
                "summary": "Create a test property (sandbox credentials, max 3).",
                "tags": [
                    "Sandbox"
                ],
                "operationId": "sandbox_create",
                "security": [
                    {
                        "bearer": []
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    },
                    "401": {
                        "description": "Missing or invalid token"
                    },
                    "404": {
                        "description": "Not found or not connected"
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "429": {
                        "description": "Rate limited"
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "example": {
                                "name": "My test hotel"
                            }
                        }
                    }
                }
            }
        },
        "/sandbox/properties/{pid}": {
            "delete": {
                "summary": "Delete a test property and all its data.",
                "tags": [
                    "Sandbox"
                ],
                "operationId": "sandbox_delete",
                "security": [
                    {
                        "bearer": []
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    },
                    "401": {
                        "description": "Missing or invalid token"
                    },
                    "404": {
                        "description": "Not found or not connected"
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "429": {
                        "description": "Rate limited"
                    }
                },
                "parameters": [
                    {
                        "name": "pid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ]
            }
        },
        "/sandbox/properties/{pid}/bookings": {
            "post": {
                "summary": "Simulate a guest booking through the real booking engine (uses your rates and availability).",
                "tags": [
                    "Sandbox"
                ],
                "operationId": "sandbox_book",
                "security": [
                    {
                        "bearer": []
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    },
                    "401": {
                        "description": "Missing or invalid token"
                    },
                    "404": {
                        "description": "Not found or not connected"
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "429": {
                        "description": "Rate limited"
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "example": {
                                "room_type_code": "DBL",
                                "check_in": "2027-01-12",
                                "check_out": "2027-01-14",
                                "guest_name": "Test Guest",
                                "adults": 2
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "pid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ]
            }
        },
        "/sandbox/bookings/{id}/modify": {
            "post": {
                "summary": "Simulate a date change by the guest.",
                "tags": [
                    "Sandbox"
                ],
                "operationId": "sandbox_modify",
                "security": [
                    {
                        "bearer": []
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    },
                    "401": {
                        "description": "Missing or invalid token"
                    },
                    "404": {
                        "description": "Not found or not connected"
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "429": {
                        "description": "Rate limited"
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "example": {
                                "check_in": "2027-01-13",
                                "check_out": "2027-01-15"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ]
            }
        },
        "/sandbox/bookings/{id}/cancel": {
            "post": {
                "summary": "Simulate a cancellation.",
                "tags": [
                    "Sandbox"
                ],
                "operationId": "sandbox_cancel",
                "security": [
                    {
                        "bearer": []
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    },
                    "401": {
                        "description": "Missing or invalid token"
                    },
                    "404": {
                        "description": "Not found or not connected"
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "429": {
                        "description": "Rate limited"
                    }
                },
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ]
            }
        },
        "/oauth/token": {
            "post": {
                "summary": "Get an access token (client_credentials, valid 1 hour).",
                "tags": [
                    "Authentication"
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "example": {
                                "grant_type": "client_credentials",
                                "client_id": "mdr_sbx_…",
                                "client_secret": "…"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "example": {
                                    "access_token": "…",
                                    "token_type": "Bearer",
                                    "expires_in": 3600,
                                    "environment": "sandbox"
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}