# Use workspace tenant variables in a project

Source: https://www.jawsdeploy.net/rest-api/project-workspace-tenant-variables-use | Section: Workspace Tenant Variables

Make a project use workspace tenant variables, so its deployments get each tenant's shared value.

`POST /api/project/workspace-tenant-variables`

Answers with the same body as `GET /api/project/workspace-tenant-variables`.

A required workspace tenant variable with no value blocks a tenant's deployments only in the projects that use it.

## Parameters

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `projectId` | body | string | yes | ID of the project. |
| `templateIds` | body | array<string> | yes | IDs of workspace tenant variables. Ones the project already uses are left as they are. |

## Errors

| Status | Meaning |
|---|---|
| 400 | Invalid `projectId`, an unknown `templateId`, or the project already has a variable, an imported workspace variable or a tenant variable with the same name. Nothing is changed. |
| 401 | Missing or invalid Basic auth credentials, or the service account can't edit this project. |

Example request:

```
POST /api/project/workspace-tenant-variables HTTP/1.1
Authorization: Basic <base64(serviceAccountId:apiKey)>
Content-Type: application/json

{
  "projectId": "prj_web",
  "templateIds": ["tvt_secret", "tvt_port"]
}
```

Example response:

```
{ "projectId": "prj_web", "templates": [...] }
```

