---
title: "Create webhook"
method: POST
path: "/api/webhooks"
tags: ["Webhooks"]
---

# Create webhook

`POST /api/webhooks`

Creates a new webhook for a stack. The webhook secret is auto-generated and only
returned in the creation response. Requires admin role.

## Request body

- object
  - `name` string, required
  - `stack_name` string, required — Target stack name.
  - `action` 'deploy' | 'restart' | 'stop' | 'start' | 'pull' | 'git-pull', required — Action to execute when the webhook is triggered. `git-pull` requires a Git source attached to the stack.
  - `enabled` boolean
  - `node_id` integer — Node the webhook executes against. Defaults to the request's resolved node or the default node.

## Response `201`

Webhook created. The `secret` field is the HMAC signing key; save it now.

- object
  - `id` integer, required
  - `secret` string, required — HMAC-SHA256 signing secret. Store securely; this is the only time it's returned in full.

## Other responses

- `400` — Validation error.
- `403` — Insufficient permissions or license tier.
- `500` — Internal server error.

---

[API](https://skmtc.net/studio-saelix/apis/sencho-api.md) · [All operations](https://skmtc.net/studio-saelix/apis/sencho-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/studio-saelix/sencho-api/versions/f36f82acae1d/schema)
