---
title: "Create access token"
method: POST
path: "/oauth/token"
tags: ["Authentication"]
---

# Create access token

`POST /oauth/token`

## Request

- Base URL: `https://v3.api.hypertrack.com`
- URL: `https://v3.api.hypertrack.com/oauth/token`
- Auth: none declared
- TypeScript: <https://skmtc.dev/hypertrack/apis/hypertrack-api/docs/oauth/token/post.ts> (a function with typed inputs; its response is checked against the schema)

Exchange your `client_id` and `client_secret` for a short-lived bearer token using the OAuth 2.0 `client_credentials` grant. Send the returned `access_token` as `Authorization: Bearer <access_token>` on all API requests. JSON and form-encoded request bodies are supported. A scope of `*` grants all access allowed by the credentials; it is not restricted.

## Request body

- OAuthTokenRequest
  - `grant_type` 'client_credentials', required: Must be `client_credentials`.
  - `client_id` string, required: Your account's client ID.
  - `client_secret` string, required: Your account's client secret.
  - `scope` string: Optional space-delimited list of scopes, such as `read.embed.orders` or `read.embed.devices`. Defaults to `*`, granting all access allowed by the credentials. Use a narrower scope for restricted views.

## Response `200`

Token issued.

- object
  - `access_token` string: Bearer token to use on subsequent API requests.
  - `token_type` string
  - `expires_in` integer: Token lifetime in seconds.

## Other responses

- `401`: Invalid client credentials.

---

[API](https://skmtc.dev/hypertrack/apis/hypertrack-api.md) - [All operations](https://skmtc.dev/hypertrack/apis/hypertrack-api/llms.txt) - [OpenAPI document](https://skmtc.dev/hypertrack/apis/hypertrack-api/revisions/389326c4c9c8?raw)
