---
title: "Redeem an authorization/device code or rotate a refresh token."
method: POST
path: "/oauth/token"
---

# Redeem an authorization/device code or rotate a refresh token.

`POST /oauth/token`

## Request

- Base URL: `https://paperagent.dev`
- URL: `https://paperagent.dev/oauth/token`
- Auth: none required

## Request body

- object
  - `grant_type` string, required
  - `client_id` string
  - `device_code` string
  - `code` string
  - `redirect_uri` string
  - `code_verifier` string
  - `refresh_token` string
  - `scope` string
  - `resource` string

## Response `200`

One-hour PaperAgent access token and rotating 30-day refresh token.

- object
  - `access_token` string
  - `refresh_token` string
  - `token_type` 'Bearer'
  - `expires_in` 3600
  - `scope` string

## Other responses

- `400`: OAuth error: authorization_pending, slow_down, access_denied, expired_token, invalid_grant, or invalid_scope. Device codes expire in 600 seconds; poll every 5 seconds, adding 5 on slow_down.

---

[API](https://skmtc.dev/paperagent/apis/paperagent-rest-api.md) · [All operations](https://skmtc.dev/paperagent/apis/paperagent-rest-api/llms.txt) · [OpenAPI document](https://skmtc.dev/paperagent/apis/paperagent-rest-api/revisions/388148938051?raw)
