---
title: "Exchange authorization code for access token"
method: POST
path: "/api/v1/oauth2_v2/token"
tags: ["Authentication"]
---

# Exchange authorization code for access token

`POST /api/v1/oauth2_v2/token`

## Request

- Base URL: `https://toolkit.browserstack.com`
- URL: `https://toolkit.browserstack.com/api/v1/oauth2_v2/token`
- Auth: none required

OAuth2 v2 token endpoint for authorization code exchange.

## Request body `application/x-www-form-urlencoded`

- string

## Response `200`

Token response returned

- object
  - `access_token` string, required
  - `token_type` string, required
  - `expires_in` integer, required
  - `refresh_token` string, nullable
  - `scope` string, nullable
  - `created_at` integer, required

## Other responses

- `400`: Unsupported grant type
- `401`: Token exchange failed

---

[API](https://skmtc.dev/birdeatsbug/apis/wdt-rails-api.md) - [All operations](https://skmtc.dev/birdeatsbug/apis/wdt-rails-api/llms.txt) - [OpenAPI document](https://skmtc.dev/birdeatsbug/apis/wdt-rails-api/revisions/cbd06b547b6a?raw)
