# Replace imported workspace variables

Source: https://www.jawsdeploy.net/rest-api/project-workspace-variables-replace | Section: Project Variables

Set the full list of workspace variables imported into a project.

`PUT /api/project/workspace-variables`

Replaces the project's workspace variable imports. Variables not in `workspaceVariableIds` are unimported.

## Parameters

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `projectId` | body | string | yes | ID of the project. |
| `workspaceVariableIds` | body | array<string> | no | Workspace variable IDs to import. |

## Errors

| Status | Meaning |
|---|---|
| 400 | Invalid `projectId` or one of the workspace variable IDs not visible to the project. |
| 401 | Missing or invalid Basic auth credentials, or the service account lacks the required role. |

Example request:

```
PUT /api/project/workspace-variables

{ "projectId": "prj_abc123", "workspaceVariableIds": ["wv_1", "wv_2"] }
```

Example response:

```
{}
```

