# List pre-receive hooks

From **GitHub v3 REST API**.

`GET /admin/pre-receive-hooks`

List pre-receive hooks

## 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"`

One of `created` (when the repository was starred) or `updated` (when it was last pushed to) or `name`.

## Responses

### `200`

Response

### `application/json`

- Type: `array`

```json
[
  {
    "allow_downstream_configuration": false,
    "enforcement": "disabled",
    "environment": {
      "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"
    },
    "id": 1,
    "name": "Check Commits",
    "script": "scripts/commmit_check.sh",
    "script_repository": {
      "full_name": "DevIT/hooks",
      "html_url": "https://github.example.com/DevIT/hooks",
      "id": 595,
      "url": "https://github.example.com/api/v3/repos/DevIT/hooks"
    }
  }
]
```

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

## Request examples

### cURL

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