Setting Up Webhooks
Webhooks let Helmdesk push real-time event notifications to your server. Instead of polling the API for changes, your application receives an HTTP POST request the moment something happens — a ticket is created, a reply is added, a status changes.
How Webhooks Work
Creating a Webhook
After creation, Helmdesk generates a signing secret for your webhook. Copy and store it securely — you will use it to verify that incoming requests are genuinely from Helmdesk.
Supported Events
Helmdesk can notify your server about the following events:
Ticket Events
ticket.created — A new ticket is submitted (via dashboard, API, widget, or email)ticket.updated — A ticket's status, priority, or assignee changesticket.replied — A new reply is added to a ticket (staff or customer)ticket.closed — A ticket is marked as closedticket.reopened — A closed ticket is reopenedticket.deleted — A ticket is permanently deletedEmail Events
email.received — An inbound email is received and processedemail.sent — A transactional email is sent successfullyemail.bounced — An email bounces (hard or soft)email.complained — A recipient marks an email as spamArticle Events
article.published — A knowledge base article is publishedarticle.updated — A published article is modifiedPayload Format
Every webhook delivery is an HTTP POST with a JSON body. The structure is consistent across all event types:
{
"event": "ticket.created",
"timestamp": "2025-01-15T10:30:00Z",
"projectId": "60bf071a-927c-4c38-81d2-f0221fe138e4",
"data": {
"id": "ticket-uuid",
"subject": "Cannot reset password",
"status": "open",
"priority": "high",
"customerEmail": "user@example.com",
"customerName": "Jane Doe",
"createdAt": "2025-01-15T10:30:00Z"
}
}
The data field contains the full resource object relevant to the event. For ticket events, it includes the ticket. For email events, it includes the email log entry.
Verifying Webhook Signatures
Every webhook request includes an x-helmdesk-signature header. Use this to verify the request came from Helmdesk and was not tampered with.
The signature is an HMAC-SHA256 hash of the raw request body, using your webhook's signing secret as the key.
import crypto from 'crypto'
function verifyWebhookSignature(
body: string,
signature: string,
secret: string
): boolean {
const expected = crypto
.createHmac('sha256', secret)
.update(body)
.digest('hex')
return crypto.timingSafeEqual(
Buffer.from(signature),
Buffer.from(expected)
)
}
Always verify signatures before processing webhook payloads. Reject any request where the signature does not match.
Retry Policy
If your endpoint returns a non-2xx status code or does not respond within 10 seconds, Helmdesk retries the delivery:
After 5 failed retries, the delivery is marked as failed. You can view failed deliveries in the webhook settings page and manually retry them.
If your endpoint fails consistently (10 consecutive failures), the webhook is automatically disabled. You will receive an email notification when this happens.
Best Practices
x-helmdesk-signature header before trusting the payload.Common Use Cases
Testing Webhooks
During development, use a tool like ngrok to expose your local server to the internet:
ngrok http 3000
Use the ngrok URL as your webhook endpoint while developing. Switch to your production URL before going live.
You can also use the Test button on the webhook settings page to send a sample event to your endpoint without waiting for a real event to occur.
Was this article helpful?