# Rename a value list

`PUT /api/v1/value-lists/{valueList}`

Rename a value list. It reads the same in every language from then on.

## Parameters

- `valueList` (integer, required): The id of the value list, as List value lists gives it.
- `name` (string, required): The new name, up to 255 characters.

## Returns

The value list as it now reads. A list of another account, a list that belongs to one field, and a value of another list answer 404.

- `data` (object): The value list.
- `data.type` (string): Always value_list.
- `data.id` (integer): The id of the list.
- `data.attributes` (object): What the list holds.
- `data.attributes.name` (string): What the list is called.
- `data.attributes.items` (array): Its choices in their order, each shaped as in List value lists.

## 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/value-lists/21 \
  -X PUT \
  -H "Authorization: Bearer $MONICA_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
      "name": "Paper suppliers"
  }'
```

```javascript
const response = await fetch('https://my.monicahq.com/api/v1/value-lists/21', {
  method: 'PUT',
  headers: { Authorization: `Bearer ${token}`, 'Content-Type': 'application/json' },
  body: JSON.stringify({
    name: 'Paper suppliers',
  }),
})
const data = await response.json()
```

```php
$response = Http::withToken($token)->put('https://my.monicahq.com/api/v1/value-lists/21', [
    'name' => 'Paper suppliers',
]);
```

## Response

`200`

```json
{
    "data": {
        "type": "value_list",
        "id": 21,
        "attributes": {
            "name": "Paper suppliers",
            "items": []
        }
    }
}
```
