Add Role Assignments
Adds a set of RoleAssignments to the specified User. Currently unavailable in self-hosted ECE.
Body
Required
The Role Assignments to add
-
Assignments for roles with platform scope.
Assignment for a role with platform scope.
-
Assignments for roles with organization scope.
Assignment for a role with organization scope.
-
Assignments for roles with deployment scope.
Assignment for a role with deployment scope.
-
Assignments for roles with project scope.
Responses
-
Role Assignments were successfully added to the target User
-
The target user Id is invalid. (code:
role_assignments.invalid_target_user_id
) -
Credentials were invalid. (code:
root.unauthorized
) -
You are not authorised to add the specified RoleAssignments. (code:
role_assignments.unauthorized_role_assignments
)
POST
/users/{user_id}/role_assignments
curl \
--request POST 'http://api.elastic-cloud.com/api/v1/users/{user_id}/role_assignments' \
--header "Content-Type: application/json" \
--data '{"platform":[{"role_id":"string"}],"organization":[{"role_id":"string","organization_id":"string"}],"deployment":[{"role_id":"string","organization_id":"string","all":true,"deployment_ids":["string"],"application_roles":["string"]}],"project":{"elasticsearch":[{"role_id":"string","organization_id":"string","all":true,"project_ids":["string"],"application_roles":["string"]}],"observability":[{"role_id":"string","organization_id":"string","all":true,"project_ids":["string"],"application_roles":["string"]}],"security":[{"role_id":"string","organization_id":"string","all":true,"project_ids":["string"],"application_roles":["string"]}]}}'