---
title: "Start linking a Microsoft account"
method: POST
path: "/v1/me/identities/microsoft/link-url"
tags: ["identities"]
---

# Start linking a Microsoft account

`POST /v1/me/identities/microsoft/link-url`

## Request

- Base URL: `https://api.patricia.app` (the document declares no server; this is the origin it was published from)
- URL: `https://api.patricia.app/v1/me/identities/microsoft/link-url`
- Auth: HTTP bearer

Mint a Microsoft sign-in URL that proves the signed-in teammate's own Entra identity, and set the short-lived browser cookie the callback requires. A contextual check returns linked or unlinked without starting a sign-in.

## Headers

- `X-Tenant-Id` string, nullable

## Request body

- MicrosoftMemberLinkRequest
  - `context` string, nullable
  - `check_only` boolean

## Response `200`

Successful Response

- union
  - MemberLinkUrlResponse: Where to send the browser so somebody can prove a provider identity.
    - `url` string, required: Provider sign-in URL carrying the signed, browser-bound link state.
  - AccountLinkStatusResponse
    - `status` 'linked' | 'unlinked', required

## Other responses

- `400`: Bad request
- `401`: Unauthorized
- `403`: Forbidden. Inspect response body `code` for the specific reason (for example: PERMISSION_DENIED, EMAIL_NOT_VERIFIED, TENANT_ACCESS_REQUIRED, ROLE_UNRESOLVED)
- `409`: Conflict
- `422`: Validation error

---

[API](https://skmtc.dev/patricia/apis/patricia-api.md) · [All operations](https://skmtc.dev/patricia/apis/patricia-api/llms.txt) · [OpenAPI document](https://skmtc.dev/patricia/apis/patricia-api/revisions/0dfb44495ea1?raw)
