Using webhooks to integrate with Amazon EventBridge

<div class="article-banners">
<div id="docs-wmp-link"><a href="https://support.zendesk.com/hc/en-us/articles/5411234991258-plan" rel="noopener" target="_blank">What's my plan?</a></div>
<div class="article-banner" id="suite_all">
<table>
<tbody>
<tr>
<td>
<strong>All Suites</strong>
</td>
<td>Team, Growth, Professional, Enterprise, or Enterprise Plus</td>
</tr>
</tbody>
</table>
</div>
<div class="article-banner" id="support_all">
<table>
<tbody>
<tr>
<td>
<strong>Support</strong>
</td>
<td>Team, Professional, or Enterprise</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="body">
<div class="note fastpath" style="margin-right: 0px;">
<span class="fastpathtitle">Location: </span> <span class="ph">Admin Center &gt; Apps and integrations &gt; Actions and webhooks
&gt; Webhooks</span>
</div>
<p class="p">Zendesk webhooks are a powerful tool to keep your other systems updated with changes in
your Zendesk account. Using webhooks to integrate with Amazon EventBridge creates the
opportunity for more sophisticated workflows with real-time data processing. This
article describes how to use webhooks to send Zendesk events to Amazon EventBridge.</p>
<div class="p">This article contains the following topics:<ul class="ul" id="topic_z2c_mtf_3cc__ul_t3t_b5f_3cc">
<li class="li"><a class="xref" href="#topic_hkx_h5f_3cc">Requirements for sending events to Amazon EventBridge with webhooks</a></li>
<li class="li"><a class="xref" href="#topic_chx_b5f_3cc">Creating your EventBridge event bus</a></li>
<li class="li"><a class="xref" href="#topic_rwc_25f_3cc">Creating a Lambda function to receive the webhook payload</a></li>
<li class="li"><a class="xref" href="#topic_ijk_h5f_3cc">Creating a Zendesk webhook to connect to Amazon EventBridge</a></li>
</ul>
</div>
</div>
<div aria-labelledby="ariaid-title2" class="topic nested1" id="topic_hkx_h5f_3cc">
<h2 class="title topictitle2" id="ariaid-title2">Requirements for sending events to Amazon EventBridge with webhooks</h2>
<div class="body">
<div class="p">The following requirements must be met to use webhooks to connect with Amazon
EventBridge:<ul class="ul" id="topic_hkx_h5f_3cc__ul_kkj_bvf_3cc">
<li class="li">You must be an admin in your Zendesk account.</li>
<li class="li">You must have an AWS account with EventBridge set up.<p class="p">Additionally, you
should have a basic understanding of AWS services, including
EventBridge.</p>
</li>
</ul>
</div>
</div>
</div>
<div aria-labelledby="ariaid-title3" class="topic nested1" id="topic_chx_b5f_3cc">
<h2 class="title topictitle2" id="ariaid-title3">Creating your EventBridge event bus</h2>
<div class="body">
<p class="p">Before creating the webhook, you must <a class="xref" href="https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-create-event-bus.html" target="_blank">create an EventBridge event bus</a>. </p>
<div class="p">Note the <strong class="ph b">ARN</strong>, which is required in a later step. The ARN should be formatted
in the following way:
<pre class="pre codeblock"><code>arn:aws:events:{REGION}:{AWS_ID}:event-bus/{EVENT_BUS_ID}</code></pre>
</div>
</div>
</div>
<div aria-labelledby="ariaid-title4" class="topic nested1" id="topic_rwc_25f_3cc">
<h2 class="title topictitle2" id="ariaid-title4">Creating a Lambda function to receive the webhook payload</h2>
<div class="body">
<p class="p">A Lambda function is required to receive the webhook, confirm the webhook's
signature, and pass the webhook payload on to the EventBridge event bus you
created.</p>
<div class="p">
<strong class="ph b">To create a Lambda function</strong><ol class="ol" id="topic_rwc_25f_3cc__ol_sdy_xwf_3cc">
<li class="li">Use the <a class="xref" href="https://console.aws.amazon.com/lambda/" target="_blank">AWS Lambda console</a> to <a class="xref" href="https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-run-lambda-schedule.html#eb-create-lambda-function" target="_blank">create a new Lambda function</a>.
Complete the fields as need. Under the <strong class="ph b">Advanced settings</strong>, select
<strong class="ph b">Enable function URL</strong> and then select <strong class="ph b">NONE</strong> for the
authentication method.<p class="p">Note the <strong class="ph b">Function URL</strong>. This is the public
URL you'll connect your webhook to.</p>
</li>
<li class="li">Add the following code to the <strong class="ph b">Code source</strong> window, then click
<strong class="ph b">Deploy</strong>.<pre class="pre codeblock"><code>import json
import hashlib
import hmac
import os
import base64
import logging

import boto3

