You can create a webhook by combining a trigger or automation with an HTTP target in Zendesk Support. In web development, a webhook sends an HTTP request to a specified url in response to an event -- in this case, when a trigger or automation fires in Zendesk Support. Web developers typically use webhooks to invoke behavior in another system.
Topics covered in this article:
About webhooks
You can create webhooks with HTTP targets to build integrations with the services or with your back-end system. Examples:
- Alert your team in Slack when an urgent ticket is created
- Pass ticket details to your docs team in Asana after a ticket is resolved
- Notify your own backend service regarding an important ticket event
An HTTP target lets you pass information to third-party services and REST APIs that accept JSON, XML, or form-encoded content in HTTP requests. HTTP targets are used by automations and triggers in Zendesk Support when a ticket meets certain conditions. To learn more about targets, see Notifying external targets.
HTTP targets differ from URL targets. URL targets only support sending information in URL parameters, such as www.example.com?order=345
. HTTP targets support sending information in the request body of POST or PUT requests, a requirement for many third-party services and open APIs. The following is a JSON example:
You can use any of the available content placeholders to insert ticket data in the content.
For more information, see the Zendesk Support placeholder reference.
HTTP targets will not retry requests based on any response code returned by the target endpoint. The only scenario in which a HTTP target notification will retry is if a timeout error is received within 10 seconds of a request being made. This can happen up to a maximum of 21 times before the target is deactivated. See Avoiding timeout errors.
Creating a webhook
- In Zendesk Support, click the Admin icon (
) in the left sidebar, then select Settings > Extensions.
- Click the Targets tab and click Add Target.
- Select HTTP Target.
- Configure the target to integrate with the third-party service.
- Save the target.
- Use the target in a trigger or automation. See Using targets in automations and triggers.
Debugging a webhook
If the webhook isn't working correctly, you can use the Target Failures tab in the API dashboard to check for problems with the request.
- In Zendesk Support, click the Admin icon (
) in the left sidebar, then select Channels > API.
- Select the Target Failures tab.
For more information, see Using the API dashboard.
Examples
The following articles give examples of building integrations using webhooks.
- Integrating with Slack, by Steven Yan
- Integrating the HTTP Target with Trello, by Steven Yan
67 Comments
I tried clicking on the 'Integrating with Slack' link in the examples, but it says I'm not authorised to view the page. Is the example available elsewhere?
Hi Ola!
It looks like that article has been archived. I'm going to follow up with our Docs team to find out what's going on!
It should work now. The post used to be part of a community topic about a beta feature. We archived the topic after the feature was released. I moved the post back into a public topic.
Thanks, Charles!
Is there any way to remove signature from latest public comment data???
Hi Rahulg,
Could you tell me a little more about your use-case here? I'd like to help, but I'm not sure what you're hoping to achieve. Thanks in advance!
Incomplete documentation. No example for "Form Encoded" targets.
Thanks, Jehan. We'll let documentation know that this needs an update.
Does anyone have an example for integrating with Asana? I want to create an Asana task when a ticket is closed in Zendesk.
Hey Nathan -
It looks like Asana has an integration for creating tickets. I'm not sure whether it can be configured to create a task when a ticket is closed, but it does look like it can create a task when a new one is opened.
Can someone explain how Target Failures are displayed? Is it the last trailing X days, last X failure events, etc.? Thanks!
Hi Scott,
Please follow below
Admin --> Channels --> API --> Target Failures
Here you can see all the target failure and reason.
Thanks,
Kiran.
Thanks for jumping in, Kiran!
Hello,
Can you please elaborate on the Basic Authentication option of the webhook? We have created a webhook to update a Zendesk ticket (to add a CC and custom field value) and we want to use a wildcard for the authentication user and the token for the password.
Can I define "{{ticket.assignee.email}}\token" as username, with the token as the password?
Thank you for answering
Hey Raoul!
I don't actually know the answer to your question, but I'm going to check with some colleagues to see if I can find some info for you! Stand by!
Hey Raoul!
To step in and help Jessie on this one, you can't pass in that placeholder as a wildcard in your target/trigger workflow. It will pass over the placeholder string and not the value that would replace it in a ticket.
That said, I also wanted to warn you that we don't recommend updating tickets using a target directly, as it's very likely you'll encounter conflicts when trying to update a ticket this way.
I hope that clarifies that a little bit!
Hello Jessie and Josh,
Thanks for the feedback. For now we will use the trigger/webhook as we created it, with a fixed username.
We are aware that using this method is not optimal and can lead to conflicts. The reason that we used this method is because it is not easy to achieve our desired behaviour via normal trigger actions. We believe we are safe, as we change a custom field value and add an email to the CC, which are both not used in any other trigger or automation.
Just to give a sketch of our implemented behaviour: We have set the assignee to 2 fields: a custom field 'Last Worker' and add it to the CC. We do this, because we configure our system to unassign tickets after a period of assignee inactivity and an engineer can easily find back what they have been working on.
If we were to do this in a trigger we would need to create a trigger per assignee, which means creating a trigger for every new support engineer.
FYI: We are looking into creating a script that will create a Zendesk agent and matching trigger, plus can delete a user and the matching trigger. Then we can get rid of this construction.
Thanks for sharing your use case, Raoul! It's a really interesting workflow. Even though placeholder token won't work for you, I'm glad you found something that works. :)
Speaking of placeholders in HTTP targets -- we are successfully using placeholders in the URL, but I am wondering if conditionals would work?
Are internal notes also shown in the webhooks? Or only official replies?
Hey Charles,
That question is going to require a Ticket to get an answer. I'll be contacting you by email.
Thanks!
I'm interested in creating a hook where when a new ticket is created to pass along the requester's email address to a HTTP target. I will look up the requester's email address for customer information to put into the ticket.
From this documentation, I can see how I can pass the ticket info to my HTTP target, but I vaguely remember that the Tickets API can't see newly created tickets. There's a 15-minute delay.
Is there a workaround? Thanks in advance.
I don't think that's the case, David. I used to have a job check for new tickets every 5 minutes (this was for an internal resource that couldn't be a webhook). There may be a delay, but it's certainly not 15 minutes.
Are there any work-around for essentials license? As of now i'm working for the same 10min cron jobs that pull for tickets and customers.
If only zendesk is generous enough to open the API for webhooks for customer and tickets change, i can integrate my internal account software here easily. I think zendesk will be more competitive with other tools with this feature, or else I will create my own ticketing tool, and i'll put this on github as open source, I'll compete with you directly.
So i suggest to open it up, so it will be 1 lesser treat for your business. :)
Hi Rommel!
I'm afraid there's no work around for folks on the Essential plan. You'd need to upgrade to Team in order to use this solution.
Suppose we have a ticket with Hyperlink within the comment. We are sending an HTTP webhook to the external system upon each public comment added. So we would like to export that comment to another system.
The problem is that the Hyperlink is passed as a plain text in the comment__body. Can we override it somehow?
Our JSON:
{
"event": "comment",
"action": "public",
"comment": {
"author": "{{ticket.latest_comment.author.name}}" ,
"body": "{{ticket.latest_comment}}",
"created_at": "{{ticket.latest_comment.created_at_with_time}}",
"id": "{{ticket.latest_comment.id}}",
"public": "True",
"url": "{{ticket.latest_comment.url}}",
"ticket_url": "{{ticket.url}}",
"ticket_title": "{{ticket.title}}",
"ticket_external_id": "{{ticket.external_id}}"
}
}
we tried also to use all other options but none of them supplied a hyperlink migration: ticket.latest_comment_rich, ticket.latest_comment_formatted
By the way, despite your wiki, attachments work in both cases: ticket.latest_comment_rich, ticket.latest_comment_formatted.
"Code Block" doesnt work in ticket.latest_comment_rich
@dmitry So, do you have two external systems?
How I'd approach the problem would be that the target of your webhook should remove the comment via regular expression before sending it off to export.
Just sharing this community post as the request is valuable for the features in this post. The HTTP requests are restrictive without being to add headers.
https://support.zendesk.com/hc/en-us/community/posts/115000453227-Feature-request-Webhooks?page=1#community_comment_360004294193
Thanks for sharing Marty!
We'll pass this information over to the appropriate team to help provide visibility :)
If our Product Managers have any questions they'll reach out directly in that feedback post.
Cheers!
Is there a way to trigger a webhook when an article is updated?
Please sign in to leave a comment.