skills/deepgram-webhooks/SKILL.md
Receive and verify Deepgram webhooks (callbacks). Use when setting up Deepgram webhook handlers, processing transcription callbacks, or handling asynchronous transcription results.
npx skillsauth add hookdeck/webhook-skills deepgram-webhooksInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Deepgram webhooks (callbacks) are used to receive transcription results asynchronously. When you provide a callback URL in your transcription request, Deepgram immediately responds with a request_id and sends the transcription results to your callback URL when processing is complete.
// Express.js example
app.post('/webhooks/deepgram', express.raw({ type: 'application/json' }), (req, res) => {
// Verify webhook authenticity using dg-token header
const dgToken = req.headers['dg-token'];
if (!dgToken) {
return res.status(401).send('Missing dg-token header');
}
// Verify the token matches your expected API Key Identifier
// The dg-token contains the API Key Identifier used in the original request
if (dgToken !== process.env.DEEPGRAM_API_KEY_ID) {
return res.status(403).send('Invalid dg-token');
}
// Parse the transcription result
const transcriptionResult = JSON.parse(req.body.toString());
// Process the transcription
console.log('Received transcription:', transcriptionResult);
// Return success to prevent retries
res.status(200).send('OK');
});
Deepgram supports two authentication methods for webhooks:
// Using dg-token header (recommended)
const verifyDgToken = (req, res, next) => {
const dgToken = req.headers['dg-token'];
if (!dgToken || dgToken !== process.env.DEEPGRAM_API_KEY_ID) {
return res.status(403).send('Invalid authentication');
}
next();
};
// Basic Auth in callback URL
// https://username:[email protected]/webhooks/deepgram
curl \
--request POST \
--header 'Authorization: Token YOUR_DEEPGRAM_API_KEY' \
--header 'Content-Type: audio/wav' \
--data-binary @audio.wav \
--url 'https://api.deepgram.com/v1/listen?callback=https://your-domain.com/webhooks/deepgram'
Deepgram sends transcription results as webhook payloads. The structure varies based on the features enabled in your request:
| Field | Description | Always Present |
|-------|-------------|----------------|
| request_id | Unique identifier for the transcription request | Yes |
| created | Timestamp when transcription was created | Yes |
| duration | Length of the audio in seconds | Yes |
| channels | Number of audio channels | Yes |
| results | Transcription results by channel | Yes |
| results.channels[].alternatives | Transcription alternatives | Yes |
| results.channels[].alternatives[].transcript | The transcribed text | Yes |
| results.channels[].alternatives[].confidence | Confidence score (0-1) | Yes |
# Your Deepgram API Key (for making requests)
DEEPGRAM_API_KEY=your_api_key_here
# API Key Identifier (shown in Deepgram console, used to verify dg-token)
# Note: This is NOT your API Key secret - it's a unique identifier shown
# in the Deepgram console that identifies which API key was used for a request
DEEPGRAM_API_KEY_ID=your_api_key_id_here
# Your webhook endpoint URL
WEBHOOK_URL=https://your-domain.com/webhooks/deepgram
For local webhook testing, install Hookdeck CLI:
# Create a local tunnel (no account required)
npx hookdeck-cli listen 3000 deepgram --path /webhooks/deepgram
# Use the provided URL as your callback URL when making Deepgram requests
This provides:
dg-token header or Basic AuthFor production handlers, install the patterns skill alongside this one. Key references (links work when only this skill is installed):
development
Receive and verify Vercel webhooks. Use when setting up Vercel webhook handlers, debugging signature verification, or handling deployment events like deployment.created, deployment.succeeded, or project.created.
development
Receive and verify Twilio webhooks. Use when setting up Twilio webhook handlers, debugging X-Twilio-Signature verification, or handling communications events like incoming SMS, voice calls, message status callbacks (delivered, failed), or recording status callbacks.
development
Receive and verify Stripe webhooks. Use when setting up Stripe webhook handlers, debugging signature verification, or handling payment events like payment_intent.succeeded, customer.subscription.created, or invoice.paid.
development
Receive and verify Slack Events API webhooks. Use when setting up Slack webhook handlers, debugging Slack signature verification, handling the url_verification challenge, or processing events like app_mention, message, reaction_added, team_join, or app_home_opened.