Rename a villa
PATCH /api/v1/properties/{propertyId}
Renames a villa. Nothing else moves: the photo, the archive state and the nightly rate are separate gestures, on purpose — renaming must not silently clear a photo.
Authorization
| Role in the organization | This endpoint |
|---|---|
owner | Allowed |
admin | Allowed |
member | Refused — 403 |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
name | string | yes | 1 to 120 characters |
Example
bash
curl -X PATCH -H "x-api-key: $VILLASLOT_API_KEY" -H "content-type: application/json" \
-d '{"name":"Villa Suar — Beachfront"}' \
"https://villaslot.app/api/v1/properties/1f0a…"Response
200 OK— the updated villa.
What it refuses
403 Forbidden— the key bearer is amember.422 Unprocessable Entity— the name is missing or too long.401 Unauthorized— missing or invalid key, or a key whose bearer left the organization.404 Not Found— unknown id, or an id belonging to another organization. The two are deliberately indistinguishable.429 Too Many Requests— over 120 requests in a minute for this key.