---
title: "Generate token"
method: POST
path: "/v2.0/auth/token"
tags: ["Authentication"]
---

# Generate token

`POST /v2.0/auth/token`

## Request

- Base URL: `https://api.freightview.dev`
- URL: `https://api.freightview.dev/v2.0/auth/token`
- Auth: none required

This endpoint can be used to generate a bearer token for use as the authentication for all other v2.0 endpoints.

## Request body

- GenerateTokenReqDTO
  - `client_id` string, required: The client id to use when generating the access token.
  - `client_secret` string, required: The client secret to use when generating the access token.
  - `grant_type` 'client_credentials', required: The grant type to use when generating access token.

## Response `200`

Success

- TokenResponseDTO
  - `access_token` string: The access token that should be used as the bearer token on all subsequent API calls.
  - `expires_in` number: The amount of time the token is valid. Will always be 86400 seconds (24 hours).
  - `scope` string: The access token scope.
  - `token_type` 'Bearer': The type of token generated. Will always be **Bearer**.

## Other responses

- `400`: Bad Request
- `401`: Unauthorized
- `402`: Payment Required
- `429`: Rate Limit Exceeded
- `500`: Internal Server Error

---

[API](https://skmtc.dev/freightview/apis/freightview-api-v2-0.md) · [All operations](https://skmtc.dev/freightview/apis/freightview-api-v2-0/llms.txt) · [OpenAPI document](https://skmtc.dev/freightview/apis/freightview-api-v2-0/revisions/8f35f3ad0a29?raw)
