Users - Role Assignments
editUsers - Role Assignments
editRemove Role Assignments
editRemoves a set of RoleAssignments from the specified User. Currently unavailable in self-hosted ECE.
Request
editDELETE /api/v1/users/{user_id}/role_assignments
Path parameters
editName | Type | Required | Description |
---|---|---|---|
|
|
Y |
Identifier for the user; include realm name and id if required |
Request body
edit(RoleAssignments
) (required) The Role Assignments to remove
Responses
edit-
200
-
Role Assignments were successfully removed from the target User
-
400
-
The target user Id is invalid. (code:
role_assignments.invalid_target_user_id
)Headers
-
x-cloud-error-codes
(string
; allowed values: [role_assignments.invalid_target_user_id
]) - The error codes associated with the response
-
-
401
-
Credentials were invalid. (code:
root.unauthorized
)Headers
-
x-cloud-error-codes
(string
; allowed values: [root.unauthorized
]) - The error codes associated with the response
-
-
403
-
You are not authorised to remove the specified RoleAssignments. (code:
role_assignments.unauthorized_role_assignments
)Headers
-
x-cloud-error-codes
(string
; allowed values: [role_assignments.unauthorized_role_assignments
]) - The error codes associated with the response
-
Request example
editcurl -XDELETE https://api.elastic-cloud.com/api/v1/users/{user_id}/role_assignments \ -H "Authorization: ApiKey $EC_API_KEY" \ -H 'Content-Type: application/json' \ -d ' { "deployment" : [ { "all" : true, "application_roles" : [ "string" ], "deployment_ids" : [ "string" ], "organization_id" : "string", "role_id" : "string" } ], "organization" : [ { "organization_id" : "string", "role_id" : "string" } ], "platform" : [ { "role_id" : "string" } ], "project" : { "elasticsearch" : [ { "all" : true, "application_roles" : [ "string" ], "organization_id" : "string", "project_ids" : [ "string" ], "role_id" : "string" } ], "observability" : [ { "all" : true, "application_roles" : [ "string" ], "organization_id" : "string", "project_ids" : [ "string" ], "role_id" : "string" } ], "security" : [ { "all" : true, "application_roles" : [ "string" ], "organization_id" : "string", "project_ids" : [ "string" ], "role_id" : "string" } ] } } '
Add Role Assignments
editAdds a set of RoleAssignments to the specified User. Currently unavailable in self-hosted ECE.
Request
editPOST /api/v1/users/{user_id}/role_assignments
Path parameters
editName | Type | Required | Description |
---|---|---|---|
|
|
Y |
Identifier for the user; include realm name and id if required |
Request body
edit(RoleAssignments
) (required) The Role Assignments to add
Responses
edit-
200
-
Role Assignments were successfully added to the target User
-
400
-
The target user Id is invalid. (code:
role_assignments.invalid_target_user_id
)Headers
-
x-cloud-error-codes
(string
; allowed values: [role_assignments.invalid_target_user_id
]) - The error codes associated with the response
-
-
401
-
Credentials were invalid. (code:
root.unauthorized
)Headers
-
x-cloud-error-codes
(string
; allowed values: [root.unauthorized
]) - The error codes associated with the response
-
-
403
-
You are not authorised to add the specified RoleAssignments. (code:
role_assignments.unauthorized_role_assignments
)Headers
-
x-cloud-error-codes
(string
; allowed values: [role_assignments.unauthorized_role_assignments
]) - The error codes associated with the response
-
Request example
editcurl -XPOST https://api.elastic-cloud.com/api/v1/users/{user_id}/role_assignments \ -H "Authorization: ApiKey $EC_API_KEY" \ -H 'Content-Type: application/json' \ -d ' { "deployment" : [ { "all" : true, "application_roles" : [ "string" ], "deployment_ids" : [ "string" ], "organization_id" : "string", "role_id" : "string" } ], "organization" : [ { "organization_id" : "string", "role_id" : "string" } ], "platform" : [ { "role_id" : "string" } ], "project" : { "elasticsearch" : [ { "all" : true, "application_roles" : [ "string" ], "organization_id" : "string", "project_ids" : [ "string" ], "role_id" : "string" } ], "observability" : [ { "all" : true, "application_roles" : [ "string" ], "organization_id" : "string", "project_ids" : [ "string" ], "role_id" : "string" } ], "security" : [ { "all" : true, "application_roles" : [ "string" ], "organization_id" : "string", "project_ids" : [ "string" ], "role_id" : "string" } ] } } '