Index of every page on this site: llms.txt
All skills
jeremylongshore avatar

/elevenlabs-webhooks-events

@0d57af8
Run it yourself

Implement ElevenLabs webhook HMAC signature verification and event handling. Use when setting up webhook endpoints for transcription completion, call recording, or agent conversation events from ElevenLabs. Trigger with "elevenlabs webhook", "elevenlabs events", "elevenlabs webhook signature", "handle elevenlabs notifications", "elevenlabs post-call webhook", "elevenlabs transcription webhook".

Use this Skill: https://skilld.dev/gh/jeremylongshore/tons-of-skills-marketplace/elevenlabs-webhooks-events

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

SKILL.md

≈106 tokens for metadata: the name and description. ≈1.6k when used: this file. ≈1.8k more on demand in 2 files.

Description uses 5.3% of example budget

Before choosing a Skill, your Agent reads its name and description. All available Skills share that space.

  • A shorter description leaves more room for other Skills. This entry exceeds our 1% size suggestion.

In our Claude Code example, all Skill names and descriptions share 8,000 characters. This Skill uses ≈426 characters, or 5.3%.

The 1% threshold is a size suggestion. Longer descriptions can still fit.

Your model, settings, and other Skills decide how much text your Agent can read.

Example settings and source

The example uses a 200k-token context and default Claude Code settings. The count includes the name, description, separators, and when_to_use when present. Codex also counts local file paths.

Skit's source and limits: Codex 0.160.1, Claude Code 2.1.292.

ElevenLabs Webhooks & Events

Overview

ElevenLabs webhooks send HTTP POST notifications when async operations complete: transcription completion, post-call data from Conversational AI agents, and call initiation failures. Every delivery is signed with an HMAC-SHA256 signature you must verify before processing. This skill builds a secure endpoint that verifies signatures, routes events by type, and acks fast to avoid auto-disable.

Prerequisites

  • ElevenLabs account (webhooks configured in Settings > Webhooks)
  • HTTPS endpoint accessible from the internet
  • Webhook secret (generated during webhook creation in dashboard)

Instructions

The full, copy-ready code for each step lives in references/implementation.md; per-event handlers live in references/examples.md. The high-level workflow:

  1. Know the event types — subscribe only to what you handle (table below).
  2. Create the webhook in the dashboard (Settings > Webhooks) and copy the HMAC secret.
  3. Verify the signature with HMAC-SHA256 over "<timestamp>.<raw_body>", using a timing-safe compare and a 5-minute replay window. See the full verifier.
  4. Handle the request with a raw body parser, ack 200 immediately, then process asynchronously. See the Express handler.
  5. Route events to per-type handlers. See handler examples.
  6. Guard against duplicates with idempotency keyed on the event ID. See idempotency.
  7. Test locally by tunneling with ngrok. See local testing.

Webhook event types

Event Type Payload When Triggered
post_call_transcription Full conversation transcript, analysis, metadata After Conversational AI call ends
post_call_audio Base64-encoded call audio, minimal metadata After call ends (if audio recording enabled)
call_initiation_failure Failure reason, metadata When an outbound call fails to connect
speech_to_text.completed Transcription result, word timestamps Async STT job completes

Signature verification skeleton

// src/elevenlabs/webhook-verify.ts — Header: t=<unix_ts>,v1=<hex_sig>
export function verifyWebhookSignature(rawBody, signatureHeader, secret) {
  const parts = new Map(signatureHeader.split(",").map(p => {
    const [k, ...v] = p.split("="); return [k, v.join("=")];
  }));
  const timestamp = parts.get("t"), signature = parts.get("v1");
  if (Math.floor(Date.now() / 1000) - parseInt(timestamp) > 300) {
    return { valid: false, reason: "Timestamp too old" };   // replay guard
  }
  const expected = crypto.createHmac("sha256", secret)
    .update(`${timestamp}.${rawBody.toString()}`).digest("hex");
  return { valid: crypto.timingSafeEqual(
    Buffer.from(signature, "hex"), Buffer.from(expected, "hex")) };
}

See references/implementation.md for the production-hardened version with full error handling.

Output

Applying this skill produces:

  • src/elevenlabs/webhook-verify.ts — reusable HMAC-SHA256 verifier with replay protection and timing-safe comparison.
  • src/api/webhooks/elevenlabs.ts — Express route that verifies signatures, acks 200 immediately, and routes events to per-type handlers.
  • Per-event handler functions (handleTranscription, handleCallAudio, handleCallFailure, handleSTTCompleted) extracting the fields each payload carries.
  • An idempotency wrapper keyed on event ID so retried deliveries are processed once.

At runtime a verified delivery returns { "received": true } with HTTP 200; a bad signature or expired timestamp returns HTTP 401 { "error": "Invalid signature" }.

Webhook Reliability

Behavior Detail
Retry policy ElevenLabs retries failed deliveries
Auto-disable After 10 consecutive failures AND 7+ days since last success
Timeout Your endpoint must respond within a few seconds
Re-enable Manually re-enable in dashboard after fixing the endpoint
Authentication HMAC-SHA256 via ElevenLabs-Signature header

Error Handling

Issue Cause Solution
Signature mismatch Wrong secret or body parsing Use express.raw(), verify secret matches dashboard
Webhook auto-disabled 10+ consecutive failures Fix endpoint, re-enable in dashboard
Duplicate events Retried delivery Implement idempotency with event ID tracking
Handler timeout Slow processing Return 200 immediately, process async
Replay attack Old timestamp reused Check timestamp age (reject > 5 min)

Examples

Route a decoded event to the right handler:

switch (event.type || event.event_type) {
  case "post_call_transcription": await handleTranscription(event); break;
  case "post_call_audio":         await handleCallAudio(event);     break;
  case "call_initiation_failure": await handleCallFailure(event);   break;
  case "speech_to_text.completed": await handleSTTCompleted(event); break;
  default: console.log("Unhandled event type:", event.type);
}

Simulate a delivery locally with curl:

curl -X POST http://localhost:3000/webhooks/elevenlabs \
  -H "Content-Type: application/json" \
  -H "ElevenLabs-Signature: t=$(date +%s),v1=test" \
  -d '{"type":"speech_to_text.completed","data":{"text":"Hello world"}}'

Full per-event handlers (transcript, audio, call-failure, STT) with the exact fields each payload carries are in references/examples.md.

Resources

Next Steps

For performance optimization, see the elevenlabs-performance-tuning skill, which covers connection pooling and batching to keep webhook handlers fast enough to ack within the ElevenLabs timeout window.

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

1 warning2mo3 checks · Risk SAFE
  • Gen Agent Trust Hub2mo

    This skill provides a secure and well-structured implementation for ElevenLabs webhook handling, featuring HMAC signature verification, replay protection, and secret management best practices.

  • Socket2mo

    No alerts

  • Snyk2mo

    Risk: MEDIUM · 1 issue

Signed by skilld at 0d57af8. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub yesterday.

Activeupdated 4 months ago
What it can do
Reads files Edits files Runs commands
version
1.6.0
author
Jeremy Longshore <jeremy@intentsolutions.io>
tags
[
  "saas",
  "voice",
  "ai",
  "elevenlabs",
  "webhooks",
  "events"
]
All 4 allowed tools
ReadWriteEditBash(curl:*)
Other metadata
compatibility
Designed for Claude Code

README badge

README badge for jeremylongshore/tons-of-skills-marketplace/elevenlabs-webhooks-events