Export an Environment's configuration as JSON
/api/v1/environments/{id}/exportReturns the configuration of the Environment :id as a versioned JSON document: format_version, source_env, access_model, hierarchy_schema, and the env's permissions, roles with their permission keys, organization role templates with their permission keys, hierarchy nodes (ref-linked), OAuth client configs, and webhook configs. Secrets are deliberately omitted — OAuth client secrets and webhook signing secrets are not included. The export is read-only and does not modify the Environment; returns 404 when no Environment of the Account has that id.
Authentication
Authorization Option A JWT access token. Never send alongside X-API-Key: a request carrying both is refused.
X-API-Key Option B API key for management-tier access. Never send alongside an Authorization header: a request carrying both is refused.
application.manageAccountCreate, update, and delete Applications and Environments, and change Environment settings. A scoped API key must hold it as a scope; a full-access key holds every scope within its Environment except the named-only and account scopes; a developer's token needs the Console capability that covers it. A credential without it is refused with 403.
Path Parameters
idstring Required Responses
application/json
data *EnvironmentExportDto
application/json
error *ApiErrorBodyDto
application/json
error *ApiErrorBodyDto
application/json
error *ApiErrorBodyDto
application/json
error *ApiErrorBodyDto
Errors
When the request can't be completed, the response body includes a stable error code you can branch on, and a correlation_id (also sent as the X-Correlation-Id header). Quote the correlation id when you contact support: it identifies the exact request in Canopy's logs. A request refused by an authorization check answers 403 with the code authorization.denied, and its data names the denial_reason and the permission checked.
authorization.deniedForbiddenThe credential does not hold the permission this operation checks: a scoped API key without the scope, a developer without the Console capability that covers it, or a permission granted somewhere other than the node the request targets. The error's data names the permission.
Add the permission named in the Authentication section to the key's scopes, or ask an account administrator to grant the covering capability, then retry. For a node-scoped operation, make sure the grant reaches the node you are acting on.
Returned object
curl -X GET "https://auth.canopy-io.com/api/v1/environments/value/export" \ -H "X-API-Key: $CANOPY_API_KEY"
{ "data": { "format_version": 1, "source_env": {}, "access_model": "flat", "organizations_enabled": false, "hierarchy_schema": {}, "auth_settings": { "mfa_required": false, "mfa_grace_period_days": 0, "mfa_trusted_device_days": 0, "mfa_factor_allowlist": [ "totp" ], "mfa_after_sso": "exempt", "allow_self_signup": false, "self_signup_require_captcha": false, "login_require_captcha": false, "password_login_enabled": false, "email_otp_login_enabled": false, "passkey_login_enabled": false, "self_signup_daily_cap": 0, "access_token_ttl_seconds": 0, "refresh_token_ttl_days": 0, "public_refresh_token_ttl_days": 0, "m2m_access_token_ttl_seconds": 0, "organizations_create_on_signup": false, "organizations_membership_required": false }, "token_claims": [ { "claim": "plan", "source": "identity.metadata.plan", "tokens": [ "access", "id" ] } ], "permissions": [ null ], "roles": [ null ], "organization_role_templates": [ null ], "nodes": [ null ], "oauth_clients": [ null ], "webhooks": [ null ] } }
Tell us how we can improve this guide.