# Change a tenant's environments for a project

Source: https://www.jawsdeploy.net/rest-api/tenants-project-update | Section: Tenants

Replace the environments a tenant can be deployed to for one connected project.

`PUT /api/tenant/project`

Replaces the environments a tenant can be deployed to for a project it is already connected to.

## Parameters

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `tenantId` | body | string | yes | ID of the tenant. |
| `projectId` | body | string | yes | ID of a project the tenant is connected to. |
| `environmentIds` | body | array<string> | no | The complete set of environment IDs. Leave out or send `[]` for none. |

## Errors

| Status | Meaning |
|---|---|
| 400 | Invalid `tenantId` or `projectId`, an environment that is not in this workspace, 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:

```
PUT /api/tenant/project HTTP/1.1
Authorization: Basic <base64(serviceAccountId:apiKey)>
Content-Type: application/json

{
  "tenantId": "tnt_acme",
  "projectId": "prj_abc123",
  "environmentIds": ["env_prod"]
}
```

Example response:

```
{
  "projectId": "prj_abc123",
  "name": "Acme web",
  "tenantedDeployments": "Allowed",
  "environments": [
    { "environmentId": "env_prod", "name": "Production" }
  ]
}
```

