# Get a stay

`GET /api/v1/vaults/{vault}/possessions/{possession}/location-stays/{stay}`

Retrieve one stay of a possession.

This endpoint also answers QUERY, with the same parameters sent in the request body. [How QUERY works](https://my.monicahq.com/docs/api/query-method).

## Path parameters

- `vault` (string, required): The vault the possession is kept in, named either by the readable name it reports as slug or by its id. A vault of another account answers 404.
- `possession` (uuid, required): The id of the possession. A possession of another vault or of another account answers 404.
- `stay` (uuid, required): The id of the stay. A stay of another possession answers 404.

## Returns

A stay object. A vault, a possession or a stay of another account answers 404.

- `data` (object): The possession location stay.
- `data.type` (string): Always possession_location_stay. It names the kind of record, so a caller holding several kinds can tell them apart without looking at where they came from.
- `data.id` (string): The id of this record, as a string even when it reads as a number. It is what every endpoint naming this record takes.
- `data.attributes` (object): Everything the record holds.
- `data.attributes.location_id` (uuid): The id of the location of the account where the possession stayed. Its full path comes from the locations endpoints.
- `data.attributes.location_name` (string): The name of that location, without the locations around it.
- `data.attributes.arrived_on` (date): The day it arrived, as YYYY-MM-DD, or null when the day is unknown.
- `data.attributes.left_on` (date): The day it left, as YYYY-MM-DD, or null on the stay where it is now.
- `data.attributes.is_current` (boolean): Whether it is the open stay, where the possession is now. A possession has at most one.
- `data.attributes.reason` (string): Why it went there, or null.
- `data.attributes.note` (string): Anything worth knowing about the stay, or null.
- `data.attributes.created_at` (timestamp): When the stay was recorded, as a count of seconds since 1970.
- `data.links` (object): Where to find this record.
- `data.links.self` (string): The absolute address this record is read from.
- `data.links.web` (string): The Locations section of the possession in the application, which opens for somebody signed in rather than for a key. It is the link to give a person.

## Rate limit

Sixty requests per minute, per user, shared by every key and device. Every answer carries the budget left in `X-RateLimit-Remaining`.

## Request

```sh
curl https://my.monicahq.com/api/v1/vaults/schrute-farms/possessions/5e1b7c93-4a28-4d6f-9b02-7c3e8a1f4d60/location-stays/f1d72a8c-5e39-4b16-9c04-7a3e6b2d8f15 \
  -H "Authorization: Bearer $MONICA_TOKEN"
```

```javascript
const response = await fetch('https://my.monicahq.com/api/v1/vaults/schrute-farms/possessions/5e1b7c93-4a28-4d6f-9b02-7c3e8a1f4d60/location-stays/f1d72a8c-5e39-4b16-9c04-7a3e6b2d8f15', {
  headers: { Authorization: `Bearer ${token}` },
})
const data = await response.json()
```

```php
$response = Http::withToken($token)->get('https://my.monicahq.com/api/v1/vaults/schrute-farms/possessions/5e1b7c93-4a28-4d6f-9b02-7c3e8a1f4d60/location-stays/f1d72a8c-5e39-4b16-9c04-7a3e6b2d8f15');
```

## Response

`200`

```json
{
    "data": {
        "type": "possession_location_stay",
        "id": "f1d72a8c-5e39-4b16-9c04-7a3e6b2d8f15",
        "attributes": {
            "location_id": "6e2f8b31-7c4d-4a95-b1e8-3d9c5a7f2e60",
            "location_name": "Cellar",
            "arrived_on": "2024-06-04",
            "left_on": null,
            "is_current": true,
            "reason": "Harvest season",
            "note": "Mose carried it down.",
            "created_at": 1773450000
        },
        "links": {
            "self": "https://my.monicahq.com/api/v1/vaults/schrute-farms/possessions/5e1b7c93-4a28-4d6f-9b02-7c3e8a1f4d60/location-stays/f1d72a8c-5e39-4b16-9c04-7a3e6b2d8f15",
            "web": "https://my.monicahq.com/vaults/schrute-farms/possessions/5e1b7c93-4a28-4d6f-9b02-7c3e8a1f4d60/locations"
        }
    }
}
```
