---
title: "Exchange grant for OAuth2 tokens"
method: POST
path: "/oauth/token"
tags: ["oauth"]
---

# Exchange grant for OAuth2 tokens

`POST /oauth/token`

Token endpoint that dispatches by grant_type: authorization_code, urn:ietf:params:oauth:grant-type:device_code, or refresh_token.

## Response `200`

OK

- OauthTokenResponse
  - `access_token` string
  - `expires_in` integer
  - `refresh_token` string
  - `token_type` string
  - `workspace_id` string

## Other responses

- `400` — Bad Request
- `500` — Internal Server Error

---

[API](https://skmtc.net/langchain-ai/apis/langsmith.md) · [All operations](https://skmtc.net/langchain-ai/apis/langsmith/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/langchain-ai/langsmith/revisions/a0acb3a6a101/schema)
