---
title: "Update a pre-receive environment"
method: PATCH
path: "/admin/pre-receive-environments/{pre_receive_environment_id}"
tags: ["enterprise-admin"]
---

# Update a pre-receive environment

`PATCH /admin/pre-receive-environments/{pre_receive_environment_id}`

You cannot modify the default environment. If you attempt to modify the default environment, you will receive a `422 Unprocessable Entity` response.

## Path parameters

- `pre_receive_environment_id` integer, required

## Request body

- object
  - `name` string — This pre-receive environment's new name.
  - `image_url` string — URL from which to download a tarball of this environment.

## Response `200`

Response

- PreReceiveEnvironment
  - `id` integer
  - `name` string
  - `image_url` string
  - `url` string
  - `html_url` string
  - `default_environment` boolean
  - `created_at` string
  - `hooks_count` integer
  - `download` object
    - `url` string
    - `state` string
    - `downloaded_at` string, nullable
    - `message` string, nullable

## Other responses

- `422` — Client Errors

---

[API](https://skmtc.net/github/apis/github-v3-rest-api-6.md) · [All operations](https://skmtc.net/github/apis/github-v3-rest-api-6/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/github/github-v3-rest-api-6/versions/15db3fa0759b/schema)
