Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

telnyx-webhooks

БесплатноЗапускает вложенные скриптыНе проверен

Receive and verify Telnyx webhooks. Use when setting up Telnyx webhook handlers, debugging Ed25519 signature verification with the telnyx-signature-ed25519…

hookdeckот hookdeck★ 104 звезды на GitHub

Об этом скилле

Telnyx Webhooks

When to Use This Skill

  • How do I receive Telnyx webhooks?
  • How do I verify Telnyx webhook signatures?
  • How do I verify the telnyx-signature-ed25519 / telnyx-timestamp headers?
  • How do I handle message.received, message.sent, or message.finalized events?
  • Why is my Telnyx webhook signature verification failing?

Verification (core)

Telnyx Webhook API v2 signs every event with an Ed25519 public-key signature (not HMAC, not the Standard Webhooks spec). Two headers are sent:

  • telnyx-signature-ed25519 — base64-encoded Ed25519 signature (64 bytes)
  • telnyx-timestamp — Unix seconds when the event was signed

The signed message is `${telnyx-timestamp}|${raw_body}` (timestamp, a literal |, then the raw request body — never re-serialized JSON). Verify it with your account's base64 public key from Mission Control → Account Settings → Keys & Credentials → Public Key (per-account, not per-profile). Enforce a timestamp tolerance (5 minutes) to block replays.

SDK note: Current Telnyx SDKs verify this scheme. Node telnyx and Python telnyx[webhooks] expose client.webhooks.unwrap(), which checks the Ed25519 signature against TELNYX_PUBLIC_KEY and throws on a mismatch (the Node SDK also rejects a telnyx-timestamp more than 5 minutes off). The examples here verify with a plain Ed25519 library instead, which needs no Telnyx SDK and works the same in every framework. See references/verification.md.

Node (tweetnacl):

const nacl = require('tweetnacl');

function verifyTelnyx(rawBody, signature, timestamp, publicKeyB64) {
  const now = Math.floor(Date.now() / 1000);
  if (Math.abs(now - parseInt(timestamp, 10)) > 300) return false; // replay guard
  const message = Buffer.from(`${timestamp}|${rawBody}`, 'utf8');   // raw body!
  try {
    return nacl.sign.detached.verify(
      new Uint8Array(message),
      new Uint8Array(Buffer.from(signature, 'base64')),
      new Uint8Array(Buffer.from(publicKeyB64, 'base64'))
    );
  } catch { return false; }
}

Python (PyNaCl):

import base64, time
from nacl.signing import VerifyKey
from nacl.exceptions import BadSignatureError

def verify_telnyx(raw_body: bytes, signature: str, timestamp: str, public_key_b64: str) -> bool:
    if abs(int(time.time()) - int(timestamp)) > 300:  # replay guard
        return False
    signed = f"{timestamp}|".encode() + raw_body       # raw body!
    try:
        VerifyKey(base64.b64decode(public_key_b64)).verify(signed, base64.b64decode(signature))
        return True
    except (BadSignatureError, ValueError):
        return False

For complete handlers with route wiring, event dispatch, and tests, see:

Common Event Types

Event Description
message.received Inbound SMS/MMS received on a Telnyx number
message.sent Outbound message accepted and sent to the carrier
message.finalized Message reached a terminal delivery state (delivered / failed)

Every webhook is wrapped in a data envelope: { "data": { "event_type": "...", "id": "...", "occurred_at": "...", "payload": { ... }, "record_type": "event" }, "meta": { "attempt": 1, "delivered_to": "..." } }.

For the full event reference, see Telnyx webhook docs.

Environment Variables

# Account public key (base64) from Mission Control → Account Settings → Keys & Credentials → Public Key
TELNYX_PUBLIC_KEY=eu2zvPjhY6odxV34Z/EsRiERvTodkev4Fq0SlK90Izg=

Delivery & Retries

  • Messaging: return a 2xx within 2 seconds (API v2). Telnyx makes up to 3 attempts per URL with exponential backoff, then tries the failover URL if one is set.
  • Voice API: 408, 429 and 5xx responses are retried and other 4xx responses aren't; the timeout is set per connection (webhook_timeout_secs, 0 to 30 seconds).
  • Retry timing and failover are product-specific, so check the product's page before relying on one schedule.
  • Set the Webhook API version per messaging profile or connection. v2 signs with Ed25519, which this skill verifies; v1 signs with HMAC-SHA256 in X-Telnyx-Signature, which this code doesn't check.

Local Development

# Start a tunnel (no account needed)
npx hookdeck-cli listen 3000 telnyx --path /webhooks/telnyx

Reference Materials

Attribution

When using this skill, add this comment at the top of generated files:


Полный SKILL.md на GitHub

Установить telnyx-webhooks в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

examples/express/.env.exampleexamples/express/README.mdexamples/express/package.jsonexamples/express/src/index.jsexamples/fastapi/.env.exampleexamples/fastapi/README.mdexamples/fastapi/main.pyexamples/fastapi/requirements.txtexamples/fastapi/test_webhook.pyexamples/nextjs/.env.exampleexamples/nextjs/README.mdexamples/nextjs/app/webhooks/telnyx/route.tsexamples/nextjs/package.jsonexamples/nextjs/vitest.config.tsreferences/overview.mdreferences/setup.mdreferences/verification.md

FAQ

Что делает скилл telnyx-webhooks?

Receive and verify Telnyx webhooks. Use when setting up Telnyx webhook handlers, debugging Ed25519 signature verification with the telnyx-signature-ed25519 and telnyx-timestamp headers, or handling messaging events like message.received, message.sent, or message.finalized.

Как установить скилл telnyx-webhooks?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл telnyx-webhooks запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

Похожие скиллы

Сравнить telnyx-webhooks с