LOGGER = logging.getLogger()
LOGGER.setLevel('INFO')

EVENTBRIDGE = boto3.client('events')

# Set these values in your Lambda function environment variables.
EVENT_BUS_ARN = os.environ['EVENT_BUS_ARN']
WEBHOOK_SECRET = os.environ['WEBHOOK_SECRET'].encode('utf-8')

def verify_signature(payload, signature, timestamp):
'''Verify the provided webhook signature was created by Zendesk's Webhook feature.'''
combined = timestamp + payload
combined_bytes = combined.encode('utf-8')
computed_hmac = hmac.new(WEBHOOK_SECRET, combined_bytes, hashlib.sha256)
computed_signature = base64.b64encode(computed_hmac.digest()).decode('utf-8')
return hmac.compare_digest(computed_signature, signature)

def webhook_to_eventbridge(event):
'''Forward the webhook body to AWS EventBridge.'''
payload = event['body']
signature = event['headers'].get('x-zendesk-webhook-signature', '')
timestamp = event['headers'].get('x-zendesk-webhook-signature-timestamp', '')

if not verify_signature(payload, signature, timestamp):
LOGGER.warning('Received webhook with invalid signature')
return {
'statusCode': 403,
'body': json.dumps({'message': 'Forbidden'}),
}

payload_dict = json.loads(payload) if isinstance(payload, str) else payload
event_source = payload_dict.get('source', 'webhook.custom')
detail_type = payload_dict.get('type', 'defaultDetailType')

put_events_response = EVENTBRIDGE.put_events(
Entries=[
{
'Source': event_source,
'DetailType': detail_type,
'Detail': json.dumps(payload_dict),
'EventBusName': EVENT_BUS_ARN,
}
]
)

response_entries = put_events_response.get('Entries', [])
if len(response_entries) == 0 or 'ErrorCode' in response_entries[0]:
LOGGER.error(f'Push to event bridge failed: {response_entries}')
return {
'statusCode': 500,
'body': json.dumps(
{
'message': 'Failed to send event to EventBridge',
'response': put_events_response,
}
),
}

return {
'statusCode': 200,
'body': json.dumps(
{
'message': 'Event successfully sent to EventBridge',
'response': put_events_response,
}
),
}

