# Start Microsoft Sign-in

> Get the Microsoft sign-in URL for connecting a Microsoft 365 or Outlook.com mailbox.

<Note>**Beta.** Not live in production yet.</Note>

Requires an API key with the `write` scope. Returns `503` until Microsoft sign-in is switched on.

Microsoft 365 and Outlook.com mailboxes cannot connect with a password or an app password, because Microsoft removed password login for IMAP. Open the returned URL in a browser and sign in; any 2FA prompt appears on Microsoft's own page. FoxReach then tests SMTP and IMAP, and connects the mailbox to the workspace of the API key only if both accept it. There is no API route for the callback, so the new account appears in [List Email Accounts](/api-reference/email-accounts/list-accounts) once someone has finished in the browser.

The link carries a signed state token that is valid for 10 minutes. Request a new URL if it expires.

<ParamField query="loginHint" type="string">
  **Beta.** The mailbox address to pre-fill on Microsoft's sign-in page.
</ParamField>

## Response

<ResponseField name="data" type="object">
  Result.

  <Expandable title="data">
    <ResponseField name="url" type="string">**Beta.** The Microsoft sign-in URL to open in a browser.</ResponseField>
  </Expandable>
</ResponseField>

<RequestExample>
```bash cURL
curl -X POST "https://api.foxreach.io/api/v1/email-accounts/microsoft-oauth/start" \
  -H "X-API-Key: otr_your_key"
```

```python Python SDK (beta)
from foxreach import FoxReach

client = FoxReach(api_key="otr_your_key")
result = client.email_accounts.microsoft_oauth_start()
print(result["url"])
```

```typescript TypeScript SDK (beta)
import { FoxReach } from "foxreach";

const client = new FoxReach({ apiKey: "otr_your_key" });
const { url } = await client.emailAccounts.startMicrosoftOAuth();
```
</RequestExample>

<ResponseExample>
```json
{
  "data": {
    "url": "https://login.microsoftonline.com/common/oauth2/v2.0/authorize?..."
  }
}
```
</ResponseExample>
