Skip to main content
POST
/
users
/
{user_id}
/
role_assignments
Add Role Assignments
curl --request POST \
  --url https://api.elastic-cloud.com/api/v1/users/{user_id}/role_assignments \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '{
  "deployment": [
    {
      "all": "<boolean>",
      "application_roles": [
        "<string>",
        "<string>"
      ],
      "deployment_ids": [
        "<string>",
        "<string>"
      ],
      "organization_id": "<string>",
      "role_id": "<string>"
    },
    {
      "all": "<boolean>",
      "application_roles": [
        "<string>",
        "<string>"
      ],
      "deployment_ids": [
        "<string>",
        "<string>"
      ],
      "organization_id": "<string>",
      "role_id": "<string>"
    }
  ],
  "organization": [
    {
      "organization_id": "<string>",
      "role_id": "<string>"
    },
    {
      "organization_id": "<string>",
      "role_id": "<string>"
    }
  ],
  "platform": [
    {
      "role_id": "<string>"
    },
    {
      "role_id": "<string>"
    }
  ],
  "project": {
    "elasticsearch": [
      {
        "all": "<boolean>",
        "application_roles": [
          "<string>",
          "<string>"
        ],
        "organization_id": "<string>",
        "project_ids": [
          "<string>",
          "<string>"
        ],
        "role_id": "<string>"
      },
      {
        "all": "<boolean>",
        "application_roles": [
          "<string>",
          "<string>"
        ],
        "organization_id": "<string>",
        "project_ids": [
          "<string>",
          "<string>"
        ],
        "role_id": "<string>"
      }
    ],
    "observability": [
      {
        "all": "<boolean>",
        "application_roles": [
          "<string>",
          "<string>"
        ],
        "organization_id": "<string>",
        "project_ids": [
          "<string>",
          "<string>"
        ],
        "role_id": "<string>"
      },
      {
        "all": "<boolean>",
        "application_roles": [
          "<string>",
          "<string>"
        ],
        "organization_id": "<string>",
        "project_ids": [
          "<string>",
          "<string>"
        ],
        "role_id": "<string>"
      }
    ],
    "security": [
      {
        "all": "<boolean>",
        "application_roles": [
          "<string>",
          "<string>"
        ],
        "organization_id": "<string>",
        "project_ids": [
          "<string>",
          "<string>"
        ],
        "role_id": "<string>"
      },
      {
        "all": "<boolean>",
        "application_roles": [
          "<string>",
          "<string>"
        ],
        "organization_id": "<string>",
        "project_ids": [
          "<string>",
          "<string>"
        ],
        "role_id": "<string>"
      }
    ]
  }
}'
{}

Authorizations

Authorization
string
header
required

Path Parameters

user_id
string
required

(Required) Identifier for the user; include realm name and id if required

Example:

"<string>"

Body

application/json
deployment
object[]
Example:
[
{
"all": "<boolean>",
"application_roles": ["<string>", "<string>"],
"deployment_ids": ["<string>", "<string>"],
"organization_id": "<string>",
"role_id": "<string>"
},
{
"all": "<boolean>",
"application_roles": ["<string>", "<string>"],
"deployment_ids": ["<string>", "<string>"],
"organization_id": "<string>",
"role_id": "<string>"
}
]
organization
object[]
Example:
[
{
"organization_id": "<string>",
"role_id": "<string>"
},
{
"organization_id": "<string>",
"role_id": "<string>"
}
]
platform
object[]
Example:
[
{ "role_id": "<string>" },
{ "role_id": "<string>" }
]
project
object

Response

Role Assignments were successfully added to the target User

The response is of type object.

I