---
title: "Token -- Redeem"
method: POST
path: "/oauth2/token"
tags: ["oauth2"]
---

# Token -- Redeem

`POST /oauth2/token`

## Request

- Base URL: `https://dialpad.com`
- URL: `https://dialpad.com/oauth2/token`
- Auth: none declared

Exchanges a temporary oauth code for an authorized access token.

## Request body

- union
  - SchemasOauthAuthorizationCodeGrantBodySchema: Used to redeem an access token via authorization code.
    - `client_id` string, nullable: The client_id of the oauth app. Note: must either be provided in the request body, or in a basic authorization header.
    - `client_secret` string, nullable: The client_secret of the oauth app. Note: must either be provided in the request body, or in a basic authorization header.
    - `code` string, nullable, required: The authorization code that resulted from the oauth2 authorization redirect.
    - `code_verifier` string, nullable: The PKCE code verifier corresponding to the initial PKCE code challenge, if applicable.
    - `grant_type` 'authorization_code' | 'null', nullable, required: The type of OAuth grant which is being requested.
  - SchemasOauthRefreshTokenGrantBodySchema: Used to exchange a refresh token for a short-lived access token and another refresh token.
    - `client_id` string, nullable: The client_id of the oauth app. Note: must either be provided in the request body, or in a basic authorization header.
    - `client_secret` string, nullable: The client_secret of the oauth app. Note: must either be provided in the request body, or in a basic authorization header.
    - `grant_type` 'refresh_token' | 'null', nullable, required: The type of OAuth grant which is being requested.
    - `refresh_token` string, nullable, required: The current refresh token which is being traded in for a new token pair.

## Response `200`

A successful response

- SchemasOauthAuthorizeTokenResponseBodySchema
  - `access_token` string, nullable: A static access token.
  - `expires_in` integer, nullable: The number of seconds after which the access token will become expired.
  - `id_token` string, nullable: User ID token (if using OpenID Connect)
  - `refresh_token` string, nullable: The refresh token that can be used to obtain a new token pair when this one expires.
  - `token_type` string, nullable: The type of the access_token being issued.

---

[API](https://skmtc.dev/dialpad/apis/oauth.md) - [All operations](https://skmtc.dev/dialpad/apis/oauth/llms.txt) - [OpenAPI document](https://skmtc.dev/dialpad/apis/oauth/revisions/1d24c6764639?raw)
