# UsHost API v1 Public API of one property (hotel or inn) in UsHost. ## Authentication Send `Authorization: Bearer ` (or `X-Api-Key: `). The token belongs to the property and defines the data it can access. A token with no scopes has full access. ## Format Every response: `{ "success": bool, "data": ..., "message": string, "errors": [...] }`. Lists carry `meta` with `page`, `per_page`, `total` and `last_page`. Dates in ISO-8601. ## Limits - Burst limit per token. When it is exceeded, the response is `429`. - Monthly plan quota: additional usage is billed or blocked, according to the property setting. - When the property disables the API, every token receives `403`. ## Safe writes Send `Idempotency-Key` on POST/PUT calls: repeating with the same key returns the original response without executing again. Same key with a different body: `409`. ## Endpoints Base: http://localhost:8000/api/v1 - `GET /me`: Property data and token permissions - `GET /reservations`: List reservations (scope `reservations:view`) - `GET /reservations/{id}`: Get one reservation (scope `reservations:view`) - `POST /reservations`: Create a reservation (scope `reservations:create`) [idempotent] - `POST /reservations/{id}/cancel`: Cancel a reservation (scope `reservations:edit`) [idempotent] - `GET /guests`: List guests (scope `guests:view`) - `GET /guests/{id}`: Get one guest (scope `guests:view`) - `POST /guests`: Create a guest (scope `guests:create`) [idempotent] - `PUT /guests/{id}`: Update a guest (scope `guests:edit`) [idempotent] - `GET /rooms`: List rooms (scope `rooms:view`) - `GET /availability`: Daily availability (scope `rooms:view`) - `GET /room-types`: List room types (scope `room_types:view`) - `GET /rate-plans`: List rate plans (scope `rate_plans:view`) Full description in OpenAPI: http://localhost:8000/api/v1/openapi.json