Skip to content

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.

id
required
string
Media type application/json
object
id
required
string
>= 1 characters <= 63 characters /^[a-z0-9]([a-z0-9-]*[a-z0-9])?$/
name
required
string
>= 1 characters <= 200 characters
description
string
<= 500 characters
include_clients
boolean
include_roles
boolean
default: true
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
}

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
Allowed values: provisioning active suspended frozen migration_read_only deleting deleted restore_pending restore_validating
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
Allowed values: passed
retry
string
Allowed values: succeeded
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
}
}