---
title: "Generate code [Beta]"
method: POST
path: "/v1/codes/generate"
---

# Generate code \[Beta\]

`POST /v1/codes/generate`

## Request

- Base URL: `https://auth.api.sandbox.cleeng.com`
- URL: `https://auth.api.sandbox.cleeng.com/v1/codes/generate`
- Auth: none required

Use this endpoint to generate a code for a specific device in Device Flow Login (PIN Pair) functionality.

## Headers

- `Content-Type` string

## Request body

- object
  - `deviceId` string, required: Unique device identifier. Minimum length: 1. Maximum length: 128.
  - `deviceName` string, required: User-friendly device name. Minimum length: 1. Maximum length: 128.
  - `broadcasterId` integer, required: Cleeng's broadcaster identifier. Value is publisherId. Minimum: 1. Maximum: 999999999.

## Response `200`

200

- object
  - `code` string
  - `expiresAt` integer
  - `verificationUrl` string

## Other responses

- `400`: 400
- `422`: 422
- `500`: 500

---

[API](https://skmtc.dev/cleeng/apis/authentication-api.md) - [All operations](https://skmtc.dev/cleeng/apis/authentication-api/llms.txt) - [OpenAPI document](https://skmtc.dev/cleeng/apis/authentication-api/revisions/e41656c81b43?raw)
