---
title: "Start a pre-receive environment download"
method: POST
path: "/admin/pre-receive-environments/{pre_receive_environment_id}/downloads"
tags: ["enterprise-admin"]
---

# Start a pre-receive environment download

`POST /admin/pre-receive-environments/{pre_receive_environment_id}/downloads`

Triggers a new download of the environment tarball from the environment's `image_url`. When the download is finished, the newly downloaded tarball will overwrite the existing environment.

If a download cannot be triggered, you will receive a `422 Unprocessable Entity` response.

The possible error messages are:

* _Cannot modify or delete the default environment_
* _Can not start a new download when a download is in progress_

## Path parameters

- `pre_receive_environment_id` integer, required

## Response `202`

Response

- PreReceiveEnvironmentDownloadStatus
  - `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)
