---
title: "Create project webhook policy."
method: POST
path: "/projects/{project_name_or_id}/webhook/policies"
tags: ["webhook"]
---

# Create project webhook policy.

`POST /projects/{project_name_or_id}/webhook/policies`

This endpoint create a webhook policy if the project does not have one.

## Path parameters

- `project_name_or_id` string, required

## Headers

- `X-Request-Id` string
- `X-Is-Resource-Name` boolean

## Request body

- WebhookPolicy — The webhook policy object
  - `id` integer — The webhook policy ID.
  - `name` string — The name of webhook policy.
  - `description` string — The description of webhook policy.
  - `project_id` integer — The project ID of webhook policy.
  - `targets` WebhookTargetObject[]
    - `type` string — The webhook target notify type.
    - `address` string — The webhook target address.
    - `auth_header` string — The webhook auth header.
    - `skip_cert_verify` boolean — Whether or not to skip cert verify.
    - `payload_format` string — The type of webhook paylod format.
  - `event_types` string[]
  - `creator` string — The creator of the webhook policy.
  - `creation_time` string, date-time — The create time of the webhook policy.
  - `update_time` string, date-time — The update time of the webhook policy.
  - `enabled` boolean — Whether the webhook policy is enabled or not.

## Response `201`

Project webhook policy create successfully.

## Other responses

- `400` — Bad request
- `401` — Unauthorized
- `403` — Forbidden
- `500` — Internal server error

---

[API](https://skmtc.dev/cerit/apis/harbor-api.md) · [All operations](https://skmtc.dev/cerit/apis/harbor-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/cerit/harbor-api/revisions/62d78801f8df/schema)
