# Update a workspace variable

Source: https://www.jawsdeploy.net/rest-api/workspace-variables-update | Section: Workspace Variables

Update workspace variable metadata.

`PUT /api/workspace-variable`

Updates the variable definition. Pass only the fields to change.

## Parameters

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `variableId` | body | string | yes | ID of the workspace variable. |
| `name` | body | string | no | New name. |
| `description` | body | string | no | New description. |
| `variableType` | body | string | no | See below. |

### Variable types

`variableType` accepts `Text`, `Secret`, `Script`, `Number`, `Boolean`, `Date`, `Map`, and `Json`. Omit the field to leave the type unchanged.

## Errors

| Status | Meaning |
|---|---|
| 400 | Invalid `variableId` or validation failure. |
| 401 | Missing or invalid Basic auth credentials, or the service account lacks the required role. |

Example request:

```
PUT /api/workspace-variable

{ "variableId": "wv_1", "description": "Primary connection string" }
```

Example response:

```
{}
```

