---
title: "Exchange authorization code for access token"
method: POST
path: "/authorizations/exchange"
---

# Exchange authorization code for access token

`POST /authorizations/exchange`

Exchanges an authorization code for an access token

## Request body

- AuthorizationExchangeRequest
  - `exchangeToken` string, required — The token that can be used to exchange for a device token after the authorization has been approved.
  - `verifier` string, required — The verifier that was used to generate the challenge.

## Response `200`

OK

- AuthorizationExchangeResponse
  - `token` string, required — The device token that can be used to authenticate requests.
  - `user` object, required — The user that the token is for.
    - `id` string, uuid, required — The ID of a user.
    - `name` string, required — The user's display name.
    - `avatarUrl` string, required — The URL to the user's avatar.
    - `githubId` integer, nullable — The user's GitHub ID.
    - `createdAt` string, date-time, required — The date and time when the user profile was created.
    - `updatedAt` string, date-time, required — The date and time when the user profile was last updated.

## Other responses

- `400` — Invalid request

---

[API](https://skmtc.net/deno/apis/jsr.md) · [All operations](https://skmtc.net/deno/apis/jsr/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/deno/jsr/versions/3d37ac9b68f7/schema)
