> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hasmcp.com/llms.txt
> Use this file to discover all available pages before exploring further.

# How do I update a server variable?

> Rotating security credentials confidently logically without severing live configurations intuitively.

# Updating Server Variables

When you need to globally rotate an aging or compromised password string , executing an in-place configuration modification fundamentally updates the environment preventing system downtime.

## The API Endpoint

To cleanly rewrite a global configuration organically, target the existing variable ID:

**`PATCH /variables/{id}`**

```bash theme={null}
curl -X PATCH https://app.hasmcp.com/api/v1/variables/m7G4v2kL9Q \
 -H "Authorization: Bearer YOUR_TOKEN" \
 -H "Content-Type: application/json" \
 -d '{
 "variable": {
 "value": "new_secret_token_123"
 }
 }'
```

If successful, the API returns `204 No Content`.

Every HasMCP instance utilizing this configuration variable effectively pulls the new value immediately.
