---
title: "The OAuth 2.0 Token Endpoint"
method: POST
path: "/oauth2/token"
tags: ["oAuth2"]
---

# The OAuth 2.0 Token Endpoint

`POST /oauth2/token`

Use open source libraries to perform OAuth 2.0 and OpenID Connect
available for any programming language. You can find a list of libraries here https://oauth.net/code/

This endpoint should not be used via the Ory SDK and is only included for technical reasons.
Instead, use one of the libraries linked above.

## Response `200`

oAuth2TokenExchange

- OAuth2TokenExchange — OAuth2 Token Exchange Result
  - `access_token` string — The access token issued by the authorization server.
  - `expires_in` integer — The lifetime in seconds of the access token. For example, the value "3600" denotes that the access token will expire in one hour from the time the response was generated.
  - `id_token` string — To retrieve a refresh token request the id_token scope.
  - `refresh_token` string — The refresh token, which can be used to obtain new access tokens. To retrieve it add the scope "offline" to your access token request.
  - `scope` string — The scope of the access token
  - `token_type` string — The type of the token issued

## Other responses

- `default` — errorOAuth2

## Changes

> 15 revisions in range; 4 could not be searched.

- **2024-02-12** `02c4930b8c92` — 1 breaking
  - the `id_token` response's property type/format changed from `integer`/`int64` to `string`/`` for status `200`
- **2022-11-10** `b01beb353b55` — 1 breaking
  - the `scope` response's property type/format changed from `integer`/`int64` to `string`/`` for status `200`

[Change history](https://skmtc.dev/ory/apis/ory-hydra-api/changes/oauth2/token/post.md)

---

[API](https://skmtc.dev/ory/apis/ory-hydra-api.md) · [All operations](https://skmtc.dev/ory/apis/ory-hydra-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/ory/ory-hydra-api/revisions/ab053e716585/schema)
