1. Docs
  2. API Reference
  3. Export an Environment's configuration as JSON

Export an Environment's configuration as JSON

GET/portal/v1/accounts/{accountSlug}/applications/{appSlug}/environments/{envSlug}/export

Authentication

  • Bearer Token Authorization

    JWT access token

Path Parameters

Name Required Type Description
envSlugRequiredstring

Code samples

cURLJavaScriptPythonGo
curl -X GET "https://api.canopy.dev/portal/v1/accounts/{accountSlug}/applications/{appSlug}/environments/value/export" \
  -H "Authorization: Bearer $CANOPY_TOKEN"

Responses

200 Versioned JSON dump: permissions, roles, role-permission joins, hierarchy nodes, OAuth client configs (without secrets), webhook configs (without secrets). Identities, AppMemberships, role assignments, and audit logs are NOT included.
{
  "format_version": 1,
  "source_env": {},
  "access_model": "flat",
  "hierarchy_schema": {},
  "permissions": [
    null
  ],
  "roles": [
    null
  ],
  "nodes": [
    null
  ],
  "oauth_clients": [
    null
  ],
  "webhooks": [
    null
  ]
}

application/json

  • format_versionnumber*
  • source_envany object*
  • access_modelenum: "flat" | "hierarchy"*
  • hierarchy_schemaany object*
  • permissionsany[]*
  • rolesany[]*
  • nodesany[]*
  • oauth_clientsany[]*
  • webhooksany[]*
401 Invalid or expired token
403 This token is not authorized for this endpoint (wrong principal type — e.g., admin token on identity-only endpoint, or vice versa)
404 Environment not found in this Application

Returned object

On this page

Related endpoints

GETList Environments in an Application
POSTCreate a new Environment in an Application
GETGet a single Environment by slug
PATCHRename or re-slug an Environment
DELETEDelete an Environment
POSTReplace an Environment's configuration from a JSON payload (destructive)
GETGet the Environment's access model
PUTSwitch the Environment's access model
GETGet hierarchy schema for the active Environment
PATCHUpdate hierarchy schema for the active Environment
POSTRevert this Environment from hierarchy to flat