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

Deny Device Sign-in

Refuse an stx login request you didn't start.

POST/v1/auth/device-denyTry it
Session token

Refuses a pending stx login request. Use it when a code you didn't start shows up on the consent screen. A denied request can't be approved later and never yields a token.

Note

Requires a session JWT. API keys are rejected with 401. Any plan.

Request Body

NameDescription
userCode:stringbodyRequired
The code shown by stx login (1–32 characters). Case and the dash are optional.

Response — 200 OK

Denying a code that is already denied returns the same response.

What the CLI sees

The request is kept until its 10 minutes are up, so a client polling POST /v1/auth/device-token keeps getting the same answer:

json
{
"error": {
"code": "access_denied",
"message": "The sign-in request was denied"
}
}

with status 403. The poll checks for a denial before 428 authorization_pending, and once the code expires it returns 410 expired as before. Trying to approve a denied code with POST /v1/auth/device-approve returns 409 device_denied ("This sign-in request was denied. Run stx login again.").

Note

stx releases before 0.7.0 don't act on access_denied: they keep polling until their own 10-minute timeout, then report that authentication timed out. No token is issued either way. stx 0.7.0 and later stop straight away on a denial, with exit code 1 — see stx login.

Error Responses

400 Bad Request

A missing or empty userCode returns 400 validation_error, with the problem in details.issues.

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 ("Invalid code") — no request has this code. This includes a code whose token the CLI has already picked up.

409 Conflict

already_approved — the code has already been approved. To undo an approved stx login, revoke its session instead:

json
{
"error": {
"code": "already_approved",
"message": "This code was already used to sign in. Revoke the session from Profile instead.",
"details": { "traceId": "6f1c2a9e-3b7d-4c11-9a0e-2d5f8b4c7e10" }
}
}

410 Gone

expired ("Code has expired") — the code has expired.

Was this page helpful? Yes No
Request
cURLJavaScriptPythonGoRubyPHPJavaC#cURL
curl -X POST https://api.syntext.dev/v1/auth/device-deny \
-H "Authorization: Bearer $SYNTEXT_JWT" \
-H "Content-Type: application/json" \
-d '{ "userCode": "WDJB-MJHT" }'
Responseapplication/json
200OK
{
"data": {
"denied": true
}
}
Product
Resources
Company
© 2026 SyntextBuilt with Syntext