---
title: "Exchange a code, or refresh (OAuth 2.1)"
method: POST
path: "/oauth/token"
tags: ["Connect"]
---

# Exchange a code, or refresh (OAuth 2.1)

`POST /oauth/token`

## Request

- Base URL: `https://api.phoenixlabs.space`
- URL: `https://api.phoenixlabs.space/oauth/token`
- Auth: none declared

grant_type authorization_code (with code_verifier, PKCE S256) or refresh_token (rotated on every use). Access tokens last 24 hours.

## Response `200`

access_token, token_type Bearer, expires_in, refresh_token, scope.

- object

## Other responses

- `400`: invalid_grant, invalid_target or unsupported_grant_type.
- `401`: invalid_client.

---

[API](https://skmtc.dev/phoenixlabs/apis/phoenix-labs-api.md) · [All operations](https://skmtc.dev/phoenixlabs/apis/phoenix-labs-api/llms.txt) · [OpenAPI document](https://skmtc.dev/phoenixlabs/apis/phoenix-labs-api/revisions/7648b94d8dd2?raw)
