Clone tenant settings into a new tenant.
POST
/api/admin/tenants/{id}/clone
Code sample: Shell / cURL
curl --request POST \ --url https://auth.example.com/api/admin/tenants/example/clone \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "id": "acme-copy", "name": "Acme Copy", "description": "Cloned tenant for staging.", "include_clients": true, "include_roles": true, "include_webhooks": false }'Clone a source tenant into a new active tenant and optionally copy clients, roles, and webhooks. This operation is platform-admin scoped and does not use X-Tenant-Id to identify the destination tenant.
Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ” id
required
string
Request Body required
Section titled “Request Body required ” Media type application/json
object
id
required
string
name
required
string
description
string
include_clients
boolean
include_roles
boolean
include_webhooks
boolean
key
additional properties
Example
{ "id": "acme-copy", "name": "Acme Copy", "description": "Cloned tenant for staging.", "include_clients": true, "include_roles": true, "include_webhooks": false}Responses
Section titled “ Responses ”Tenant clone response.
Media type application/json
object
tenant
required
Tenant row returned by create, update, set-default, and other tenant mutation operations.
object
id
required
string
tenant_code
required
string
name
required
string
description
required
string | null
lifecycle_state
required
string
is_default
required
boolean
created_at
required
Unix timestamp in seconds.
integer format: int64
updated_at
required
Unix timestamp in seconds.
integer format: int64
provisioning
Present on tenant D1 pool create and provisioning retry responses.
object
mode
string
slot_id
string
smoke_test
string
retry
string
key
additional properties
key
additional properties
cloned_items
required
object
settings
required
boolean
clients
required
integer
roles
required
integer
webhooks
required
integer
key
additional properties
key
additional properties
Example
{ "tenant": { "id": "acme-copy", "tenant_code": "acme-copy", "name": "Acme Copy", "description": "Cloned tenant for staging.", "lifecycle_state": "active", "is_default": false, "created_at": 1770000000, "updated_at": 1770000000 }, "cloned_items": { "settings": true, "clients": 3, "roles": 2, "webhooks": 0 }}