Add Role Assignments
Adds a set of RoleAssignments to the specified User. Currently unavailable in self-hosted ECE.
Path parameters
-
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.
-
organization array[object]
Assignments for roles with organization scope.
-
deployment array[object]
Assignments for roles with deployment scope.
-
project object
Assignments for roles with project scope.
Additional properties are allowed.
Responses
-
Role Assignments were successfully added to the target User
Additional properties are allowed.
-
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 \
-X POST https://api.elastic-cloud.com/api/v1/users/{user_id}/role_assignments \
-d '{"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"]}]}}'
Request examples
{
"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"
]
}
]
}
}
Response examples (200)
{}
Response examples (400)
# Headers
x-cloud-error-codes: role_assignments.invalid_target_user_id
# Payload
{
"errors": [
{
"code": "string",
"message": "string",
"fields": [
"string"
]
}
]
}
Response examples (401)
# Headers
x-cloud-error-codes: root.unauthorized
# Payload
{
"errors": [
{
"code": "string",
"message": "string",
"fields": [
"string"
]
}
]
}
Response examples (403)
# Headers
x-cloud-error-codes: role_assignments.unauthorized_role_assignments
# Payload
{
"errors": [
{
"code": "string",
"message": "string",
"fields": [
"string"
]
}
]
}