Webhooks
Create, test, and monitor webhooks from the command line. Alias: pf wh
- PlanPro or Enterprise
- WhoOwners, admins, and members
Commands
pf webhooks listList all webhooks
alias: pf wh ls
Options
--limitnumberWebhooks per page, 1 to 200. Without it you get one response with up to 1,000
--cursorstringCursor from the previous page
--allbooleanFollow every cursor and print one list
--pagebooleanWith --json, keep hasMore and nextCursor alongside the rows
Example
pf webhooks list
pf webhooks list --limit 50 --cursor '<nextCursor>'pf webhooks createCreate a new webhook
alias: pf wh create
Options
--namestringrequiredWebhook name, up to 100 characters
--urlstringrequiredHTTPS endpoint URL that receives events
--eventsstringrequiredComma-separated list of event types
--project-scopestringDeliver only this project's events. Members must set it; only owners and admins can create a webhook for every project.
--agent-presetstringStart 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-credentialstringThe 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=valueA preset option. Repeat the flag for more than one.
--signing-secretstringUse 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-signingbooleanAlso 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.
--disabledbooleanCreate in disabled state
Example
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-credentialIn 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
pf webhooks view wh123pf webhooks edit [id]Update a webhook
alias: pf wh update
Options
--namestringNew name
--urlstringNew endpoint URL
--eventsstringNew event types (comma-separated)
--project-scopestringDeliver only this project's events
--all-projectsbooleanClear the project scope. Owners and admins only.
--agent-presetstringStart an AI agent run for each event. Without --agent-credential the saved credential is kept; changing the preset needs a new one.
--agent-credentialstringReplace the saved credential. With no value, the CLI reads PROJECT_FEED_AGENT_CREDENTIAL; a value of - reads standard input.
--agent-optionkey=valueReplace the preset options. Repeat the flag for more than one.
--signing-secretstringReplace 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-signingbooleanAdd a v1a Ed25519 signature and print the whpk_ public key. A webhook that already has a key keeps it.
--no-asymmetric-signingbooleanStop signing with the Ed25519 key and delete the key pair. Turning it on again creates a new one.
--standard-destinationbooleanSwitch back to the signed request and delete the saved credential. Supply --signing-secret and set --url to the receiver URL in the same command.
--enablebooleanEnable the webhook
--disablebooleanDisable the webhook
Example
pf webhooks edit wh123 --events post.created,comment.created
pf wh update wh123 --disablepf webhooks delete [id]Delete a webhook
alias: pf wh rm
Options
--confirmbooleanSkip confirmation prompt
--dry-runbooleanPreview without deleting
Example
pf webhooks delete wh123 --confirmpf 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
pf webhooks test wh123pf webhooks regen-secret <id>Regenerate the signing secret for a webhook
Options
--confirmbooleanSkip confirmation prompt
--dry-runbooleanPreview without regenerating
Example
pf webhooks regen-secret wh123 --confirmAfter 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
--failedbooleanShow only failed deliveries; same as --status failed
--statusstringsuccess, failed, or skipped
--event-typestringOnly deliveries of this event
--sincestringOnly deliveries after this time: milliseconds or an ISO date
Example
pf webhooks deliveries wh123
pf wh logs wh123 --failed
pf webhooks deliveries wh123 --event-type task.created --since 2026-10-14T09:00:00ZWith --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
pf webhooks delivery wh123 del456The 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
--schemabooleanInclude the JSON Schema of each event in --json output
Example
pf webhooks events
pf webhooks events --schema --jsonpf webhooks trigger <id> <event>Send a sample of an event type to a webhook, signed with its secret. The body has test: true
Example
pf webhooks trigger wh123 task.completedIt 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
pf webhooks retry wh123 del456pf webhooks replay <id>Re-send stored events to a webhook with their original event IDs, oldest first, at most 100 a call
Options
--sincestringrequiredReplay events after this time: milliseconds or an ISO date
--untilstringReplay events up to this time; defaults to when the first call ran, and --cursor keeps it
--typesstringComma-separated event types
--cursorstringContinue a previous replay. The command prints the full line to run, with --since, --until and --types repeated
Example
pf webhooks replay wh123 --since 2026-10-14T09:00:00Z
pf wh replay wh123 --since 2026-10-14T09:00:00Z --types task.completedOnly 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-tostringURL to receive each event's stored payload, signed like a live delivery
--signing-secretstringThe 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.
--eventsstringFilter by event types
--intervalnumberPolling 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
pf webhooks listen wh123
pf wh listen wh123 --forward-to http://localhost:3000/api/webhook --events post.created --signing-secretFollows 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.
Create the webhook disabled
Keep it disabled while the receiver, signature verification, queue, and monitoring are being prepared.
- 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.
Send a test
Inspect its delivery entry and verify the receiver accepted the delivery ID once without applying a production side effect.
- 4.
Enable the endpoint
Generate one subscribed workspace event and trace the real delivery through acceptance and processing.
- 5.
Check failed deliveries
Do this after deployment and before rotating a secret or removing an endpoint.
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> --failedRead 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
--configstringrequiredPath to a JSON array of native MCP event names and filters, up to 32 selections and 8192 bytes
Example
pf events channel --config ./project-feed-events.jsonSupports 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
--typestringComma-separated event types
--projectstringOnly events for this project
--sincestringOnly events after this time: milliseconds or an ISO date
--orderstringasc or desc (default desc)
--limitnumberEvents per page, from 1 to 100 (default 50)
--cursorstringContinue from the cursor a previous page printed
--minebooleanOnly new comments, annotations, doc comments, and chat messages on your own work. Adds a reason: thread, author, assignee, or follower
Example
pf events list --type task.completed,task.created
pf events list --since 2026-10-14T09:00:00Z --order asc --json
pf events list --mineEvents 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
pf events get evt_01J9ZG6QK2M7XW3R5H8T4N9PVC --jsonpf events tailPrint new events as they happen
Options
--typestringComma-separated event types
--projectstringOnly events for this project
--sincestringStart exactly after this time instead of a few seconds before now: milliseconds or an ISO date
--intervalnumberPolling interval in milliseconds, at least 1000 (default 2000). The wait doubles while no events arrive, up to a minute
--minebooleanOnly new comments, annotations, doc comments, and chat messages on your own work. Adds a reason: thread, author, assignee, or follower
Example
pf events tail --type task.completed
pf events tail --json | jq .data.taskId
pf events tail --mineWithout --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.
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.createdTo 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:
pf webhooks deliveries wh123 --failed
pf webhooks retry wh123 del456
pf webhooks test wh123Fix 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.