---
title: "Ms365 Initiate"
method: POST
path: "/v1/auth/ms365/initiate"
tags: ["auth"]
---

# Ms365 Initiate

`POST /v1/auth/ms365/initiate`

## Request

- Base URL: `https://app.tokumalabs.com/api`
- URL: `https://app.tokumalabs.com/api/v1/auth/ms365/initiate`
- Auth: none declared

Initiate MS365 OAuth flow for client authentication.

## Request body

- MS365InitiateRequest
  - `username` string, required: User email address
  - `code_challenge` string, required: PKCE code challenge (SHA256 of code_verifier)
  - `redirect_uri` string, required: Desktop app callback URI (e.g., http://localhost:PORT)

## Response `200`

Successful Response

- MS365InitiateResponse
  - `authorization_url` string, required: Microsoft authorization URL to open in browser
  - `state` string, required: OAuth state parameter for CSRF protection

## Other responses

- `400`: Validation error or domain rule violation.
- `401`: Missing, expired, or invalid authentication.
- `403`: Authenticated but not permitted.
- `404`: Resource not found.
- `409`: Resource state conflict (duplicate, illegal transition).
- `422`: Request body failed schema validation.
- `500`: Server-side failure.

---

[API](https://skmtc.dev/tokumalabs/apis/tokuma-user-api.md) - [All operations](https://skmtc.dev/tokumalabs/apis/tokuma-user-api/llms.txt) - [OpenAPI document](https://skmtc.dev/tokumalabs/apis/tokuma-user-api/revisions/1f8201af459b?raw)
