---
title: "Exchange a connect code for a user MCP token"
method: POST
path: "/api/connector/exchange"
tags: ["Users"]
---

# Exchange a connect code for a user MCP token

`POST /api/connector/exchange`

## Request

- Base URL: `http://localhost:3013`
- URL: `http://localhost:3013/api/connector/exchange`
- Auth: none declared

Unauthenticated: the single-use code is the credential. Rate limited per IP. Unknown, expired and used codes all return 404 code_invalid.

## Request body

- object
  - `code` string, required

## Response `200`

Minted MCP token for the code's user

- object
  - `token` string, required
  - `userId` string, required
  - `version` string, required

## Other responses

- `404`: Code unknown, malformed, expired or already used
- `413`: Request body too large
- `429`: Rate limited

## Changes

- **2026-10-07** `931ce53b3c35`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/desplega-ai/apis/agent-swarm-api/changes/api/connector/exchange/post.md)

---

[API](https://skmtc.dev/desplega-ai/apis/agent-swarm-api.md) - [All operations](https://skmtc.dev/desplega-ai/apis/agent-swarm-api/llms.txt) - [OpenAPI document](https://skmtc.dev/desplega-ai/apis/agent-swarm-api/revisions/7e4c7198192a?raw)
