# Update pre-receive hook enforcement for an organization

From **GitHub v3 REST API**.

`PATCH /orgs/{org}/pre-receive-hooks/{pre_receive_hook_id}`

For pre-receive hooks which are allowed to be configured at the org level, you can set `enforcement` and `allow_downstream_configuration`

## Parameters

### `org`

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

### `pre_receive_hook_id`

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

pre_receive_hook_id parameter

## Request body

- Required: false
### `application/json`

- Type: `object`

```json
{
  "allow_downstream_configuration": false,
  "enforcement": "enabled"
}
```

```json
{"properties":{"allow_downstream_configuration":{"description":"Whether repositories can override enforcement.","type":"boolean"},"enforcement":{"description":"The state of enforcement for the hook on this repository.","type":"string"}},"type":"object"}
```

## Responses

### `200`

Response

### `application/json`

- Type: `object`

```json
{
  "allow_downstream_configuration": false,
  "configuration_url": "https://github.example.com/api/v3/orgs/octocat/pre-receive-hooks/42",
  "enforcement": "enabled",
  "id": 42,
  "name": "Check Commits"
}
```

```json
{"properties":{"allow_downstream_configuration":{"type":"boolean"},"configuration_url":{"type":"string"},"enforcement":{"type":"string"},"id":{"type":"integer"},"name":{"type":"string"}},"type":"object"}
```

## Request examples

### cURL

```shell
curl --request PATCH \
  --url {protocol}://{hostname}/api/v3/orgs/{org}/pre-receive-hooks/{pre_receive_hook_id} \
  --header 'content-type: application/json' \
  --data '{
  "allow_downstream_configuration": false,
  "enforcement": "enabled"
}'
```
