---
title: "Issue a one-time exchange code for the current user JWT"
method: POST
path: "/oauth/token-exchange/issue"
tags: ["OAuth"]
---

# Issue a one-time exchange code for the current user JWT

`POST /oauth/token-exchange/issue`

## Request

- Base URL: `https://api.hyperspell.com`
- URL: `https://api.hyperspell.com/oauth/token-exchange/issue`
- Auth: HTTP bearer

Exchange a user token for a short-lived, one-time connection code.

Use the returned code in a ``/oauth/link/{integration_id}`` link to start a
connection without placing the user token in a browser URL. Only user tokens are accepted.

## Headers

- `X-As-User` string, nullable: Optionally set this header to act as a specific user when using an API Key, equivalent to first exchanging the API Key for a User Token

## Response `200`

Successful Response

- TokenExchangeIssueResponse
  - `code` string, required
  - `expires_in` integer

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/hyperspell/apis/hyperspell-api.md) - [All operations](https://skmtc.dev/hyperspell/apis/hyperspell-api/llms.txt) - [OpenAPI document](https://skmtc.dev/hyperspell/apis/hyperspell-api/revisions/9bafd1215a0f?raw)
