{
  "schema_version": 2,
  "id": "operate/rs/references/rest-api/requests/ldap_mappings",
  "title": "LDAP mappings requests",
  "url": "https://redis.io/docs/latest/operate/rs/references/rest-api/requests/ldap_mappings/",
  "summary": "LDAP mappings requests",
  "tags": [
    "docs",
    "operate",
    "rs"
  ],
  "last_updated": "2025-07-09T16:04:22-05:00",
  "children": [],
  "page_type": "content",
  "content_hash": "eeb44b2d03d85fa4626b0c5a5fcc418b110292554d5cfa93439a19ba0298b2dc",
  "sections": [
    {
      "id": "overview",
      "title": "Overview",
      "role": "overview",
      "text": "| Method | Path | Description |\n|--------|------|-------------|\n| [GET](#get-all-ldap_mappings) | `/v1/ldap_mappings` | Get all LDAP mappings |\n| [GET](#get-ldap_mapping) | `/v1/ldap_mappings/{uid}` | Get a single LDAP mapping |\n| [PUT](#put-ldap_mapping) | `/v1/ldap_mappings/{uid}` | Update an LDAP mapping |\n| [POST](#post-ldap_mappings) | `/v1/ldap_mappings` | Create a new LDAP mapping |\n| [DELETE](#delete-ldap_mappings) | `/v1/ldap_mappings/{uid}` | Delete an LDAP mapping |"
    },
    {
      "id": "get-all-ldap_mappings",
      "title": "Get all LDAP mappings",
      "role": "content",
      "text": "GET /v1/ldap_mappings\n\nGet all LDAP mappings.\n\n#### Required permissions\n\n| Permission name |\n|-----------------|\n| [view_all_ldap_mappings_info](https://redis.io/docs/latest/operate/rs/references/rest-api/permissions#view_all_ldap_mappings_info) |"
    },
    {
      "id": "get-all-request",
      "title": "Request",
      "role": "content",
      "text": "#### Example HTTP request\n\n\tGET /v1/ldap_mappings \n\n#### Request headers\n\n| Key | Value | Description |\n|-----|-------|-------------|\n| Host | cnm.cluster.fqdn | Domain name |\n| Accept | application/json | Accepted media type |"
    },
    {
      "id": "get-all-response",
      "title": "Response",
      "role": "returns",
      "text": "Returns a JSON array of [LDAP mapping objects](https://redis.io/docs/latest/operate/rs/references/rest-api/objects/ldap_mapping).\n\n#### Example JSON body\n\n[code example]"
    },
    {
      "id": "get-all-status-codes",
      "title": "Status codes",
      "role": "content",
      "text": "| Code | Description |\n|------|-------------|\n| [200 OK](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.1) | No error |"
    },
    {
      "id": "get-ldap_mapping",
      "title": "Get LDAP mapping",
      "role": "content",
      "text": "GET /v1/ldap_mappings/{int: uid}\n\nGet a specific LDAP mapping.\n\n#### Required permissions\n\n| Permission name |\n|-----------------|\n| [view_ldap_mapping_info](https://redis.io/docs/latest/operate/rs/references/rest-api/permissions#view_ldap_mapping_info) |"
    },
    {
      "id": "get-request",
      "title": "Request",
      "role": "content",
      "text": "#### Example HTTP request\n\n\tGET /v1/ldap_mappings/1 \n\n#### Request headers\n\n| Key | Value | Description |\n|-----|-------|-------------|\n| Host | cnm.cluster.fqdn | Domain name |\n| Accept | application/json | Accepted media type |\n\n#### URL parameters\n\n| Field | Type | Description |\n|-------|------|-------------|\n| uid | integer | The object's unique ID. |"
    },
    {
      "id": "get-response",
      "title": "Response",
      "role": "returns",
      "text": "Returns an [LDAP mapping object](https://redis.io/docs/latest/operate/rs/references/rest-api/objects/ldap_mapping).\n\n#### Example JSON body\n\n[code example]"
    },
    {
      "id": "get-error-codes",
      "title": "Error codes",
      "role": "errors",
      "text": "Possible `error_code` values:\n\n| Code | Description |\n|------|-------------|\n| unsupported_resource | The cluster is not yet able to handle this resource type. This could happen in a partially upgraded cluster, where some of the nodes are still on a previous version.| \n| ldap_mapping_not_exist | An object does not exist|"
    },
    {
      "id": "get-status-codes",
      "title": "Status codes",
      "role": "content",
      "text": "| Code | Description |\n|------|-------------|\n| [200 OK](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.1) | Success. |\n| [403 Forbidden](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.4) | Operation is forbidden. |\n| [404 Not Found](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.5) | ldap_mapping does not exist. |\n| [501 Not Implemented](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.5.2) | Cluster doesn't support LDAP mappings yet. |"
    },
    {
      "id": "put-ldap_mapping",
      "title": "Update LDAP mapping",
      "role": "content",
      "text": "PUT /v1/ldap_mappings/{int: uid}\n\nUpdate an existing ldap_mapping object.\n\n#### Required permissions\n\n| Permission name |\n|-----------------|\n| [update_ldap_mapping](https://redis.io/docs/latest/operate/rs/references/rest-api/permissions#update_ldap_mapping) |"
    },
    {
      "id": "put-request",
      "title": "Request",
      "role": "content",
      "text": "#### Example HTTP request\n\n\tPUT /v1/ldap_mappings/17 \n\n#### Example JSON body\n\n[code example]\n\n#### Request headers\n\n| Key | Value | Description |\n|-----|-------|-------------|\n| Host | cnm.cluster.fqdn | Domain name |\n| Accept | application/json | Accepted media type |\n\n\n#### Request body\n\nInclude an [LDAP mapping object](https://redis.io/docs/latest/operate/rs/references/rest-api/objects/ldap_mapping) with updated fields in the request body."
    },
    {
      "id": "put-response",
      "title": "Response",
      "role": "returns",
      "text": "#### Example JSON body\n\n[code example]"
    },
    {
      "id": "put-error-codes",
      "title": "Error codes",
      "role": "errors",
      "text": "Possible `error_code` values:\n\n| Code | Description |\n|------|-------------|\n| unsupported_resource | The cluster is not yet able to handle this resource type. This could happen in a partially upgraded cluster, where some of the nodes are still on a previous version.| \n| name_already_exists | An object of the same type and name exists| \n| ldap_mapping_not_exist | An object does not exist| \n| invalid_dn_param | A dn parameter has an illegal value| \n| invalid_name_param | A name parameter has an illegal value| \n| invalid_role_uids_param | A role_uids parameter has an illegal value| \n| invalid_account_id_param | An account_id parameter has an illegal value|"
    },
    {
      "id": "put-status-codes",
      "title": "Status codes",
      "role": "content",
      "text": "| Code | Description |\n|------|-------------|\n| [200 OK](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.1) | Success, LDAP mapping is created. |\n| [400 Bad Request](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.1) | Bad or missing configuration parameters. |\n| [404 Not Found](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.5) | Attempting to change a non-existing LDAP mapping. |\n| [501 Not Implemented](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.5.2) | Cluster doesn't support LDAP mapping yet. |"
    },
    {
      "id": "post-ldap_mappings",
      "title": "Create LDAP mapping",
      "role": "content",
      "text": "POST /v1/ldap_mappings\n\nCreate a new LDAP mapping.\n\n#### Required permissions\n\n| Permission name |\n|-----------------|\n| [create_ldap_mapping](https://redis.io/docs/latest/operate/rs/references/rest-api/permissions#create_ldap_mapping) |"
    },
    {
      "id": "post-request",
      "title": "Request",
      "role": "content",
      "text": "#### Example HTTP request\n\n\tPOST /v1/ldap_mappings \n\n#### Example JSON body\n\n[code example]\n\n#### Request headers\n\n| Key | Value | Description |\n|-----|-------|-------------|\n| Host | cnm.cluster.fqdn | Domain name |\n| Accept | application/json | Accepted media type |\n\n\n#### Request body\n\nInclude an [LDAP mapping object](https://redis.io/docs/latest/operate/rs/references/rest-api/objects/ldap_mapping) in the request body."
    },
    {
      "id": "post-response",
      "title": "Response",
      "role": "returns",
      "text": "#### Example JSON body\n\n[code example]"
    },
    {
      "id": "post-error-codes",
      "title": "Error codes",
      "role": "errors",
      "text": "Possible `error_code` values:\n\n| Code | Description |\n|------|-------------|\n| unsupported_resource | The cluster is not yet able to handle this resource type. This could happen in a partially upgraded cluster, where some of the nodes are still on a previous version.| \n| name_already_exists | An object of the same type and name exists| \n| missing_field | A needed field is missing| \n| invalid_dn_param | A dn parameter has an illegal value| \n| invalid_name_param | A name parameter has an illegal value| \n| invalid_role_uids_param | A role_uids parameter has an illegal value|"
    },
    {
      "id": "post-status-codes",
      "title": "Status codes",
      "role": "content",
      "text": "| Code | Description |\n|------|-------------|\n| [200 OK](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.1) | Success, an LDAP-mapping object is created. |\n| [400 Bad Request](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.1) | Bad or missing configuration parameters. |\n| [501 Not Implemented](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.5.2) | Cluster doesn't support LDAP mappings yet. |"
    },
    {
      "id": "delete-ldap_mappings",
      "title": "Delete LDAP mapping",
      "role": "content",
      "text": "DELETE /v1/ldap_mappings/{int: uid}\n\nDelete an LDAP mapping object.\n\n#### Required permissions\n\n| Permission name |\n|-----------------|\n| [delete_ldap_mapping](https://redis.io/docs/latest/operate/rs/references/rest-api/permissions#delete_ldap_mapping) |"
    },
    {
      "id": "delete-request",
      "title": "Request",
      "role": "content",
      "text": "#### Example HTTP request\n\n\tDELETE /v1/ldap_mappings/1 \n\n#### Request headers\n\n| Key | Value | Description |\n|-----|-------|-------------|\n| Host | cnm.cluster.fqdn | Domain name |\n| Accept | application/json | Accepted media type |\n\n\n#### URL parameters\n\n| Field | Type | Description |\n|-------|------|-------------|\n| uid | integer | The ldap_mapping unique ID. |"
    },
    {
      "id": "delete-response",
      "title": "Response",
      "role": "returns",
      "text": "Returns a status code. If an error occurs, the response body may include a more specific error code and message."
    },
    {
      "id": "delete-error-codes",
      "title": "Error codes",
      "role": "errors",
      "text": "Possible `error_code` values:\n\n| Code | Description |\n|------|-------------|\n| unsupported_resource | The cluster is not yet able to handle this resource type. This could happen in a partially upgraded cluster, where some of the nodes are still on a previous version.| \n| ldap_mapping_not_exist | An object does not exist|"
    },
    {
      "id": "delete-status-codes",
      "title": "Status codes",
      "role": "content",
      "text": "| Code | Description |\n|------|-------------|\n| [200 OK](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.1) | Success, the ldap_mapping is deleted. |\n| [406 Not Acceptable](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.7) | The request is not acceptable. |\n| [501 Not Implemented](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.5.2) | Cluster doesn't support LDAP mappings yet. |"
    }
  ],
  "examples": [
    {
      "id": "get-all-response-ex0",
      "language": "json",
      "code": "[\n  {\n     \"uid\": 17,\n     \"name\": \"Admins\",\n     \"dn\": \"OU=ops.group,DC=redislabs,DC=com\",\n     \"email\": \"ops.group@redislabs.com\",\n     \"role_uids\": [1],\n     \"email_alerts\": true,\n     \"bdbs_email_alerts\": [\"1\",\"2\"],\n     \"cluster_email_alerts\": true\n  }\n]",
      "section_id": "get-all-response"
    },
    {
      "id": "get-response-ex0",
      "language": "json",
      "code": "{\n     \"uid\": 17,\n     \"name\": \"Admins\",\n     \"dn\": \"OU=ops.group,DC=redislabs,DC=com\",\n     \"email\": \"ops.group@redislabs.com\",\n     \"role_uids\": [1],\n     \"email_alerts\": true,\n     \"bdbs_email_alerts\": [\"1\",\"2\"],\n     \"cluster_email_alerts\": true\n}",
      "section_id": "get-response"
    },
    {
      "id": "put-request-ex0",
      "language": "json",
      "code": "{\n    \"dn\": \"OU=ops,DC=redislabs,DC=com\",\n    \"email\": \"ops@redislabs.com\",\n    \"email_alerts\": true,\n    \"bdbs_email_alerts\": [\"1\",\"2\"],\n    \"cluster_email_alerts\": true\n}",
      "section_id": "put-request"
    },
    {
      "id": "put-response-ex0",
      "language": "json",
      "code": "{\n     \"uid\": 17,\n     \"name\": \"Admins\",\n     \"dn\": \"OU=ops,DC=redislabs,DC=com\",\n     \"email\": \"ops@redislabs.com\",\n     \"role_uids\": [1],\n     \"email_alerts\": true,\n     \"bdbs_email_alerts\": [\"1\",\"2\"],\n     \"cluster_email_alerts\": true\n}",
      "section_id": "put-response"
    },
    {
      "id": "post-request-ex0",
      "language": "json",
      "code": "{\n     \"name\": \"Admins\",\n     \"dn\": \"OU=ops.group,DC=redislabs,DC=com\",\n     \"email\": \"ops.group@redislabs.com\",\n     \"role_uids\": [1]\n}",
      "section_id": "post-request"
    },
    {
      "id": "post-response-ex0",
      "language": "json",
      "code": "{\n     \"uid\": 17,\n     \"name\": \"Admins\",\n     \"dn\": \"OU=ops.group,DC=redislabs,DC=com\",\n     \"email\": \"ops.group@redislabs.com\",\n     \"role_uids\": [1]\n}",
      "section_id": "post-response"
    }
  ]
}
