---
title: "Create a token"
method: POST
path: "/oauth/token"
tags: ["API authentication"]
---

# Create a token

`POST /oauth/token`

## Headers

- `IdempotencyKey` string — A unique key per operation, could be V4 UUID or other high‑entropy random string. Keys can be up to 255 characters. See [Idempotent Requests](/docs/idempotent-requests).

## Request body

- union
  - AuthorizationCodeRequest
    - `grant_type` 'authorization_code', required
    - `code` string, required — Non-empty text string
    - `code_verifier` string — Non-empty text string
    - `client_id` string — Non-empty text string
    - `client_secret` string — Non-empty text string
    - `redirect_uri` string, uri, required — HTTP(S) URL
    - `audience` string — Non-empty text string
    - `resource` string, uri — HTTP(S) URL
  - RefreshTokenRequest
    - `grant_type` 'refresh_token', required
    - `refresh_token` string, required — Non-empty text string
    - `client_id` string — Non-empty text string

## Response `200`

Successful operation

- object
  - `access_token` string, required — Non-empty text string
  - `refresh_token` string, required — Non-empty text string
  - `expires_in` integer, required — Non-negative integer (0 to 2147483647)
  - `token_type` 'bearer', required

---

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