---
schema_version: "1"
id: 18b9ed34e1e48dda00b7831f2893b9074304415d109e300e63546d64df7abb09
title: Create an API Destination and Connection in EventBridge
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/platform/264-0-0/ev_relay_create_api_destination.md
canonical_url: https://help.salesforce.com/s/articleView?id=platform.ev_relay_create_api_destination.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 48f4375cb5d8039df55a4ac0a4c198fc01804113cb7b81f948377233eb1592b1
description: Create an API destination that uses a new connection. In this case, the API destination is a REST API call to Salesforce to publish a platform event back. The connection contains the authentication information for the API call. The connection accepts several authorization methods.
products:
  - Salesforce Platform
  - Security
release: "264"
---
# Create an API Destination and Connection in EventBridge

Create an API destination that uses a new connection. In this case, the API destination is a REST API call to Salesforce to publish a platform event back. The connection contains the authentication information for the API call. The connection accepts several authorization methods.

Prerequisites:

To use OAuth authorization for the API destination connection, create a connected app in Salesforce by following the steps in [Create a Connected App in Salesforce for OAuth](https://help.salesforce.com/s/articleView?id=platform.ev_relay_create_connected_app.htm&release=264.0.0&type=5 "To use OAuth to authorize the API call to Salesforce, set up a connected app in Salesforce. The connected app generates a consumer key and secret that you can store in the EventBridge connection in AWS."). You use the consumer key and secret from the connected app for the API destination connection.

1. To create an API destination in the EventBridge console, follow the steps in [Create an API destination](https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-api-destinations.html#eb-api-destination-create) in the AWS documentation. Then set up the configurations that are specific to Salesforce.
2. Get your Salesforce org’s My Domain name, which is on the My Domain page in Setup. You use the name in the endpoint in the next step.
3. For the event that you want to send to Salesforce, use an existing custom platform event or define a new one. For example, you can create a platform event with the label Carbon Estimate (API name `Carbon_Estimate__e`). To learn how to add fields to a platform event, see [(Optional) Define a Platform Event](https://help.salesforce.com/s/articleView?id=platform.ev_relay_define_pe.htm&release=264.0.0&type=5 "If you have a custom platform event defined in your Salesforce org that you want to use for the event relay, you can skip this step. You can also skip this step if you want to use the event relay with a change data capture event. Otherwise, follow the steps in this section to define an example platform event, Carbon_Comparison__e, which the event relay configuration steps use."). Add the same fields as the ones in the Carbon Comparison event. Also, add this field.
    
    Field type: Number (3,0), Label: Carbon Reduction Percentage
4. For API destination endpoint, use this URL after replacing MyDomainName with your org’s domain name and MyEvent\_\_e with the API name of the platform event to return: `https://MyDomainName.my.salesforce.com/services/data/v58.0/sobjects/MyEvent__e`
    
    For example, for the Carbon Estimate event, the URL is: `https://MyDomainName.my.salesforce.com/services/data/v58.0/sobjects/Carbon_Estimate__e`
5. For HTTP method, select **POST**.
6. For the connection, select **Create a new connection**, and enter a connection name.
7. For Destination type, select **Partners**, and then select **Salesforce** from Partner Destinations.
    
    If you’re setting up OAuth authorization, provide this information for your Salesforce org.
8. For Authorization type, make sure that **OAuth Client Credentials** is selected.
9. For Authorization endpoint, replace the populated endpoint with one of these options.
    1. If using a production org, enter this URL, and replace MyDomainName with your org’s My Domain name: `https://MyDomainName.my.salesforce.com/services/oauth2/token`
    2. If using a sandbox without enhanced domains, enter this URL, and replace MyDomainName with your org’s My Domain name and SandboxName with your sandbox name: `https://MyDomainName--SandboxName.my.salesforce.com/services/oauth2/token`
    3. If using a sandbox with enhanced domains, enter this URL, and replace MyDomainName with your org’s My Domain name and SandboxName with your sandbox name: `https://MyDomainName--SandboxName.sandbox.my.salesforce.com/services/oauth2/token`
10. For HTTP method, select **POST**.
11. For Client ID, enter the consumer key from the connected app in Salesforce.
12. For Client secret, enter the consumer secret from the connected app in Salesforce.
13. Add OAuth HTTP parameters.
    1. Parameter: Body field, Key: grant\_type, Value: client\_credentials

![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-platform-extend_click-264-0-0-production-enus/5f7d9219-b7b1-4552-8891-f1aba9b289fc/images/icon_note.png)

Note If your Salesforce org uses multi-factor authentication (MFA) for API access, users must complete a second authentication challenge to access Salesforce APIs. For more information, see [Set Multi-Factor Authentication Login Requirements for API Access](https://help.salesforce.com/s/articleView?id=xcloud.security_require_2fa_api.htm&type=5&language=en_US).

After you create the API destination, you can create a rule whose target is the destination. See [Create an EventBridge Rule and Connect it to the API Destination](https://help.salesforce.com/s/articleView?id=platform.ev_relay_create_eb_rule.htm&release=264.0.0&type=5 "The EventBridge rule routes events from the event bus to the API destination, which results in making a REST call to publish an event back to Salesforce.").

#### See Also

- [_AWS Documentation_: API Destinations](https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-api-destinations.html)
- [_AWS Compute Blog_: Using API destinations with Amazon EventBridge](https://aws.amazon.com/blogs/compute/using-api-destinations-with-amazon-eventbridge/)
- [_Platform Events Developer Guide_: Publish Event Messages with Salesforce APIs](https://developer.salesforce.com/docs/atlas.en-us.platform_events.meta/platform_events/platform_events_publish_api.htm)