# Get a tenant's variables for a project

Source: https://www.jawsdeploy.net/rest-api/tenants-variables-get | Section: Tenant Variables

Get the values a tenant gave a project's tenant variables, and which required ones are missing.

`GET /api/tenant/variables`

Returns each of the project's tenant variables with the values this tenant gave it. A value with `environmentId: null` is used in all environments; a value for one environment wins over it there. Where neither is set, the variable's default is used.

`isMissing` is `true` when the variable is required and some of the tenant's environments get no value at all - `missingEnvironmentIds` says which.

Secret values are write-only: they are listed, so you can see one is set, but `value` is always `null`.

## Parameters

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `tenantId` | query | string | yes | ID of the tenant. |
| `projectId` | query | string | yes | ID of a project the tenant is connected to. |

## Errors

| Status | Meaning |
|---|---|
| 400 | Invalid `tenantId` or `projectId`, or the tenant is not connected to the project. |
| 401 | Missing or invalid Basic auth credentials, or the service account lacks permission to manage tenants in this workspace. |

Example request:

```
GET /api/tenant/variables?tenantId=tnt_acme&projectId=prj_abc123 HTTP/1.1
Authorization: Basic <base64(serviceAccountId:apiKey)>
```

Example response:

```
{
  "tenantId": "tnt_acme",
  "projectId": "prj_abc123",
  "environments": [
    { "environmentId": "env_test", "name": "Test" },
    { "environmentId": "env_prod", "name": "Production" }
  ],
  "variables": [
    {
      "templateId": "tvt_db",
      "name": "DatabaseName",
      "variableType": "Text",
      "isRequired": true,
      "isSecret": false,
      "isMissing": true,
      "missingEnvironmentIds": ["env_prod"],
      "values": [
        { "environmentId": "env_test", "value": "acme_test" }
      ]
    },
    {
      "templateId": "tvt_key",
      "name": "LicenceKey",
      "variableType": "Secret",
      "isRequired": false,
      "isSecret": true,
      "isMissing": false,
      "missingEnvironmentIds": [],
      "values": [
        { "environmentId": null, "value": null }
      ]
    }
  ]
}
```

