---
title: Amazon SQS
---
# Amazon SQS

Svix can deliver webhooks directly to an Amazon SQS queue, without your customers having to set up any listener endpoint or write any glue code.

When **Advanced Endpoint Types** is [enabled](/advanced-endpoints#enabling-advanced-endpoint-types), your customers will see the option to use an SQS destination in the [App Portal](/app-portal).

![SQS Endpoint Create](/img/advanced-endpoints/sqs-create.png)

They will be able to configure the connection right in the App Portal:

- `queueUrl` — the full URL of the SQS queue to send messages to.
- `region`, `accessKeyId`, `secretAccessKey` — the AWS region and credentials used to authenticate.

Every webhook in the batch is sent to the queue as a separate message.

# Transformations

By default, all SQS Endpoints come bundled with the following transformation code.

```JavaScript
/**
 * @param input - The input object
 * @param input.events - The array of webhooks in the batch. The number of webhooks in the batch is capped by the endpoint's batch size.
 * @param input.events[].payload - The message payload (string or JSON).
 * @param input.events[].eventType - The message event type (string).
 *
 * @returns Object containing the response.
 * @returns returns.messages - The array of SQS messages to send to the SQS queue.
 * @returns returns.messages[].payload - The payload of the message (string).
 */
function handler(input) {
  const messages = input.events.map((event) => ({
    payload: event,
  }));

  return {
    messages,
  };
}
```

`input.events` is the list of webhooks received by the endpoint, processed in batches.

Each entry in the returned `messages` array is sent as a separate SQS message, with its `payload` used as the message body. By default, each webhook is sent as its serialized JSON.

For example, if the endpoint receives the following messages:

```json
{
  "eventType": "user.created",
  "payload": "{\"email\": \"joe@enterprise.io\"}"
}
```

```json
{
  "eventType": "user.login",
  "payload": "{\"id\": 12, \"timestamp\": \"2025-07-21T14:23:17.861Z\"}"
}
```

The default transformation code would send two messages to your queue, with the following bodies.

```json
{"payload":{"email":"joe@enterprise.io"},"eventType":"user.created"}
```

```json
{"payload":{"id":12,"timestamp":"2025-07-21T14:23:17.861Z"},"eventType":"user.login"}
```

To control the message bodies, return your own array of `messages`. Each message's `payload` becomes the body of one SQS message.

SQS accepts at most 10 messages per batch request, so larger batches are automatically split across multiple `SendMessageBatch` calls.
