Engineering Swantide
03/25/2026, 6:30 PMAsk Inkeep
03/25/2026, 6:30 PMAsk Inkeep
03/25/2026, 6:30 PMcurl --location '<https://api.permit.io/v2/projects/{project_id}/envs/{env_id}/copy>' \
-H 'authorization: Bearer API_SECRET_KEY' \
--data '{
"target_env": {
"new": {
"key": "prod",
"name": "production"
}
}'
For large environments, use the asynchronous endpoint:
curl --location '<https://api.permit.io/v2/projects/default/envs/staging/copy/async>' \
-H 'authorization: Bearer API_SECRET_KEY' \
--data '{
"target_env": {
"new": {
"key": "prod",
"name": "production"
}
}'
*What Gets Copied*
Environment copying applies only to Policy objects, not Directory objects. The copied objects include:
• Resource
• Resource Actions
• Resource Action Groups
• Resource Attributes
• Resource Roles
• Resource Relations
• Roles
• Role Permissions
• Role Derivations
• Role Hierarchy
• Condition Sets
• User Sets
• Resource Sets
• Condition Sets Rules
• Condition Sets Inheritance
• Custom Policies
Directory objects like Users, Tenants, and Resource Instances are not copied.
*Using the CLI*
You can also use the Permit CLI: (2)
permit env copy --api-key permit_key --from staging --to productionAsk Inkeep
03/25/2026, 6:30 PMEngineering Swantide
03/25/2026, 6:32 PMOr Weis
03/25/2026, 6:40 PMAsk Inkeep
03/25/2026, 6:41 PMAsk Inkeep
03/25/2026, 6:41 PMAsk Inkeep
03/25/2026, 6:41 PMOr Weis
03/25/2026, 6:42 PM