---
title: "POST /v1/{+parent}/hooks"
method: POST
path: "/v1/{+parent}/hooks"
tags: ["projects"]
---

# POST /v1/{+parent}/hooks

`POST /v1/{+parent}/hooks`

Creates a new hook in a given repository.

## Path parameters

- `parent` string, required

## Query parameters

- `hookId` string

## Request body

- Hook — Metadata of a Secure Source Manager Hook.
  - `createTime` string, google-datetime — Output only. Create timestamp.
  - `targetUri` string — Required. The target URI to which the payloads will be delivered.
  - `uid` string — Output only. Unique identifier of the hook.
  - `sensitiveQueryString` string — Optional. The sensitive query string to be appended to the target URI.
  - `events` string[] — Optional. The events that trigger hook on.
  - `disabled` boolean — Optional. Determines if the hook disabled or not. Set to true to stop sending traffic.
  - `name` string — Identifier. A unique identifier for a Hook. The name should be of the format: `projects/{project}/locations/{location_id}/repositories/{repository_id}/hooks/{hook_id}`
  - `pushOption` PushOption
    - `branchFilter` string — Optional. Trigger hook for matching branches only. Specified as glob pattern. If empty or *, events for all branches are reported. Examples: main, {main,release*}. See https://pkg.go.dev/github.com/gobwas/glob documentation.
  - `updateTime` string, google-datetime — Output only. Update timestamp.

## Response `200`

Successful response

---

[API](https://skmtc.net/google/apis/securesourcemanager.md) · [All operations](https://skmtc.net/google/apis/securesourcemanager/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/google/securesourcemanager/versions/4c9890b46a17/schema)
