---
search:
  tags:
    - Tenants
    - PUT
seo:
  description: >-
    Replaces a tenant's settings with the ones you send: its quotas, custom
    hostnames,… Reference for the PUT /_luna/tenants/{tenant} endpoint in the
    Luna API.
sidebar:
  label: Replace a tenant's settings
  badge: PUT
title: Replace a tenant's settings
type: openapi-operation
---
Replaces a tenant's settings with the ones you send: its quotas, custom hostnames, grants, outbound handler, retention, telemetry export and tags. A setting you leave out goes back to its default. The tenant's keys and its public hostname stay as they are.

`PUT /_luna/tenants/{tenant}`

**Request body** (`application/json`, required)

- `quotas` (TenantQuotas) — The most a tenant can use. A limit that is null or left out is not set here, so the plan's limit holds.
- `hostnames` (string[]) — Custom routes to the tenant, each as \`host\` or \`host/first-path-segment\`.
- `grants` (object) — The platform luna types the tenant's code can call, each under the service name the code uses.
- `outbound` (OutboundHandler | null)
- `retentionDays` (integer<int32> | null) — How many days the tenant's logs and traces are kept. The deployment's setting holds when left out.
- `historyDays` (integer<int32> | null) — How many days back the tenant's lunas can be restored or forked. At most what its plan keeps, which is the default. A change takes effect when its workers next start.
- `otlp` (OtlpConfig | null)
- `labels` (object) — Your own tags, for finding and grouping tenants. Left out of a response when there are none.
- `hostLabel` (string | null) — The label of the tenant's public hostname, \`\<label\>.\<app domain\>\`. Luna sets it once. A request cannot change it.

Request body example:

```json
{
  "quotas": {
    "cpuPercent": null,
    "requestsPerSecond": null,
    "sandboxes": null,
    "storageBytes": null
  },
  "hostnames": [],
  "grants": {},
  "outbound": null,
  "retentionDays": null,
  "historyDays": null,
  "otlp": null,
  "labels": {},
  "hostLabel": null
}
```

**Responses**

- `200` — The settings are saved.
- `default` — The request failed. The status says how and \`error.message\` says why.

Response example, 200:

```json
{
  "ok": true
}
```
