---
title: "POST /api/auth-tokens"
method: POST
path: "/api/auth-tokens"
tags: ["auth-tokens"]
---

# POST /api/auth-tokens

`POST /api/auth-tokens`

## Request

- The document declares no server URL.
- Auth: API key in header `Authorization`
- TypeScript: <https://skmtc.dev/fermyon/apis/fermyon-cloud-api/docs/api/auth-tokens/post.ts> (a function with typed inputs; its response is checked against the schema)

## Headers

- `Api-Version` string

## Request body

- CreateTokenCommand
  - `providerCode` string
  - `clientId` string
  - `provider` 'GitHub' | 'DeviceFlow'
  - `isMarketingEmailOn` boolean

## Response `200`

Success

- TokenInfo
  - `token` string, required
  - `refreshToken` string, required
  - `expiration` string, date-time, required

## Changes

- **2024-05-01** `78d366daf86a`: 4 breaking
  - removed the enum value `GitHubPersonalToken` of the request property `provider` (media type: application/json-patch+json)
  - removed the enum value `GitHubPersonalToken` of the request property `provider` (media type: application/json)
  - removed the enum value `GitHubPersonalToken` of the request property `provider` (media type: text/json)
  - removed the enum value `GitHubPersonalToken` of the request property `provider` (media type: application/*+json)
- **2024-01-18** `902971e033f7`: 4 info
  - added the new `GitHubPersonalToken` enum value to the request property `provider` (media type: application/json-patch+json)
  - added the new `GitHubPersonalToken` enum value to the request property `provider` (media type: application/json)
  - added the new `GitHubPersonalToken` enum value to the request property `provider` (media type: text/json)
  - added the new `GitHubPersonalToken` enum value to the request property `provider` (media type: application/*+json)
- …earlier changes not shown

[Operation history](https://skmtc.dev/fermyon/apis/fermyon-cloud-api/changes/api/auth-tokens/post.md)

---

[API](https://skmtc.dev/fermyon/apis/fermyon-cloud-api.md) - [All operations](https://skmtc.dev/fermyon/apis/fermyon-cloud-api/llms.txt) - [OpenAPI document](https://skmtc.dev/fermyon/apis/fermyon-cloud-api/revisions/78d366daf86a?raw)
