---
title: "Create a new webhook"
method: POST
path: "/projects/{project_id}/webhooks"
tags: ["Webhooks"]
---

# Create a new webhook

`POST /projects/{project_id}/webhooks`

## Request

- Base URL: `/api` (relative, and the document was published on a file host, not at the API’s origin)
- URL: `/api/projects/{project_id}/webhooks`
- Auth: HTTP bearer

## Path parameters

- `project_id` integer, required

## Request body

- CreateWebhookRequestBody
  - `enabled` boolean, nullable: Whether the webhook is enabled
  - `events` string[], required: Event types to subscribe to
  - `secret` string, password, nullable: A credential. Write-only: it is never returned, and the AI assistant supplies it through a secret slot instead of typing it into the conversation.
  - `url` string, required: Target URL for webhook delivery

## Response `201`

Webhook created

- WebhookResponse
  - `created_at` string, date-time, required
  - `enabled` boolean, required
  - `events` string[], required
  - `has_secret` boolean, required
  - `id` integer, required
  - `project_id` integer, required
  - `updated_at` string, date-time, required
  - `url` string, required

## Other responses

- `400`: Invalid request
- `401`: Unauthorized
- `403`: Forbidden
- `500`: Internal server error

## Changes

- **2026-10-23** `7d41b820a372`: 2 breaking, 1 info
  - the request property `secret` became not nullable
  - the `secret` request property type changed from `string, null` to no type
  - added `#/components/schemas/SecretString, subschema #2` to the `secret` request property `oneOf` list
- **2026-10-23** `24af93ff5379`: 2 breaking, 1 info
  - removed `#/components/schemas/SecretString, subschema #2` from the `secret` request property `oneOf` list
  - the `secret` request property type changed from no type to `string, null`
  - the request property `secret` became nullable
- **2026-10-22** `842d42ed4659`: 2 breaking, 1 info
  - the request property `secret` became not nullable
  - the `secret` request property type changed from `string, null` to no type
  - added `#/components/schemas/SecretString, subschema #2` to the `secret` request property `oneOf` list
- **2026-10-22** `1a12a50b75ee`: 2 breaking, 1 info
  - removed `#/components/schemas/SecretString, subschema #2` from the `secret` request property `oneOf` list
  - the `secret` request property type changed from no type to `string, null`
  - the request property `secret` became nullable
- **2026-10-21** `79089e9f49ee`: 2 breaking, 1 info
  - the request property `secret` became not nullable
  - the `secret` request property type changed from `string, null` to no type
  - added `#/components/schemas/SecretString, subschema #2` to the `secret` request property `oneOf` list

[Operation history](https://skmtc.dev/gotempsh/apis/temps/changes/projects/:project_id/webhooks/post.md)

---

[API](https://skmtc.dev/gotempsh/apis/temps.md) - [All operations](https://skmtc.dev/gotempsh/apis/temps/llms.txt) - [OpenAPI document](https://skmtc.dev/gotempsh/apis/temps/revisions/3b040526eb43?raw)
