Skip to content

Webhooks

Create, test, and monitor webhooks from the command line. Alias: pf wh

Commands

pf webhooks listList all webhooks

alias: pf wh ls

Options

  • --limitnumber

    Webhooks per page, 1 to 200. Without it you get one response with up to 1,000

  • --cursorstring

    Cursor from the previous page

  • --allboolean

    Follow every cursor and print one list

  • --pageboolean

    With --json, keep hasMore and nextCursor alongside the rows

Example

Shell
pf webhooks list
pf webhooks list --limit 50 --cursor '<nextCursor>'
pf webhooks createCreate a new webhook

alias: pf wh create

Options

  • --namestringrequired

    Webhook name, up to 100 characters

  • --urlstringrequired

    HTTPS endpoint URL that receives events

  • --eventsstringrequired

    Comma-separated list of event types

  • --project-scopestring

    Deliver only this project's events. Members must set it; only owners and admins can create a webhook for every project.

  • --agent-presetstring

    Start an AI agent run for each event instead of sending a signed request. The URL must match the preset. See the Webhooks API reference for presets.

  • --agent-credentialstring

    The service's token or key. With no value, the CLI reads PROJECT_FEED_AGENT_CREDENTIAL; a value of - reads standard input. It is never printed and is redacted in the CLI history file. Use the environment variable or standard input to keep it out of shell history.

  • --agent-optionkey=value

    A preset option. Repeat the flag for more than one.

  • --signing-secretstring

    Use a whsec_ secret issued by the receiving service, such as a Grok automation, instead of a generated one. With no value, the CLI reads PROJECT_FEED_WEBHOOK_SIGNING_SECRET; a value of - reads standard input. It is never printed and is redacted in the CLI history file.

  • --asymmetric-signingboolean

    Also sign with an Ed25519 key. Deliveries carry a v1a signature next to the v1 one, and the command prints the whpk_ public key. Cannot be combined with --agent-preset.

  • --disabledboolean

    Create in disabled state

Example

Shell
pf webhooks create --name "CI Notify" --url https://ci.example.com/hook --events post.created,post.updated
pf wh create --name "Release announcer" --url https://bridge.example.com/hook --events post.published --project-scope <project-id>
echo "$GROK_WEBHOOK_SECRET" | pf webhooks create --name "Grok automation" --url "$GROK_WEBHOOK_URL" --events task.completed --signing-secret -
pf webhooks create --name "Handoff runner" --url https://api.anthropic.com/v1/claude_code/routines/trig_01ABC/fire --events handoff.created --agent-preset claude_routine --agent-credential
pf webhooks create --name "Devin runner" --url https://api.devin.ai/v3/organizations/org-abc123/sessions --events handoff.created --agent-preset devin_session --agent-option org_id=org-abc123 --agent-credential

In a terminal, missing --name, --url, or --events are prompted for. Without a terminal, the command fails when any of them is missing. --agent-credential and --agent-option need --agent-preset. --signing-secret cannot be combined with --agent-preset.

pf webhooks view [id]View webhook details, including the public key that verifies v1a signatures

alias: pf wh show

Example

Shell
pf webhooks view wh123
pf webhooks edit [id]Update a webhook

alias: pf wh update

Options

  • --namestring

    New name

  • --urlstring

    New endpoint URL

  • --eventsstring

    New event types (comma-separated)

  • --project-scopestring

    Deliver only this project's events

  • --all-projectsboolean

    Clear the project scope. Owners and admins only.

  • --agent-presetstring

    Start an AI agent run for each event. Without --agent-credential the saved credential is kept; changing the preset needs a new one.

  • --agent-credentialstring

    Replace the saved credential. With no value, the CLI reads PROJECT_FEED_AGENT_CREDENTIAL; a value of - reads standard input.

  • --agent-optionkey=value

    Replace the preset options. Repeat the flag for more than one.

  • --signing-secretstring

    Replace the signing secret with one issued by the receiving service. With no value, the CLI reads PROJECT_FEED_WEBHOOK_SIGNING_SECRET; a value of - reads standard input.

  • --asymmetric-signingboolean

    Add a v1a Ed25519 signature and print the whpk_ public key. A webhook that already has a key keeps it.

  • --no-asymmetric-signingboolean

    Stop signing with the Ed25519 key and delete the key pair. Turning it on again creates a new one.

  • --standard-destinationboolean

    Switch back to the signed request and delete the saved credential. Supply --signing-secret and set --url to the receiver URL in the same command.

  • --enableboolean

    Enable the webhook

  • --disableboolean

    Disable the webhook

Example

Shell
pf webhooks edit wh123 --events post.created,comment.created
pf wh update wh123 --disable
pf webhooks delete [id]Delete a webhook

alias: pf wh rm

Options

  • --confirmboolean

    Skip confirmation prompt

  • --dry-runboolean

    Preview without deleting

Example

Shell
pf webhooks delete wh123 --confirm
pf webhooks test <id>Send a test event to the webhook endpoint. For a webhook that starts an AI agent run, this starts a real run.

Example

