# Restore a group

`PUT /api/v1/vaults/{vault}/groups/{group}/restoration`

Bring a deleted group back, with every membership it held.

A group that is not deleted answers 404.

Groups are not yet available to every account. Until they are available to yours, every endpoint here answers 404.

## Path parameters

- `vault` (string, required): The vault the groups live in, named either by the readable name it reports as slug or by its id.
- `group` (uuid, required): The id of the group. One addressed through the wrong vault, or belonging to another account, answers 404.

## Returns

The group object, restored.

- `data` (object): The group.
- `data.type` (string): Always group. 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.name` (string): What the group is called.
- `data.attributes.description` (string): What was written about it, or null.
- `data.attributes.started_on` (string): When it started, written as a year, a month and a day, or null.
- `data.attributes.started_precision` (string): How much of the date is known: day, month, year or decade. Always unknown when there is no date.
- `data.attributes.ended_on` (string): When it ended, written as a year, a month and a day, or null while it still exists.
- `data.attributes.ended_precision` (string): How much of the date is known: day, month, year or decade. Always unknown when there is no date.
- `data.attributes.current_member_count` (integer): How many people are in it today. Those who left are not counted.
- `data.attributes.created_at` (timestamp): When it was created, as a count of seconds since 1970.
- `data.attributes.updated_at` (timestamp): When it last changed, as a count of seconds since 1970, or null.
- `data.attributes.deleted_at` (timestamp): When it was deleted, as a count of seconds since 1970, or null.
- `data.links` (object): Where to find this record.
- `data.links.self` (string): The absolute address this record is read from.

## 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://people.hansyeoh.com/api/v1/vaults/dunder-mifflin/groups/5d2a7c91-3e48-4b06-9f1d-a83c60e2b4f7/restoration \
  -X PUT \
  -H "Authorization: Bearer $MONICA_TOKEN"
```

```javascript
const response = await fetch('https://people.hansyeoh.com/api/v1/vaults/dunder-mifflin/groups/5d2a7c91-3e48-4b06-9f1d-a83c60e2b4f7/restoration', {
  method: 'PUT',
  headers: { Authorization: `Bearer ${token}` },
})
const data = await response.json()
```

```php
$response = Http::withToken($token)->put('https://people.hansyeoh.com/api/v1/vaults/dunder-mifflin/groups/5d2a7c91-3e48-4b06-9f1d-a83c60e2b4f7/restoration');
```

## Response

`200`

```json
{
    "data": {
        "type": "group",
        "id": "5d2a7c91-3e48-4b06-9f1d-a83c60e2b4f7",
        "attributes": {
            "name": "Party planning committee",
            "description": "Plans every birthday, retirement and holiday party of the Scranton branch.",
            "started_on": "2005-01-01",
            "started_precision": "year",
            "ended_on": null,
            "ended_precision": "unknown",
            "current_member_count": 3,
            "created_at": 1791547200,
            "updated_at": 1791547200,
            "deleted_at": null
        },
        "links": {
            "self": "https://people.hansyeoh.com/api/v1/vaults/dunder-mifflin/groups/5d2a7c91-3e48-4b06-9f1d-a83c60e2b4f7"
        }
    }
}
```
