---
title: "Update an environment"
method: PATCH
path: "/projects/{project_id}/environments/{environment_id}"
tags: ["Environments"]
---

# Update an environment

`PATCH /projects/{project_id}/environments/{environment_id}`

## Request

- Base URL: `https://app.honeybadger.io/v3`
- URL: `https://app.honeybadger.io/v3/projects/{project_id}/environments/{environment_id}`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/honeybadger/apis/honeybadger-api/docs/projects/:project_id/environments/:environment_id/patch.ts> (a function with typed inputs; its response is checked against the schema)

Updates an environment's settings.

## Path parameters

- `project_id` string, required
- `environment_id` string, required

## Request body

- EnvironmentInput: Fields to change on an environment. Omitted fields are unchanged. Read-only fields are ignored.
  - `name` string: Can only be sent with its current value; an environment can't be renamed.
  - `notifications` boolean, nullable: Whether errors in this environment notify. Null resets it to true.

## Response `200`

Success

- object
  - `data` Environment, required: An environment a project's errors are reported from, such as production or staging, and whether errors from it send notifications.
    - `id` string, required
    - `project_id` string, required: ID of the project this environment belongs to
    - `name` string, required: Environment name
    - `notifications` boolean, required: Whether notifications fire for this environment.
    - `created_at` string, date-time, nullable, required: When the environment was created
  - `meta` ResponseMeta
    - `request_id` string: Unique identifier for the request, for correlating with support

## Other responses

- `401`: The credential is missing, invalid, expired or revoked (`unauthorized`), or was sent in a way v3 doesn't accept (see the examples).
- `403`: The credential isn't allowed to do this. `error.code` says why. An account or project the credential doesn't cover is 404 `not_found`, not 403.
- `404`: Resource not found
- `422`: Validation error

---

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