Shell
pf webhooks test wh123
pf webhooks regen-secret <id>Regenerate the signing secret for a webhook

Options

  • --confirmboolean

    Skip confirmation prompt

  • --dry-runboolean

    Preview without regenerating

Example

Shell
pf webhooks regen-secret wh123 --confirm

After regenerating, update the secret in your receiving service. Standard Webhooks signatures overlap for 24 hours, and the output shows when that ends. Legacy X-Webhook-Signature verification needs the new secret immediately.

pf webhooks deliveries <id>List recent deliveries for a webhook

alias: pf wh logs

Options

  • --failedboolean

    Show only failed deliveries; same as --status failed

  • --statusstring

    success, failed, or skipped

  • --event-typestring

    Only deliveries of this event

  • --sincestring

    Only deliveries after this time: milliseconds or an ISO date

Example

Shell
pf webhooks deliveries wh123
pf wh logs wh123 --failed
pf webhooks deliveries wh123 --event-type task.created --since 2026-10-14T09:00:00Z

With --json each delivery has eventId, so pf events get <eventId> returns the payload that was sent.

pf webhooks delivery <webhookId> <deliveryId>Show one delivery attempt: status, the other attempts of the same event, timings, the response, and the request headers with signatures hidden

Example

Shell
pf webhooks delivery wh123 del456

The response body is cut at 1,000 characters. The payload is not included; read it with pf events get.

pf webhooks eventsList the event types a webhook can subscribe to, with their data fields

Options

  • --schemaboolean

    Include the JSON Schema of each event in --json output

Example

Shell
pf webhooks events
pf webhooks events --schema --json
pf webhooks trigger <id> <event>Send a sample of an event type to a webhook, signed with its secret. The body has test: true

Example

Shell
pf webhooks trigger wh123 task.completed

It uses the test route, so it counts toward the 10 a minute limit shared with tests and retries. For a webhook that starts an AI agent run, this starts a real run.

pf webhooks retry <webhookId> <deliveryId>Retry a failed webhook delivery

Example

Shell
pf webhooks retry wh123 del456
pf webhooks replay <id>Re-send stored events to a webhook with their original event IDs, oldest first, at most 100 a call

Options

  • --sincestringrequired

    Replay events after this time: milliseconds or an ISO date

  • --untilstring

    Replay events up to this time; defaults to when the first call ran, and --cursor keeps it

  • --typesstring

    Comma-separated event types

  • --cursorstring

    Continue a previous replay. The command prints the full line to run, with --since, --until and --types repeated

Example

Shell
pf webhooks replay wh123 --since 2026-10-14T09:00:00Z
pf wh replay wh123 --since 2026-10-14T09:00:00Z --types task.completed

Only events the webhook subscribes to and its creator can see are sent. Events from the last 30 days are available. Replays are limited to 10 per hour for each workspace, and a webhook that starts an AI agent run cannot be replayed.

pf webhooks listen <id>Poll for new deliveries. Optionally forward each event's stored payload to a local endpoint.

Options

  • --forward-tostring

    URL to receive each event's stored payload, signed like a live delivery

  • --signing-secretstring

    The webhook's whsec_ secret, used to sign what is forwarded. With no value, the CLI reads PROJECT_FEED_WEBHOOK_SIGNING_SECRET; a value of - reads standard input. Without it the forwarded request is unsigned.

  • --eventsstring

    Filter by event types

  • --intervalnumber

    Polling interval in milliseconds, at least 1000 (default 2000). While no new deliveries arrive, the wait doubles up to the greater of one minute or the chosen interval, then returns to the interval when one arrives

Example

Shell
pf webhooks listen wh123
pf wh listen wh123 --forward-to http://localhost:3000/api/webhook --events post.created --signing-secret

Follows history pages back to the previous checkpoint. Stops on history gaps or retry exhaustion and reports undelivered record IDs. A delivery with no stored event, such as a test, is not forwarded. Each poll counts against the key's rate limit, so stop the listener with Ctrl+C when you finish testing.

Create and verify an endpoint

  1. 1.

    Create the webhook disabled

    Keep it disabled while the receiver, signature verification, queue, and monitoring are being prepared.

  2. 2.

    Save the signing secret

    Store it in the receiver's secret manager right away. The full value is shown once and cannot be retrieved later.

  3. 3.

    Send a test

    Inspect its delivery entry and verify the receiver accepted the delivery ID once without applying a production side effect.

  4. 4.

    Enable the endpoint

    Generate one subscribed workspace event and trace the real delivery through acceptance and processing.

  5. 5.

    Check failed deliveries

    Do this after deployment and before rotating a secret or removing an endpoint.

Shell
pf webhooks create --name "Build receiver" --url https://hooks.example.com/project-feed --events post.created --project-scope <project-id> --disabled --json
pf webhooks test <webhook-id>
pf webhooks deliveries <webhook-id>
pf webhooks edit <webhook-id> --enable
pf webhooks deliveries <webhook-id> --failed

Read events

