---
title: "Create an OAuth token"
method: POST
path: "/oauth/token"
tags: ["oauth-token"]
---

# Create an OAuth token

`POST /oauth/token`

Exchange credentials or authorisation grants for an OAuth 2.0 access token.

The `grant_type` field determines which parameters are required and which response fields are returned.

See [managing token expiration](/api-reference/oauth-token#managing-token-expiration) for guidance on refreshing tokens before they expire.

## Headers

- `X-External-Correlation-Id` string, uuid

## Response `200`

Token created successfully.

- TokenResponse
  - `access_token` string — Access token to be used when calling the API. Valid for 12 hours.
  - `token_type` string — Type of the token.
  - `refresh_token` string — Refresh token used to obtain new user access tokens without requiring the user to re-authorise. Valid for up to 20 years. Only returned for user access token grant types (`registration_code`, `authorization_code`, `refresh_token`).
  - `expires_in` integer — Access token expiry time in seconds.
  - `expires_at` string — Access token expiration timestamp (UTC).
  - `refresh_token_expires_in` integer — Refresh token expiry time in seconds. Only returned for user access token grant types (`registration_code`, `authorization_code`, `refresh_token`).
  - `refresh_token_expires_at` string — Refresh token expiration timestamp (UTC). Only returned for user access token grant types (`registration_code`, `authorization_code`, `refresh_token`).
  - `scope` string — Scope of the token.
  - `created_at` string — Token creation time in ISO 8601 format. Only returned for user access token grant types (`registration_code`, `authorization_code`, `refresh_token`).

## Other responses

- `400` — Bad request.
- `401` — Invalid credentials. For example, the user reclaimed the account or an invalid registration code was used.
- `429` — Rate limit exceeded. Retry after the number of seconds specified in the `Retry-After` header.

---

[API](https://skmtc.net/wise/apis/platform-api.md) · [All operations](https://skmtc.net/wise/apis/platform-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/wise/platform-api/revisions/4907a1d269ab/schema)
