setup-webhooks
Skill0 starsChanged 57 days agoMITView on GitHub
Create, test, verify, rotate, or troubleshoot ThunderPhone webhook endpoints. Use when someone asks for call events, incoming or complete notifications, webhook signing secrets, X-ThunderPhone-Signature verification, HMAC code in Python or TypeScript, retries, or duplicate delivery handling.
- Reads credentials
In this repository21 other files it gives its agents.
- AGENTS.mdAGENTS.md
- add-knowledgeSkill
- build-tool-integrationSkill
- create-agentSkill
- embed-web-widgetSkill
- get-phone-numberSkill
- handle-inbound-callsSkill
- iterate-on-agentSkill
- migrate-from-blandSkill
- migrate-from-elevenlabsSkill
- migrate-from-retellSkill
- migrate-from-vapiSkill
- place-outbound-callsSkill
- run-campaignSkill
- setup-api-keySkill
- test-agentSkill
- thunderphone-mcp-setupSkill
- thunderphone-prompt-builderSkill
- use-with-livekitSkill
- use-with-openai-realtimeSkill
- use-with-pipecatSkill
The file
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 2 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 84
Use webhook endpoints, events, and signature verification.
- Distinctive: line 85
Never log the endpoint signing secret, authorization header, or unredacted sensitive payload.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Set up signed webhooks
- Choose events. Subscribe only to required event families. Common choices
include
telephony.incoming,telephony.complete, tool and turn events,web.*,voice.*,call.graded,issue.reported,test-call.completed, andalert.triggered. Confirm exact values in the events reference. - Create an HTTPS receiver. Preserve the exact raw request bytes. Parse JSON only after signature verification. Return a fast success and queue slower work.
- Create the endpoint with
POST /v1/developer/webhook-endpoints. Capture the signing secret once into a secret manager; the create response does not make it safe to log.
{
"label": "Production call events",
"url": "https://example.com/thunderphone/hook",
"events": ["telephony.incoming", "telephony.complete"]
}curl --fail-with-body -X POST https://api.thunderphone.com/v1/developer/webhook-endpoints \
-H "Authorization: Bearer $THUNDERPHONE_API_KEY" \
-H "Content-Type: application/json" \
-H "X-ThunderPhone-Client: skills/setup-webhooks@1.0" \
--data-binary @webhook-endpoint.json- Verify every delivery. Compute HMAC-SHA256 over the raw bytes and compare
it with
X-ThunderPhone-Signaturein constant time.
import hashlib, hmac, os
def verify_thunderphone(raw_body: bytes, signature: str) -> bool:
expected = hmac.new(os.environ["THUNDERPHONE_WEBHOOK_SECRET"].encode(),
raw_body, hashlib.sha256).hexdigest()
return hmac.compare_digest(expected, signature)import { createHmac, timingSafeEqual } from "node:crypto";
export function verifyThunderPhone(rawBody: Buffer, signature: string): boolean {
const expected = createHmac("sha256", process.env.THUNDERPHONE_WEBHOOK_SECRET!)
.update(rawBody).digest("hex");
const received = Buffer.from(signature, "utf8");
const wanted = Buffer.from(expected, "utf8");
return received.length === wanted.length && timingSafeEqual(received, wanted);
}- Make processing idempotent. Deduplicate with the delivery/event ID. Store the event before performing side effects. Accept retries without repeating external writes.
- Test the endpoint using
POST /v1/developer/webhook-endpoints/{endpoint_id}/test, then trigger one real controlled event. - Verify. Confirm valid events pass, a changed byte or signature fails, the receiver returns quickly, and retrying the same event creates one effect.
Errors
| Symptom | Cause | Fix |
| Every signature fails | JSON was parsed/reserialized before hashing or wrong secret is loaded | Hash raw bytes and confirm the endpoint-specific secret. |
| Valid request crashes timing-safe compare | Encodings or lengths differ | Decode consistently and reject unequal lengths before comparison. |
| Duplicate side effects | Delivery was treated as exactly-once | Persist a delivery key and make consumers idempotent. |
| Test passes but real events do not | Wrong event selection or environment endpoint | Read the endpoint record and trigger the exact subscribed event. |
Source and safety rules
- Use webhook endpoints, events, and signature verification.
- Never log the endpoint signing secret, authorization header, or unredacted sensitive payload.
- Reject before parsing or acting when signature verification fails.
- A test delivery proves reachability, not every production event path.
See references/webhook-checklist.md.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

