Create a new HTTP API Segment source
First, create a new HTTP API source in your Segment workspace. Make a note of the write key, as you’ll need this later when configuring Power Automate.

Create a new Microsoft Dynamics 365 CRM trial (optional)
Head over to trials section of the Microsoft Dynamics website and select the the edition of Dynamics you’d like to integrate with Segment. For the purposes of this guide, we’ll be using Microsoft Dynamics Sales 365. Once you’ve setup a trial, it’s a few simple steps to start sending data to Segment.
Create a new Power Automate Flow
To create a new Power Automate flow, navigate to the Contacts tab within Microsoft Dynamics and select to See your flows from the Flow menu using the top navigation menu. This will open a new window for Power Automate.

Use the New Flow button at the top of the page, select Automated Cloud Flow from the list of options. Give your flow a name and search for the Microsoft Dataverse trigger for when a row is added, modified or deleted.

Next define when your flow should trigger and select New step. In this example, we are triggering a flow when a Contact is added or modified across the entire organization.

Select + New step to add a new step to your flow. The second step of the flow will send the new or updated contact data from Microsoft Dynamics to Segment’s HTTP API. Search for and select HTTP from the list of available connectors.

Next, configure the HTTP connector to send data to a Segment HTTP API source.

Set the Method as “POST
” and the URI to “https://api.segment.io/v1/identify
”.
Next, add the Authorization and Content-Type headers. The Authorization header should contain the value "Basic", followed by your base64 encoded write key (appended with a colon), which we obtained from your Segment HTTP API source. You can easily find online tools to help encode the write key. For more on how to authenticate with the HTTP API, refer to the Segment documentation.
Set the Content-Type header to “
application/json
”.
The body of your request should include a JSON object that aligns to the Segment Spec. In this example, we are making an identify call, which is used to create and update users. This call require the userId and traits that should be passed to your downstream tools.
Here’s an example of an identify call with real values:
{
"userId": "97980cfea0067"
"traits": {
"email": "peter@example.com",
"first_name": "Peter",
"last_name": "Gibbons",
"crm_id": "97980cfea0067",
"mobile": "0452222589"
},
}
When defining the body of your API call, Power Automate allows you to insert dynamic content into your request. Save when you’re finished mapping your data.

Testing your Flow
To test your integration, update a contact record in Dynamics 365 and view the Segment Debugger for your HTTP API source to view the request. If the integration is successful, you will see your identify call with the user’s traits.

If you aren't finding any activity in the Segment debugger, you have the option to view the run history within Power Automate for any failed requests. This area allows you to view the status and any error codes that may have been returned by Segment's API.

Wrapping up
In this recipe you’ve seen how no code is required to sync your contacts data from Dynamics 365 with Segment and make that data available for every other tool in your stack. But that’s not the end of the journey! You could try this with all sorts of other data sets within your Dynamics 365 environment: Leads, accounts, opportunities, or even send events to your downstream tools when a customer service case is closed. How could you better use the data in your CRM if it were piped to other systems in this manner?
Getting started is easy
Start connecting your data with Segment.