---
title: "Token"
method: POST
path: "/auth/oauth2/token"
tags: ["Getting Started", "OAuth2"]
---

# Token

`POST /auth/oauth2/token`

## Request

- Base URL: `https://gateway.remote.com`
- URL: `https://gateway.remote.com/auth/oauth2/token`
- Auth: HTTP basic

Endpoint to exchange tokens in the Authorization Code, Assertion Flow, Client Credentials and Refresh Token flows.

For backward compatibility, this endpoint returns `400` with `invalid_grant` in some cases where
RFC 6749 would use `invalid_client` (invalid client credentials) or `unauthorized_client`
(the integration is not allowed to use the grant type). Use `error_description` to tell these
cases apart.

## Authentication

This endpoint requires the following token type:

- **Basic authentication** (`BasicAuth`) — using the `CLIENT_ID` as login and the `CLIENT_SECRET` as password. See [Authentication for partners](https://developer.remote.com/docs/authentication-for-partners).

## Request body

- union
  - intersection
    - [`AuthorizationCodeParams`](https://skmtc.dev/remote-com/apis/remote-api/revisions/777f36f27c65/schema?at=%2Fcomponents%2Fschemas%2FAuthorizationCodeParams)
  - intersection
    - [`ClientCredentialsParams`](https://skmtc.dev/remote-com/apis/remote-api/revisions/777f36f27c65/schema?at=%2Fcomponents%2Fschemas%2FClientCredentialsParams)
  - intersection
    - [`RefreshTokenParams`](https://skmtc.dev/remote-com/apis/remote-api/revisions/777f36f27c65/schema?at=%2Fcomponents%2Fschemas%2FRefreshTokenParams)
  - intersection
    - [`AssertionTokenParams`](https://skmtc.dev/remote-com/apis/remote-api/revisions/777f36f27c65/schema?at=%2Fcomponents%2Fschemas%2FAssertionTokenParams)

## Response `200`

Success

- union
  - intersection
    - [`AuthorizationCodeResponse`](https://skmtc.dev/remote-com/apis/remote-api/revisions/777f36f27c65/schema?at=%2Fcomponents%2Fschemas%2FAuthorizationCodeResponse)
  - intersection
    - [`ClientCredentialsResponse`](https://skmtc.dev/remote-com/apis/remote-api/revisions/777f36f27c65/schema?at=%2Fcomponents%2Fschemas%2FClientCredentialsResponse)
  - intersection
    - [`RefreshTokenResponse`](https://skmtc.dev/remote-com/apis/remote-api/revisions/777f36f27c65/schema?at=%2Fcomponents%2Fschemas%2FRefreshTokenResponse)

## Other responses

- `400`: Bad Request
- `401`: Unauthorized
- `404`: Not Found
- `422`: Unprocessable Entity
- `429`: Too many requests

## Changes

- **2026-12-01** `830df2c44d2d`: 1 info
  - the `message` response's property pattern `Not Found` was removed for the status `404`
- **2026-10-03** `84069084fd5e`: 1 info
  - the request property `oneOf[subschema #2: ClientCredentialsParams]/client_id` became optional

[Operation history](https://skmtc.dev/remote-com/apis/remote-api/changes/auth/oauth2/token/post.md)

---

[API](https://skmtc.dev/remote-com/apis/remote-api.md) - [All operations](https://skmtc.dev/remote-com/apis/remote-api/llms.txt) - [OpenAPI document](https://skmtc.dev/remote-com/apis/remote-api/revisions/777f36f27c65?raw)
