# Update a variable

**Publié le** : 2026-05-08
**Catégorie** : Core CMS

## `PUT /variables/:id`

**Update a variable**

Updates a variable's value. The key cannot be changed.

Required permissions: `variables.update`

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string | Yes | Unique identifier |


### Request Body

Content-Type: `application/json`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `key` | string | No | 1-100 characters |
| `label` | string | No | 1-255 characters |
| `value` | string | No | Amount value. 1-100000 characters |
| `description` | string \| null | No | Description text |


### Responses

| Status | Description |
| --- | --- |
| `200` | Successful response |
| `401` | Unauthorized — invalid or missing API token |
| `403` | Forbidden — insufficient permissions |
| `404` | Not found |
| `422` | Validation error |


### Examples

```bash
curl -X PUT https://api.lynkow.com/v1/variables/1 \
  -H "Authorization: Bearer $API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"value": "Acme Corporation"}'
```

### Response Example

```json
{
  "data": {
    "id": 1,
    "key": "company_name",
    "value": "Acme Corporation",
    "type": "text",
    "locale": "en",
    "createdAt": "2025-01-05T09:00:00.000Z",
    "updatedAt": "2025-04-06T16:00:00.000Z"
  }
}
```

---