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

# Create a token

`POST /oauth/token`

## Request

- Base URL: `https://core.sivo.com`
- URL: `https://core.sivo.com/oauth/token`
- Auth: one of:
  - API key in header `Authorization`
  - OAuth 2
    - Authorization code: `https://dashboard.sivo.com/oauth/authorize`
    - Client credentials
    - Token URL: `https://core.sivo.com/oauth/token`
- TypeScript: <https://skmtc.dev/sivo/apis/sivo-advance-api/docs/oauth/token/post.ts> (a function with typed inputs; its response is checked against the schema)

## Headers

- `Idempotency-Key` string: A unique key per operation, could be V4 UUID or other high‑entropy random string. Keys can be up to 256 bytes. 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

## Changes

- **2026-11-03** `4bbab9699612`: 1 warning, 1 info
  - deleted the `header` request parameter `IdempotencyKey`
  - added the new optional `header` request parameter `Idempotency-Key`

[Operation history](https://skmtc.dev/sivo/apis/sivo-advance-api/changes/oauth/token/post.md)

---

[API](https://skmtc.dev/sivo/apis/sivo-advance-api.md) - [All operations](https://skmtc.dev/sivo/apis/sivo-advance-api/llms.txt) - [OpenAPI document](https://skmtc.dev/sivo/apis/sivo-advance-api/revisions/4bbab9699612?raw)
