<@U08614ZV82F> Is it possible to create a copy of ...
# permit-saas
m
@Ask Inkeep Is it possible to create a copy of a tenant? I want to duplicate a directory from one tenant to another,
a
Thanks for tagging me @Míla Votradovec. I'll look through relevant sources and get back to you shortly.
Based on the available documentation, I don't see a direct API or method to copy or duplicate tenants in Permit.io. The documentation shows how to create new tenants (1) (2) , but not how to copy existing ones. In Permit.io, tenants function as silos of resources and users (3) , where users are assigned to tenants via roles . To create a new tenant, you can use the API (1) :
Copy code
curl '<https://api.permit.io/v2/facts/{project_id}/{env_id}/tenants>' \
  -H 'authorization: Bearer API_SECRET_KEY'
  --data-raw '{"key":"new-tenant-name","name":"New Tenant Name","description":"New tenant description"}' \
If you need to replicate a tenant's configuration, you would likely need to: 1. Create a new tenant using the create API 2. Manually recreate the user assignments and configurations from the source tenant For copying directories or more complex tenant duplication scenarios, I'd recommend reaching out to [P
To learn more, see the sources I considered: [[1] Create Tenant](https://docs.permit.io/api/examples/create-tenant) [[2] Create](https://docs.permit.io/sdk/golang/tenant/Create) [[3] Multi-Tenant Authorization](https://docs.permit.io/concepts/multi-tenant-authorization)
m
@Eli Moshkovich @Or Weis 👋 Do you think it would be possible to get a feature like this?
a
Hey @Míla Votradovec, I'll pass your request to the relevant people and update you once i have an answer!
m
Thank you very much!
a
Hey @Míla Votradovec, Your request was accepted but it would take time for it to be prioritized. Opened a ticket PER-13141
thanks 1