> ## Documentation Index
> Fetch the complete documentation index at: https://www.courier.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Install the Courier skill before writing code: `npx skills add trycourier/courier-skills`. It carries the verified SDK shapes and the rules you cannot get wrong.
> Authenticate every request with `Authorization: Bearer <API_KEY>`. A workspace has several environments and each has its own keys, which are plain `pk_` strings with no environment prefix. Start with Test.
> Send with `client.send.message`, the default import of the v7 Node SDK. Reference a template by its `nt_` id or its alias.
> A send accepts a bare Elemental element list, but storing content on a template requires the top-level elements wrapped in a channel element.
> Templates and journeys can be built in the Courier app or created through the API. Either way they live in the workspace and are referenced by ID when you send.
> The hosted MCP server is https://mcp.courier.com. For a briefing on what Courier is and when to use it, read https://www.courier.com/llms.txt.
> Prefer the Guides tab for how-do-I questions and the Docs tab for how-does-it-behave questions. The API reference lives under /api-reference.

# Send push with Amazon SNS for push through Courier

> Connect Amazon SNS for push with IAM credentials and target a topic or endpoint ARN.

export const Endpoint = ({method, path, name, href, children, bare}) => {
  const verb = String(method || "").toUpperCase();
  const title = verb + " " + path;
  const label = children || name || path;
  if (bare) {
    return href ? <a href={href}><code>{title}</code></a> : <code>{title}</code>;
  }
  if (!href) {
    return <span className="cx-endpoint" data-method={verb} title={title}>
        <span className="cx-endpoint-label">{label}</span>
        <span className="cx-endpoint-method">{verb}</span>
      </span>;
  }
  return <a className="cx-endpoint" data-method={verb} href={href} title={title}>
      <span className="cx-endpoint-label">{label}</span>
      <span className="cx-endpoint-method">{verb}</span>
    </a>;
};

export const AppLink = ({href, children, name, bare}) => {
  const label = children || name || "Open in Courier";
  if (bare) {
    return <a href={href} target="_blank" rel="noreferrer">{label}</a>;
  }
  return <a className="cx-endpoint" data-kind="app" href={href} target="_blank" rel="noreferrer">
      <span className="cx-endpoint-label">{label}</span>
      <span className="cx-endpoint-method" aria-hidden="true">↗</span>
    </a>;
};

export const Doc = ({href, children, name, bare}) => {
  const label = children || name || href;
  if (bare) {
    return <a href={href}>{label}</a>;
  }
  return <a className="cx-endpoint" data-kind="doc" href={href}>
      <span className="cx-endpoint-label">{label}</span>
      <span className="cx-endpoint-method">DOC</span>
    </a>;
};

Amazon Simple Notification Service, also written as Amazon SNS or AWS SNS, pushes to devices subscribed to an SNS topic or target ARN.

Its Courier provider key is `aws-sns`.

<Note>
  Amazon SNS also works as an SMS provider. See <Doc href="/docs/integrations/sms/aws-sns">Amazon SNS for SMS</Doc>.
</Note>

## Prerequisites

