If you’ve ever wondered how to trigger personalized, automated customer journeys in Salesforce Marketing Cloud based on real-time actions from external systems, that’s because of Journey Builder API events.
These powerful tools allow businesses to create personalized marketing experiences, triggering customer journeys based on external data such as purchases, registrations or app interactions.
In this blog, we’ll detail everything you need to know about Salesforce Marketing Cloud Journey Builder API events in a simple, easy-to-understand way.
What are API events in Journey Builder?
In Salesforce Marketing Cloud (SFMC), Journey Builder helps you create automated, multi-step customer journeys.
API events allow you to trigger these journeys based on data from external systems, such as a CRM, website, or e-commerce platform.
When a customer purchases a product on your site, an API event can instantly add them to a journey, triggering personalized emails, messages, or other communications based on their purchase.
Why use API events?
Real-time engagement: They enable instant customer interaction, right when the customer takes an action (like buying a product).
Automation: You don’t need to manually add customers to journeys, making it a scalable solution.
Personalization: API events allow you to pass specific data to the customer, which can be used to tailor the journey to their specific needs or behaviors.
Now let’s see how to configure and use API events in Journey Builder!
Step-by-step guide to using API events in Journey Builder:
Step 1: Define your journey and your audience
First, you need to plan a trip in Journey Builder. Think about the experience you want to create for your customers:
- Will the journey be triggered when a user makes a purchase?
- Should it start when someone fills out a form on your website?
- Or will it be triggered by another external event (like subscribing to a newsletter)?
Have a clear goal for your journey and define the touchpoints (emails, texts, etc.) your customers will go through.
Step 2: Configure the journey with an API input source
Once you know how you want to interact with your audience, follow these steps:
- Go to Journey Builder in Marketing Cloud.
- Click Create New Trip.
- Select Multi-step journey.
- Under Input Sources, select API Event. (An input source is what triggers the trip. In this case, we’ll use an API event.)
- Choose API Event as the event type.
- Choose what you want to do with the event, such as update the contact
Step 3: Get the API endpoint and key
- Go to configuration
- In the quick search box, search for Installed Packages, click Installed Packages.
- Click new
- Enter name and description
- Click Add Component
- Choose the component type API integration
- Select server to server
- Select the scope, for this example we will select
- Travel: Read
- List and subscribers: Read
- Click Save.
Once you configure the package, Salesforce will generate
- Customer ID
- Customer confidentiality
- Authentication Base URI
- REST base URI
- SOAP Base URI

These will be used by external systems to trigger the event.
Step 4. Copy the authentication base URI to generate the access_token
Method : JOB
Endpoint:
body :
{ "grant_type": "client_credentials", "client_id": "*******************", "client_secret": "****************" }
Step 5: Configure API call in external systems
Now that you have your REST base URI and access_token, you will need to integrate it with your external system.
Whether you’re using a website, app, or other CRM system, you’ll need to configure it to call this endpoint every time the event occurs.
For example, if you want the journey to trigger when a user makes a purchase:
1. When the purchase occurs, your website or e-commerce platform sends an HTTP POST request to the API endpoint.
2. The API call will include all required customer data, such as name, email address, and purchase details.
Here is an example API call format:
Method: JOB
Endpoint:
Stubborn: “Authorization: Bearer YOUR_AUTH_KEY”, “Content-Type: application/json”
Body:
'{ "contactKey": "[email protected]", "eventDefinitionKey": "YOUR_EVENT_DEFINITION_KEY", "data": { "firstName": "John", "lastName": "Doe", "purchaseAmount": "100", "productId": "12345" } }'
Step 6: Test API event
Before starting the journey, it’s a good idea to test the event API to make sure everything works as expected.
1. Use a tool like Postman to simulate an API call and ensure the journey fires correctly.
2. Check Marketing Cloud to ensure the test contact has been injected into the journey.
Step 8: Start the journey
Once you’ve tested everything, go ahead and activate travel. Now, every time your external system makes an API call, the journey is triggered and your customers are automatically added.
Best practices for using API events in Journey Builder
1. Validate the data: Make sure the data coming from your external system is clean and correctly formatted. Incorrect data may result in trip failure.
2. Monitor and optimize: Use Marketing Cloud tracking and reporting tools to see how your journeys are performing. Are customers engaging with your emails or messages? Make any necessary adjustments.
3. Secure your API calls: Always ensure that your API endpoints are secure and that only authorized systems can trigger journeys. Use appropriate tokens, keys, and authentication methods.