# Rest api call: pass client roles/ composites to a custom role

**URL:** <https://forum.keycloak.org/t/rest-api-call-pass-client-roles-composites-to-a-custom-role/7120>\
**Category:** Configuring the server\
**Created:** [February 2, 2021, 11:35am UTC](https://forum.keycloak.org/t/rest-api-call-pass-client-roles-composites-to-a-custom-role/7120 "2021-02-02T11:35:37Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![klimac](https://avatars.discourse-cdn.com/v4/letter/k/41988e/32.png) [@klimac](https://forum.keycloak.org/u/klimac)\
**Post date:** [February 2, 2021, 11:35am UTC](https://forum.keycloak.org/t/rest-api-call-pass-client-roles-composites-to-a-custom-role/7120/1 "2021-02-02T11:35:37Z")

</div>

Hi,

I have created a role and I am trying to assign a few client roles/composites to that role. I want to do that by rest api calls. But I can not get the composites’ IDs and IDs are required to successfully make the api calls.

Is there any way to achieve that?

Regards,  
Jim

---

<div class="post-metadata">

**Author:** ![klimac](https://avatars.discourse-cdn.com/v4/letter/k/41988e/32.png) [@klimac](https://forum.keycloak.org/u/klimac)\
**Post date:** [February 2, 2021, 12:21pm UTC](https://forum.keycloak.org/t/rest-api-call-pass-client-roles-composites-to-a-custom-role/7120/2 "2021-02-02T12:21:52Z")

</div>

Solution:  
Get the clients from your realm:  
`realms/{realm}/clients`  
You extract the ID of the client that you want to work on (1) and then:  
`realms/{realm}/clients/{client-id-from-(1)}/roles`  
You will be returned all of IDs from the requested client (1).
