# How to set client scope mappings via APIs?

**URL:** <https://forum.keycloak.org/t/how-to-set-client-scope-mappings-via-apis/11586>\
**Category:** Miscellanaeous\
**Created:** [October 18, 2021, 8:41pm UTC](https://forum.keycloak.org/t/how-to-set-client-scope-mappings-via-apis/11586 "2021-10-18T20:41:33Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jackhammer](https://avatars.discourse-cdn.com/v4/letter/j/a88e57/32.png) [@jackhammer](https://forum.keycloak.org/u/jackhammer)\
**Post date:** [October 18, 2021, 8:41pm UTC](https://forum.keycloak.org/t/how-to-set-client-scope-mappings-via-apis/11586/1 "2021-10-18T20:41:33Z")

</div>

I am trying to set `clientScopeMappings` using Keycloak APIs but I am not able how to define it after import entire realm first time. On first time, I call a POST on `admin/realms` sending a big json with the following attribute:

```auto
  "clientScopeMappings": {
    "realm-management": [
      {
        "client": "myclient",
        "roles": [
          "manage-users"
        ]
      }
    ]
  },

```

This is running smooth to create new realms but how can I define `clientScopeMappings` when I am tyring just to add a new client to realm?

I have read docs for Keycloak 15.0 but I didn’t figure what API should be used.
