# Sending Webhooks to AWS SQS

Open Loyalty now allows you to send webhook events directly to an **Amazon Web Services (AWS) Simple Queue Service (SQS)** queue.&#x20;

This new functionality is ideal when you need to process events asynchronously, ensuring that your system can handle high volumes of data without being overwhelmed by direct HTTP requests. Instead of sending real-time data to an external system via an HTTPS request, events are pushed to an SQS queue, **where they can be processed at your own pace.**

***

### Step-by-step instructions

To configure Open Loyalty to send webhooks to AWS SQS, follow these steps:

{% stepper %}
{% step %}
**Navigate to Webhook Configuration**

In the Open Loyalty admin panel, go to the section where you configure webhooks.

<figure><img src="https://123136216-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgIv2CyIIYf7vRfuhMKQ6%2Fuploads%2Fg2hP7tOSo3pm9XyxcMLW%2Fimage.png?alt=media&#x26;token=98306dbc-25bc-4012-85a3-9b2338a8cd1d" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}
**Create a New Webhook Subscription**

Click on the button **Add webhook**.

<figure><img src="https://123136216-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgIv2CyIIYf7vRfuhMKQ6%2Fuploads%2FhdKzDevL96XV5zKiZD5z%2Fimage.png?alt=media&#x26;token=1718c8c0-90be-4e5b-b5b3-37044402ccc5" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}
**Select Integration Type**

Under **Integration type**, choose the **Send to queue** option.

<figure><img src="https://123136216-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgIv2CyIIYf7vRfuhMKQ6%2Fuploads%2F4LMyMDHG5juyUtsXQ8rV%2Fimage.png?alt=media&#x26;token=41747f25-e4a4-4c8f-b533-7253a2d0a546" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}
**Select Webhook Name**

Select the webhook name (or subscribe to all webhooks) that you want to receive.

<figure><img src="https://123136216-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgIv2CyIIYf7vRfuhMKQ6%2Fuploads%2Ff8OUVudvFfVZRxwibCZQ%2Fimage.png?alt=media&#x26;token=2b882e34-6b91-4b09-a78d-cb3d852b9b41" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}
**Enter Queue URL**

Input the Queue URL for your AWS SQS queue. This URL identifies the specific SQS queue where events will be sent.

<figure><img src="https://123136216-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgIv2CyIIYf7vRfuhMKQ6%2Fuploads%2FMg3Cujwq0sWu2lbhGLy6%2Fimage.png?alt=media&#x26;token=2c1a151d-e7f9-43e0-9ccf-f976f0d0d3a8" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}
**Enter Access Key**

Enter your Access key. This is the access key created when you set up security credentials for your SQS user account in AWS.

<figure><img src="https://123136216-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgIv2CyIIYf7vRfuhMKQ6%2Fuploads%2FlRAJLNJKpse34CBSRXHR%2Fimage.png?alt=media&#x26;token=ff92e591-4179-4107-86b3-dd24b58c5af7" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}
**Enter Secret Key**

Enter your Secret key. This is the secret key created when you set up security credentials for your SQS user account in AWS.

<figure><img src="https://123136216-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgIv2CyIIYf7vRfuhMKQ6%2Fuploads%2FEqAfly9qe7tJaBbJQ7v1%2Fimage.png?alt=media&#x26;token=99a34a72-32f2-4653-90ca-a06d427fb56a" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}
**Enable Payload Encryption (Optional)**

If you need to ensure secure delivery of your webhook data, you can enable the Encrypt payload toggle. When enabled, the webhook payload will be encrypted before being sent to the SQS queue.

<figure><img src="https://123136216-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgIv2CyIIYf7vRfuhMKQ6%2Fuploads%2FqRp2lFyAiZj7dGLDFRaD%2Fimage.png?alt=media&#x26;token=ef7c887e-c142-4e83-a33f-0a3f66adef0e" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}
**Save Configuration**

Once all the required fields are filled, save your webhook configuration by clicking **Add webhook** button.
{% endstep %}
{% endstepper %}

***

### Final tips and comments

* **Asynchronous Processing:** \
  Sending webhooks to SQS is particularly useful for asynchronous processing. This means your application doesn't have to immediately respond to every webhook event, allowing for more robust and scalable integrations.
* **Error Handling and Retries:** \
  AWS SQS automatically handles message durability and offers features like Dead-Letter Queues (DLQs), which can be very helpful for managing messages that fail processing.
* **AWS Credentials:** \
  Ensure that the AWS Access Key and Secret Key you use have the necessary permissions to send messages to the specified SQS queue. Granting the least privilege is a security best practice.
* **Queue Visibility Timeout:** \
  Be mindful of your SQS queue's visibility timeout setting. This determines how long messages are invisible to other consumers after being picked up, preventing multiple consumers from processing the same message.
* **Payload Encryption**\
  When using payload encryption, ensure that your receiving system (the SQS consumer) is capable of decrypting the payload using the corresponding key or method. This adds an extra layer of security for sensitive data.
