Skip to main content

Replace the permissions granted to a user directly.

POST/api/v1/users/{user_id}/direct-permissions/replacepermissions:admin

Replaces the whole set of the user's direct grants; permissions the user holds through a group's set are unaffected. Adding grants requires Grant User Direct Permissions and current possession of each added permission or Delegate Permissions Beyond Own Access, including when changing your own grants. Removing grants requires Revoke User Direct Permissions. An empty set removes every direct grant.

Scopepermissions:admin (sensitive)
AsynchronousNo
MCP toolreplace_user_direct_permissions

Parameters​

NameInTypeRequiredDescription
user_idpathstringRequired
Docwize-Versionheaderstring (date)Optional
If-MatchheaderstringOptional

Request body​

Content typeType
application/jsonDirectPermissionReplaceInput

Responses​

StatusDescriptionBody
200Success.application/json DirectPermissionSet or object
400invalid_version, malformed_jsonapplication/problem+json Problem
401token_expired, unauthenticatedapplication/problem+json Problem
403forbidden, insufficient_scope, token_owner_inactiveapplication/problem+json Problem
404not_foundapplication/problem+json Problem
405method_not_allowedapplication/problem+json Problem
406not_acceptableapplication/problem+json Problem
412precondition_failedapplication/problem+json Problem
413payload_too_largeapplication/problem+json Problem
415unsupported_media_typeapplication/problem+json Problem
421wrong_regionapplication/problem+json Problem
422validation_failedapplication/problem+json Problem
500internal_errorapplication/problem+json Problem
503tenant_unavailable, unavailableapplication/problem+json Problem
504timeoutapplication/problem+json Problem

Errors​

The problem codes this operation can answer with. Each code links to its page.

Schemas​

DirectPermissionReplaceInput​

FieldTypeRequiredDescription
permission_idsarray of stringRequiredThe complete set of permission_id keys; each appears once.

DirectPermissionSet​

FieldTypeRequiredDescription
itemsarray of PermissionRequired

Permission​

FieldTypeRequiredDescription
permissionstringRequiredThe permission's name, as the Portal shows it.
permission_idstringRequiredThe permission's stable key.