---
title: "POST /api/device-codes"
method: POST
path: "/api/device-codes"
tags: ["device-codes"]
---

# POST /api/device-codes

`POST /api/device-codes`

## Request

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

## Headers

- `Api-Version` string

## Request body

- CreateDeviceCodeCommand
  - `clientId` string, uuid, required

## Response `200`

Success

- DeviceCodeItem
  - `deviceCode` string, required
  - `userCode` string, required
  - `verificationUrl` string, required
  - `expiresIn` integer, required
  - `interval` integer, required

## Changes

- **2023-03-10** `ea159bb388e0`: 15 info
  - the response property `deviceCode` became required for the status `200` (media type: text/plain)
  - the response property `deviceCode` became required for the status `200` (media type: application/json)
  - the response property `deviceCode` became required for the status `200` (media type: text/json)
  - the response property `expiresIn` became required for the status `200` (media type: text/plain)
  - …11 more
- **2023-03-10** `4650ad92794e`: 1 breaking, 1 info
  - request body became required
  - added the new optional `header` request parameter `Api-Version`

[Operation history](https://skmtc.dev/fermyon/apis/fermyon-cloud-api/changes/api/device-codes/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)
