By now you can receive deliveries, verify them, and survive retries. This page is the operational layer — how you actually create the webhook records, list them, take one offline, or rotate a leaked secret. There are three HTTP endpoints, all underDocumentation Index
Fetch the complete documentation index at: https://docs.photon.codes/docs/llms.txt
Use this file to discover all available pages before exploring further.
https://spectrum.photon.codes/projects/{projectId}/webhooks/. Every example below uses curl. The same operations are also available through the Webhook tab of the Spectrum dashboard, the API reference, and any HTTP client (Postman, Insomnia, a language SDK, etc.) — see Three ways to manage webhooks on the overview for details.
Authentication
Every request uses HTTP Basic auth where the username is yourprojectId and the password is your projectSecret. The projectId also appears in the URL path — both are required.
photon projects regenerate-secret <id> (see the CLI projects docs) if they leak.
Register a webhook
200 OK):
Errors
| Status | When it happens | What to do |
|---|---|---|
422 | webhookUrl fails schema validation (empty, malformed, etc.) | Send a syntactically valid URL string |
409 | The same URL is already registered for this project | List existing webhooks, or delete the old one and re-register |
401 | Bad project credentials | Rotate via the CLI and try again |
URL requirements
- Should be
https://. We accepthttp://URLs today and don’t reject them at registration, but delivery is then sent in plaintext — anyone on the network path can read the payload and forge requests. Treat HTTPS as a hard requirement for any non-toy webhook. - Must be reachable from the public internet — if Spectrum can’t reach it, every delivery fails after the retry budget exhausts.
- Path component is yours to choose; we POST to it as-is.
List registered webhooks
The list response does not include
signingSecret. It’s only ever returned at creation time. Treat the secret like a password — if you need it back, rotate by deleting and re-registering.Delete a webhook
200, no further events are delivered to that URL. A delivery already in flight at the moment of deletion may still complete (the worker won’t abort an in-progress POST).
The delete is logical — the row is soft-deleted with a deletedAt timestamp on our side. The id and signingSecret are gone forever; re-registering the same URL produces a brand-new webhook with a new id and a new secret.
Errors
| Status | When it happens |
|---|---|
404 | The id doesn’t exist or has already been deleted |
Rotating the signing secret
There is no dedicated rotation endpoint. To rotate, delete and re-register:Multiple webhooks per project
You can register as many URLs as you need. Each one:- Has its own
id. - Has its own
signingSecret. - Receives every event for the project (no per-URL filtering yet).
- Is delivered in parallel with the others — one failing URL doesn’t delay the others.
| Pattern | Setup |
|---|---|
| Prod + staging mirror | Register both URLs. Staging receives a copy of every prod event for testing. |
| Multi-service fan-out | Register one URL per consumer service. Each gets its own copy. |
| Backup endpoint | Register a logging service in addition to your main handler. If your main handler is down, the logger still gets it for replay later. |
2xx the rest.
Working with the CLI
A first-classphoton webhooks CLI is on the roadmap. Until then, wrap the curl commands above in a shell function or use photon projects show --json to find your credentials and pipe them in.
Working with the dashboard
The same operations are available as a UI in the Spectrum dashboard under the Webhook tab of a workspace (alongside Platforms, Users, Lines, and Settings). The tab contains:- A list of every registered webhook — endpoint URL and registration date.
- An + Add webhook button. The signing secret is shown once in a modal after registration; it cannot be retrieved later.
- A Remove button on each row. Same effect as the
DELETEendpoint: delivery stops immediately and the signing secret is invalidated.
Common workflows
”I lost my secret”
- List webhooks, find the one you’ve lost the secret for.
- Delete it.
- Re-register the same URL — store the new secret immediately.
- Update your server.
”I’m changing my URL”
- Register the new URL (you’ll get a new secret).
- Update your DNS / ingress so the new URL points at your server.
- Once you’ve confirmed events are arriving on the new URL, delete the old one.
”I’m rotating credentials after a leak”
- Rotate the project secret first via
photon projects regenerate-secret <id>. This invalidates Basic auth on management endpoints, so an attacker can’t make further changes. - Rotate every webhook signing secret using the delete-and-recreate flow above.
Where to next
You can register, list, delete, and rotate. If you’re hitting a snag along the way — a verify that won’t pass, a webhook that registers but never delivers, a duplicate that won’t go away — the next chapter is the triage guide.Troubleshooting
Common signature errors, missed deliveries, duplicates, ngrok issues, and how to debug them.
API reference
Schema and live request playground for every endpoint on this page.