The events commands read the same stored events the API serves for 30 days. Use them to inspect what a webhook would have received, or to watch a workspace while you build a receiver.

pf events channelForward selected events to a running Claude Code session over MCP stdio

Options

  • --configstringrequired

    Path to a JSON array of native MCP event names and filters, up to 32 selections and 8192 bytes

Example

Shell
pf events channel --config ./project-feed-events.json

Supports every native MCP event type with current resource access checks. Channels is a research preview: use an interactive Claude Code session with --dangerously-load-development-channels server:project-feed-events and review its approval prompt. Project-restricted API keys are not supported by this catalog. Stdout is reserved for MCP; omit --json, --jq and --template. The CLI buffers at most 32 events and sends at most one notice every 30 seconds. Stable idle connections do not poll or notify the model. Reconnects stay quiet when the workspace has not changed; possible missed activity produces a gap notice. At most twenty reconnect attempts are allowed per hour. Unreadable selections are dropped with a notice while the others stay active. Refetch after a gap or long idle period. Transport acceptance does not prove Claude processed the event. Delivery budgets are shared with native MCP event subscriptions. Stop the MCP server to close the channel.

pf events listList stored events you can see, newest first

alias: pf events ls

Options

  • --typestring

    Comma-separated event types

  • --projectstring

    Only events for this project

  • --sincestring

    Only events after this time: milliseconds or an ISO date

  • --orderstring

    asc or desc (default desc)

  • --limitnumber

    Events per page, from 1 to 100 (default 50)

  • --cursorstring

    Continue from the cursor a previous page printed

  • --mineboolean

    Only new comments, annotations, doc comments, and chat messages on your own work. Adds a reason: thread, author, assignee, or follower

Example

Shell
pf events list --type task.completed,task.created
pf events list --since 2026-10-14T09:00:00Z --order asc --json
pf events list --mine

Events are kept for 30 days. With --json the output includes hasMore and nextCursor. With --mine a page holds at most 25 events, and your own comments from the app or another key count only when they answer something this key wrote.

pf events get <id>Get one event as the payload a webhook receives

alias: pf events show

Example

Shell
pf events get evt_01J9ZG6QK2M7XW3R5H8T4N9PVC --json
pf events tailPrint new events as they happen

Options

  • --typestring

    Comma-separated event types

  • --projectstring

    Only events for this project

  • --sincestring

    Start exactly after this time instead of a few seconds before now: milliseconds or an ISO date

  • --intervalnumber

    Polling interval in milliseconds, at least 1000 (default 2000). The wait doubles while no events arrive, up to a minute

  • --mineboolean

    Only new comments, annotations, doc comments, and chat messages on your own work. Adds a reason: thread, author, assignee, or follower

Example

Shell
pf events tail --type task.completed
pf events tail --json | jq .data.taskId
pf events tail --mine

Without --since the tail starts five seconds before now, so an event stamped just before it started but stored a moment later still prints, once. Each poll counts against the key's rate limit. Press Ctrl+C to stop.

Local development

Use pf webhooks listen to forward real events to your local development server. For each new delivery it fetches the stored event from the events API and sends that exact body with the Standard Webhooks headers, signed with the secret you pass. Your receiver verifies it the same way it verifies a live delivery, so you can develop against real payloads without a public URL.

Shell
export PROJECT_FEED_WEBHOOK_SIGNING_SECRET=whsec_...
pf webhooks listen wh123 --forward-to http://localhost:3000/api/webhook --signing-secret
pf webhooks listen wh123 --forward-to http://localhost:3000/api/webhook --signing-secret --events post.created,comment.created

To try an event type that has not happened yet, send a sample with pf webhooks trigger wh123 task.completed.

Forwarded requests include X-Project-Feed-Delivery-Id for receiver deduplication. Each forward times out after 10 seconds and retries up to five attempts with backoff. The listener keeps at most 1,000 pending records and scans at most 20 history pages per poll. It stops if the checkpoint is missing, a cursor repeats, a budget is exhausted, or the server lacks pagination metadata. On termination, undelivered IDs are reported. Pending forwards are kept in memory for the running session.

Debugging

Check delivery history and retry failed deliveries:

Shell
pf webhooks deliveries wh123 --failed
pf webhooks retry wh123 del456
pf webhooks test wh123

Fix webhook problems

The one-time secret was lost
Regenerate it, save the new value before closing the output, update the receiver, and test. Standard Webhooks signatures overlap for 24 hours. Legacy X-Webhook-Signature verification needs the new secret immediately.
A test fails
Inspect deliveries before retrying. Correct public HTTPS access, signature handling, response time, or receiver availability, then send a new test.
A real delivery failed
Fix and test the receiver first, then retry the original delivery ID. The receiver must deduplicate the retry before applying side effects.
Local forwarding receives nothing
Confirm the webhook ID, event filter, polling interval, and local URL. The listener polls Project Feed. It does not make an unreachable local port public.
The endpoint was disabled after failures
Keep it disabled while repairing the receiver. Enable it only after the built-in test succeeds and one failed delivery can be processed safely.

Next steps

Image preview
100%