# Update a user

Use the following endpoint to update the `reference` of a user by their `userId`.

#### Request Endpoint: [reference](https://docs.venly.io/reference/updateuser)

HTTP

```http
PUT /api/users/{userId}
```

| Parameter   | Param Type | Description                                           | Data Type | Mandatory |
| ----------- | ---------- | ----------------------------------------------------- | --------- | --------- |
| `userId`    | Path       | The ID of the user whose reference you want to update | String    | ✅         |
| `reference` | Body       | The new reference text                                | String    | ❌         |

#### Request Body:

JSON

```json
{
  "reference": "Updated reference"
}
```

#### Response Body:

JSON

```json
{
    "success": true,
    "result": {
        "id": "07cc0aa5-0f98-4a4e-9c55-686124e0f0e4",
        "reference": "Updated reference",
        "createdAt": "2023-12-06T14:53:13.985862"
    }
}
```
