---
title: "Exchange handoff code for JWT"
method: POST
path: "/auth/connections/{id}/exchange"
tags: ["Managed Auth"]
---

# Exchange handoff code for JWT

`POST /auth/connections/{id}/exchange`

Validates the handoff code and returns a JWT token for subsequent requests. Used by the hosted login UI.

## Path parameters

- `id` string, required

## Request body

- ManagedAuthExchangeRequest — Request to exchange handoff code for JWT
  - `code` string, required — Handoff code from start endpoint

## Response `200`

Exchange successful, JWT returned

- ManagedAuthExchangeResponse — Response from exchange endpoint
  - `invocation_id` string, required — Invocation ID
  - `jwt` string, required — JWT token with invocation_id claim (30 minute TTL)

## Other responses

- `400` — Bad Request – invalid input
- `404` — Resource not found
- `410` — Resource expired or no longer available
- `500` — Internal Server Error

---

[API](https://skmtc.net/kernel/apis/kernel-api.md) · [All operations](https://skmtc.net/kernel/apis/kernel-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/kernel/kernel-api/versions/9e8ce9fcf5e1/schema)
