---
title: "Exchange O Auth Code"
method: POST
path: "/api/oauth/exchange"
tags: ["OAuth"]
---

# Exchange O Auth Code

`POST /api/oauth/exchange`

## Request

- Base URL: `https://api.unorouter.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.unorouter.com/api/oauth/exchange`
- Auth: none required

## Request body

- OAuthExchangeRequest: OAuthExchangeRequest schema
  - `code` string, required: One-time authorization code from OAuth redirect

## Response `200`

OK

- ResponseDtoOAuthExchangeData: Response_dto.OAuthExchangeData schema
  - `data` OAuthExchangeData, required
    - `access_expires_at` integer
    - `access_token` string, required
    - `action` string
    - `display_name` string, required
    - `flow_token` string
    - `methods` unknown
    - `proof_expires_at` integer
    - `proof_token` string
    - `role` integer, required
    - `scope` string
    - `state` string
    - `user_id` integer, required
    - `username` string, required
  - `message` string, required
  - `success` boolean, required

## Changes

- **2026-10-17** `3ee060bd70d8`: 4 info
  - added the optional property `data/flow_token` to the response with the `200` status (media type: application/json)
  - added the optional property `data/flow_token` to the response with the `200` status (media type: application/xml)
  - added the optional property `data/methods` to the response with the `200` status (media type: application/json)
  - added the optional property `data/methods` to the response with the `200` status (media type: application/xml)
- **2026-10-17** `f4c1590bbe06`: 2 info
  - added the optional property `data/state` to the response with the `200` status (media type: application/json)
  - added the optional property `data/state` to the response with the `200` status (media type: application/xml)
- **2026-10-15** `6cb670e861f5`: 6 info
  - added the optional property `data/proof_expires_at` to the response with the `200` status (media type: application/json)
  - added the optional property `data/proof_expires_at` to the response with the `200` status (media type: application/xml)
  - added the optional property `data/proof_token` to the response with the `200` status (media type: application/json)
  - added the optional property `data/proof_token` to the response with the `200` status (media type: application/xml)
  - …2 more

[Operation history](https://skmtc.dev/unorouter/apis/new-api/changes/api/oauth/exchange/post.md)

---

[API](https://skmtc.dev/unorouter/apis/new-api.md) - [All operations](https://skmtc.dev/unorouter/apis/new-api/llms.txt) - [OpenAPI document](https://skmtc.dev/unorouter/apis/new-api/revisions/1b50ada14f59?raw)
