---
title: "Update tenant"
description: "Set the server modules a tenant may use: its whole features list."
source: "https://www.cloudpdf.com/docs/api-reference/tenants/update"
---

# Update tenant

`PATCH /v1/tenants/{tenantId}` · v3.3.0

Set the server modules a tenant may use: its whole features list.

A feature names an installed module; any other id is a 400. A module route answers a tenant without its feature 403 FeatureNotEnabled, and one whose feature is stopped 402 FeatureStopped (details.feature, details.stopped). Other replicas apply a change within 30 seconds.

## Authentication

- **apiToken** — The deployment's static root credential (CLOUDPDF\_API\_AUTH\_TOKENS), valid on every surface.

## Parameters

- `tenantId` string (path) — required

## Request body

`application/json` — TenantsUpdateRequest

- `features` TenantFeature\[] — required
  - `id` string — required
  - `stopped` "cap"

**Example**

```json
{
  "features": [
    {
      "id": "id"
    }
  ]
}
```

## SDK examples

**TypeScript**

```typescript
import { CloudPDFClient } from "@cloudpdf/sdk";

const client = new CloudPDFClient({
  token: "<token>",
});

await client.tenants.update({
  tenantId: "tenantId",
  features: [{
      id: "id"
    }]
});
```

**Python**

```python
from cloudpdf import CloudPDFClient
from cloudpdf import CloudPDFClient, TenantFeature

client = CloudPDFClient(
    token="<token>",
)

client.tenants.update(
    tenant_id="tenantId",
    features=[
        TenantFeature(
            id="id",
        )
    ],
)
```

**PHP**

```php
use CloudPDF\CloudPDFClient;

$client = new CloudPDFClient(
    token: '<token>',
);

$client->tenants->update(
    'tenantId',
    new TenantsUpdateRequest([
        'features' => [
            new TenantFeature([
                'id' => 'id',
            ]),
        ],
    ]),
);
```

**.NET**

```csharp
using CloudPDF;

var client = new CloudPDFClient(
    "<token>"
);

await client.Tenants.UpdateAsync(
    new TenantsUpdateRequest
    {
        TenantId = "tenantId",
        Features = new List<TenantFeature>() { new TenantFeature { Id = "id" } },
    }
);
```

**Go**

```go
import (
    "context"

    cloudpdf "github.com/embedpdf/cloudpdf-sdk-go/v3"
    client "github.com/embedpdf/cloudpdf-sdk-go/v3/client"
    option "github.com/embedpdf/cloudpdf-sdk-go/v3/option"
)

client := client.NewClient(
    option.WithToken("<token>"),
)

request := &cloudpdf.TenantsUpdateRequest{
    TenantID: "tenantId",
    Features: []*cloudpdf.TenantFeature{
        &cloudpdf.TenantFeature{
            ID: "id",
        },
    },
}
client.Tenants.Update(
    context.TODO(),
    request,
)
```

**Java**

```java
import com.cloudpdf.api.CloudPDFClient;

CloudPDFClient client = CloudPDFClient
    .builder()
    .token("<token>")
    .build();

client.tenants().update(
    "tenantId",
    TenantsUpdateRequest
        .builder()
        .features(
            Arrays.asList(
                TenantFeature
                    .builder()
                    .id("id")
                    .build()
            )
        )
        .build()
);
```

**Ruby**

```ruby
require "cloudpdf"

client = CloudPDF::Client.new(
  token: "<token>"
)

client.tenants.update(
  tenant_id: "tenantId",
  features: [{
    id: "id"
  }]
)
```

## Responses

### 200 — OK

`application/json` — TenantsUpdateResponse

- `tenant` object — required
  - `id` string — required
  - `name` string — required
  - `autoProvisioned` boolean — required
  - `status` "active" | "suspended"
  - `features` TenantFeature\[]
    - `id` string — required
    - `stopped` "cap"
  - `createdAt` string\<date-time> — required

### 400 — Bad request

`application/json` — ErrorResponse

