> ## Documentation Index
> Fetch the complete documentation index at: https://docs.agentlinkops.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create webhook

> Subscribe an HTTPS receiver to source or destination events, or periodic digests.

`create_webhook`

Subscribe an HTTPS receiver to source or destination events, or periodic digests. Returns the signing secret once. Delivery is signed, at-least-once, and starts at the current sequence; deduplicate by Linktrail-Delivery-Id and recover gaps through the event feed. A 410 receiver response disables delivery.

<Note>Hosted MCP registration verified. These schemas describe the development contract; confirm supported inputs with tools/list. Generic CLI/HTTP calls require a matching development server. Configure LINKTRAIL\_API\_URL; production does not expose these command routes.</Note>

| Access          | Behavior              |
| --------------- | --------------------- |
| `watches:write` | Writes or admits work |

Reading saved data does not start a verification job. Mutations can change saved records or access; the effects below apply.

## Example request

Connect through [MCP](/guides/connect-mcp), [CLI](/guides/connect-cli), or [HTTP](/guides/connect-http). Replace example identifiers with records from your workspace.

<CodeGroup>
  ```json MCP theme={null}
  {
    "jsonrpc": "2.0",
    "id": 1,
    "method": "tools/call",
    "params": {
      "name": "create_webhook",
      "arguments": {
        "url": "https://example.com/guide"
      }
    }
  }
  ```

  ```bash CLI theme={null}
  linktrail call create_webhook --args '{"url":"https://example.com/guide"}'
  ```

  ```bash HTTP theme={null}
  curl "$LINKTRAIL_API_URL/v1/commands/create_webhook" \
    -H "Authorization: Bearer $LINKTRAIL_API_KEY" \
    -H 'Content-Type: application/json' \
    --data '{"url":"https://example.com/guide"}'
  ```
</CodeGroup>

## Returned result

Illustrative data validated against the documented response schema. IDs and dates are examples, not a live account capture. MCP returns this data in `structuredContent` and in a text content block; generic HTTP and CLI return the JSON result directly.

```json theme={null}
{
  "id": "webhook_example",
  "workspace_id": "ws_example",
  "project_id": null,
  "url": "https://example.com/guide",
  "description": "",
  "state": "active",
  "active_secret_count": 1,
  "event_types": null,
  "feeds": [
    "events"
  ],
  "delivery_mode": "events",
  "digest_frequency": null,
  "digest_hour_utc": 9,
  "digest_last_sent_at": null,
  "consecutive_failures": 0,
  "disabled_at": null,
  "disabled_reason": null,
  "created_at": "2026-09-13T12:00:00.000Z",
  "updated_at": "2026-09-13T12:00:00.000Z",
  "secret": "whsec_example_not_a_credential"
}
```

## Input fields

Omit optional fields when you do not want to supply them. Null is accepted only where listed. Unknown input properties are rejected.

| Field             | Type    | Presence | Meaning and constraints                                                                                               |
| ----------------- | ------- | -------- | --------------------------------------------------------------------------------------------------------------------- |
| `projectId`       | string  | Optional | Identifier of the project returned by its create or list operation. minLength: 1; maxLength: 200                      |
| `url`             | string  | Required | Public HTTPS endpoint or destination URL required by this operation. minLength: 1; maxLength: 2048                    |
| `description`     | string  | Optional | Optional human-readable description of this resource. maxLength: 200; default: ""                                     |
| `eventTypes`      | array   | Optional | Event type filters for this subscription; omitted means all supported types. minItems: 1; maxItems: 32                |
| `feeds`           | array   | Optional | Independent source or destination event feeds to subscribe to. minItems: 1; default: \["events"]                      |
| `deliveryMode`    | string  | Optional | Choose individual event deliveries or one digest per configured window. default: "events"; values: "events", "digest" |
| `digestFrequency` | string  | Optional | Digest window frequency; applicable only when deliveryMode is digest. values: "daily", "weekly"                       |
| `digestHourUtc`   | integer | Optional | UTC hour from 0 to 23 when the digest window closes. minimum: 0; maximum: 23; default: 9                              |

### Validation and omitted values

Omitting eventTypes subscribes to all supported types. Omitted projectId creates a workspace-level endpoint; it does not select a project automatically.

digestFrequency is required when deliveryMode is digest; it has no default cadence. The signing secret is returned once.

New subscriptions begin at current feed sequences. Creating an endpoint does not replay earlier events or prove delivery is configured. Event type filters must contain one to sixty-four lowercase letters, `_` or `.` per value.

### Defaults when omitted

| Field           | Default      |
| --------------- | ------------ |
| `description`   | `""`         |
| `feeds`         | `["events"]` |
| `deliveryMode`  | `"events"`   |
| `digestHourUtc` | `9`          |

## Output fields

Fields inside optional or nullable parents apply only when that parent exists. [Common schema conventions](/reference/schemas) explain evidence states, empty lists and extensions.

| Field                  | Type          | Presence | Meaning and constraints                                                          |
| ---------------------- | ------------- | -------- | -------------------------------------------------------------------------------- |
| `id`                   | string        | Required | Resource identifier returned by the operation.                                   |
| `workspace_id`         | string        | Required | Workspace that owns this record.                                                 |
| `project_id`           | string / null | Required | Project that owns this record.                                                   |
| `url`                  | string        | Required | url recorded for this result.                                                    |
| `description`          | string        | Required | description recorded for this result.                                            |
| `state`                | string        | Required | Saved lifecycle or evidence state, as enumerated for this record.                |
| `active_secret_count`  | number        | Required | active secret count recorded for this result.                                    |
| `event_types`          | array / null  | Required | event types recorded for this result.                                            |
| `feeds`                | array         | Required | feeds recorded for this result.                                                  |
| `delivery_mode`        | string        | Required | delivery mode recorded for this result.                                          |
| `digest_frequency`     | string / null | Required | digest frequency recorded for this result.                                       |
| `digest_hour_utc`      | number / null | Required | digest hour utc recorded for this result.                                        |
| `digest_last_sent_at`  | string / null | Required | digest last sent at recorded for this result.                                    |
| `consecutive_failures` | number        | Required | consecutive failures recorded for this result.                                   |
| `disabled_at`          | string / null | Required | disabled at recorded for this result.                                            |
| `disabled_reason`      | string / null | Required | disabled reason recorded for this result.                                        |
| `created_at`           | string        | Required | UTC timestamp when the record was created.                                       |
| `updated_at`           | string        | Required | UTC timestamp of the last record update.                                         |
| `secret`               | string        | Optional | Webhook signing secret returned only when created or rotated. Store it securely. |

[Download input schema](/schemas/create_webhook.input.json) · [Download output schema](/schemas/create_webhook.output.json)

## Errors and retries

This command is not annotated idempotent. After a timeout, inspect existing state before repeating a write.

See [error recovery](/reference/errors) for status, scope, cooldown, cursor and retry handling. Unknown observations are result data and do not establish loss.

## HTTP resource routes

These existing resource routes share the operation’s domain behavior. Their parameter placement, status and response envelope can differ from generic invocation. See [HTTP route details](/reference/http/routes).

| Method and route    | Success | Details                                       |
| ------------------- | ------- | --------------------------------------------- |
| `POST /v1/webhooks` | 201     | Remaining arguments go in a JSON object body. |

## Continue

[list\_webhook\_deliveries](/reference/commands/list_webhook_deliveries) · [list\_webhooks](/reference/commands/list_webhooks)

Follow the [related workflow](/guides/webhooks), inspect [capability status](/capability-status), or return to the [command index](/reference/index).
