---
title: "OAuth2 Token Endpoint"
method: POST
path: "/oauth2/token"
tags: ["authentication"]
---

# OAuth2 Token Endpoint

`POST /oauth2/token`

Exchange an authorization code for tokens, or refresh an existing token. Supports grant_type authorization_code and refresh_token.

## Response `200`

Token response

- OAuth2TokenResponse
  - `access_token` string, required
  - `token_type` string, required
  - `expires_in` integer, required
  - `refresh_token` string
  - `id_token` string
  - `scope` string

## Other responses

- `default` — OAuth2 error response

---

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