---
title: "Look up a pending device code by its 6-digit user code (session only)"
method: GET
path: "/v1/cli-auth/device/{userCode}"
tags: ["Account"]
---

# Look up a pending device code by its 6-digit user code (session only)

`GET /v1/cli-auth/device/{userCode}`

## Request

- Base URL: `https://api.openrelay.inc`
- URL: `https://api.openrelay.inc/v1/cli-auth/device/{userCode}`
- Auth: HTTP bearer

Shows the approval page what a pending device login is: the requesting device's name, the IP that started the flow and when. User sessions only.
Approving or denying a CLI login is something only a signed-in person does, so an API key can never call this. Rate limited per user and per IP, the brute-force mitigation for a guessed 6-digit code.

Requires the `self.update` permission. See [Permissions](https://docs.openrelay.inc/docs/permissions) for the roles and API key permissions that include it.

## Path parameters

- `userCode` string, required

## Response `200`

The pending code's device details

- object
  - `clientIp` string
  - `deviceName` string, required
  - `requestedAt` string, date-time, required
  - `status` string, required: pending, approved, or denied.

## Other responses

- `401`: Missing or invalid API key
- `404`: Resource not found
- `429`: The request is invalid

## Changes

- **2026-10-26** `7fe59d94a9f5`: 3 info
  - added the optional property `requestId` to the response with the `401` status
  - added the optional property `requestId` to the response with the `404` status
  - added the optional property `requestId` to the response with the `429` status
- **2026-10-21** `dc9750cb25b5`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/openrelay/apis/openrelay-api/changes/v1/cli-auth/device/:userCode/get.md)

---

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