> ## Documentation Index
> Fetch the complete documentation index at: https://docs.pinkfish.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# ldap

> LDAP API

**Server path:** `/ldap` | **Type:** Application | **PCID required:** Yes

## Tools

| Tool                            | Description                                                                                      |
| ------------------------------- | ------------------------------------------------------------------------------------------------ |
| [`ldap_add`](#ldap_add)         | Add a new entry to the LDAP directory                                                            |
| [`ldap_compare`](#ldap_compare) | Compare an attribute value against an LDAP directory entry. Returns whether the value matches.   |
| [`ldap_delete`](#ldap_delete)   | Delete an entry from the LDAP directory                                                          |
| [`ldap_info`](#ldap_info)       | Get LDAP connection info including host, port, TLS status, and base DN                           |
| [`ldap_modify`](#ldap_modify)   | Modify an existing LDAP directory entry by adding, replacing, or deleting attributes             |
| [`ldap_search`](#ldap_search)   | Search LDAP directory entries by filter. Returns matching entries with their DNs and attributes. |

***

## ldap\_add

Add a new entry to the LDAP directory

**Parameters:**

| Parameter    | Type   | Required | Default | Description                                                                                                    |
| ------------ | ------ | -------- | ------- | -------------------------------------------------------------------------------------------------------------- |
| `dn`         | string | Yes      | —       | Distinguished name of the entry to create, e.g. cn=John Doe,ou=Users,dc=example,dc=com                         |
| `attributes` | object | Yes      | —       | Entry attributes as \{ attributeName: \[values] }, e.g. \{ objectClass: \["top","person"], cn: \["John Doe"] } |

<Expandable title="inputSchema">
  ```json theme={null}
  {
    "type": "object",
    "properties": {
      "PCID": {
        "type": "string",
        "description": "Pink Connect ID"
      },
      "dn": {
        "type": "string",
        "description": "Distinguished name of the entry to create, e.g. cn=John Doe,ou=Users,dc=example,dc=com"
      },
      "attributes": {
        "type": "object",
        "additionalProperties": true,
        "description": "Entry attributes as { attributeName: [values] }, e.g. { objectClass: [\"top\",\"person\"], cn: [\"John Doe\"] }"
      }
    },
    "required": [
      "PCID",
      "dn",
      "attributes"
    ]
  }
  ```
</Expandable>

***

## ldap\_compare

Compare an attribute value against an LDAP directory entry. Returns whether the value matches.

**Parameters:**

| Parameter   | Type   | Required | Default | Description                                                            |
| ----------- | ------ | -------- | ------- | ---------------------------------------------------------------------- |
| `dn`        | string | Yes      | —       | Distinguished name of the entry to compare against                     |
| `attribute` | string | Yes      | —       | Attribute name to compare, e.g. "memberOf"                             |
| `value`     | string | Yes      | —       | Value to compare against, e.g. "cn=Admins,ou=Groups,dc=example,dc=com" |

<Expandable title="inputSchema">
  ```json theme={null}
  {
    "type": "object",
    "properties": {
      "PCID": {
        "type": "string",
        "description": "Pink Connect ID"
      },
      "dn": {
        "type": "string",
        "description": "Distinguished name of the entry to compare against"
      },
      "attribute": {
        "type": "string",
        "description": "Attribute name to compare, e.g. \"memberOf\""
      },
      "value": {
        "type": "string",
        "description": "Value to compare against, e.g. \"cn=Admins,ou=Groups,dc=example,dc=com\""
      }
    },
    "required": [
      "PCID",
      "dn",
      "attribute",
      "value"
    ]
  }
  ```
</Expandable>

***

## ldap\_delete

Delete an entry from the LDAP directory

**Parameters:**

| Parameter | Type   | Required | Default | Description                               |
| --------- | ------ | -------- | ------- | ----------------------------------------- |
| `dn`      | string | Yes      | —       | Distinguished name of the entry to delete |

<Expandable title="inputSchema">
  ```json theme={null}
  {
    "type": "object",
    "properties": {
      "PCID": {
        "type": "string",
        "description": "Pink Connect ID"
      },
      "dn": {
        "type": "string",
        "description": "Distinguished name of the entry to delete"
      }
    },
    "required": [
      "PCID",
      "dn"
    ]
  }
  ```
</Expandable>

***

## ldap\_info

Get LDAP connection info including host, port, TLS status, and base DN

<Expandable title="inputSchema">
  ```json theme={null}
  {
    "type": "object",
    "properties": {
      "PCID": {
        "type": "string",
        "description": "Pink Connect ID"
      }
    },
    "required": [
      "PCID"
    ]
  }
  ```
</Expandable>

***

## ldap\_modify

Modify an existing LDAP directory entry by adding, replacing, or deleting attributes

**Parameters:**

| Parameter | Type      | Required | Default | Description                               |
| --------- | --------- | -------- | ------- | ----------------------------------------- |
| `dn`      | string    | Yes      | —       | Distinguished name of the entry to modify |
| `changes` | object\[] | Yes      | —       | Array of modifications to apply           |

<Expandable title="inputSchema">
  ```json theme={null}
  {
    "type": "object",
    "properties": {
      "PCID": {
        "type": "string",
        "description": "Pink Connect ID"
      },
      "dn": {
        "type": "string",
        "description": "Distinguished name of the entry to modify"
      },
      "changes": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "operation": {
              "type": "string",
              "enum": [
                "add",
                "replace",
                "delete"
              ],
              "description": "Modification operation"
            },
            "attribute": {
              "type": "string",
              "description": "Attribute name to modify"
            },
            "values": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "description": "Values to add/replace/delete (empty array for delete-all)"
            }
          }
        },
        "description": "Array of modifications to apply"
      }
    },
    "required": [
      "PCID",
      "dn",
      "changes"
    ]
  }
  ```
</Expandable>

***

## ldap\_search

Search LDAP directory entries by filter. Returns matching entries with their DNs and attributes.

**Parameters:**

| Parameter    | Type      | Required | Default             | Description                                                                                |
| ------------ | --------- | -------- | ------------------- | ------------------------------------------------------------------------------------------ |
| `base`       | string    | No       | —                   | Base DN to search from (defaults to the connection base DN)                                |
| `filter`     | string    | No       | `"(objectClass=*)"` | LDAP search filter (RFC 4515), e.g. (objectClass=user), (&(cn=John\*)(objectClass=person)) |
| `scope`      | string    | No       | `"sub"`             | Search scope: base (single entry), one (one level), sub (subtree, default)                 |
| `attributes` | string\[] | No       | —                   | Attributes to return (omit for all user attributes). e.g. \["cn", "mail", "memberOf"]      |
| `size_limit` | number    | No       | `100`               | Maximum entries to return (default: 100, max: 1000)                                        |

<Expandable title="inputSchema">
  ```json theme={null}
  {
    "type": "object",
    "properties": {
      "PCID": {
        "type": "string",
        "description": "Pink Connect ID"
      },
      "base": {
        "type": "string",
        "description": "Base DN to search from (defaults to the connection base DN)"
      },
      "filter": {
        "type": "string",
        "default": "(objectClass=*)",
        "description": "LDAP search filter (RFC 4515), e.g. (objectClass=user), (&(cn=John*)(objectClass=person))"
      },
      "scope": {
        "type": "string",
        "enum": [
          "base",
          "one",
          "sub"
        ],
        "default": "sub",
        "description": "Search scope: base (single entry), one (one level), sub (subtree, default)"
      },
      "attributes": {
        "type": "array",
        "items": {
          "type": "string"
        },
        "description": "Attributes to return (omit for all user attributes). e.g. [\"cn\", \"mail\", \"memberOf\"]"
      },
      "size_limit": {
        "type": "number",
        "default": 100,
        "description": "Maximum entries to return (default: 100, max: 1000)"
      }
    },
    "required": [
      "PCID"
    ]
  }
  ```
</Expandable>
