---
title: "Nodinite LDAP Web API Request Schema: XML/JSON Structure and Integration Guide"
description: Learn how to construct powerful, flexible Request messages for the Nodinite LDAP Web API. See schema details, XML/JSON structure, and integration best practices.
---

# <i class="fal fa-sign-out" aria-hidden="true"></i> Request Schema

Unlock seamless LDAP integration with the <span class="nodinite-product-name" title="The node that unites different systems. Or as we call it Nodinite">Nodinite</span> LDAP Web API Request schema. This How To guide empowers you to construct robust, flexible requests in XML or JSON, and explains the schema for rapid, error-free development.

✅ Leverage a unified schema for both XML and JSON requests  
✅ Integrate with BizTalk, custom code, or any platform  
✅ Track, batch, and upsert operations for advanced scenarios  
✅ Accelerate development with clear, pre-defined structures  

You must send the **Request** to the <span class="nodinite-product-name" title="The node that unites different systems. Or as we call it Nodinite">Nodinite</span> LDAP products using a pre-defined schema. Use the **XSD** format for XML messages, and follow the same definition for the **JSON** structure. As a developer, you can easily use and validate these requests in your solutions.

<aside aria-label="Note" class="nodinite-note nodinite-note--note">
<p class="nodinite-note__label" aria-hidden="true"><i class="far fa-fw fa-note"></i> Note</p>
<div class="nodinite-note__content"><p>For BizTalk implementations, a separate Property Schema (<code>IS.BizTalk.Adapters.LDAP.PropertySchema_v1.0.xsd</code>) is available for use in static and dynamic send ports when you need to provide connection information via context properties. See the <span class="nodinite-product-name" title="The node that unites different systems. Or as we call it Nodinite">Nodinite</span> <a href="https://docs.nodinite.com/biztalk-ldap-adapter/getting-started/configuration/">BizTalk LDAP Adapter Configuration</a> documentation for details.</p></div>
</aside>

|Property|Example value|  
|---|---|  
|File|`IS.BizTalk.Adapters.LDAP.Request_v1.0.xsd`|  
|Target Namespace|`http://integrationsoftware.se/BizTalk/Adapters/LDAP/Request/1.0`|  
|Root Node|`LDAP`|  
|BizTalk [Message Type][Message Types]|`http://integrationsoftware.se/BizTalk/Adapters/LDAP/Request/1.0#LDAP`|  

> You do not need to install this schema in your BizTalk environment unless you create your own maps (.BTM files) or use custom-built pipelines/components that require it. The LDAP adapter performs all LDAP operations based on the available operations in the request schema.

The root record is named `LDAP`. The response root record is also named `LDAP`. This element contains two children:

