> For the complete documentation index, see [llms.txt](https://docs.stacksync.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.stacksync.com/connectors/dynamics-365-crm/authorize-dynamics-365-crm.md).

# Authorize Dynamics 365 CRM

## 1. Find your Microsoft Dynamics Environment URL

Your environment URL is the base address of your D365 CRM instance. To find it, copy the URL from your browser when you are in the application.

Examples:

* Production: `https://yourorg.crm.dynamics.com`
* Sandbox: `https://yourorg.sandbox.crm.dynamics.com`

### 2. Select Dynamics 365 CRM

In Stacksync:

1. Click **Create Sync**
2. Choose **Dynamics 365 CRM**<br>

   <figure><img src="/files/iEoplNPniM1P7Ka3Y9ww" alt=""><figcaption></figcaption></figure>

This opens the authorization flow.

***

### 3. Enter Your Environment URL

Provide the base URL of your D365 CRM environment you retrieved in the first step.\
\ <br>

<figure><img src="/files/yfcM8Wy5KFvCSVUTuDPy" alt=""><figcaption></figcaption></figure>

Click **Authorize App**.

***

### 4. Sign In with Microsoft

You will be redirected to Microsoft’s login page.

1. Enter your Microsoft credentials
2. Continue to the permissions screen

This authenticates you as a valid D365 user.

***

### 5. Grant Stacksync Access

Microsoft will ask you to approve the Stacksync app.

Click **Accept** to authorize:

* Permission to read CRM data
* Permission to interact with OData entities

If you see this message:

> *“Need admin approval for this app.”*

Ask your admin to:

* Open the Microsoft identity / directory admin portal and go to the **enterprise applications / app registrations** area.
* Locate the **Stacksync** application or the corresponding app registration.
* Review and grant the requested API permissions (for example, access to Dynamics 365 CRM APIs).

Once an admin has granted consent, the “Need admin approval” screen will no longer appear when you authorize Stacksync. You can then restart the authorization from step 2, and the flow will complete successfully, allowing Stacksync to connect to your Microsoft account and start syncing data.

If you have any questions or run into any blockers, reach out anytime at <hello@stacksync.com> and the Stacksync team will be happy to help.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.stacksync.com/connectors/dynamics-365-crm/authorize-dynamics-365-crm.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
