---
title: "Obtain an OAuth token"
method: POST
path: "/m2m-oauth-server/oauth/token"
tags: ["Native OAuth"]
---

# Obtain an OAuth token

`POST /m2m-oauth-server/oauth/token`

This endpoint is used to obtain an OAuth token by providing the necessary credentials and parameters.

## Response `200`

OAuth token obtained successfully

- object
  - `access_token` string — The OAuth access token.
  - `token_type` string — The type of token. Typically 'Bearer'.
  - `expires_in` integer — The expiration time of the token in seconds. If not provided, the token will be valid indefinitely.
  - `scope` string — The scopes granted for the token.

## Other responses

- `401` — Unauthorized. The request requires valid user authentication.

## Changes

- **2026-07-17** `1927458b3ccc` — 3 info
  - api tag `Native OAuth` added
  - added the new optional request property `expiration`
  - added the new optional request property `token_name`
- **2024-07-05** `cfb2166420c3` — 2 warning, 1 info
  - removed the request property `expiration`
  - removed the request property `token_name`
  - api tag `Native OAuth` removed

[Change history](https://skmtc.dev/plgd-dev/apis/plgd-m2m-api/changes/m2m-oauth-server/oauth/token/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)