- `error` EngineError — required
  - `code` "Unknown" | "InvalidArg" | "DocNotOpen" | "DocOpenFailed" | "DocPasswordRequired" | "DocPasswordIncorrect" | "GrantPassphraseRequired" | "Aborted" | "Network" | "Unauthenticated" | "Forbidden" | "NotFound" | "WireFormat" | "RuntimeUnavailable" | "LayerVersionConflict" | "NotImplemented" | "MalformedPdf" | "SigningPending" | "SigningExpired" | "SigningVersionMismatch" | "SignatureRefused" | "ProtectedDocument" | "PayloadTooLarge" | "ObjectNumberUnavailable" | "LayerFull" | "ChangeConflict" | "UndoUnavailable" | "IdempotencyKeyReused" | "LayerDeleted" | "VisitorIdentityRequired" | "Conflict" | "EngineBusy" | "EngineRestarting" | "DocumentQuarantined" | "ThumbnailNotReady" | "TooManyRequests" | "GrantExpired" | "OriginRequired" | "OriginNotAllowed" | "FeatureNotEnabled" | "FeatureStopped" | "LicenseInvalid" | "LicenseUsageLimit" | "UpstreamError" — required — Why the request failed. A newer server can add codes: read one your client doesn't know as \`Unknown\`.
  - `message` string — required
  - `details` object — What a code carries besides its message, as each code says.

### 404 — Not found

`application/json` — ErrorResponse

- `error` EngineError — required
  - `code` "Unknown" | "InvalidArg" | "DocNotOpen" | "DocOpenFailed" | "DocPasswordRequired" | "DocPasswordIncorrect" | "GrantPassphraseRequired" | "Aborted" | "Network" | "Unauthenticated" | "Forbidden" | "NotFound" | "WireFormat" | "RuntimeUnavailable" | "LayerVersionConflict" | "NotImplemented" | "MalformedPdf" | "SigningPending" | "SigningExpired" | "SigningVersionMismatch" | "SignatureRefused" | "ProtectedDocument" | "PayloadTooLarge" | "ObjectNumberUnavailable" | "LayerFull" | "ChangeConflict" | "UndoUnavailable" | "IdempotencyKeyReused" | "LayerDeleted" | "VisitorIdentityRequired" | "Conflict" | "EngineBusy" | "EngineRestarting" | "DocumentQuarantined" | "ThumbnailNotReady" | "TooManyRequests" | "GrantExpired" | "OriginRequired" | "OriginNotAllowed" | "FeatureNotEnabled" | "FeatureStopped" | "LicenseInvalid" | "LicenseUsageLimit" | "UpstreamError" — required — Why the request failed. A newer server can add codes: read one your client doesn't know as \`Unknown\`.
  - `message` string — required
  - `details` object — What a code carries besides its message, as each code says.

### default — Error

`application/json` — ErrorResponse

- `error` EngineError — required
  - `code` "Unknown" | "InvalidArg" | "DocNotOpen" | "DocOpenFailed" | "DocPasswordRequired" | "DocPasswordIncorrect" | "GrantPassphraseRequired" | "Aborted" | "Network" | "Unauthenticated" | "Forbidden" | "NotFound" | "WireFormat" | "RuntimeUnavailable" | "LayerVersionConflict" | "NotImplemented" | "MalformedPdf" | "SigningPending" | "SigningExpired" | "SigningVersionMismatch" | "SignatureRefused" | "ProtectedDocument" | "PayloadTooLarge" | "ObjectNumberUnavailable" | "LayerFull" | "ChangeConflict" | "UndoUnavailable" | "IdempotencyKeyReused" | "LayerDeleted" | "VisitorIdentityRequired" | "Conflict" | "EngineBusy" | "EngineRestarting" | "DocumentQuarantined" | "ThumbnailNotReady" | "TooManyRequests" | "GrantExpired" | "OriginRequired" | "OriginNotAllowed" | "FeatureNotEnabled" | "FeatureStopped" | "LicenseInvalid" | "LicenseUsageLimit" | "UpstreamError" — required — Why the request failed. A newer server can add codes: read one your client doesn't know as \`Unknown\`.
  - `message` string — required
  - `details` object — What a code carries besides its message, as each code says.
