Add Role Assignments
Adds a set of RoleAssignments to the specified User. Currently unavailable in self-hosted ECE.
Path parameters
-
user_id
string Required Identifier for the user; include realm name and id if required
Body
Required
The Role Assignments to add
-
platform
array[object] Assignments for roles with platform scope.
Assignment for a role with platform scope.
-
organization
array[object] Assignments for roles with organization scope.
Assignment for a role with organization scope.
-
deployment
array[object] Assignments for roles with deployment scope.
Assignment for a role with deployment scope.
-
project
object Assignments for roles with project scope.
Responses
-
200 application/json
Role Assignments were successfully added to the target User
-
400 application/json
The target user Id is invalid. (code:
role_assignments.invalid_target_user_id
) -
401 application/json
Credentials were invalid. (code:
root.unauthorized
) -
403 application/json
You are not authorised to add the specified RoleAssignments. (code:
role_assignments.unauthorized_role_assignments
)
curl \
--request POST 'https://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"]}]}}'
{
"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"
]
}
]
}
}
{}
# Headers
x-cloud-error-codes: role_assignments.invalid_target_user_id
# Payload
{
"errors": [
{
"code": "string",
"message": "string",
"fields": [
"string"
]
}
]
}
# Headers
x-cloud-error-codes: root.unauthorized
# Payload
{
"errors": [
{
"code": "string",
"message": "string",
"fields": [
"string"
]
}
]
}
# Headers
x-cloud-error-codes: role_assignments.unauthorized_role_assignments
# Payload
{
"errors": [
{
"code": "string",
"message": "string",
"fields": [
"string"
]
}
]
}