Deny a device login
Denies the device login; the CLI's next poll receives `access_denied`.
POST
/v1/auth/device/{user_code}/deny
Denies the device login; the CLI's next poll receives `access_denied`.
Authentication
API Key (cookie: __Host-b3os_session)
Path Parameters
user_code
string
required
path
The code the CLI showed, with or without the dash.
Example:
"WDJB-MJHT"Header Parameters
x-b3os-csrf
string
required
header
The `csrf_token` from `GET /v1/auth/session`.
Example:
"9f8b7c6d5e4f3a2b1c0d9e8f7a6b5c4d"Responses
200
The denied device login.
application/jsonobject
string
REQUIRED
Enum:
device_authorizationuser_code
string
REQUIRED
client_id
string
REQUIRED
client_name
string
REQUIRED
scopes
string[]
REQUIRED
Array of:
string
status
string
REQUIRED
Enum:
pending, approved, denied, expireduser_agent
string | null
REQUIRED
created_at
string (date-time)
REQUIRED
expires_at
string (date-time)
REQUIRED
decided_at
string (date-time) | null
REQUIRED
400
The request failed validation (`invalid_request`, `invalid_url`).
application/problem+jsontype
string (uri)
REQUIRED
`https://docs.beta.b3os.org/errors#<code>`.
title
string
REQUIRED
Short summary of the problem type.
status
integer
REQUIRED
The HTTP status code, repeated for convenience.
code
string
REQUIRED
Stable machine-readable error code from the errors catalog.
detail
string
REQUIRED
Explanation of this occurrence. Never contains secrets.
instance
string
The request ID (`req_…`) of the request that failed. Include it when you contact support.
errors
object[]
Validation problems, one per field (`invalid_request` and the other codes that list `errors`).
Array of:
pointer
string
REQUIRED
Where the problem is: a JSON pointer into the request body (`/url`, `/steps/0/uses`), or `#query/<name>`,
`#path/<name>` or `#header/<name>` for parameters.
detail
string
REQUIRED
What is wrong there.
reason
string
Finer-grained cause for codes that document one (`unauthorized`, `forbidden`, `egress_denied`, `upstream_unreachable`, …).
required_scope
string
The scope that was missing (`forbidden` with `reason: scope`).
retry_after_s
integer
Same value as the `Retry-After` header, for clients that only read the body.
limit
object
The limit an error refers to. IDs and current values are listed by `GET /v1/limits`.
id
string
REQUIRED
Limit ID, such as `vision.scrape.rpm` or `sandboxes.concurrent`.
limit
number
REQUIRED
The limit's value.
unit
string
REQUIRED
What the limit counts, such as `requests`, `sandboxes`, `vcpu` or `MiB`.
window_s
integer
Window length in seconds for rate limits and quotas.
current
number
Current usage against the limit, when known.
current_status
string
The object's current status, for state conflicts such as `sandbox_not_running`.
upstream_status
integer
The HTTP status the upstream returned (`upstream_error`, `action_output_invalid`).
step
string
The failed step, as a step ID (routines), an index (`act`) or a path such as `beats/2/do/0` (render).
pack_error
object
The error a pack's error mapping chose (`upstream_error` from pack actions).
code
string
REQUIRED
message
string
REQUIRED
retryable
boolean
REQUIRED
401
Missing, malformed, expired or revoked credentials (`unauthorized`).
application/problem+jsontype
string (uri)
REQUIRED
`https://docs.beta.b3os.org/errors#<code>`.
title
string
REQUIRED
Short summary of the problem type.
status
integer
REQUIRED
The HTTP status code, repeated for convenience.
code
string
REQUIRED
Stable machine-readable error code from the errors catalog.
detail
string
REQUIRED
Explanation of this occurrence. Never contains secrets.
instance
string
The request ID (`req_…`) of the request that failed. Include it when you contact support.
errors
object[]
Validation problems, one per field (`invalid_request` and the other codes that list `errors`).
Array of:
pointer
string
REQUIRED
Where the problem is: a JSON pointer into the request body (`/url`, `/steps/0/uses`), or `#query/<name>`,
`#path/<name>` or `#header/<name>` for parameters.
detail
string
REQUIRED
What is wrong there.
reason
string
Finer-grained cause for codes that document one (`unauthorized`, `forbidden`, `egress_denied`, `upstream_unreachable`, …).
required_scope
string
The scope that was missing (`forbidden` with `reason: scope`).
retry_after_s
integer
Same value as the `Retry-After` header, for clients that only read the body.
limit
object
The limit an error refers to. IDs and current values are listed by `GET /v1/limits`.
id
string
REQUIRED
Limit ID, such as `vision.scrape.rpm` or `sandboxes.concurrent`.
limit
number
REQUIRED
The limit's value.
unit
string
REQUIRED
What the limit counts, such as `requests`, `sandboxes`, `vcpu` or `MiB`.
window_s
integer
Window length in seconds for rate limits and quotas.
current
number
Current usage against the limit, when known.
current_status
string
The object's current status, for state conflicts such as `sandbox_not_running`.
upstream_status
integer
The HTTP status the upstream returned (`upstream_error`, `action_output_invalid`).
step
string
The failed step, as a step ID (routines), an index (`act`) or a path such as `beats/2/do/0` (render).
pack_error
object
The error a pack's error mapping chose (`upstream_error` from pack actions).
code
string
REQUIRED
message
string
REQUIRED
retryable
boolean
REQUIRED
403
Authenticated but not allowed (`forbidden`, `egress_denied`).
application/problem+jsontype
string (uri)
REQUIRED
`https://docs.beta.b3os.org/errors#<code>`.
title
string
REQUIRED
Short summary of the problem type.
status
integer
REQUIRED
The HTTP status code, repeated for convenience.
code
string
REQUIRED
Stable machine-readable error code from the errors catalog.
detail
string
REQUIRED
Explanation of this occurrence. Never contains secrets.
instance
string
The request ID (`req_…`) of the request that failed. Include it when you contact support.
errors
object[]
Validation problems, one per field (`invalid_request` and the other codes that list `errors`).
Array of:
pointer
string
REQUIRED
Where the problem is: a JSON pointer into the request body (`/url`, `/steps/0/uses`), or `#query/<name>`,
`#path/<name>` or `#header/<name>` for parameters.
detail
string
REQUIRED
What is wrong there.
reason
string
Finer-grained cause for codes that document one (`unauthorized`, `forbidden`, `egress_denied`, `upstream_unreachable`, …).
required_scope
string
The scope that was missing (`forbidden` with `reason: scope`).
retry_after_s
integer
Same value as the `Retry-After` header, for clients that only read the body.
limit
object
The limit an error refers to. IDs and current values are listed by `GET /v1/limits`.
id
string
REQUIRED
Limit ID, such as `vision.scrape.rpm` or `sandboxes.concurrent`.
limit
number
REQUIRED
The limit's value.
unit
string
REQUIRED
What the limit counts, such as `requests`, `sandboxes`, `vcpu` or `MiB`.
window_s
integer
Window length in seconds for rate limits and quotas.
current
number
Current usage against the limit, when known.
current_status
string
The object's current status, for state conflicts such as `sandbox_not_running`.
upstream_status
integer
The HTTP status the upstream returned (`upstream_error`, `action_output_invalid`).
step
string
The failed step, as a step ID (routines), an index (`act`) or a path such as `beats/2/do/0` (render).
pack_error
object
The error a pack's error mapping chose (`upstream_error` from pack actions).
code
string
REQUIRED
message
string
REQUIRED
retryable
boolean
REQUIRED
404
The device code is unknown or expired (`user_code_not_found`).
application/problem+jsontype
string (uri)
REQUIRED
`https://docs.beta.b3os.org/errors#<code>`.
title
string
REQUIRED
Short summary of the problem type.
status
integer
REQUIRED
The HTTP status code, repeated for convenience.
code
string
REQUIRED
Stable machine-readable error code from the errors catalog.
detail
string
REQUIRED
Explanation of this occurrence. Never contains secrets.
instance
string
The request ID (`req_…`) of the request that failed. Include it when you contact support.
errors
object[]
Validation problems, one per field (`invalid_request` and the other codes that list `errors`).
Array of:
pointer
string
REQUIRED
Where the problem is: a JSON pointer into the request body (`/url`, `/steps/0/uses`), or `#query/<name>`,
`#path/<name>` or `#header/<name>` for parameters.
detail
string
REQUIRED
What is wrong there.
reason
string
Finer-grained cause for codes that document one (`unauthorized`, `forbidden`, `egress_denied`, `upstream_unreachable`, …).
required_scope
string
The scope that was missing (`forbidden` with `reason: scope`).
retry_after_s
integer
Same value as the `Retry-After` header, for clients that only read the body.
limit
object
The limit an error refers to. IDs and current values are listed by `GET /v1/limits`.
id
string
REQUIRED
Limit ID, such as `vision.scrape.rpm` or `sandboxes.concurrent`.
limit
number
REQUIRED
The limit's value.
unit
string
REQUIRED
What the limit counts, such as `requests`, `sandboxes`, `vcpu` or `MiB`.
window_s
integer
Window length in seconds for rate limits and quotas.
current
number
Current usage against the limit, when known.
current_status
string
The object's current status, for state conflicts such as `sandbox_not_running`.
upstream_status
integer
The HTTP status the upstream returned (`upstream_error`, `action_output_invalid`).
step
string
The failed step, as a step ID (routines), an index (`act`) or a path such as `beats/2/do/0` (render).
pack_error
object
The error a pack's error mapping chose (`upstream_error` from pack actions).
code
string
REQUIRED
message
string
REQUIRED
retryable
boolean
REQUIRED
409
The device login was already approved or denied (`device_authorization_finished`).
application/problem+jsontype
string (uri)
REQUIRED
`https://docs.beta.b3os.org/errors#<code>`.
title
string
REQUIRED
Short summary of the problem type.
status
integer
REQUIRED
The HTTP status code, repeated for convenience.
code
string
REQUIRED
Stable machine-readable error code from the errors catalog.
detail
string
REQUIRED
Explanation of this occurrence. Never contains secrets.
instance
string
The request ID (`req_…`) of the request that failed. Include it when you contact support.
errors
object[]
Validation problems, one per field (`invalid_request` and the other codes that list `errors`).
Array of:
pointer
string
REQUIRED
Where the problem is: a JSON pointer into the request body (`/url`, `/steps/0/uses`), or `#query/<name>`,
`#path/<name>` or `#header/<name>` for parameters.
detail
string
REQUIRED
What is wrong there.
reason
string
Finer-grained cause for codes that document one (`unauthorized`, `forbidden`, `egress_denied`, `upstream_unreachable`, …).
required_scope
string
The scope that was missing (`forbidden` with `reason: scope`).
retry_after_s
integer
Same value as the `Retry-After` header, for clients that only read the body.
limit
object
The limit an error refers to. IDs and current values are listed by `GET /v1/limits`.
id
string
REQUIRED
Limit ID, such as `vision.scrape.rpm` or `sandboxes.concurrent`.
limit
number
REQUIRED
The limit's value.
unit
string
REQUIRED
What the limit counts, such as `requests`, `sandboxes`, `vcpu` or `MiB`.
window_s
integer
Window length in seconds for rate limits and quotas.
current
number
Current usage against the limit, when known.
current_status
string
The object's current status, for state conflicts such as `sandbox_not_running`.
upstream_status
integer
The HTTP status the upstream returned (`upstream_error`, `action_output_invalid`).
step
string
The failed step, as a step ID (routines), an index (`act`) or a path such as `beats/2/do/0` (render).
pack_error
object
The error a pack's error mapping chose (`upstream_error` from pack actions).
code
string
REQUIRED
message
string
REQUIRED
retryable
boolean
REQUIRED
429
A rate, concurrency or quota limit applies (`rate_limited`, `concurrency_limited`, `quota_exceeded`).
application/problem+jsontype
string (uri)
REQUIRED
`https://docs.beta.b3os.org/errors#<code>`.
title
string
REQUIRED
Short summary of the problem type.
status
integer
REQUIRED
The HTTP status code, repeated for convenience.
code
string
REQUIRED
Stable machine-readable error code from the errors catalog.
detail
string
REQUIRED
Explanation of this occurrence. Never contains secrets.
instance
string
The request ID (`req_…`) of the request that failed. Include it when you contact support.
errors
object[]
Validation problems, one per field (`invalid_request` and the other codes that list `errors`).
Array of:
pointer
string
REQUIRED
Where the problem is: a JSON pointer into the request body (`/url`, `/steps/0/uses`), or `#query/<name>`,
`#path/<name>` or `#header/<name>` for parameters.
detail
string
REQUIRED
What is wrong there.
reason
string
Finer-grained cause for codes that document one (`unauthorized`, `forbidden`, `egress_denied`, `upstream_unreachable`, …).
required_scope
string
The scope that was missing (`forbidden` with `reason: scope`).
retry_after_s
integer
Same value as the `Retry-After` header, for clients that only read the body.
limit
object
The limit an error refers to. IDs and current values are listed by `GET /v1/limits`.
id
string
REQUIRED
Limit ID, such as `vision.scrape.rpm` or `sandboxes.concurrent`.
limit
number
REQUIRED
The limit's value.
unit
string
REQUIRED
What the limit counts, such as `requests`, `sandboxes`, `vcpu` or `MiB`.
window_s
integer
Window length in seconds for rate limits and quotas.
current
number
Current usage against the limit, when known.
current_status
string
The object's current status, for state conflicts such as `sandbox_not_running`.
upstream_status
integer
The HTTP status the upstream returned (`upstream_error`, `action_output_invalid`).
step
string
The failed step, as a step ID (routines), an index (`act`) or a path such as `beats/2/do/0` (render).
pack_error
object
The error a pack's error mapping chose (`upstream_error` from pack actions).
code
string
REQUIRED
message
string
REQUIRED
retryable
boolean
REQUIRED
500
Something failed inside B3OS (`internal`). Retry with backoff.
application/problem+jsontype
string (uri)
REQUIRED
`https://docs.beta.b3os.org/errors#<code>`.
title
string
REQUIRED
Short summary of the problem type.
status
integer
REQUIRED
The HTTP status code, repeated for convenience.
code
string
REQUIRED
Stable machine-readable error code from the errors catalog.
detail
string
REQUIRED
Explanation of this occurrence. Never contains secrets.
instance
string
The request ID (`req_…`) of the request that failed. Include it when you contact support.
errors
object[]
Validation problems, one per field (`invalid_request` and the other codes that list `errors`).
Array of:
pointer
string
REQUIRED
Where the problem is: a JSON pointer into the request body (`/url`, `/steps/0/uses`), or `#query/<name>`,
`#path/<name>` or `#header/<name>` for parameters.
detail
string
REQUIRED
What is wrong there.
reason
string
Finer-grained cause for codes that document one (`unauthorized`, `forbidden`, `egress_denied`, `upstream_unreachable`, …).
required_scope
string
The scope that was missing (`forbidden` with `reason: scope`).
retry_after_s
integer
Same value as the `Retry-After` header, for clients that only read the body.
limit
object
The limit an error refers to. IDs and current values are listed by `GET /v1/limits`.
id
string
REQUIRED
Limit ID, such as `vision.scrape.rpm` or `sandboxes.concurrent`.
limit
number
REQUIRED
The limit's value.
unit
string
REQUIRED
What the limit counts, such as `requests`, `sandboxes`, `vcpu` or `MiB`.
window_s
integer
Window length in seconds for rate limits and quotas.
current
number
Current usage against the limit, when known.
current_status
string
The object's current status, for state conflicts such as `sandbox_not_running`.
upstream_status
integer
The HTTP status the upstream returned (`upstream_error`, `action_output_invalid`).
step
string
The failed step, as a step ID (routines), an index (`act`) or a path such as `beats/2/do/0` (render).
pack_error
object
The error a pack's error mapping chose (`upstream_error` from pack actions).
code
string
REQUIRED
message
string
REQUIRED
retryable
boolean
REQUIRED
503
The node or the product is not available right now (`node_unavailable`, `product_unavailable`, `capacity_unavailable`).
application/problem+jsontype
string (uri)
REQUIRED
`https://docs.beta.b3os.org/errors#<code>`.
title
string
REQUIRED
Short summary of the problem type.
status
integer
REQUIRED
The HTTP status code, repeated for convenience.
code
string
REQUIRED
Stable machine-readable error code from the errors catalog.
detail
string
REQUIRED
Explanation of this occurrence. Never contains secrets.
instance
string
The request ID (`req_…`) of the request that failed. Include it when you contact support.
errors
object[]
Validation problems, one per field (`invalid_request` and the other codes that list `errors`).
Array of:
pointer
string
REQUIRED
Where the problem is: a JSON pointer into the request body (`/url`, `/steps/0/uses`), or `#query/<name>`,
`#path/<name>` or `#header/<name>` for parameters.
detail
string
REQUIRED
What is wrong there.
reason
string
Finer-grained cause for codes that document one (`unauthorized`, `forbidden`, `egress_denied`, `upstream_unreachable`, …).
required_scope
string
The scope that was missing (`forbidden` with `reason: scope`).
retry_after_s
integer
Same value as the `Retry-After` header, for clients that only read the body.
limit
object
The limit an error refers to. IDs and current values are listed by `GET /v1/limits`.
id
string
REQUIRED
Limit ID, such as `vision.scrape.rpm` or `sandboxes.concurrent`.
limit
number
REQUIRED
The limit's value.
unit
string
REQUIRED
What the limit counts, such as `requests`, `sandboxes`, `vcpu` or `MiB`.
window_s
integer
Window length in seconds for rate limits and quotas.
current
number
Current usage against the limit, when known.
current_status
string
The object's current status, for state conflicts such as `sandbox_not_running`.
upstream_status
integer
The HTTP status the upstream returned (`upstream_error`, `action_output_invalid`).
step
string
The failed step, as a step ID (routines), an index (`act`) or a path such as `beats/2/do/0` (render).
pack_error
object
The error a pack's error mapping chose (`upstream_error` from pack actions).
code
string
REQUIRED
message
string
REQUIRED
retryable
boolean
REQUIRED
curl -X POST 'https://beta.b3os.org/v1/auth/device/WDJB-MJHT/deny' \ -H 'Authorization: Bearer YOUR_API_TOKEN' \ -H 'x-b3os-csrf: 9f8b7c6d5e4f3a2b1c0d9e8f7a6b5c4d'
const response = await fetch('https://beta.b3os.org/v1/auth/device/WDJB-MJHT/deny', { method: 'POST', headers: { "Authorization": "Bearer YOUR_API_TOKEN", "x-b3os-csrf": "9f8b7c6d5e4f3a2b1c0d9e8f7a6b5c4d" }});const data = await response.json();console.log(data);
import requestsheaders = { 'Authorization': 'Bearer YOUR_API_TOKEN', 'x-b3os-csrf': '9f8b7c6d5e4f3a2b1c0d9e8f7a6b5c4d'}response = requests.post('https://beta.b3os.org/v1/auth/device/WDJB-MJHT/deny', headers=headers)print(response.json())
200
Response
{ "object": "device_authorization", "user_code": "WDJB-MJHT", "client_id": "b3os-cli", "client_name": "B3OS CLI", "scopes": [ "*" ], "status": "denied", "user_agent": "b3os-cli/0.1.0 (darwin arm64)", "created_at": "2026-10-25T22:30:00.000Z", "expires_at": "2026-10-25T22:45:00.000Z", "decided_at": "2026-10-25T22:31:10.000Z"}
400
Response
{ "type": "https://docs.beta.b3os.org/errors#invalid_request", "title": "Invalid request", "status": 400, "code": "invalid_request", "detail": "1 field failed validation", "instance": "req_01m5t4yg394wegr3j4y01qb363", "errors": [ { "pointer": "/url", "detail": "must be an absolute http or https URL" } ]}
401
Response
{ "type": "https://docs.beta.b3os.org/errors#unauthorized", "title": "Unauthorized", "status": 401, "code": "unauthorized", "detail": "API key checksum does not match; check that the whole key was copied", "instance": "req_01m5t4yg394wegr3j4y01qb363", "reason": "malformed"}
403
Response
{ "type": "https://docs.beta.b3os.org/errors#forbidden", "title": "Forbidden", "status": 403, "code": "forbidden", "detail": "This key lacks the scope sandboxes:write", "instance": "req_01m5t4yg394wegr3j4y01qb363", "reason": "scope", "required_scope": "sandboxes:write"}
404
Response
{ "type": "https://docs.beta.b3os.org/errors#user_code_not_found", "title": "Device code not found", "status": 404, "code": "user_code_not_found", "detail": "WDJB-MJHT is unknown or expired; run b3os login again", "instance": "req_01m5t4yg394wegr3j4y01qb363"}
409
Response
{ "type": "https://docs.beta.b3os.org/errors#device_authorization_finished", "title": "Device login already decided", "status": 409, "code": "device_authorization_finished", "detail": "WDJB-MJHT was already approved", "instance": "req_01m5t4yg394wegr3j4y01qb363", "current_status": "approved"}
429
Response
{ "type": "https://docs.beta.b3os.org/errors#rate_limited", "title": "Rate limited", "status": 429, "code": "rate_limited", "detail": "60 scrapes per minute allowed; retry in 12 seconds", "instance": "req_01m5t4yg394wegr3j4y01qb363", "retry_after_s": 12, "limit": { "id": "vision.scrape.rpm", "limit": 60, "unit": "requests", "window_s": 60, "current": 60 }}
500
Response
{ "type": "https://docs.beta.b3os.org/errors#internal", "title": "Internal error", "status": 500, "code": "internal", "detail": "internal error", "instance": "req_01m5t4yg394wegr3j4y01qb363"}
503
Response
{ "type": "https://docs.beta.b3os.org/errors#node_unavailable", "title": "Node unavailable", "status": 503, "code": "node_unavailable", "detail": "Node n1 is not reachable; retry in 5 seconds", "instance": "req_01m5t4yg394wegr3j4y01qb363", "retry_after_s": 5}
API Playground
Try this endpoint
POST
/v1/auth/device/{user_code}/deny
Response
Response Headers
Request History
Was this page helpful?