# Update an Amazon SNS channel

> **PUT** `https://api.us.nylas.com/v3/channels/sns/{id}`

Source: https://developer.nylas.com/docs/reference/api/amazon-sns-notifications/put-sns-by-id/

Updates the specified Amazon SNS notification channel.

When you make a `PUT` request, Nylas replaces all data in the nested object with the information
included in your request. For more information, see
[Updating objects](/docs/reference/api/#updating-objects).

**Authentication:** NYLAS_API_KEY

## Parameters

### Path parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `id` | string | Yes | The ID of the Amazon SNS channel to update. |

## Request body

The Amazon SNS channel properties to update.

Content-Type: application/json

- `description` (string) - A human-readable description of the Amazon SNS channel.
- `trigger_types` (array) - The event that triggers the notification. See the
[notification schemas](/docs/reference/notifications/) for details about each trigger
type.

See the [Grants](/docs/reference/api/manage-grants/), [Calendar](/docs/reference/api/calendar/),
[Events](/docs/reference/api/events/), and [Messages](/docs/reference/api/messages/) references
for information on how to trigger each event type.
- `topic` (string) - The Amazon SNS topic ARN that Nylas sends notifications to. Must start with `arn:aws:sns:`.
- `role_arn` (string) - The ARN of the IAM role that Nylas assumes to publish messages to the SNS topic.
- `status` (string) - The new status of the channel. Use this to restart a channel that you manually paused, or that was automatically paused due to deliverability issues.
- `notification_email_addresses` (array) - The email addresses that Nylas notifies if there are errors or deliverability problems. See the [rate limit documentation](/docs/dev-guide/best-practices/rate-limits/) for details.
- `compressed_delivery` (boolean) - If `true`, Nylas gzip-compresses and then base64-encodes notification payloads before delivering them. Nylas adds a `content_encoding: gzip+base64` message attribute to the SNS message. To decode, base64-decode the message body, then gzip-decompress.

## Responses

### 200 - Amazon SNS channel updated

- `data` (object)
  - `id` (string) - A unique identifier for the Amazon SNS channel.
  - `description` (string) - A human-readable description of the Amazon SNS channel.
  - `trigger_types` (array) - The event that triggers the notification. See the
[notification schemas](/docs/reference/notifications/) for details about each trigger
type.

See the [Grants](/docs/reference/api/manage-grants/), [Calendar](/docs/reference/api/calendar/),
[Events](/docs/reference/api/events/), and [Messages](/docs/reference/api/messages/) references
for information on how to trigger each event type.
  - `topic` (string) - The Amazon SNS topic ARN that Nylas sends notifications to.
  - `role_arn` (string) - The ARN of the IAM role that Nylas assumes to publish messages to the SNS topic.
  - `status` (string) - The deliverability status of the Amazon SNS channel.
  - `notification_email_addresses` (array) - The email addresses that Nylas notifies if delivery to the Amazon SNS channel fails.
  - `compressed_delivery` (boolean) - If `true`, Nylas gzip-compresses and then base64-encodes notification payloads before delivering them.
  - `status_updated_at` (integer) - The time the `status` field was last updated, represented as a Unix timestamp in seconds.
  - `created_at` (integer) - The time the Amazon SNS channel was created, represented as a Unix timestamp in seconds.
  - `updated_at` (integer) - The time the Amazon SNS channel was last updated, represented as a Unix timestamp in seconds.
- `request_id` (string) - The unique ID of the request that generated this response.

### 400 - Amazon SNS channel not updated

- `error` (object)
  - `type` (string) - An alphanumeric code that represents the error type.
  - `message` (string) - A human readable message with details about the error.
- `request_id` (string) - The unique ID of the request that generated this response.

## Code samples

### cURL

```bash
curl --request PUT \
  --url 'https://api.us.nylas.com/v3/channels/sns/<SNS_CHANNEL_ID>' \
  --header 'Content-Type: application/json' \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer <NYLAS_API_KEY>' \
  --data-raw '{
    "description": "Updated SNS channel",
    "trigger_types": ["event.created", "event.updated"],
    "topic": "arn:aws:sns:us-east-1:123456789012:my-updated-topic",
    "notification_email_addresses": ["sysadmin@example.com"]
  }'
```
