Skip to main content
Telnyx signs every webhook delivery with an ED25519 signature carried in the telnyx-signature-ed25519 and telnyx-timestamp request headers. The SDK’s webhook service verifies the signature against your account’s public key and parses the payload into a typed event. Copy your public key from the Mission Control Portal and expose it as TELNYX_PUBLIC_KEY (or the telnyx.publicKey system property) — TelnyxOkHttpClient.fromEnv() reads it automatically, the same way it reads TELNYX_API_KEY:

Verify and parse an event

Pass the raw request body and the request headers from your HTTP framework to client.webhooks().unwrap():
unwrap(UnwrapWebhookParams) throws TelnyxWebhookException when the signature does not match and TelnyxInvalidDataException when the payload cannot be parsed.

Skipping verification

client.webhooks().unsafeUnwrap(body) — and the single-argument unwrap(String body) overload — parse a payload without checking the signature. Only use them for payloads you have already verified by other means, or in tests.