putUserScreenScopes
const url = 'https://example.com/api/v1/users/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/screen-scopes';const options = { method: 'PUT', headers: {'X-CSRF-Token': 'example', 'Content-Type': 'application/json'}, body: '{"mode":"all","scopes":[{"type":"location","id":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","name":"example"}]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PUT \ --url https://example.com/api/v1/users/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/screen-scopes \ --header 'Content-Type: application/json' \ --header 'X-CSRF-Token: example' \ --data '{ "mode": "all", "scopes": [ { "type": "location", "id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "name": "example" } ] }'Replace an account’s screen access. Requires users.manage and the admin scope. Cookie-authenticated unsafe requests require X-CSRF-Token. mode is required: all screens is an explicit choice, never an empty grant list. An Owner cannot be restricted, nobody can change their own screen access, and a caller with restricted screen access may grant only locations and Display Groups granted to it directly.
Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters”Header Parameters
Section titled “Header Parameters”Request Bodyrequired
Section titled “Request Bodyrequired”object
All reaches every screen. restricted reaches the union of the granted locations and Display Groups, and nothing without grants.
Grants for restricted access. Must be empty for all.
object
Responses
Section titled “ Responses ”Screen access replaced
object
object
All reaches every screen. restricted reaches the union of the granted locations and Display Groups, and nothing without grants.
object
False when the account has no stored policy, which reaches no screen until one is saved.
Read mode instead. True exactly when a stored policy is in mode all; never derived from the number of grants.
Example
{ "data": { "mode": "all", "scopes": [ { "type": "location" } ] }}Invalid request body
Dashboard authentication required
Insufficient role, own account (cannot_scope_self), or screen access the caller may not delegate (screen_scope_delegation)
User not found
Mode missing (screen_access_mode_required), grants invalid (scope_invalid), or the account is an Owner (owner_not_scopable)