PUT/api/apps/{app_id}/device-authorizationAuthenticated

Enable or disable an app's device authorization grant

Enables or disables the OAuth 2.0 device authorization grant (RFC 8628) for the client application. Enable it for apps that run where the login page cannot be shown, such as command-line tools or TV apps: the app then asks POST /api/oidc/device_authorization for a code, and its users approve it on the auth server's /device page. It is off by default because whoever starts a device flow chooses who is shown its code: anyone who knows the app's id can ask a user to approve a request in the app's name. Disabling takes effect at once: the app's requests that were not redeemed yet are discarded, and devices still polling get unauthorized_client. Dynamically registered clients can never use the grant, so the setting cannot be changed for them either way (409). Idempotent. Requires management access; hardcoded apps cannot be configured.

operationId put_api_apps_app_id_device_authorizationClient applications

Authentication & permissionsAuthenticated

Any authenticated user

Accepted credentials
Who may call
Any authenticated user

Path parameters

NameTypeDescription
app_id*string

Client application id

Request body

Required

application/json
SetAppDeviceAuthorizationPolicyRequest
PropertyTypeDescription
enabled*boolean

Enable or disable the device authorization grant for the app. Disabling discards the app's device sign-in requests that were not redeemed yet.

JSONExample
"enabled"true

Responses

application/json
AppDeviceAuthorizationPolicyResponse
PropertyTypeDescription
success*true
available*boolean

Whether the app can use the grant at all: false for dynamically registered clients, which never can

enabled*boolean

Whether the app may start device flows (POST /api/oidc/device_authorization) and redeem them

enabled_at*integer | null | null

When it was enabled (Unix epoch ms); null when disabled

JSONExample
"success"true
"available"true
"enabled"true
"enabled_at"1

Example request

bashcurl
curl -X PUT 'https://auth.botreeinc.com/api/apps/<app_id>/device-authorization' \
  -b 'refresh_token_<auth_server_app_id>=<value>' \
  -H 'Content-Type: application/json' \
  -d '{
  "enabled": true
}'
PUT /api/apps/{app_id}/device-authorization | Botree Auth API