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

# Document structure

> [!WARNING]
>
> You are viewing the documentation of release 26.1, which is no longer the current one. [Go to the documentation of the current release 26.2](https://developers.circularo.com/).

In Circularo a "document" is a collection of metadata and the file itself (binary file). The file is uploaded separately and metadata are assigned when creating a document.

So in order to create the document, file needs to be uploaded first.

> [!NOTE]
>
> Below is an explanation of some of the values in the document object that can be useful to know about for next chapters in this guide. Please note that these are only some of the properties and there are a lot of other that are present in document object. If you wish to explain some particular ones, please contact our support team.

To get document data use endpoint below. More info can be found in [Retrieve the document](https://developers.circularo.com/26.1/getting-started/basic-scenarios/retrieve-the-document.md)

```http theme={null}
GET /documents/{id}
```

`documentTitle` - name of the pdf file

`pdfFile` - an object containing data of the uploaded file itself (ref - [Create file](https://developers.circularo.com/26.1/getting-started/basic-scenarios/create-file.md))

`signFields` - predefined sign fields and annotations in the document

`signatureComponents` - already placed signatures and annotations to the document

`position` - position of the sign field on the X,Y axis on the page

`workflow` - an object containing activity data performed on the document

`workflow.history` - history of the actions with the documents

`workflow.shareStateName` - current signing status

## Document search

Below are some of the examples of the elasticsearch queries used for searching documents in the database.

All queries are using the endpoint

```http theme={null}
POST /search
```

Search document with the name

```json theme={null}
{
  "query": {
    "match": {
      "name": "myDocument.pdf"
    }
  }
}
```

Get documents in specific state created after specified date (in this case all completed documents)

```json theme={null}
{
  "query": {
    "bool": {
      "must": [
        {
          "range": {
            "createDate": {
              "gte": "2020-12-31T23:59:59.999Z" // Date from
            }
          }
        },
        {
          "nested": {
            "path": "workflow",
            "query": {
              "terms": {
                "workflow.shareStateName": ["completed"] //other options: "inprogress", "rejected", "expired", "cancelled"
              }
            }
          }
        }
      ]
    }
  }
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.