setTenantExpiry
Sets or clears the tenant’s expiry timestamp. Pass input.expiresAt as null to clear. Soft-deleted (disabled) tenants are not visible to this mutation — call restoreTenant first (it accepts an optional new expiry). Returns an error when the tenant does not exist (including the disabled case). The value is written directly to tenant.expires_at; the periodic tenant-expiry-check workflow soft-deletes the tenant once the timestamp is in the past. Idempotent on the already-at-target-state cases (clear against empty, set matching the current value).
The target tenant is named by input.tenantId. System caller required (PYCK_SERVICE_TOKEN): the expiry is the deadline an operator imposes on the tenant, and a tenant admin able to move it would outlive the operator’s decision on its own. The Zitadel root organization is refused as the target: it is not a tenant.
Served by: management
Arguments
Section titled “Arguments”| Name | Type |
|---|---|
input |
SetTenantExpiryInput! |
Returns
Section titled “Returns”Example
Section titled “Example”Sets or clears the tenant’s expiry timestamp. Pass null to clear. System role required. The value is written directly to tenant.expires_at; the periodic tenant-expiry-check workflow soft-deletes the tenant once the timestamp is reached. Returns an error when the tenant does not exist; soft-deleted tenants are invisible to this mutation. Idempotent on the already-at-target-state cases.
mutation SetTenantExpiry($input: SetTenantExpiryInput!) { setTenantExpiry(input: $input) { success }}Variables
{ "input": { "expiresAt": "<RFC3339 timestamp, or null to clear>", "tenantId": "<tenant ID>" }}