---
title: "Creates a new token"
method: POST
path: "/m2m-oauth-server/api/v1/tokens"
tags: ["Tokens"]
---

# Creates a new token

`POST /m2m-oauth-server/api/v1/tokens`

## Request body

- PbCreateTokenRequest
  - `clientId` string
  - `clientSecret` string
  - `audience` string[]
  - `scope` string[]
  - `expiration` string, int64
  - `clientAssertionType` string
  - `clientAssertion` string
  - `tokenName` string
  - `grantType` string

## Response `200`

A successful response.

- PbCreateTokenResponse
  - `accessToken` string
  - `tokenType` string
  - `expiresIn` string, int64
  - `scope` string[]

## Other responses

- `default` — An unexpected error response.

## Changes

- **2026-07-17** `1927458b3ccc` — 1 info
  - endpoint added
- **2024-07-05** `cfb2166420c3` — 1 breaking
  - api path removed without deprecation

[Change history](https://skmtc.dev/plgd-dev/apis/plgd-m2m-api/changes/m2m-oauth-server/api/v1/tokens/post.md)

---

[API](https://skmtc.dev/plgd-dev/apis/plgd-m2m-api.md) · [All operations](https://skmtc.dev/plgd-dev/apis/plgd-m2m-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/plgd-dev/plgd-m2m-api/revisions/1927458b3ccc/schema)
