---
title: "Issue an OAuth token"
method: POST
path: "/v1/oauth/token/"
---

# Issue an OAuth token

`POST /v1/oauth/token/`

## Request

- Base URL: `https://app.iconik.io/API/auth`
- URL: `https://app.iconik.io/API/auth/v1/oauth/token/`
- Auth: none declared
- TypeScript: <https://skmtc.dev/iconik/apis/iconik-auth/docs/v1/oauth/token/post.ts> (a function with typed inputs; its response is checked against the schema)

## Query parameters

- `expires_in` integer

## Headers

- `Authorization` string

## Request body `application/x-www-form-urlencoded`

- object
  - `client_id` string: The OAuth2 client ID (application ID). Required unless the client authenticates with HTTP Basic.
  - `client_secret` string: The OAuth2 client secret (required for the client_credentials grant unless sent as HTTP Basic credentials)
  - `code` string: The authorization code (required for authorization_code grant)
  - `code_verifier` string: The PKCE code verifier (required for authorization_code grant)
  - `grant_type` 'authorization_code' | 'client_credentials' | 'refresh_token', required: The OAuth2 grant type
  - `redirect_uri` string: The redirect URI used in the authorization request (required for authorization_code grant)
  - `refresh_token` string: The refresh token (required for refresh_token grant)
  - `scope` string: The requested scope. Used by the client_credentials grant, and by the refresh_token grant to request a subset of the scope already granted (a broader scope is rejected).

## Response `200`

Returns a new generated token for particular user

- TokenSchema
  - `app_id` string, uuid
  - `auth_system_domains` MultiDomainUserSystemSchema[]
    - `logo_url` string, url
    - `mfa_methods` string[]
    - `mfa_methods_configured` string[]
    - `mfa_required` boolean
    - `mfa_required_configured` boolean
    - `platform_url` string, url
    - `system_domain_id` string, uuid, required
    - `system_domain_name` string
    - `url` string, url
  - `date_created` string, date-time
  - `date_modified` string, date-time
  - `expires` string, date-time
  - `id` string, uuid
  - `is_admin` boolean
  - `is_mfa_authenticated` boolean
  - `is_saml_authenticated` boolean
  - `is_super_admin` boolean
  - `is_super_admin_light` boolean
  - `system_domain_id` string, uuid
  - `system_domain_is_plg` boolean
  - `system_domain_status` 'ACTIVE' | 'WARNING' | 'FROZEN' | 'DEACTIVATED'
  - `system_domain_type` string
  - `system_domain_warning_message` string
  - `system_domains` string[]
  - `token` string, required
  - `user_id` string, uuid

## Other responses

- `400`: Bad request
- `default`: Error response

---

[API](https://skmtc.dev/iconik/apis/iconik-auth.md) - [All operations](https://skmtc.dev/iconik/apis/iconik-auth/llms.txt) - [OpenAPI document](https://skmtc.dev/iconik/apis/iconik-auth/revisions/5dde985bb742?raw)