* [Batches](#batches)  
* [PassThruContent](#passthrucontent)

<div class="mermaid">
graph TD
    roLDAP["fa:fa-file-code LDAP (root)"] --> roBatches["fa:fa-layer-group Batches (guid, returnResponseMessageOnExceptions)"]
    roLDAP --> roPass["fa:fa-share PassThruContent (optional)"]
    roBatches --> roBatch["fa:fa-box Batch (guid, transactionScopeOption, transactionTimeOut, continueOnError)"]
    roBatch --> roEntity["fa:fa-user Entity: User, Group, OrganizationalUnit, Schema, AD"]
    roEntity --> roWith["fa:fa-magnifying-glass With (CN, OU, DC, searchScope, searchFilter, expectedMatchCount)"]
    roEntity --> roOperation["fa:fa-gear Operation and parameters"]
    roEntity --> roProps["fa:fa-list Properties (name, value, contentType)"]
</div>

*Diagram: the nesting of the Request message, from the `LDAP` root record down to the search criteria, operations, and properties of each entity.*

![Request schema root with the Batches and PassThruContent records][1]  
*The `LDAP` root record of the Request schema in the XSD.*  

## Batches

The `Batches` element has two attributes and one child record:

|Item|Kind|Required|Default|Description|  
|---|---|---|---|---|  
|[guid](#guid)|Attribute|✅ Yes|-|Provides end-to-end tracking|  
|[returnResponseMessageOnExceptions](#returnresponsemessageonexceptions)|Attribute (boolean)|❌ No|`false`|Determines the type of response when errors occur|  
|[Batch](#batch)|Record, 1..n|✅ Yes|-|A collection of work to be performed|  

### guid

Each request **must** provide a unique tracking ID represented by the attribute `guid`. You must use a unique guid per message interchange (each call). The **mandatory** guid attribute aids error handling by identifying which batch failed. Each batch should have its own [Universally unique identifier](https://en.wikipedia.org/wiki/Universally_unique_identifier)<sup><i class="fal fa-arrow-up-right-from-square" aria-hidden="true"></i></sup>.

![Request and response messages with the same guid value][2]  
*The **guid** you send is the same as the **guid** you receive in the response.*  

If you use **C#**, create a new GUID with:

```c#
System.Guid.NewGuid().ToString("D")
```

You can also review the following [article](https://learn.microsoft.com/en-us/dotnet/api/system.guid.tostring?view=net-10.0)<sup><i class="fal fa-arrow-up-right-from-square" aria-hidden="true"></i></sup>.

### returnResponseMessageOnExceptions

The optional parameter `returnResponseMessageOnExceptions` defaults to **false**. If errors occur, the system raises an application Exception that you must handle in your explicit error handler. Raising errors generally disrupts the flow.

>We recommend that you set this attribute to `true` and handle the response message using standard conditional logic (if/case/when).

<aside aria-label="Note" class="nodinite-note nodinite-note--note">
<p class="nodinite-note__label" aria-hidden="true"><i class="far fa-fw fa-note"></i> Note</p>
<div class="nodinite-note__content"><p><strong>JSON (<a href="https://docs.nodinite.com/ldap-web-api/overview/">LDAP Web API</a> 4.0.1 and later):</strong> the property is named <code>ReturnResponseOnExceptions</code> and sits at the top level of the request, next to <code>RequestId</code>: <code>"ReturnResponseOnExceptions": true</code>. See the <a href="https://docs.nodinite.com/ldap-web-api/getting-started/test/#json-payload-401-and-later">JSON examples</a>.</p></div>
</aside>

You can use the different options during the design, development, and testing of solutions.

#### For BizTalk developers

If you use BizTalk and allow errors to be raised, the response message will be suspended in the BizTalk message box (BizTalkMsgBoxDb) and disrupt the flow. We do not recommend this approach.

<div class="mermaid">
stateDiagram
  Client -->  LDAP
  LDAP -->  Client
</div>

*returnResponseMessageOnExceptions = true.*

<div class="mermaid">
sequenceDiagram
  Client->>+Nodinite LDAP: Request
  Nodinite LDAP->>-BizTalk MsgboxDB: Error - Suspend Message
  Nodinite LDAP->>Client: Exception
</div>

*returnResponseMessageOnExceptions = false.*

For example, if you have an [Orchestration][Orchestrations] and an error occurs, you must add an Exception block and handle the logic for retries. Since that code is part of a scope, you must add additional loops and logic to handle the error.

If you set **returnResponseMessageOnExceptions** to `true`, you can use an **if** clause and retry according to your logic without adding extra shapes. This approach accelerates your development and simplifies negative testing.

### Batch

Each **Request** message can contain one or more Batches. Each **Batch** can contain one or more entities with one or more operations, repeated as needed and in the correct logical order.

![Request message with several Batch records][3]  
*A Request message with more than one **Batch**, each holding its own entities and operations.*  

<aside aria-label="Note" class="nodinite-note nodinite-note--note">
<p class="nodinite-note__label" aria-hidden="true"><i class="far fa-fw fa-note"></i> Note</p>
<div class="nodinite-note__content"><p>Each <strong>Batch</strong> holds one group of related operations. You must specify the order of operations in each batch.</p></div>
</aside>

<aside aria-label="Warning" class="nodinite-note nodinite-note--warning">
<p class="nodinite-note__label" aria-hidden="true"><i class="far fa-fw fa-triangle-exclamation"></i> Warning</p>
<div class="nodinite-note__content"><p>If an exception occurs in a <strong>Batch</strong>, the system immediately aborts further execution.</p></div>
</aside>

To compensate for aborted or partial operations, keep your batches small, even though the adapter allows you to create large messages with unlimited operations.

Each `Batch` has these attributes:

|Attribute|Type|Required|Default|Description|  
|---|---|---|---|---|  
|[guid](#batch-guid)|GUID|✅ Yes|-|Unique ID per batch, copied to the response|  
|[transactionScopeOption](#transactionscopeoption)|`Required`, `RequiresNew`, `Suppress`|❌ No|`Suppress`|Transaction scope for the batch|  
|[transactionTimeOut](#transactiontimeout)|Integer (seconds)|❌ No|`30`|Time within which the transaction must complete|  
|[continueOnError](#continueonerror)|Boolean|❌ No|`false`|Continue with the next batch if this batch fails|  

#### transactionScopeOption

The system executes each batch within the **Request** in a **transactional scope** with options provided by the optional `transactionScopeOption` attribute.

>No LDAP services currently honor the two-phase commit protocol. We provide this option for future use.

See also [Transaction Scope Enum](https://learn.microsoft.com/en-us/dotnet/api/system.transactions.transactionscopeoption?view=net-10.0)<sup><i class="fal fa-arrow-up-right-from-square" aria-hidden="true"></i></sup>.

Available values (default `Suppress`):

* Required
* RequiresNew
* Suppress

#### transactionTimeOut

The optional attribute `transactionTimeOut` sets the period in **seconds** within which a transaction must complete. If not set, the default is 30 seconds. See [TransactionScope Constructors](https://learn.microsoft.com/en-us/dotnet/api/system.transactions.transactionscope.-ctor?view=net-10.0)<sup><i class="fal fa-arrow-up-right-from-square" aria-hidden="true"></i></sup>.

<aside aria-label="Tip" class="nodinite-note nodinite-note--tip">
<p class="nodinite-note__label" aria-hidden="true"><i class="far fa-fw fa-lightbulb"></i> Tip</p>
<div class="nodinite-note__content"><p>You can use transactions and set the transactionTimeOut to abort operations that exceed your allowed time.</p></div>
</aside>

#### continueOnError

The optional `continueOnError` attribute (default `false`) lets you choose at design time to **continue** to the next [Batch](#batch) even if an operation fails. This feature enables the <span class="nodinite-product-name" title="The node that unites different systems. Or as we call it Nodinite">Nodinite</span> LDAP product to support **`Upserts`**. For example, you can create one Request message with **two** batches: the first batch has the Insert operation, and the second batch contains the update operation. If the insert operation fails (for example, if the record already exists), the system still updates the record. You can use this feature for many other scenarios.

#### Batch Guid

You must provide a unique GUID per [Batch](#batch). The system copies the GUID back to the response message. This feature lets you correlate the request Batch with the response data and enables even better tracking/[Logging][].

![Batch record with its own guid attribute][4]  
*Example: A unique GUID for a batch.*  

## With

The <span class="nodinite-product-name" title="The node that unites different systems. Or as we call it Nodinite">Nodinite</span> LDAP products perform the requested operations based on the **Set** of objects returned from the **search query**. The search query uses the parameters in the **`With`** record.

The **With** record has the following structure:

![With record attributes in the Request schema][5]  
*Parameters for **With**.*  

### CN

The optional `CN` attribute represents the common name to use in the query. Use this attribute when you require an exact match with the distinguished name.

Example:  

|JSON|XML|  
|---|---|  
|`"With": { "CN": "CN=John Doe" }`|`<With CN="CN=Jane Doe" />`|  

<aside aria-label="Important" class="nodinite-note nodinite-note--important">
<p class="nodinite-note__label" aria-hidden="true"><i class="far fa-fw fa-message-exclamation"></i> Important</p>
<div class="nodinite-note__content"><p>Do not provide the CN attribute for <strong>create</strong> operations.</p></div>
</aside>

Example of when to use CN: this scenario updates the description of `Jane Doe`. The CN part in the LDAP Catalogue is `Jane Doe`, and you want to update exactly this record.

![Update operation with the CN attribute set in the With record][6]  
*Example: the `CN` attribute targets exactly one record.*  

Example of when NOT to use the `CN` attribute: when the query itself returns the set of objects to work on, do NOT provide the CN part, since the system extracts and uses the CN from the set of objects returned by the query.

### OU

The optional `OU` attribute specifies which OU branch in the tree to bind to. For more information about OUs, see [Organizational units](https://en.wikipedia.org/wiki/Active_Directory#Organizational_units)<sup><i class="fal fa-arrow-up-right-from-square" aria-hidden="true"></i></sup>.

Example of usage in the LDAP Adapter:

This binds to the logical department HQ. The HQ OU must exist in your LDAP Catalog for this query to succeed.

<aside aria-label="Note" class="nodinite-note nodinite-note--note">
<p class="nodinite-note__label" aria-hidden="true"><i class="far fa-fw fa-note"></i> Note</p>
<div class="nodinite-note__content"><p>You must explicitly write OU= as part of the value (right-hand side of =). This is because an OU in the catalog does not necessarily have to be an <code>OU</code> object. Other valid examples include OU="CN=Developers".</p></div>
</aside>

### DC

The required attribute `DC` provides information on the domain component to bind to. For more information, see [Object Names and Identities](https://learn.microsoft.com/en-us/windows/win32/ad/object-names-and-identities)<sup><i class="fal fa-arrow-up-right-from-square" aria-hidden="true"></i></sup>.

This is the top level of your LDAP tree.

Example of usage in the LDAP Adapter:
This query searches from the top of the tree and traverses all nodes due to the searchScope option.

### searchScope

The optional `searchScope` attribute sets the depth of the tree to traverse during search. If you don't set it, the default is `Base`. Valid values:

* Base
* OneLevel
* Subtree

<aside aria-label="Note" class="nodinite-note nodinite-note--note">
<p class="nodinite-note__label" aria-hidden="true"><i class="far fa-fw fa-note"></i> Note</p>
<div class="nodinite-note__content"><p>These values are case sensitive (as in XML).</p></div>
</aside>

See [Specifying the Search Scope](https://learn.microsoft.com/en-us/windows/win32/ad/search-scope)<sup><i class="fal fa-arrow-up-right-from-square" aria-hidden="true"></i></sup> for more information.

### expectedMatchCount

The `expectedMatchCount` attribute validates that your search criteria returns the expected number of records. If there is a mismatch, the Adapter aborts operations on the current batch to prevent unintended bulk operations.

<aside aria-label="Important" class="nodinite-note nodinite-note--important">
<p class="nodinite-note__label" aria-hidden="true"><i class="far fa-fw fa-message-exclamation"></i> Important</p>
<div class="nodinite-note__content"><p><i class="fal fa-shield-halved" aria-hidden="true"></i> <strong>Critical Safety Feature</strong></p><p>The <code>expectedMatchCount</code> attribute is your primary defense against accidental mass operations, especially for <strong>Delete operations</strong> that can permanently remove users, groups, or entire OU structures from Active Directory.</p><p><strong>ALWAYS use <code>expectedMatchCount</code> for Delete operations</strong> to ensure you delete exactly what you intend.</p></div>
</aside>

#### Attribute Values

|Value|Behavior|Use Case|  
|---|---|---|  
|`1`, `2`, `3`, etc.|Exact match required|Single or specific count operations (e.g., `expectedMatchCount="1"` for deleting one user)|  
|`0`|No match allowed|Verify that an object doesn't exist yet|  
|`*`|At least one match required|Operations where exact count is unknown but at least one record must exist|  
|(not specified)|No validation|**NOT RECOMMENDED** - Disables safety check, allows operations on any number of records|  

<aside aria-label="Note" class="nodinite-note nodinite-note--note">
<p class="nodinite-note__label" aria-hidden="true"><i class="far fa-fw fa-note"></i> Note</p>
<div class="nodinite-note__content"><p>The schema accepts only <code>0</code>, a positive number, or <code>*</code>. Ranges such as <code>1-5</code> are not valid. To cap the number of objects instead, combine <code>*</code> with <a href="#sizelimit">sizeLimit</a>.</p></div>
</aside>

#### Examples

```xml
<!-- SAFE: Delete exactly one user -->
<With CN="CN=Jane Doe" OU="OU=Users" DC="DC=example,DC=com" expectedMatchCount="1"/>

<!-- SAFE: Update exactly 5 users matching criteria -->
<With OU="OU=Department" DC="DC=example,DC=com" searchFilter="(title=Manager)" expectedMatchCount="5"/>

<!-- SAFE: Select at least one matching record -->
<With OU="OU=Users" DC="DC=example,DC=com" searchFilter="(name=John*)" expectedMatchCount="*"/>

<!-- UNSAFE: No validation - could delete ALL users if filter is wrong -->
<With OU="OU=Users" DC="DC=example,DC=com" searchScope="Subtree"/>
```

Example of exception information when the number of records found did not match the numbers sought:

Example of exception information due to invalid value provided for parameter `expectedMatchCount`.

### Exceptions

The adapter fails to operate for some use cases:

#### Create User

You can only create a user in exactly one OU. If you provide any value for expectedMatchCount other than 1, the adapter fails to operate.

### returnProperties

The optional `returnProperties` attribute limits the number of properties returned in both `SearchResult` and `OperationalResult`. Only the properties with provided names are returned.
Values are provided as a comma-separated list (no whitespaces) of the property names to return. If not provided, the system returns all properties.

If you provide `DN` as a requested property name, the system returns the full path (AdsPath/DN for ADSI) for the found object.

### Warnings

The adapter may add Warning messages if you request properties that the adapter cannot find. Two internal operations occur in the adapter, and the warning messages are bound to these:

1. Search Part – returnProperties returns the matching attributes from search
2. Operation Part – returnProperties returns the matching attributes from the post-operation result.

### sizeLimit

The optional `sizeLimit` attribute limits the number of objects to perform provided operations on. The default value 0 provides no limit. Otherwise, this value should be equal to or larger than `expectedMatchCount`. The system logs a warning and provides it in the result set if this condition is not met.

### searchFilter

The optional `searchFilter` attribute can override or extend the standard filter used by the adapter when performing the query. Make sure to include the proper objectCategory/objectClass in your search if you are searching for something other than the predefined/hidden User/Group/OU. See also [Search Filter Syntax](https://learn.microsoft.com/en-us/windows/win32/adsi/search-filter-syntax)<sup><i class="fal fa-arrow-up-right-from-square" aria-hidden="true"></i></sup>.

Common valid examples:

* `searchFilter="(name=j*)"` – Limits the objects returned to those with names starting with the letter j.
* `searchFilter="(objectCategory=Computer)(objectClass=computer)(!(operatingSystem=Windows 8*))"` – Gets all computers that do not have Windows 8* as the operating system.

### Entity

The LDAP adapter defines and groups supported operations per **entity**. The LDAP Request [Batch](#batch) supports the following entities (record names as in the schema):

|Entity record|Has `With`|Operations|  
|---|---|---|  
|`User`|✅ Yes|See [User Management][User Management]|  
|`Group`|✅ Yes|See [Group Management][Group Management]|  
|`OrganizationalUnit`|✅ Yes|See [OU Management][OU Management]|  
|`Schema`|❌ No|See [Schema Management][Schema Management]|  
|`AD`|❌ No|See [AD Management][AD Management]|  

Each operation always has a name and may include additional parameters, which may or may not be required depending on the operation.

The `With` record defines the selection criteria for the query, and is required for the `User`, `Group`, and `OrganizationalUnit` entities. The `With` part always receives a corresponding `SearchResult` record in the Response message.

### Properties

The Create and Update operations of the `User`, `Group`, and `OrganizationalUnit` entities may have a `Properties` record.

This collection can contain named (`name`) attributes with values (`value`) to set in Insert and Update operations.

The optional `contentType` attribute has the following allowed values:

|Value|Behavior|  
|---|---|  
|`String`|Default. The system writes values as is without modification|  
|`RAW`|Not used in version 1.0|  
|`LoadFromByteArray`|Provide content as a Base64-encoded byte array|  
|`LoadFromFile`|The system loads content from a file. Make sure to provide a highly available file share when using this feature|  

The following attributes use contentType:

* jpegPhoto
* thumbnailPhoto

### Missing parameter Example

If an operation requires an argument by the schema definition and you do not provide it, the operation within the batch fails and the response message may contain an exception message with details.

### Invalid operation provided

If you send an invalid or unsupported operation to the LDAP Adapter, the system does not execute that operation and aborts the batch.

The response message may contain an exception message with details.

## PassThruContent

The LDAP adapter supports submitting ANY XML-based data as part of the Request. Embed this data within the `PassThruContent` element.

You should use a qualified namespace with a prefix on all elements. The system returns the same data as part of the Response message.

This feature means you do not need an orchestration and a multipart messagetype to construct the next message in the message chain! Also, using this technique, you can construct the map more easily.

The adapter already supports XSLT on the response, so you can get the final result back from the adapter.

You should put the “Any” data in a namespace. The new PassThruContent record is optional (0..1) in the schemas.

## <i class="fal fa-hand-point-right" aria-hidden="true"></i> Next Steps

* Review the [Response Schema][Response] for output structure  
* Explore [User Management][User Management] for practical examples  
* Learn about [Logging][Logging] for traceability  

## <i class="fal fa-link-horizontal" aria-hidden="true"></i> Related Topics

* [LDAP Web API Overview][Overview]  
* [Developer Guide][Features Overview]  
* [Schema Management][Schema Management]  
* [Group Management][Group Management]  
* [BizTalk LDAP Adapter Configuration][BizTalk Configuration]  

[1]:https://docs.nodinite.com/media/Documentation%20Pictures/LDAP%20WebAPI/Develop/Request/SchemaBatchesAndRoot.png
[2]:https://docs.nodinite.com/media/Documentation%20Pictures/LDAP%20WebAPI/Develop/Request/requestresponseguid.png
[3]:https://docs.nodinite.com/media/Documentation%20Pictures/LDAP%20WebAPI/Develop/Request/Batch.png
[4]:https://docs.nodinite.com/media/Documentation%20Pictures/LDAP%20WebAPI/Develop/Request/BatchGuid.png
[5]:https://docs.nodinite.com/media/Documentation%20Pictures/LDAP%20WebAPI/Develop/Request/With.png
[6]:https://docs.nodinite.com/media/Documentation%20Pictures/LDAP%20WebAPI/Develop/Request/CNExample.png

[AD Management]:https://docs.nodinite.com/ldap-web-api/features/ad-management/
[BizTalk Configuration]:https://docs.nodinite.com/biztalk-ldap-adapter/getting-started/configuration/
[Features Overview]:https://docs.nodinite.com/ldap-web-api/features/overview/
[Group Management]:https://docs.nodinite.com/ldap-web-api/features/group-management/
[Logging]:https://docs.nodinite.com/ldap-web-api/troubleshooting/logging/
[Message Types]:https://docs.nodinite.com/repository-model/message-types/overview/
[Orchestrations]:https://docs.nodinite.com/logging-and-monitoring/microsoft-biztalk-server-monitoring/features/orchestrations/overview/
[OU Management]:https://docs.nodinite.com/ldap-web-api/features/ou-management/
[Overview]:https://docs.nodinite.com/ldap-web-api/overview/
[Response]:https://docs.nodinite.com/ldap-web-api/features/response/
[Schema Management]:https://docs.nodinite.com/ldap-web-api/features/schema-management/
[Test JSON]:https://docs.nodinite.com/ldap-web-api/getting-started/test/#json-payload-401-and-later
[User Management]:https://docs.nodinite.com/ldap-web-api/features/user-management/