FruxonDocs
ApiDevice authorization

Begin a device-authorization (browser-login) flow.

Unauthenticated — the client calls this before it has any credentials. Returns a high-entropy `deviceCode` the client keeps secret and echoes back on every poll, a short human-readable `userCode`, and the URL it should open in the user's browser (the URL carries the `userCode`, never the device code). Grant expires in 10 minutes.

POST
/v1/deviceAuthorizations

The preset the client wants the minted key scoped to (REQUIRED — there is no server-side default), plus optional client identity (clientType / clientName) and device identity (deviceId / deviceLabel) so a re-login from the same machine rotates its credential in place.

clientType?string

What kind of client is starting the flow (CLI / IDE / desktop / MCP). Drives the approval-page copy and the minted token's display name. Defaults to Fruxon.Model.DeviceAuth.ClientType.Unspecified (treated as CLI) when the client doesn't send it.

Value in"UNSPECIFIED" | "CLI" | "IDE" | "DESKTOP" | "MCP" | "OTHER"
clientName?string|null

Optional human-readable client name (e.g. "Fruxon CLI 0.4.1", "VS Code"). Display/attribution only. Null when not provided.

deviceId?string|null

Stable per-install device id (a UUID the client generates once and persists). Null when the client doesn't send it.

deviceLabel?string|null

Human-readable device label (e.g. hostname), best-effort. Attribution only — never gates anything. Null when not provided.

preset?string|null

Named preset the client wants the minted key scoped to — one of observer, operator, developer, maintainer, admin. REQUIRED: the client knows what access it needs and must say so — there is no server-side default. The user's role at the approval page is to see it and approve/deny, not to choose (the GitHub device-flow model).

[key: string]?never

Response Body

curl -X POST "https://api.fruxon.com/v1/deviceAuthorizations" \  -H "Content-Type: application/json" \  -d '{}'
{
  "deviceCode": "string",
  "userCode": "string",
  "verificationUri": "string",
  "verificationUriComplete": "string",
  "expiresInSeconds": 0,
  "pollIntervalSeconds": 0
}
{
  "type": "string",
  "title": "string",
  "status": 0,
  "detail": "string",
  "instance": "string",
  "property1": null,
  "property2": null
}
{
  "type": "string",
  "title": "string",
  "status": 0,
  "detail": "string",
  "instance": "string",
  "property1": null,
  "property2": null
}