# List workspace tenant variables

Source: https://www.jawsdeploy.net/rest-api/workspace-tenant-variable-templates-list | Section: Workspace Tenant Variables

List the tenant variables defined once for the workspace, and the projects that use each one.

`GET /api/workspace/tenant-variable-templates`

A workspace tenant variable is a value each tenant fills in once and every project that uses the variable gets - for example a port or a secret shared by a customer's site and its API.

A project gets one only after it starts using it (`POST /api/project/workspace-tenant-variables`). `usedBy` lists those projects. Each tenant sets its values with `PUT /api/tenant/variables` without a `projectId`.

Secret defaults are never returned: `defaultValue` is always `null` for them, and `hasDefault` says whether one is set.

## Parameters

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `workspaceId` | query | string | yes | ID of the workspace. |

## Errors

| Status | Meaning |
|---|---|
| 400 | Invalid `workspaceId`. |
| 401 | Missing or invalid Basic auth credentials, or the service account can't manage workspace variables in this workspace. |

Example request:

```
GET /api/workspace/tenant-variable-templates?workspaceId=ws_abc123 HTTP/1.1
Authorization: Basic <base64(serviceAccountId:apiKey)>
```

Example response:

```
{
  "workspaceId": "ws_abc123",
  "templates": [
    {
      "templateId": "tvt_secret",
      "projectId": null,
      "workspaceId": "ws_abc123",
      "isWorkspace": true,
      "usedBy": [
        { "projectId": "prj_api", "name": "Shop.Api" },
        { "projectId": "prj_web", "name": "Shop.Web" }
      ],
      "name": "SharedSecret",
      "description": "Shared by the site and its API",
      "variableType": "Secret",
      "isRequired": true,
      "sortOrder": 0,
      "hasDefault": false,
      "defaultValue": null
    }
  ]
}
```