* [An AWS account with an IAM user for SNS](https://aws.amazon.com/)
* [Your Access Key ID and Secret Access Key](https://console.aws.amazon.com/iam/)
* The AWS region for your SNS topics

## Setup

<Steps>
  <Step title="Create an AWS access key">
    In AWS, create an IAM user with SNS publish permission and copy its [access key ID and secret access key](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html).
  </Step>

  <Step title="Configure in Courier">
    Open the <AppLink href="https://app.courier.com/integrations/catalog/aws-sns">Amazon SNS integration</AppLink> in Courier, enter your Access Key ID and Secret Access Key, choose your region, then click "Complete."
  </Step>
</Steps>

You only add the integration once. It is then available as a provider on both the push and SMS channels.

<Warning>
  Leave Topic ARN empty to push to individual devices. A saved Topic ARN outranks the Target ARN on a recipient's profile, so every push goes to the topic instead. See [Destination precedence](#destination-precedence).
</Warning>

## Profile requirements

Device tokens live on the user profile rather than on the send, so one profile can hold tokens for several devices and every push provider reads them from the same place. <Doc href="/docs/send/push/overview">Send push</Doc> covers the model.

SNS addresses the device by the Target ARN it is subscribed to, nested under `aws_sns` on the profile. Store it once with <Endpoint method="POST" path="/profiles/{user_id}" name="Create a Profile" href="/docs/api-reference/user-profiles/create-a-profile" />, which merges into the profile and creates it if it does not exist:

<CodeGroup>
  ```javascript Node.js highlight={3-5} theme={null}
  const profile = await client.profiles.create('user_123', {
    profile: {
      aws_sns: {
        target_arn: 'your:target:arn',
      },
    },
  });
  ```

  ```python Python highlight={4-6} theme={null}
  profile = client.profiles.create(
      user_id="user_123",
      profile={
          "aws_sns": {
              "target_arn": "your:target:arn",
          },
      },
  )
  ```

  ```bash cURL highlight={7-9} theme={null}
  curl --request POST \
    --url https://api.courier.com/profiles/user_123 \
    --header "Authorization: Bearer $COURIER_API_KEY" \
    --header 'Content-Type: application/json' \
    --data '{
      "profile": {
        "aws_sns": {
          "target_arn": "your:target:arn"
        }
      }
    }'
  ```

  ```ruby Ruby highlight={4-6} theme={null}
  profile = courier.profiles.create(
    "user_123",
    profile: {
      aws_sns: {
        target_arn: "your:target:arn"
      }
    }
  )
  ```

  ```go Go highlight={6-8} theme={null}
  profile, err := client.Profiles.New(
  	context.TODO(),
  	"user_123",
  	courier.ProfileNewParams{
  		Profile: map[string]any{
  			"aws_sns": map[string]any{
  				"target_arn": "your:target:arn",
  			},
  		},
  	},
  )
  ```

  ```java Java highlight={4-5} theme={null}
  ProfileCreateParams params = ProfileCreateParams.builder()
      .userId("user_123")
      .profile(ProfileCreateParams.Profile.builder()
          .putAdditionalProperty("aws_sns", JsonValue.from(java.util.Map.of(
              "target_arn", "your:target:arn")))
          .build())
      .build();
  ProfileCreateResponse profile = client.profiles().create(params);
  ```

  ```php PHP highlight={2-4} theme={null}
  $profile = $client->profiles->create('user_123', profile: [
    'aws_sns' => [
      'target_arn' => 'your:target:arn',
    ],
  ]);
  ```

  ```csharp C# highlight={7-9} theme={null}
  ProfileCreateParams parameters = new()
  {
      UserID = "user_123",
      Profile = JsonSerializer.Deserialize<Dictionary<string, JsonElement>>(
          """
          {
            "aws_sns": {
              "target_arn": "your:target:arn"
            }
          }
          """
      ),
  };
  var profile = await client.Profiles.Create(parameters);
  ```

  ```bash CLI highlight={4} wrap theme={null}
  courier profiles create \
    --api-key "$COURIER_API_KEY" \
    --user-id user_123 \
    --profile '{"aws_sns":{"target_arn":"your:target:arn"}}'
  ```

  ```text MCP theme={null}
  With Courier MCP, save the SNS target ARN your:target:arn on user_123.
  ```
</CodeGroup>

To use a Topic ARN instead, set it on the integration or pass it as a [`config` override](#overrides). It is not read from the recipient profile.

### Destination precedence

Courier picks exactly one SNS destination per message, in this order:

1. `phone_number` on the profile, which sends an SMS rather than a push
2. Topic ARN, from the integration config or a `config` override
3. `aws_sns.target_arn` on the profile

The first one present wins and the rest are discarded. Nothing is sent if none of the three is set.

Then send to `user_id` and Courier resolves the address.

For a one-off with no stored profile, pass it inline instead: `"to": { "aws_sns": { "target_arn": "your:target:arn" } }`.

<CardGroup cols={1}>
  <Card title="Send by user id" icon="user" href="/docs/recipients/overview#send-by-user-id">
    The call in every language, and the rest of the profile object.
  </Card>
</CardGroup>

## Send to a recipient

<Tabs>
  <Tab title="Send to user id">
    Courier reads `aws_sns` off the saved profile, so preferences apply and the value can change without touching this code.

    <CodeGroup>
      ```javascript Node.js highlight={4} theme={null}
      const { requestId } = await courier.send.message({
        message: {
          to: {
            user_id: "user_123",
          },
          template: "nt_01kx4h2jdafq8bk9aftxak4b40",
        },
      });
      ```

      ```python Python highlight={4} theme={null}
      response = client.send.message(
          message={
              "to": {
                  "user_id": "user_123",
              },
              "template": "nt_01kx4h2jdafq8bk9aftxak4b40",
          },
      )
      ```

      ```bash cURL highlight={7} wrap theme={null}
      curl -X POST https://api.courier.com/send \
        -H "Authorization: Bearer $COURIER_API_KEY" \
        -H "Content-Type: application/json" \
        -d '{
          "message": {
            "to": {
              "user_id": "user_123"
            },
            "template": "nt_01kx4h2jdafq8bk9aftxak4b40"
          }
        }'
      ```

      ```ruby Ruby highlight={4} theme={null}
      response = courier.send_.message(
        message: {
          to: {
            user_id: "user_123"
          },
          template: "nt_01kx4h2jdafq8bk9aftxak4b40"
        }
      )
      ```

      ```go Go highlight={5} theme={null}
      response, err := client.Send.Message(context.TODO(), courier.SendMessageParams{
      	Message: courier.SendMessageParamsMessage{
      		To: courier.SendMessageParamsMessageToUnion{
      			OfUserRecipient: &shared.UserRecipientParam{
      				UserID: courier.String("user_123"),
      			},
      		},
      		Template: courier.String("nt_01kx4h2jdafq8bk9aftxak4b40"),
      	},
      })
      ```

      ```java Java highlight={3} theme={null}
      SendMessageParams params = SendMessageParams.builder()
          .message(SendMessageParams.Message.builder()
              .to(UserRecipient.builder().userId("user_123").build())
              .template("nt_01kx4h2jdafq8bk9aftxak4b40")
              .build())
          .build();
      SendMessageResponse response = client.send().message(params);
      ```

      ```php PHP highlight={4} theme={null}
      $response = $client->send->message(
        message: [
          'to' => [
            'user_id' => 'user_123',
          ],
          'template' => 'nt_01kx4h2jdafq8bk9aftxak4b40',
        ],
      );
      ```

      ```csharp C# highlight={5} theme={null}
      SendMessageParams parameters = new()
      {
          Message = new()
          {
              To = new UserRecipient { UserID = "user_123" },
              Template = "nt_01kx4h2jdafq8bk9aftxak4b40",
          },
      };

      var response = await client.Send.Message(parameters);
      ```

      ```bash CLI highlight={3} wrap theme={null}
      courier send message \
        --api-key "$COURIER_API_KEY" \
        --message.to '{"user_id": "user_123"}' \
        --message.template nt_01kx4h2jdafq8bk9aftxak4b40
      ```

      ```text MCP theme={null}
      With Courier MCP, send my template to user_123 by email.
      ```
    </CodeGroup>
  </Tab>

  <Tab title="Send to `aws_sns`">
    Pass it inline instead and nothing is stored. Swap this `to` object into the call on the other tab.

    <CodeGroup>
      ```javascript Node.js highlight={5-7} theme={null}
      const { requestId } = await courier.send.message({
        message: {
          // A provider recipient is a profile field, so it sits outside the typed union.
          to: {
            aws_sns: {
              target_arn: "your:target:arn",
            },
          } as any,
          template: "nt_01kx4h2jdafq8bk9aftxak4b40",
        },
      });
      ```

      ```python Python highlight={4-6} theme={null}
      response = client.send.message(
          message={
              "to": {
                  "aws_sns": {
                      "target_arn": "your:target:arn",
                  },
              },
              "template": "nt_01kx4h2jdafq8bk9aftxak4b40",
          },
      )
      ```

      ```bash cURL highlight={7-9} wrap theme={null}
      curl -X POST https://api.courier.com/send \
        -H "Authorization: Bearer $COURIER_API_KEY" \
        -H "Content-Type: application/json" \
        -d '{
          "message": {
            "to": {
              "aws_sns": {
                "target_arn": "your:target:arn"
              }
            },
            "template": "nt_01kx4h2jdafq8bk9aftxak4b40"
          }
        }'
      ```

      ```ruby Ruby highlight={4-6} theme={null}
      response = courier.send_.message(
        message: {
          to: {
            aws_sns: {
              target_arn: "your:target:arn"
            }
          },
          template: "nt_01kx4h2jdafq8bk9aftxak4b40"
        }
      )
      ```

      ```go Go highlight={2-4} theme={null}
      // A provider recipient is a profile field, so it sits outside the typed union.
      to := param.Override[shared.UserRecipientParam](
      	json.RawMessage(`{"aws_sns": {"target_arn": "your:target:arn"}}`),
      )

      response, err := client.Send.Message(context.TODO(), courier.SendMessageParams{
      	Message: courier.SendMessageParamsMessage{
      		To: courier.SendMessageParamsMessageToUnion{OfUserRecipient: &to},
      		Template: courier.String("nt_01kx4h2jdafq8bk9aftxak4b40"),
      	},
      })
      ```

      ```java Java highlight={3-4} theme={null}
      // A provider recipient is a profile field, so it sits outside the typed union.
      UserRecipient to = UserRecipient.builder()
          .putAdditionalProperty("aws_sns", JsonValue.from(Map.of(
                  "target_arn", "your:target:arn")))
          .build();

      client.send().message(SendMessageParams.builder()
          .message(SendMessageParams.Message.builder()
              .to(to)
              .template("nt_01kx4h2jdafq8bk9aftxak4b40")
              .build())
          .build());
      ```

      ```php PHP highlight={4-6} theme={null}
      $response = $client->send->message(
        message: [
          'to' => [
            'aws_sns' => [
              'target_arn' => 'your:target:arn',
            ],
          ],
          'template' => 'nt_01kx4h2jdafq8bk9aftxak4b40',
        ],
      );
      ```

      ```csharp C# highlight={3-5} theme={null}
      // A provider recipient is a profile field, so it sits outside the typed union.
      UserRecipient to = UserRecipient.FromRawUnchecked(
          JsonSerializer.Deserialize<Dictionary<string, JsonElement>>(
              """{"aws_sns": {"target_arn": "your:target:arn"}}"""
          )
      );

      var response = await client.Send.Message(new() { Message = new() { To = to, Template = "nt_01kx4h2jdafq8bk9aftxak4b40" } });
      ```

      ```bash CLI highlight={3} wrap theme={null}
      courier send message \
        --api-key "$COURIER_API_KEY" \
        --message.to '{"aws_sns": {"target_arn": "your:target:arn"}}' \
        --message.template nt_01kx4h2jdafq8bk9aftxak4b40
      ```

      ```text MCP theme={null}
      With Courier MCP, send my template to the SNS target arn your:target:arn.
      ```
    </CodeGroup>
  </Tab>
</Tabs>

## Overrides

<Doc href="/docs/send/overrides#how-overrides-work">How overrides work</Doc> covers the two levels and which one wins. <Doc href="/docs/integrations/push/overview#channel-overrides">Push channel overrides</Doc> lists the fields every push provider takes.

The `config` override swaps credentials, region, or the Topic ARN at send time:

| Field             | Effect                                                                    |
| ----------------- | ------------------------------------------------------------------------- |
| `accessKeyId`     | Replaces the saved Access Key ID                                          |
| `secretAccessKey` | Replaces the saved Secret Access Key                                      |
| `region`          | Replaces the saved region. Defaults to `us-east-1` if neither is set      |
| `topicArn`        | Replaces the saved Topic ARN, and still outranks a profile's `target_arn` |

<CodeGroup>
  ```javascript Node.js highlight={10-18} theme={null}
  const { requestId } = await courier.send.message({
    message: {
      template: "nt_01kx4h2jdafq8bk9aftxak4b40",
      to: {
        aws_sns: {
          target_arn: "your:target:arn",
        },
      },
      providers: {
        "aws-sns": {
          override: {
            config: {
              accessKeyId: "RUNTIME_ACCESS_KEY_ID",
              secretAccessKey: "RUNTIME_SECRET_ACCESS_KEY",
              region: "eu-west-1",
            },
          },
        },
      },
    },
  });
  ```

  ```python Python highlight={10-18} theme={null}
  response = client.send.message(
      message={
          "template": "nt_01kx4h2jdafq8bk9aftxak4b40",
          "to": {
              "aws_sns": {
                  "target_arn": "your:target:arn",
              },
          },
          "providers": {
              "aws-sns": {
                  "override": {
                      "config": {
                          "accessKeyId": "RUNTIME_ACCESS_KEY_ID",
                          "secretAccessKey": "RUNTIME_SECRET_ACCESS_KEY",
                          "region": "eu-west-1",
                      },
                  },
              },
          },
      },
  )
  ```

  ```bash cURL highlight={13-21} wrap theme={null}
  curl -X POST https://api.courier.com/send \
    -H "Authorization: Bearer $COURIER_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "message": {
        "template": "nt_01kx4h2jdafq8bk9aftxak4b40",
        "to": {
          "aws_sns": {
            "target_arn": "your:target:arn"
          }
        },
        "providers": {
          "aws-sns": {
            "override": {
              "config": {
                "accessKeyId": "RUNTIME_ACCESS_KEY_ID",
                "secretAccessKey": "RUNTIME_SECRET_ACCESS_KEY",
                "region": "eu-west-1"
              }
            }
          }
        }
      }
    }'
  ```

  ```ruby Ruby highlight={10-18} theme={null}
  response = courier.send_.message(
    message: {
      template: "nt_01kx4h2jdafq8bk9aftxak4b40",
      to: {
        aws_sns: {
          target_arn: "your:target:arn"
        }
      },
      providers: {
        "aws-sns": {
          override: {
            config: {
              accessKeyId: "RUNTIME_ACCESS_KEY_ID",
              secretAccessKey: "RUNTIME_SECRET_ACCESS_KEY",
              region: "eu-west-1"
            }
          }
        }
      }
    }
  )
  ```

  ```go Go highlight={14-22} theme={null}
  // This provider addresses the recipient with fields outside the typed
  // UserRecipient model, so pass the recipient as raw JSON.
  to := param.Override[shared.UserRecipientParam](json.RawMessage(`{
    "aws_sns": {
      "target_arn": "your:target:arn"
    }
  }`))

  response, err := client.Send.Message(context.TODO(), courier.SendMessageParams{
  	Message: courier.SendMessageParamsMessage{
  		To: courier.SendMessageParamsMessageToUnion{OfUserRecipient: &to},
  		Template: courier.String("nt_01kx4h2jdafq8bk9aftxak4b40"),
  		Providers: shared.MessageProvidersParam{
  			"aws-sns": shared.MessageProvidersTypeParam{
  				Override: map[string]any{
  					"config": map[string]any{
  						"accessKeyId": "RUNTIME_ACCESS_KEY_ID",
  						"secretAccessKey": "RUNTIME_SECRET_ACCESS_KEY",
  						"region": "eu-west-1",
  					},
  				},
  			},
  		},
  	},
  })
  ```

  ```java Java highlight={12-18} theme={null}
  SendMessageParams params = SendMessageParams.builder()
      .message(SendMessageParams.Message.builder()
          // This provider addresses the recipient with fields outside the
          // typed UserRecipient model, so pass them as additional properties.
          .to(UserRecipient.builder()
              .putAdditionalProperty("aws_sns", JsonValue.from(java.util.Map.of(
                  "target_arn", "your:target:arn"
              )))
              .build())
          .template("nt_01kx4h2jdafq8bk9aftxak4b40")
          .providers(MessageProviders.builder()
              .putAdditionalProperty("aws-sns", JsonValue.from(java.util.Map.of("override", java.util.Map.of(
                      "config", java.util.Map.of(
                          "accessKeyId", "RUNTIME_ACCESS_KEY_ID",
                          "secretAccessKey", "RUNTIME_SECRET_ACCESS_KEY",
                          "region", "eu-west-1"
                      )
                  ))))
              .build())
          .build())
      .build();
  SendMessageResponse response = client.send().message(params);
  ```

  ```php PHP highlight={10-18} theme={null}
  $response = $client->send->message(
    message: [
      'template' => 'nt_01kx4h2jdafq8bk9aftxak4b40',
      'to' => [
        'aws_sns' => [
          'target_arn' => 'your:target:arn',
        ],
      ],
      'providers' => [
        'aws-sns' => [
          'override' => [
            'config' => [
              'accessKeyId' => 'RUNTIME_ACCESS_KEY_ID',
              'secretAccessKey' => 'RUNTIME_SECRET_ACCESS_KEY',
              'region' => 'eu-west-1',
            ],
          ],
        ],
      ],
    ],
  );
  ```

  ```csharp C# highlight={21-37} theme={null}
  SendMessageParams parameters = new()
  {
      Message = new()
      {
          // This provider addresses the recipient with fields outside the
          // typed UserRecipient model, so build it from raw JSON.
          To = UserRecipient.FromRawUnchecked(
              JsonSerializer.Deserialize<Dictionary<string, JsonElement>>(
                  """
                  {
                    "aws_sns": {
                      "target_arn": "your:target:arn"
                    }
                  }
                  """
              )
          ),
          Template = "nt_01kx4h2jdafq8bk9aftxak4b40",
          Providers = new Dictionary<string, MessageProvidersType>()
          {
              {
                  "aws-sns",
                  new()
                  {
                      Override = JsonSerializer.Deserialize<Dictionary<string, JsonElement>>(
                          """
                          {
                            "config": {
                              "accessKeyId": "RUNTIME_ACCESS_KEY_ID",
                              "secretAccessKey": "RUNTIME_SECRET_ACCESS_KEY",
                              "region": "eu-west-1"
                            }
                          }
                          """
                      ),
                  }
              },
          },
      },
  };

  var response = await client.Send.Message(parameters);
  ```

  ```bash CLI highlight={5} wrap theme={null}
  courier send message \
    --api-key "$COURIER_API_KEY" \
    --message.to '{"aws_sns": {"target_arn": "your:target:arn"}}' \
    --message.template nt_01kx4h2jdafq8bk9aftxak4b40 \
    --message.providers '{"aws-sns": {"override": {"config": {"accessKeyId": "RUNTIME_ACCESS_KEY_ID", "secretAccessKey": "RUNTIME_SECRET_ACCESS_KEY", "region": "eu-west-1"}}}}'
  ```

  ```text MCP theme={null}
  With Courier MCP, send my template to this SNS target ARN in a different region.
  ```
</CodeGroup>

The `body` override merges into the SNS `Publish` request itself, so its fields use the AWS parameter names rather than Courier's. See the [SNS publish properties](https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/SNS.html#publish-property).

<CodeGroup>
  ```javascript Node.js highlight={10-17} theme={null}
  const { requestId } = await courier.send.message({
    message: {
      template: "nt_01kx4h2jdafq8bk9aftxak4b40",
      to: {
        aws_sns: {
          target_arn: "your:target:arn",
        },
      },
      providers: {
        "aws-sns": {
          override: {
            body: {
              Subject: "Order update",
              MessageStructure: "json",
            },
          },
        },
      },
    },
  });
  ```

  ```python Python highlight={10-17} theme={null}
  response = client.send.message(
      message={
          "template": "nt_01kx4h2jdafq8bk9aftxak4b40",
          "to": {
              "aws_sns": {
                  "target_arn": "your:target:arn",
              },
          },
          "providers": {
              "aws-sns": {
                  "override": {
                      "body": {
                          "Subject": "Order update",
                          "MessageStructure": "json",
                      },
                  },
              },
          },
      },
  )
  ```

  ```bash cURL highlight={13-20} wrap theme={null}
  curl -X POST https://api.courier.com/send \
    -H "Authorization: Bearer $COURIER_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "message": {
        "template": "nt_01kx4h2jdafq8bk9aftxak4b40",
        "to": {
          "aws_sns": {
            "target_arn": "your:target:arn"
          }
        },
        "providers": {
          "aws-sns": {
            "override": {
              "body": {
                "Subject": "Order update",
                "MessageStructure": "json"
              }
            }
          }
        }
      }
    }'
  ```

  ```ruby Ruby highlight={10-17} theme={null}
  response = courier.send_.message(
    message: {
      template: "nt_01kx4h2jdafq8bk9aftxak4b40",
      to: {
        aws_sns: {
          target_arn: "your:target:arn"
        }
      },
      providers: {
        "aws-sns": {
          override: {
            body: {
              Subject: "Order update",
              MessageStructure: "json"
            }
          }
        }
      }
    }
  )
  ```

  ```go Go highlight={14-21} theme={null}
  // This provider addresses the recipient with fields outside the typed
  // UserRecipient model, so pass the recipient as raw JSON.
  to := param.Override[shared.UserRecipientParam](json.RawMessage(`{
    "aws_sns": {
      "target_arn": "your:target:arn"
    }
  }`))

  response, err := client.Send.Message(context.TODO(), courier.SendMessageParams{
  	Message: courier.SendMessageParamsMessage{
  		To: courier.SendMessageParamsMessageToUnion{OfUserRecipient: &to},
  		Template: courier.String("nt_01kx4h2jdafq8bk9aftxak4b40"),
  		Providers: shared.MessageProvidersParam{
  			"aws-sns": shared.MessageProvidersTypeParam{
  				Override: map[string]any{
  					"body": map[string]any{
  						"Subject": "Order update",
  						"MessageStructure": "json",
  					},
  				},
  			},
  		},
  	},
  })
  ```

  ```java Java highlight={12-17} theme={null}
  SendMessageParams params = SendMessageParams.builder()
      .message(SendMessageParams.Message.builder()
          // This provider addresses the recipient with fields outside the
          // typed UserRecipient model, so pass them as additional properties.
          .to(UserRecipient.builder()
              .putAdditionalProperty("aws_sns", JsonValue.from(java.util.Map.of(
                  "target_arn", "your:target:arn"
              )))
              .build())
          .template("nt_01kx4h2jdafq8bk9aftxak4b40")
          .providers(MessageProviders.builder()
              .putAdditionalProperty("aws-sns", JsonValue.from(java.util.Map.of("override", java.util.Map.of(
                      "body", java.util.Map.of(
                          "Subject", "Order update",
                          "MessageStructure", "json"
                      )
                  ))))
              .build())
          .build())
      .build();
  SendMessageResponse response = client.send().message(params);
  ```

  ```php PHP highlight={10-17} theme={null}
  $response = $client->send->message(
    message: [
      'template' => 'nt_01kx4h2jdafq8bk9aftxak4b40',
      'to' => [
        'aws_sns' => [
          'target_arn' => 'your:target:arn',
        ],
      ],
      'providers' => [
        'aws-sns' => [
          'override' => [
            'body' => [
              'Subject' => 'Order update',
              'MessageStructure' => 'json',
            ],
          ],
        ],
      ],
    ],
  );
  ```

  ```csharp C# highlight={21-36} theme={null}
  SendMessageParams parameters = new()
  {
      Message = new()
      {
          // This provider addresses the recipient with fields outside the
          // typed UserRecipient model, so build it from raw JSON.
          To = UserRecipient.FromRawUnchecked(
              JsonSerializer.Deserialize<Dictionary<string, JsonElement>>(
                  """
                  {
                    "aws_sns": {
                      "target_arn": "your:target:arn"
                    }
                  }
                  """
              )
          ),
          Template = "nt_01kx4h2jdafq8bk9aftxak4b40",
          Providers = new Dictionary<string, MessageProvidersType>()
          {
              {
                  "aws-sns",
                  new()
                  {
                      Override = JsonSerializer.Deserialize<Dictionary<string, JsonElement>>(
                          """
                          {
                            "body": {
                              "Subject": "Order update",
                              "MessageStructure": "json"
                            }
                          }
                          """
                      ),
                  }
              },
          },
      },
  };

  var response = await client.Send.Message(parameters);
  ```

  ```bash CLI highlight={5} wrap theme={null}
  courier send message \
    --api-key "$COURIER_API_KEY" \
    --message.to '{"aws_sns": {"target_arn": "your:target:arn"}}' \
    --message.template nt_01kx4h2jdafq8bk9aftxak4b40 \
    --message.providers '{"aws-sns": {"override": {"body": {"Subject": "Order update", "MessageStructure": "json"}}}}'
  ```

  ```text MCP theme={null}
  With Courier MCP, send my template to this SNS target ARN with the publish parameters overridden.
  ```
</CodeGroup>

## Provider details

```text theme={null}
aws-sns
```

Courier recommends routing to the channel. Naming this key in `routing.channels` instead is supported, and sends through just this provider.

<Card title="Send to a specific provider" icon="bullseye-arrow" href="/docs/send/send-to-a-provider" horizontal arrow="true">
  When that is worth doing, and what you give up: failover, channel priority, and providers you add later.
</Card>
