# List pre-receive environments

From **GitHub v3 REST API**.

`GET /admin/pre-receive-environments`

List pre-receive environments

## Parameters

### `per_page`

- Location: query
- Required: false
- Type: `integer`
- Default: `30`

Results per page (max 100)

### `page`

- Location: query
- Required: false
- Type: `integer`
- Default: `1`

Page number of the results to fetch.

### `direction`

- Location: query
- Required: false
- Type: `string`
- Default: `desc`
- Allowed values: `"asc"`, `"desc"`

One of `asc` (ascending) or `desc` (descending).

### `sort`

- Location: query
- Required: false
- Type: `string`
- Default: `created`
- Allowed values: `"created"`, `"updated"`, `"name"`

## Responses

### `200`

Response

### `application/json`

- Type: `array`

```json
[
  {
    "created_at": "2016-05-20T11:35:45-05:00",
    "default_environment": true,
    "download": {
      "downloaded_at": "2016-05-26T07:42:53-05:00",
      "message": null,
      "state": "not_started",
      "url": "https://github.example.com/api/v3/admin/pre-receive-environments/1/downloads/latest"
    },
    "hooks_count": 14,
    "html_url": "https://github.example.com/admin/pre-receive-environments/1",
    "id": 1,
    "image_url": "githubenterprise://internal",
    "name": "Default",
    "url": "https://github.example.com/api/v3/admin/pre-receive-environments/1"
  },
  {
    "created_at": "2016-05-20T11:35:45-05:00",
    "default_environment": false,
    "download": {
      "downloaded_at": "2016-05-26T07:42:53-05:00",
      "message": null,
      "state": "success",
      "url": "https://github.example.com/api/v3/admin/pre-receive-environments/2/downloads/latest"
    },
    "hooks_count": 1,
    "html_url": "https://github.example.com/admin/pre-receive-environments/2",
    "id": 2,
    "image_url": "https://my_file_server/path/to/devtools_env.tar.gz",
    "name": "DevTools Hook Env",
    "url": "https://github.example.com/api/v3/admin/pre-receive-environments/2"
  }
]
```

```json
{"items":{"$ref":"#/components/schemas/pre-receive-environment"},"type":"array"}
```

## Request examples

### cURL

```shell
curl --request GET \
  --url {protocol}://{hostname}/api/v3/admin/pre-receive-environments
```
