1. Docs
  2. API Reference
  3. Set the App's default Environment

Set the App's default Environment

PUT/portal/v1/accounts/{accountSlug}/applications/{appSlug}/default-environment

Authentication

  • Bearer Token Authorization

    JWT access token

Request body

  • slugstring*

    Slug of the Environment in this Application that should become the new default.

Code samples

cURLJavaScriptPythonGo
curl -X PUT "https://api.canopy.dev/portal/v1/accounts/{accountSlug}/applications/{appSlug}/default-environment" \
  -H "Authorization: Bearer $CANOPY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "slug": "string"
  }'

Responses

200 Application updated — `default_environment_id` repointed to the supplied env
{
  "id": "string",
  "account_id": "string",
  "name": "string",
  "slug": "string",
  "settings": {},
  "version": 0,
  "created_at": "2026-04-20T12:00:00.000Z",
  "updated_at": "2026-04-20T12:00:00.000Z"
}

application/json

  • idstring*
  • account_idstring*
  • namestring*
  • slugstring*
  • settingsany object*
  • versionnumber*
  • created_atstring (date-time)*
  • updated_atstring (date-time)*
400 `default_environment_id` does not point at an Environment in this Application
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)

Returned object

On this page

Related endpoints

GETGet the current Application
PATCHUpdate the Application name or settings
DELETEDelete an Application
GETGet the admin's resume-state for this Application
PUTUpdate the admin's resume-state for this Application