# Adding multiple realm roles to a user, via REST API

**URL:** <https://forum.keycloak.org/t/adding-multiple-realm-roles-to-a-user-via-rest-api/13628>\
**Category:** Miscellanaeous\
**Created:** [February 16, 2022, 6:54am UTC](https://forum.keycloak.org/t/adding-multiple-realm-roles-to-a-user-via-rest-api/13628 "2022-02-16T06:54:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![eldarj](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/eldarj/32/4365_2.png) [@eldarj](https://forum.keycloak.org/u/eldarj)\
**Post date:** [February 16, 2022, 6:54am UTC](https://forum.keycloak.org/t/adding-multiple-realm-roles-to-a-user-via-rest-api/13628/1 "2022-02-16T06:54:36Z")

</div>

I can add a single new role to a user via the realm-mappings endpoint eg

```auto
http://host/auth/admin/realms/realm-name/users/some-user-id/role-mappings/realm

```

posting the role as the body eg

```auto
{
id: some-id
name: some-role-name
}

```

However, can I add multiple roles via a single request? I’d like to send a body like

```auto
[
{id: some-id, name: some-role-name},
{id: some-other-id, name: some-other-role-name},
]

```

Couldn’t find the answer in docs, and couldn’t do this via the above endpoint. Is this possible with some other endpoints?
