# Rename a life event category

`PUT /api/v1/life-event-categories/{lifeEventCategory}`

Change what a category is called, whether the product supplied it or you added it.

A category the product supplied is renamed like any other. is_system stops a category being deleted and stops nothing else, so a French household preferring Santé to Health and wellbeing writes it here.

What the product does with the category is untouched: its stable identity, its place in the order and whether it is offered all stay, and nothing filed under it moves.

Once you write your own words they stand in every language. The wording the product supplied reads in the language of whoever is looking, and renaming gives that up, which is the bargain every renameable supplied record makes here.

## Parameters

- `lifeEventCategory` (uuid, required): The id of the category. A path that is not a uuid answers 404 without a query being run.
- `name` (string, optional): What the category is called. Up to 255 characters. It cannot be null.

## Returns

The life event category object as it now reads.

- `data` (object): The category.
- `data.type` (string): Always life_event_category. 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 category is called. A category the product supplied reads in the language you ask for, until somebody renames it, after which their words stand in every language. Up to 255 characters, reduced to plain text, so no markup survives here.
- `data.attributes.position` (integer): Where the category sits in the settings, the pickers and the journal filters, counting from 1. Retired categories are numbered along with the rest, so one switched back on finds the place it had.
- `data.attributes.is_system` (boolean): Whether the product supplied the category with the account. It governs one thing and one thing only: a supplied category cannot be deleted. It may be renamed, moved and retired like any other.
- `data.attributes.is_active` (boolean): Whether the category and the natures under it are offered when a life event is recorded. False removes the whole category from that choice and touches nothing already written.
- `data.attributes.life_event_type_count` (integer): How many life event natures are filed under the category, retired ones counted. It is what decides whether the category may be deleted.
- `data.attributes.created_at` (timestamp): When the category was added, as a count of seconds since 1970 rather than a written date.
- `data.attributes.updated_at` (timestamp): When it last changed, as a count of seconds. Equal to created_at until it first changes.
- `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://my.monicahq.com/api/v1/life-event-categories/a71d6e04-2b58-4c39-9f80-3e5c1a7b2d46 \
  -X PUT \
  -H "Authorization: Bearer $MONICA_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
      "name": "Volunteering"
  }'
```

```javascript
const response = await fetch('https://my.monicahq.com/api/v1/life-event-categories/a71d6e04-2b58-4c39-9f80-3e5c1a7b2d46', {
  method: 'PUT',
  headers: { Authorization: `Bearer ${token}`, 'Content-Type': 'application/json' },
  body: JSON.stringify({
    name: 'Volunteering',
  }),
})
const data = await response.json()
```

```php
$response = Http::withToken($token)->put('https://my.monicahq.com/api/v1/life-event-categories/a71d6e04-2b58-4c39-9f80-3e5c1a7b2d46', [
    'name' => 'Volunteering',
]);
```

## Response

`200`

```json
{
    "data": {
        "type": "life_event_category",
        "id": "a71d6e04-2b58-4c39-9f80-3e5c1a7b2d46",
        "attributes": {
            "name": "Volunteering",
            "position": 9,
            "is_system": false,
            "is_active": true,
            "life_event_type_count": 0,
            "created_at": 1756339200,
            "updated_at": 1756425600
        },
        "links": {
            "self": "https://my.monicahq.com/api/v1/life-event-categories/a71d6e04-2b58-4c39-9f80-3e5c1a7b2d46"
        }
    }
}
```
