Export an Environment's configuration as JSON
/portal/v1/accounts/{accountSlug}/applications/{appSlug}/environments/{envSlug}/exportAuthentication
- Bearer Token
AuthorizationJWT access token
Path Parameters
| Name | Required | Type | Description |
|---|---|---|---|
envSlug | string |
Code samples
curl -X GET "https://api.canopy.dev/portal/v1/accounts/{accountSlug}/applications/{appSlug}/environments/value/export" \
-H "Authorization: Bearer $CANOPY_TOKEN"const response = await fetch("https://api.canopy.dev/portal/v1/accounts/{accountSlug}/applications/{appSlug}/environments/value/export", {
method: "GET",
headers: {
"Authorization": "Bearer $CANOPY_TOKEN"
},
});
const data = await response.json();import requests
response = requests.get(
"https://api.canopy.dev/portal/v1/accounts/{accountSlug}/applications/{appSlug}/environments/value/export",
headers={
"Authorization": "Bearer $CANOPY_TOKEN"
},
)
data = response.json()package main
import (
"net/http"
)
func main() {
req, _ := http.NewRequest("GET", "https://api.canopy.dev/portal/v1/accounts/{accountSlug}/applications/{appSlug}/environments/value/export", nil)
req.Header.Set("Authorization", "Bearer $CANOPY_TOKEN")
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
}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_version *numbersource_env *any objectaccess_model *enum: "flat" | "hierarchy"hierarchy_schema *any objectpermissions *any[]roles *any[]nodes *any[]oauth_clients *any[]webhooks *any[]
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