/Docs
Search docs or ask a question⌘K
DocsAgent
Changelog
API Reference Get Device Sign-in Request

Get Device Sign-in Request

Look up a pending stx login request before approving or denying it.

GET/v1/auth/device/{userCode}Try it
Session token

Returns what is asking to sign in with a device code — the client, where the request came from, and whether it is still pending. The dashboard's consent screen calls this before showing Authorize device and Deny, so you can check the request before you act on it.

stx login starts the request with POST /v1/auth/device-code, which returns the user code shown in the terminal. Approve it with POST /v1/auth/device-approve, or refuse it with Deny Device Sign-in. Approving a code that has expired returns 410 expired, the same code as polling and this lookup.

Note

Requires a session JWT — the consent screen is signed in. API keys are rejected with 401. Any plan.

Path Parameters

NameDescription
userCode:stringpathRequired
The code shown by stx login, e.g. WDJB-MJHT. Case and the dash are optional: wdjbmjht finds the same request.

Response — 200 OK

NameDescription
client:objectbody
Display labels derived from the CLI's user agent, in the same form as List Sessions. It shows the OS and stx version only when the client sends a stx/<version> (<platform>; <arch>) user agent; otherwise it is "stx CLI" with the address.
ip:string | nullbody
The address the request came from. Display only.
status:stringbody
pending, approved (approved but not yet picked up by the CLI) or denied.

The device code the CLI polls with, and who approved the request, are never returned. Codes last 10 minutes.

Error Responses

401 Unauthorized

unauthorized for a missing, invalid or expired token (or an API key); session_revoked when the session has been signed out.

404 Not Found

not_found — no request has this code. A code stops existing once the CLI has picked up its token.

json
{
"error": {
"code": "not_found",
"message": "Invalid code",
"details": { "traceId": "6f1c2a9e-3b7d-4c11-9a0e-2d5f8b4c7e10" }
}
}

410 Gone

expired — the code has expired. Run stx login again for a new one.

json
{
"error": {
"code": "expired",
"message": "Code has expired",
"details": { "traceId": "6f1c2a9e-3b7d-4c11-9a0e-2d5f8b4c7e10" }
}
}
Was this page helpful? Yes No
Request
cURLJavaScriptPythonGoRubyPHPJavaC#cURL
curl https://api.syntext.dev/v1/auth/device/WDJB-MJHT \
-H "Authorization: Bearer $SYNTEXT_JWT"
Responseapplication/json
200OK
{
"data": {
"userCode": "WDJB-MJHT",
"clientId": "syntext-cli",
"createdAt": "2026-11-08T14:00:00.000Z",
"expiresAt": "2026-11-08T14:10:00.000Z",
"userAgent": "Bun/1.2.19",
"ip": "198.51.100.23",
"client": {
"name": "stx CLI",
"detail": "stx CLI · 198.51.100.23"
},
"status": "pending"
}
}
Product
Resources
Company
© 2026 SyntextBuilt with Syntext