# List pre-receive hooks for a repository

From **GitHub v3 REST API**.

`GET /repos/{owner}/{repo}/pre-receive-hooks`

List all pre-receive hooks that are enabled or testing for this repository as well as any disabled hooks that are allowed to be enabled at the repository level. Pre-receive hooks that are disabled at a higher level and are not configurable will not be listed.

## Parameters

### `owner`

- Location: path
- Required: true
- Type: `string`

### `repo`

- Location: path
- Required: true
- Type: `string`

### `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
[
  {
    "configuration_url": "https://github.example.com/api/v3/orgs/octocat/pre-receive-hooks/42",
    "enforcement": "disabled",
    "id": 42,
    "name": "Check Commits"
  }
]
```

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

## Request examples

### cURL

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