---
title: "Restore a deleted tenant"
description: "Trillet OEM API: Brings a deleted tenant back within 30 days of deletion."
openapi: /public/openapi/trillet-oem.yaml POST /partner/v1/tenants/{tenantId}/restore
lastUpdated: "2026-10-28"
---

> **For AI agents:** the complete documentation index is at [llms.txt](https://trillet-ai.jamdesk.app/llms.txt). Append `.md` to any page URL for its markdown version.

`POST https://api.trillet.ai/partner/v1/tenants/{tenantId}/restore`

Brings a deleted tenant back within 30 days of deletion. Needs `tenants:write`.

## Authentication

- `partnerKey` — http bearer (tpk_live_...)

## Response 200

The restored tenant.
  - response (object)
    - `object` (string, required)
    - `id` (string, required) — Use it in paths and as `x-workspace-id` on standard endpoints.
    - `externalId` (string, required) — Your ID for this customer.
    - `name` (string, required)
    - `status` (string, required, one of: active, suspended, deleted, provisioning_failed)
    - `region` (string, required, one of: us, au)
    - `metadata` (object, required)
    - `limits` (object, required)
      - `monthlySpendCap` (number | null) — Monthly spend cap in USD. `null` means no cap. `0` blocks all paid work.
    - `suspendedAt` (string | null, date-time)
    - `suspendedReason` (string | null)
    - `deletedAt` (string | null, date-time)
    - `createdAt` (string, date-time, required)

## Response 401

Authentication failed. A key that is unknown or revoked returns `invalid_api_key`, an
account without Trillet OEM returns `partner_not_enabled`, and a user session or user API
key returns `partner_key_required`. Handle a `401` by status, not only by `error.code`.
  - response
    - (oneOf)
      - value (object)
        - `error` (object, required)
          - `type` (string, required, one of: invalid_request_error, authentication_error, permission_error, conflict_error, rate_limit_error, api_error, idempotency_error)
          - `code` (string, required) — A stable code. Handle errors by `code`, not by `message`.
          - `message` (string, required)
          - `param` (string) — The request field the error is about, when there is one.
          - `requestId` (string | null) — Include it when you contact support. Not present on idempotency errors.
      - value (object)
        - `error` (string, required)

## Response 403

`missing_scope`, or `key_restricted` on webhook endpoint routes.
  - response (object)
    - `error` (object, required)
      - `type` (string, required, one of: invalid_request_error, authentication_error, permission_error, conflict_error, rate_limit_error, api_error, idempotency_error)
      - `code` (string, required) — A stable code. Handle errors by `code`, not by `message`.
      - `message` (string, required)
      - `param` (string) — The request field the error is about, when there is one.
      - `requestId` (string | null) — Include it when you contact support. Not present on idempotency errors.

## Response 404

Not found, or not yours. For example `tenant_not_found`.
  - response (object)
    - `error` (object, required)
      - `type` (string, required, one of: invalid_request_error, authentication_error, permission_error, conflict_error, rate_limit_error, api_error, idempotency_error)
      - `code` (string, required) — A stable code. Handle errors by `code`, not by `message`.
      - `message` (string, required)
      - `param` (string) — The request field the error is about, when there is one.
      - `requestId` (string | null) — Include it when you contact support. Not present on idempotency errors.

## Response 409

`tenant_not_deleted`, or `tenant_exists` when a live tenant has taken its `externalId`.
  - response (object)
    - `error` (object, required)
      - `type` (string, required, one of: invalid_request_error, authentication_error, permission_error, conflict_error, rate_limit_error, api_error, idempotency_error)
      - `code` (string, required) — A stable code. Handle errors by `code`, not by `message`.
      - `message` (string, required)
      - `param` (string) — The request field the error is about, when there is one.
      - `requestId` (string | null) — Include it when you contact support. Not present on idempotency errors.

## Response 410

`restore_window_expired`: the tenant was deleted more than 30 days ago.
  - response (object)
    - `error` (object, required)
      - `type` (string, required, one of: invalid_request_error, authentication_error, permission_error, conflict_error, rate_limit_error, api_error, idempotency_error)
      - `code` (string, required) — A stable code. Handle errors by `code`, not by `message`.
      - `message` (string, required)
      - `param` (string) — The request field the error is about, when there is one.
      - `requestId` (string | null) — Include it when you contact support. Not present on idempotency errors.


---

📦 **OpenAPI specs:** Every OpenAPI specification referenced by this documentation is available as a single download — https://trillet-ai.jamdesk.app/api-specs.zip
