# Add a workspace variable value

Source: https://www.jawsdeploy.net/rest-api/workspace-variable-value-create | Section: Workspace Variables

Add a scoped value to a workspace variable.

`POST /api/workspace-variable/value`

Adds a new value with optional environment / machine / cloud target / tag filters - same shape as project variable values.

## Parameters

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `variableId` | body | string | yes | ID of the workspace variable. |
| `theValue` | body | string | no | Value content. |
| `environmentsFilter` | body | array<string> | no | Restrict to these environments. |
| `machineFilter` | body | array<string> | no | Restrict to these machines. |
| `cloudTargetFilter` | body | array<string> | no | Restrict to these cloud targets. |
| `tagFilter` | body | array<object> | no | Tag-set filter. |

## Errors

| Status | Meaning |
|---|---|
| 400 | Invalid `variableId` or filter validation failure. |
| 401 | Missing or invalid Basic auth credentials, or the service account lacks the required role. |

Example request:

```
POST /api/workspace-variable/value

{ "variableId": "wv_1", "theValue": "Server=prod;...", "environmentsFilter": ["env_prod"] }
```

Example response:

```
{ "variableValueId": "wvv_1" }
```

