---
title: "PUT /api/v1/hosting/apps/{app_id}/environments/{id}"
method: PUT
path: "/api/v1/hosting/apps/{app_id}/environments/{id}"
tags: ["hosting"]
---

# PUT /api/v1/hosting/apps/{app_id}/environments/{id}

`PUT /api/v1/hosting/apps/{app_id}/environments/{id}`

## Request

- Base URL: `https://composal.com` (the document declares no server; this is the origin it was published from)
- URL: `https://composal.com/api/v1/hosting/apps/{app_id}/environments/{id}`
- Auth: HTTP bearer

## Path parameters

- `app_id` string, required
- `id` string, required

## Request body

- AppEnvironmentUpdatePayload
  - `slug` string
  - `name` string
  - `kind` 'production' | 'staging' | 'development' | 'preview' | 'ephemeral' | 'custom'
  - `status` 'active' | 'paused' | 'archived'
  - `location_id` string
  - `branch_pattern` string, nullable
  - `base_domain` string, nullable
  - `auto_deploy` boolean

## Response `200`

Updated app environment

- object
  - `environment` AppEnvironment, required
    - `id` string, required
    - `hosted_app_id` string, required
    - `location_id` string, required
    - `slug` string, required
    - `name` string, required
    - `kind` 'production' | 'staging' | 'development' | 'preview' | 'ephemeral' | 'custom', required
    - `status` 'active' | 'paused' | 'archived', required
    - `location` HostingLocation, required
      - `id` string, required
      - `code` string, required
      - `name` string, required
      - `nomad_datacenter` string, required
      - `created_at` string, date-time, required
      - `updated_at` string, date-time, required
    - `branch_pattern` string, nullable, required
    - `base_domain` string, nullable, required
    - `auto_deploy` boolean, required
    - `created_at` string, date-time, required
    - `updated_at` string, date-time, required
    - `created_at_label` string, nullable, required
    - `updated_at_label` string, nullable, required

## Other responses

- `401`: Unauthorized
- `403`: Forbidden
- `404`: Not found
- `422`: Deployment request failed validation
- `502`: Bad gateway

---

[API](https://skmtc.dev/composal/apis/vex-api.md) - [All operations](https://skmtc.dev/composal/apis/vex-api/llms.txt) - [OpenAPI document](https://skmtc.dev/composal/apis/vex-api/revisions/74298a24e040?raw)
