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

# AddNewEmptyDocument

> Add an empty document to a FlexiCapture batch with the AddNewEmptyDocument Web Services API method, then attach pages.

## What it does

Adds an empty document into a batch. You can then attach pages to this document using the [AddNewPageEx](/flexi-capture/api/methods/add-new-page-ex) method. A new document is created with the `excludeFromAutomaticAssembling` flag set to `true`. This flag specifies that the document is already assembled, so the assembly settings specified for the batch type are not applied to this document.

This method is retained for compatibility with previous versions of the API. To create an empty document, you can also use the [AddNewDocumentEx](/flexi-capture/api/methods/add-new-document-ex) method, leaving the `file` parameter empty (`file.Name = ""`, `file.Bytes = new bytes [0]`).

## Definition

```csharp theme={null}
int AddNewEmptyDocument(int sessionId, int batchId);
```

## Parameters

| Name        | Type  | Description                                              |
| ----------- | ----- | -------------------------------------------------------- |
| `sessionId` | `int` | The ID of the connection to the Application Server       |
| `batchId`   | `int` | The ID of the batch into which a document is to be added |

## Returned value

| Type  | Description                          |
| ----- | ------------------------------------ |
| `int` | The ID of the created empty document |
