---
title: "Create OAuth 2.0 access token"
method: POST
path: "/iam/v2/oauth2/token"
tags: ["OAuth"]
---

# Create OAuth 2.0 access token

`POST /iam/v2/oauth2/token`

This endpoint is an OAuth 2.0 <a href="https://datatracker.ietf.org/doc/html/rfc6749#section-3.2">token endpoint</a> and can be used by a client to obtain an access token.

Use <a href="https://app.atlar.com/users/all">programmatic access user</a> credentials as OAuth 2.0 client credentials.
Use the <i>access key</i> as <a href="https://datatracker.ietf.org/doc/html/rfc6749#section-2.2">client identifier (`client_id`)</a>.
Use the <i>secret</i> as <a href="https://datatracker.ietf.org/doc/html/rfc6749#section-2.3.1">client password (`client_secret`)</a>.

This endpoint supports <a href="https://datatracker.ietf.org/doc/html/rfc6749#section-2.3.1">authentication using HTTP Basic auth</a>.

Supported grant types:
<a href="https://datatracker.ietf.org/doc/html/rfc6749#section-4.4">client_credentials</a> for programmatic access users.

<a href="https://datatracker.ietf.org/doc/html/rfc6749#section-4.1">authorization_code</a> (with PKCE) and
<a href="https://datatracker.ietf.org/doc/html/rfc6749#section-6">refresh_token</a> for MCP CIMD clients.

## Response `200`

Successful OAuth 2.0 <a href="https://datatracker.ietf.org/doc/html/rfc6749#section-4.4.3">access token response</a>.

- OAuth2AccessTokenResponse — Successful OAuth 2.0 access token response.
  - `access_token` string, required
  - `token_type` string, required
  - `expires_in` integer — The lifetime in seconds of the access token.
  - `refresh_token` string — Opaque <a href="https://datatracker.ietf.org/doc/html/rfc6749#section-1.5">OAuth 2.0 refresh token</a> that the client can use to obtain a new access token. Only present when the authorization server issued one for the grant.

## Other responses

- `400` — Invalid access token request.
- `401` — Client authentication failed.

---

[API](https://skmtc.net/atlar/apis/atlar-api-v2.md) · [All operations](https://skmtc.net/atlar/apis/atlar-api-v2/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/atlar/atlar-api-v2/revisions/9c5e194ccf5d/schema)
