# How to create an external ldap role using the REST API?

**URL:** <https://community.sonatype.com/t/how-to-create-an-external-ldap-role-using-the-rest-api/8842>\
**Category:** Sonatype Nexus Repository\
**Tags:** integrations\
**Created:** [June 20, 2022, 7:17am UTC](https://community.sonatype.com/t/how-to-create-an-external-ldap-role-using-the-rest-api/8842 "2022-06-20T07:17:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![anders.e.stenman](https://avatars.discourse-cdn.com/v4/letter/a/df788c/32.png) [@anders.e.stenman](https://community.sonatype.com/u/anders.e.stenman)\
**Post date:** [June 20, 2022, 7:17am UTC](https://community.sonatype.com/t/how-to-create-an-external-ldap-role-using-the-rest-api/8842/1 "2022-06-20T07:17:07Z")

</div>

What is the best way to create an external ldap role using the REST API?

I thought that posting something like

```auto
{
  "description": "ACL_GRAFANA_editor",
  "id": "ACL_GRAFANA_editor",
  "source": "ldap",
  "name": "ldap-ACL_GRAFANA_editor"
}

```

to /service/rest/v1/security/roles would do the trick, but I get the response

```auto
id : ACL_GRAFANA_editor
source : default
name : ldap-ACL_GRAFANA_editor
description : ACL_GRAFANA_editor
privileges : {}
roles : {}

```

i.e., source is set to default, not ldap

---

<div class="post-metadata">

**Author:** ![mmartz](https://avatars.discourse-cdn.com/v4/letter/m/e9bcb4/32.png) [@mmartz](https://community.sonatype.com/u/mmartz)\
**Post date:** [June 20, 2022, 2:28pm UTC](https://community.sonatype.com/t/how-to-create-an-external-ldap-role-using-the-rest-api/8842/2 "2022-06-20T14:28:29Z")

</div>

It appears we don’t currently support creating external role mappings via the REST API (due to not including a source field) and at first glance I didn’t find an open ticket to add the functionality to the REST API. If you’d like this functionality added, please open a ticket on [issues.sonatype.org](http://issues.sonatype.org) against the “Dev - Nexus Repo (NEXUS)” project. That will help us track the requests for this functionality and may help get it prioritized.
