---
title: "Generic Webhook"
method: POST
path: "/webhook"
---

# Generic Webhook

`POST /webhook`

Create a task directly from a generic inbound webhook payload.

The endpoint is intentionally small and separate from the trigger-manager
flow: callers POST a task-shaped payload and Bernstein creates one task.
``BERNSTEIN_WEBHOOK_SECRET`` must be configured (fail-closed; )
and each request must carry a fresh ``X-Bernstein-Timestamp`` header
plus a matching ``X-Bernstein-Webhook-Signature-256`` HMAC over
``f"{timestamp}.".encode() + body``. The plaintext
``X-Bernstein-Webhook-Secret`` fallback has been removed; callers
relying on it must upgrade to the HMAC + timestamp flow.

Automation bridge (#2512): an admitted trigger returns a signed,
chain-anchored trigger receipt in ``receipt`` so the calling platform holds
a proof of what it asked for rather than a bare task reference. A trigger
that fails authentication, or that replays a trigger id already admitted,
is refused with its own signed refusal receipt (HTTP 401 and 409
respectively) -- the negative path leaves a record, never a silent drop.

## Request body

- WebhookTaskCreate — Body for POST /webhook.
  - `title` string, required
  - `description` string, required
  - `role` string
  - `tenant_id` string
  - `priority` integer
  - `scope` string
  - `complexity` string
  - `eu_ai_act_risk` string
  - `approval_required` boolean
  - `risk_level` string
  - `estimated_minutes` integer, nullable
  - `depends_on` string[]
  - `parent_task_id` string, nullable
  - `depends_on_repo` string, nullable
  - `owned_files` string[]
  - `cell_id` string, nullable
  - `repo` string, nullable
  - `task_type` string
  - `upgrade_details` object, nullable
  - `model` string, nullable
  - `effort` string, nullable
  - `cli` string, nullable
  - `batch_eligible` boolean
  - `completion_signals` CompletionSignalSchema[]
    - `type` 'path_exists' | 'glob_exists' | 'test_passes' | 'file_contains' | 'llm_review' | 'llm_judge', required
    - `value` string, required
  - `slack_context` object, nullable
  - `metadata` object
  - `deadline` number, nullable
  - `parent_session_id` string, nullable
  - `parent_context` string, nullable
  - `retry_count` integer, nullable
  - `max_retries` integer, nullable
  - `retry_delay_s` number, nullable
  - `terminal_reason` string, nullable
  - `max_output_tokens` integer, nullable
  - `meta_messages` string[], nullable
  - `max_turns` integer, nullable

## Response `201`

Successful Response

- WebhookTaskResponse — Serialized task returned by POST /webhook. ``receipt`` carries the signed, chain-anchored trigger receipt for the admitted trigger (#2512) so the calling automation platform stores a proof of what it asked for, not just a task reference. It is optional: an install whose bridge state is unavailable still creates the task and returns ``None`` rather than failing the caller.
  - `task` TaskResponse, required — Serialised task returned by every task endpoint.
    - `id` string, required
    - `title` string, required
    - `description` string, required
    - `role` string, required
    - `tenant_id` string, required
    - `priority` integer, required
    - `scope` string, required
    - `complexity` string, required
    - `eu_ai_act_risk` string, required
    - `approval_required` boolean, required
    - `risk_level` string, required
    - `estimated_minutes` integer, nullable, required
    - `status` string, required
    - `depends_on` string[], required
    - `parent_task_id` string, nullable, required
    - `depends_on_repo` string, nullable, required
    - `owned_files` string[], required
    - `assigned_agent` string, nullable, required
    - `result_summary` string, nullable, required
    - `cell_id` string, nullable, required
    - `repo` string, nullable, required
    - `task_type` string, required
    - `upgrade_details` object, nullable, required
    - `model` string, nullable, required
    - `effort` string, nullable, required
    - `cli` string, nullable
    - `batch_eligible` boolean
    - `completion_signals` object[]
    - `slack_context` object, nullable
    - `metadata` object
    - `created_at` number, required
    - `claimed_at` number, nullable
    - `completed_at` number, nullable
    - `closed_at` number, nullable
    - `deadline` number, nullable
    - `progress_log` ProgressEntry[]
      - `timestamp` number, required
      - `message` string, required
      - `percent` integer, required
    - `version` integer
    - `parent_session_id` string, nullable
    - `retry_count` integer
    - `max_retries` integer
    - `retry_delay_s` number
    - `terminal_reason` string, nullable
    - `max_output_tokens` integer, nullable
    - `meta_messages` string[]
    - `max_turns` integer, nullable
  - `receipt` object, nullable

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/sipyourdrink-ltd/apis/bernstein-task-server.md) · [All operations](https://skmtc.net/sipyourdrink-ltd/apis/bernstein-task-server/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/sipyourdrink-ltd/bernstein-task-server/versions/86f514b4e920/schema)
