> ## Documentation Index
> Fetch the complete documentation index at: https://docs.daysync.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Accommodation

> Read and manage accommodation (stays) for a tour.

**Accommodation** records are the stays booked for a tour — hotels, rentals, and residences. Accommodation IDs are integers.

All endpoints require the standard [authentication](/authentication) headers.

***

## List accommodation

```text theme={null}
GET /v1/tours/{tourId}/accommodation
```

Returns the stays for a tour.

**Scope:** `accommodation.read`

**Example**

```bash theme={null}
curl "$BASE/v1/tours/2f1c…/accommodation" \
  -H "x-api-key: $KEY" -H "x-api-secret: $SECRET" -H "Authorization: Bearer $TOKEN"
```

**Path parameters**

| Name     | Type          | Description |
| -------- | ------------- | ----------- |
| `tourId` | string (UUID) | The tour.   |

**Response `data`** — array of stays:

```json theme={null}
{
  "id": 318,
  "title": "Grand Hotel",
  "subtitle": "City centre",
  "is_confirmed": true,
  "notes": "Late checkout arranged",
  "image": "https://…",
  "type": "HOTEL",
  "timezone": "Australia/Sydney",
  "street_address": "1 George St",
  "city": "Sydney",
  "zip_code": "2000",
  "country": "Australia",
  "state": "NSW",
  "check_in_date_time": "2026-06-01T15:00:00Z",
  "check_out_date_time": "2026-06-03T10:00:00Z",
  "booking_number": "ABC123",
  "coordinates": { "lat": -33.86, "lng": 151.20 },
  "day_id": 1843,
  "day_id_list": [1843, 1844],
  "is_deleted": false,
  "updated_at": "2026-05-20T08:00:00Z",
  "is_everyone": true,
  "is_admin_only": false
}
```

***

## Create accommodation

```text theme={null}
POST /v1/accommodation
```

**Scope:** `accommodation.write`

