---
title: "Send authorization request for MS Exchange account."
method: POST
path: "/api/v1/auth/exchange"
tags: ["Auth"]
---

# Send authorization request for MS Exchange account.

`POST /api/v1/auth/exchange`

## Request

- Base URL: `https://api.intheloop.io`
- URL: `https://api.intheloop.io/api/v1/auth/exchange`
- Auth: API key in header `Authorization`

## Query parameters

- `isAddAccount` boolean
- `loginPurpose` 'Login' | 'SetSecret'

## Request body

- AuthExchange: Authorization exchange on premise resource
  - `token` Token: Token resource
    - `accessToken` string: Access token, type is Bearer
    - `refreshToken` string: Refresh token
    - `email` string: Email of refresh token
    - `isSyncable` boolean, required: Token is syncable
  - `$type` string, required
  - `email` string, required: User's email
  - `secret` string, required: User's secret, only set by client, always returned empty by server
  - `username` string: User's user name
  - `domain` string: User's domain
  - `serverUri` string: User's server Uri

## Response `201`

Created

- AuthExchange: Authorization exchange on premise resource
  - `token` Token: Token resource
    - `accessToken` string: Access token, type is Bearer
    - `refreshToken` string: Refresh token
    - `email` string: Email of refresh token
    - `isSyncable` boolean, required: Token is syncable
  - `$type` string, required
  - `email` string, required: User's email
  - `secret` string, required: User's secret, only set by client, always returned empty by server
  - `username` string: User's user name
  - `domain` string: User's domain
  - `serverUri` string: User's server Uri

## Other responses

- `400`: Bad request. Check fields message and error code from response body for additional information.
- `401`: Unauthorized request. Check fields message and error code from response body for additional information.
- `429`: Too many requests. Check response header Retry-After indicating how long to wait before making a new request.

---

[API](https://skmtc.dev/intheloop/apis/loop-api.md) - [All operations](https://skmtc.dev/intheloop/apis/loop-api/llms.txt) - [OpenAPI document](https://skmtc.dev/intheloop/apis/loop-api/revisions/0892c5ba0787?raw)