def lambda_handler(event, context):
try:
return webhook_to_eventbridge(event)
except Exception as e:
LOGGER.exception('Error handling webhook')
return {
'statusCode': 500,
'body': json.dumps({'message': 'Error handling webhook', 'error': str(e)}),
}
</code></pre>
</li>
<li class="li">Add two environmental variables to the Lambda function:<ul class="ul" id="topic_rwc_25f_3cc__ul_bnk_fxf_3cc">
<li class="li">
<code class="ph codeph">EVENT_BUS_ARN</code>: Set this to the <strong class="ph b">ARN</strong> value you
got when <a class="xref" href="#topic_chx_b5f_3cc">creating the
EventBridge event bus</a>. This is the event bus
location.</li>
<li class="li">
<code class="ph codeph">WEBHOOK_SECRET</code>: After you <a class="xref" href="#topic_ijk_h5f_3cc">create the
webhook</a>, you'll need to set this to the webhook
secret.</li>
</ul>
</li>
<li class="li">Use the <a class="xref" href="https://console.aws.amazon.com/iam/" target="_blank">AWS IAM console</a> to <a class="xref" href="https://docs.aws.amazon.com/lambda/latest/dg/lambda-intro-execution-role.html" target="_blank">create a role</a> for the AWS Lambda
service.<p class="p">Note the role's name. You'll need this information to assign
the role to your Lambda function.</p>
</li>
<li class="li">After creating the role, edit it to add the EventBridge event bus
<strong class="ph b">ARN</strong>. <ol class="ol" id="topic_rwc_25f_3cc__ol_h1t_n3g_3cc" type="a">
<li class="li">Open the role.</li>
<li class="li">Under <strong class="ph b">Step 2: Add permissions</strong> click <strong class="ph b">Edit</strong> and select
<strong class="ph b">Create inline policy.</strong>
</li>
<li class="li">Search for <strong class="ph b">EventBridge</strong> services and select the
<strong class="ph b">PutEvents</strong> method.</li>
<li class="li">Under <strong class="ph b">Resources</strong>, click <strong class="ph b">Add ARNs</strong>.</li>
<li class="li">Enter the <a class="xref" href="#topic_chx_b5f_3cc">EventBridge
event bus</a> ARN and click <strong class="ph b">Next</strong>.</li>
<li class="li">Enter a <strong class="ph b">Name</strong> for your policy and click <strong class="ph b">Create
policy</strong>.</li>
</ol>
</li>
<li class="li">Use the <a class="xref" href="https://console.aws.amazon.com/lambda/" target="_blank">AWS Lambda console</a> to open the Lambda function
you created and assign the IAM role to it. On the <strong class="ph b">Configuration</strong> tab,
select <strong class="ph b">Permissions</strong> and click <strong class="ph b">Edit</strong>. At the bottom of the page,
select the role's name and click <strong class="ph b">Save</strong>.</li>
</ol>
</div>
</div>
</div>
<div aria-labelledby="ariaid-title5" class="topic nested1" id="topic_ijk_h5f_3cc">
<h2 class="title topictitle2" id="ariaid-title5">Creating a Zendesk webhook to connect to Amazon EventBridge</h2>
<div class="body">
<p class="p">After creating the EventBridge event bus and configuring the Lambda function, you
need to create the webhook itself.</p>
<div class="p">
<strong class="ph b">To create a webhook to integrate with Amazon EventBright</strong><ol class="ol" id="topic_ijk_h5f_3cc__ol_q2q_4lg_3cc">
<li class="li"><span class="ph">In <a class="xref" href="https://support.zendesk.com/hc/en-us/articles/4581766374554#topic_hfg_dyz_1hb" target="_blank">Admin Center</a>, click <img class="image" id="topic_ijk_h5f_3cc__d8e1738" src="https://zen-marketing-documentation.s3.amazonaws.com/docs/en/ac_apps_integrations_icon.png">
<strong class="ph b">Apps and integrations</strong> in the sidebar, then select <strong class="ph b">Actions and webhooks &gt;
Webhooks</strong>.</span></li>
<li class="li">
<a class="xref" href="https://support.zendesk.com/hc/en-us/articles/4408839108378" target="_blank">Create the webhook</a>, making sure to
specify the following values:<ul class="ul" id="topic_ijk_h5f_3cc__ul_wzr_5lg_3cc">
<li class="li">Set the <strong class="ph b">Endpoint URL</strong> to the <strong class="ph b">Function URL</strong> you got when
you <a class="xref" href="#topic_rwc_25f_3cc">created the Lambda
function</a>.</li>
<li class="li">Set <strong class="ph b">Authentication</strong> to <strong class="ph b">None</strong>.</li>
</ul>
</li>
<li class="li">Click <strong class="ph b">Create webhook</strong>.</li>
</ol>
<div class="note">
<span class="notetitle">Note:</span> Zendesk generates a secret key during the creation process for each
webhook. To successfully connect your webhook to Amazon EventBridge, you must
copy and paste this secret key into your Lambda function's
<code class="ph codeph">WEBHOOK_SECRET</code> environmental variable. See <a class="xref" href="#topic_rwc_25f_3cc">Creating a Lambda function to receive the webhook payload</a>.</div>
</div>
<div class="p">
<div class="note">
<span class="notetitle">Note:</span> This article, including the integration code, is provided for general
informational purposes only. Zendesk does not support or guarantee the code.
Zendesk also can't provide support for third-party technologies, such as Amazon
EventBridge. Post any issues you have in the comments section or try searching
for a solution online.</div>
</div>
</div>
</div>
<script id="docs-schema-markup" type="application/ld+json">{
"@context": "https://schema.org",
"@type": "TechArticle",
"@id": "https://support.zendesk.com/hc/en-us/articles/7778413975322",
"url": "https://support.zendesk.com/hc/en-us/articles/7778413975322-Using-webhooks-to-integrate-with-Amazon-EventBridge",
"headline": "Using webhooks to integrate with Amazon EventBridge",
"description": "You can use webhooks to send events from your system to Amazon EventBridge by creating an EventBridge event bus, configuring a Lambda function to handle webhook payloads, and setting up the webhook with the Lambda function URL and secret key.",
"articleSection": "Extending Zendesk",
"datePublished": "2024-08-08T23:01:46+00:00",
"dateModified": "2025-09-05T23:16:24+00:00",
"inLanguage": "en-US",
"mainEntityOfPage": {
"@type": "WebPage",
"@id": "https://support.zendesk.com/hc/en-us/articles/7778413975322"
},
"author": {
"@type": "Organization",
"name": "Zendesk",
"@id": "https://www.zendesk.com"
},
"publisher": {
"@type": "Organization",
"name": "Zendesk",
"@id": "https://www.zendesk.com"
},
"isPartOf": {
"@type": "WebSite",
"name": "Zendesk Help",
"@id": "https://support.zendesk.com/hc/"
},
"about": {
"@type": "SoftwareApplication",
"name": "Zendesk",
"@id": "https://www.zendesk.com"
}
}</script><script id="fast-path-script">
//<![CDATA[
const fast_path_style = document.createElement('style');
fast_path_style.innerHTML = `#article-body .fastpath{font-size:.9em;background-color:#f3f3f3;border:1px solid #d3d3d3;padding:10px 10px 8px;margin-bottom:16px}#article-body .fastpath::before{content:none!important}`;
document.head.appendChild(fast_path_style);
//]]>
</script>