# Change a tenant variable

Source: https://www.jawsdeploy.net/rest-api/project-tenant-variable-template-update | Section: Tenant Variables

Change a tenant variable's name, type, default or description.

`PUT /api/project/tenant-variable-template`

Changes a tenant variable. Pass only the fields you want to change - a field left out keeps its current value.

## Parameters

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `templateId` | body | string | yes | ID of the tenant variable. |
| `name` | body | string | no | New name. |
| `variableType` | body | string | no | New type. A `Secret` can't be changed to another type; any other type can become `Secret`, which encrypts the stored values. |
| `isRequired` | body | boolean | no | Whether every tenant must have a value. |
| `defaultValue` | body | string | no | New default. Leave out to keep the current one, send `""` to remove it. |
| `description` | body | string | no | New description. |
| `sortOrder` | body | integer | no | New position in the list. |

## Errors

| Status | Meaning |
|---|---|
| 400 | Invalid `templateId`, an unknown `variableType`, a name that is taken, a value that is not valid for the new type, or a `Secret` changed to another type. |
| 401 | Missing or invalid Basic auth credentials, or the service account can't edit this project. |

Example request:

```
PUT /api/project/tenant-variable-template HTTP/1.1
Authorization: Basic <base64(serviceAccountId:apiKey)>
Content-Type: application/json

{
  "templateId": "tvt_db",
  "defaultValue": "acme_db"
}
```

Example response:

```
{
  "templateId": "tvt_db",
  "projectId": "prj_abc123",
  "name": "DatabaseName",
  "description": "The customer's database",
  "variableType": "Text",
  "isRequired": true,
  "sortOrder": 0,
  "hasDefault": true,
  "defaultValue": "acme_db"
}
```

