# restoreTenant

Audience: Programmer

Restore a previously disabled tenant by clearing its deleted_at flag.

Restore a previously disabled tenant by clearing its deleted_at
flag. An optional input.expiresAt overrides the tenant's prior
expiry; when omitted, the prior expiry persists, which can
re-disable the tenant on the next tenant-expiry-check sweep if the
value is already in the past.

The target tenant is named by input.tenantId. Only a tenant whose
registration finished (status done) can be restored.

System caller required (PYCK_SERVICE_TOKEN): restore is an operator
action, so an admin (the tenant's own or one holding ROLE_ADMIN
through a cross-tenant grant) is refused.

**Served by:** [management](https://docs.pyck.cloud/latest/api/services/management.md)

## Arguments

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| `input` | [RestoreTenantInput](https://docs.pyck.cloud/latest/api/inputs/restoretenantinput.md)! |  |  |

## Returns

[RestoreTenantResponse](https://docs.pyck.cloud/latest/api/types/restoretenantresponse.md)!

## Example

Manually restores a previously disabled tenant by clearing its deleted_at flag via the RestoreTenantWorkflow. System role required. Only a tenant whose registration finished can be restored. Returns an error when the tenant does not exist; idempotent on already-active tenants.

```graphql
mutation RestoreTenant($input: RestoreTenantInput!) {
  restoreTenant(input: $input) {
    success
  }
}
```

**Variables**

```json
{
  "input": {
    "expiresAt": "<RFC3339 timestamp, omit to keep existing expiry>",
    "tenantId": "<tenant ID>"
  }
}
```