<Note>
  Accommodation uses **camelCase** ID fields (`tourId`, `dayId`) — unlike most resources, which use `snake_case` (`tour_id`, `day_id`). See [Field naming](/introduction#field-naming).
</Note>

**Body**

| Field                         | Type               | Required | Description                                                           |
| ----------------------------- | ------------------ | -------- | --------------------------------------------------------------------- |
| `tourId`                      | string (UUID)      | Yes      | Tour the stay belongs to.                                             |
| `formatted_address`           | Location           | Yes      | Address object (see [Location structure](#location-structure) below). |
| `checkInDate`                 | number             | Yes      | Check-in date (numeric).                                              |
| `checkOutDate`                | number             | Yes      | Check-out date (numeric).                                             |
| `checkInTime`                 | number             | Yes      | Check-in time (numeric).                                              |
| `checkOutTime`                | number             | Yes      | Check-out time (numeric).                                             |
| `reservationStatus`           | boolean            | Yes      | Whether the booking is confirmed.                                     |
| `type`                        | enum               | Yes      | One of `HOTEL`, `RENTAL`, `RESIDENCE`.                                |
| `title`                       | string             | No       | Stay name.                                                            |
| `subtitle`                    | string             | No       | Secondary label.                                                      |
| `confirmationNumber`          | string             | No       | Booking reference.                                                    |
| `generalNotes`                | string             | No       | Free-text notes.                                                      |
| `image_url`                   | string             | No       | Image URL.                                                            |
| `dayId`                       | number             | No       | Primary day.                                                          |
| `daysList`                    | array\<number>     | No       | Days this stay spans.                                                 |
| `attachments`                 | array\<Attachment> | No       | `{ link, fileSize, … }`.                                              |
| `isEveryone` / `isAdminsOnly` | boolean            | No       | Visibility shortcuts.                                                 |
| `visibilityList`              | array\<string>     | No       | Explicit user visibility.                                             |

### Date & time format

`checkInDate`, `checkOutDate`, `checkInTime`, and `checkOutTime` are numeric **epoch milliseconds**, not ISO strings. *Confirmed against the live API.*

The stored check-in / check-out instant comes from **`checkInTime` / `checkOutTime`** — each is the **full epoch-millisecond timestamp** of the moment. `checkInDate` / `checkOutDate` are the date-only epoch-ms (midnight UTC) and do **not** affect the stored instant (they are used for date grouping only).

| Field          | Type   | Format                                     | Example                                |
| -------------- | ------ | ------------------------------------------ | -------------------------------------- |
| `checkInTime`  | number | Epoch ms of the **full check-in instant**  | `1781236800000` (2026-06-12T04:00:00Z) |
| `checkOutTime` | number | Epoch ms of the **full check-out instant** | `1781564400000` (2026-06-15T23:00:00Z) |
| `checkInDate`  | number | Epoch ms, date only (midnight UTC)         | `1781222400000` (2026-06-12)           |
| `checkOutDate` | number | Epoch ms, date only (midnight UTC)         | `1781481600000` (2026-06-15)           |

<Warning>
  A previous version of this page described `checkInTime` / `checkOutTime` as "minutes from midnight" — that is **incorrect**. Passing minutes (e.g. `840`) stores the time as `840` *milliseconds* past the Unix epoch (i.e. 1970), not `14:00`. Always pass the **full epoch-millisecond instant** in `checkInTime` / `checkOutTime`.
</Warning>

<Note>
  **Images:** `image_url` accepts a **publicly reachable** image URL. The API fetches it **server-side** and re-hosts it in Daysync storage — the `image` returned by `GET` is a Daysync S3 URL, not the URL you sent. If the URL can't be fetched, the create/edit fails with `400` `{ "error": "400", "message": "fetch failed" }`, so the source must be reachable (mind spaces/encoding in the URL). Known quirk: the re-hosted filename currently comes out as `undefined_<timestamp>.jpeg`, but the image is stored and served correctly. (This differs from [Venues](/endpoints/venues), whose `image` field is **not** fetched.)
</Note>

**Response `data`:** `{ "id": 318, "name": "…" }`.

***

## Edit accommodation

```text theme={null}
PUT /v1/accommodation/{accommodationId}
```

**Scope:** `accommodation.write`

**Path parameters**

| Name              | Type    | Description       |
| ----------------- | ------- | ----------------- |
| `accommodationId` | integer | The stay to edit. |

**Body** — the edit input is a **different, narrower set** than create. Fields not listed below cannot be changed via edit.

| Field                         | Type               | Required | Description                                                           |
| ----------------------------- | ------------------ | -------- | --------------------------------------------------------------------- |
| `title`                       | string             | No       | Stay name.                                                            |
| `formatted_address`           | Location           | No       | Address object (see [Location structure](#location-structure) below). |
| `checkInDate`                 | number             | No       | Check-in date (numeric).                                              |
| `checkOutDate`                | number             | No       | Check-out date (numeric).                                             |
| `checkInTime`                 | number             | No       | Check-in time (numeric).                                              |
| `checkOutTime`                | number             | No       | Check-out time (numeric).                                             |
| `confirmationNumber`          | string             | No       | Booking reference.                                                    |
| `reservationStatus`           | boolean            | No       | Whether the booking is confirmed.                                     |
| `generalNotes`                | string             | No       | Free-text notes.                                                      |
| `type`                        | enum               | No       | One of `HOTEL`, `RENTAL`, `RESIDENCE`.                                |
| `image_url`                   | string             | No       | Image URL.                                                            |
| `attachment`                  | Attachment         | No       | Single attachment `{ link, fileSize, … }`.                            |
| `attachments`                 | array\<Attachment> | No       | `{ link, fileSize, … }`.                                              |
| `isEveryone` / `isAdminsOnly` | boolean            | No       | Visibility shortcuts.                                                 |
| `visibilityList`              | array\<string>     | No       | Explicit user visibility.                                             |

<Note>
  **Ignored on update:** `tourId`, `subtitle`, `dayId`, and `daysList` are accepted in the request body but have **no effect** — sending them will not raise an error, but the values are silently ignored. They are set at creation time only and cannot be changed afterwards. The `accommodationId` is taken from the URL path — do **not** send it in the request body.
</Note>

**Response `data`:** `{ "id": 318, "name": "…" }`.

***

## Delete accommodation

```text theme={null}
DELETE /v1/accommodation/{accommodationId}
```

**Scope:** `accommodation.write`

**Path parameters**

| Name              | Type    | Description         |
| ----------------- | ------- | ------------------- |
| `accommodationId` | integer | The stay to delete. |

**Response `data`:** none.

***

## Location structure

The `formatted_address` field on create and edit accepts a Google Places–style location object. The `geometry.location` and `geometry.viewport` sub-fields are **required** for the address to be valid.

```json theme={null}
{
  "formatted_address": "1 George St, Sydney NSW 2000, Australia",
  "place_id": "ChIJP3Sa8ziYEmsRUKgyFmh9AQM",
  "placeName": "Grand Hotel",
  "fullAddress": "1 George St, Sydney NSW 2000, Australia",
  "timeZone": "Australia/Sydney",
  "types": ["lodging", "point_of_interest", "establishment"],
  "address_components": [
    { "long_name": "1", "short_name": "1", "types": ["street_number"] },
    { "long_name": "George Street", "short_name": "George St", "types": ["route"] }
  ],
  "geometry": {
    "location": { "lat": -33.8688, "lng": 151.2093 },
    "viewport": {
      "northeast": { "lat": -33.8674, "lng": 151.2107 },
      "southwest": { "lat": -33.8702, "lng": 151.2079 }
    },
    "location_type": "ROOFTOP"
  }
}
```

| Field                    | Type                       | Required | Description                                |
| ------------------------ | -------------------------- | -------- | ------------------------------------------ |
| `formatted_address`      | string                     | No       | Full human-readable address.               |
| `place_id`               | string                     | No       | Google Places ID.                          |
| `placeName`              | string                     | No       | Short name of the place.                   |
| `fullAddress`            | string                     | No       | Duplicate of `formatted_address` (legacy). |
| `timeZone`               | string                     | No       | IANA time zone.                            |
| `types`                  | array\<string>             | No       | Google Places types.                       |
| `address_components`     | array                      | No       | `{ long_name, short_name, types }`.        |
| `geometry`               | object                     | **Yes**  | Must include `location` and `viewport`.    |
| `geometry.location`      | `{ lat, lng }`             | **Yes**  | Coordinates.                               |
| `geometry.viewport`      | `{ northeast, southwest }` | **Yes**  | Each has `{ lat, lng }`.                   |
| `geometry.location_type` | string                     | No       | e.g. `"ROOFTOP"`.                          |

***

See also: [Tours](/endpoints/tours), [Venues](/endpoints/venues).
