---
title: Relationships & Structure of Batches, Documents, Pages and Files
description: Relation between batches, documents, pages and files to trace how many pages are in a document, how many documents in a batch and in which order. Which incoming files led to which batch, document and page, download output files.
---

[Skip to content](https://support.parashift.io/structure-relationsships-of-batches-documents-pages-and-files#main-content)

[Contact us](https://support.parashift.io/kb-tickets/new?hsLang=en) [Customer support portal](https://support.parashift.io/tickets-view?hsLang=en)

[![parashift\_logo\_white-2](https://support.parashift.io/hs-fs/hubfs/parashift_logo_white-2.png?width=250&height=45&name=parashift_logo_white-2.png)](https://support.parashift.io/?hsLang=en)

Open main navigation

Close main navigation

- [Contact us](https://support.parashift.io/kb-tickets/new)
- [Customer support portal](https://support.parashift.io/tickets-view)

 How can we help you?

- There are no suggestions because the search field is empty.

1. [Support Center](https://support.parashift.io/?hsLang=en)
2. [API Documentation](https://support.parashift.io/api-documentation?hsLang=en)
3. [Technical API Documentation](https://support.parashift.io/api-documentation?hsLang=en#technical-api-documentation)

# Relationships & Structure of Batches, Documents, Pages and Files

## Relation between batches, documents, pages and files to trace how many pages are in a document, how many documents in a batch and in which order. Which incoming files led to which batch, document and page, download output files.

### Introduction

The Parashift Platform can handle all sorts of different scenarios, from uploading batches with multiple documents consisting of multiple files each to separating batches into documents and then rotating, sorting and deleting pages inside of these documents.

An output file can be created for each document, and internally the platform also creates various files, such as a colored jpeg for display in our viewers, a thumbnail for lists (and other non-public file types used for our machine learning predictions)

This article describes how to trace all of these different changes and relationships between the different objects.

### Relationships & Structure

In a nutshell, the following diagram shows how the different objects (batches, documents, pages and files) are linked with each other. 

![Relationships & Structure of Batches, Documents, Pages and Files\_2022-03-09](https://support.parashift.io/hs-fs/hubfs/Relationships%20%26%20Structure%20of%20Batches%2c%20Documents%2c%20Pages%20and%20Files_2022-03-09.png?width=670&name=Relationships%20%26%20Structure%20of%20Batches%2c%20Documents%2c%20Pages%20and%20Files_2022-03-09.png)

### Main takeaways

- One batch consists of one or multiple documents, while a document is always linked to one single batch.
- One document consists of one or multiple pages, while a page is always linked to one single document.
- One file (input\_file, output\_file, color\_jpeg) is linked to one single record (batch, document, page), while one record can have multiple files of the same or different type.  
  A generalized "Files" object stores all the different types of files, uploaded or generated by the platform. Each file has one main record that it is linked to, identifiable through the record\_type (either batches, documents, pages) and record\_id (either batch\_id, document\_id or page\_id)

| **file\_type** | **record\_type** | **record\_id** |
| --- | --- | --- |
| input\_file | batches | \<batch\_id\> |
| output\_file | documents | \<document\_id\> |
| color\_jpeg | pages | \<page\_id\> |

- "index" or "object\_index" is used throughout the different objects to show the order/rank of one object inside the other, the value is zero-based 
    - documents.batch\_index -\> order of this document inside the corresponding batch
    - pages.document\_index -\> order of this page inside the corresponding document
    - pages.input\_file\_index -\> the page number of the originally uploaded input\_file from which this page was created (e.g. originally uploaded 20-page pdf as input\_file, pages.input\_file\_index = "12"  -\> this document page was created based on the 13th page of the originally uploaded input\_file)
    - files.index -\> order of this file in the linked record, depending on file\_type & record\_type:

| **file\_type** | **record\_type** | **index** |
| --- | --- | --- |
| input\_file | batches | order of this input\_file inside the corresponding batch |
| output\_file | documents | order of this output\_file inside the corresponding document, fixed to "0" since one document (at the moment) only has one output\_file |
| color\_jpeg | pages | order of this color\_jpeg inside the corresponding page, fixed to "0" since one page only has one color\_jpeg |

### Example API Calls

#### Ordered amount of pages in document

```
GET /pages/?filter[document_id]=123456&stats[total]=count&sort=document_index
```

#### Pages in a batch, corresponding input\_file per page

```
GET /batches/123456/?include=input_files&extra_fields[files]=url
```

#### The output\_file (created PDF) of a document

```
GET /documents/123456/?include=output_files&extra_fields[files]=url
```

(the URL extra\_field is needed to get a temporary accessible download URL)

#### All output\_files (created PDF) of a batch

```
GET /documents/?filter[batch_id]=123456&include=output_files&extra_fields[files]=url
```

(the URL extra\_field is needed to get a temporary accessible download URL)

#### All color\_jpeg pages of a given document

```
GET /pages/?filter[document_id]=123456&include=color_jpeg
```

#### All color\_jpeg files of a given document

```
GET /pages/?filter[document_id]=123456&include=color_jpeg&extra_fields[files]=url
```

(the URL extra\_field is needed to get a temporary accessible download URL)

#### All input\_files of a given batch

```
GET /files/?filter[batch_id]=123456&filter[file_type]=input_file&extra_fields[files]=url
```

(the URL extra\_field is needed to get a temporary accessible download URL)

- [Getting Started](https://support.parashift.io/getting-started?hsLang=en)
- [User Guides](https://support.parashift.io/user-guides?hsLang=en#main-content)

    - [General](https://support.parashift.io/user-guides?hsLang=en#general)
    - [Validation](https://support.parashift.io/user-guides?hsLang=en#validation)
    - [Platform Workshops](https://support.parashift.io/user-guides?hsLang=en#platform-workshops)
- [Configuration Guides](https://support.parashift.io/configuration-guides?hsLang=en#main-content)

    - [Document Type & Fields](https://support.parashift.io/configuration-guides?hsLang=en#document-type-fields)
    - [Automation](https://support.parashift.io/configuration-guides?hsLang=en#automation)
    - [Tenant (User management)](https://support.parashift.io/configuration-guides?hsLang=en#tenant-user-management)
    - [Workflow (Upload Configuration, Separation, Classification)](https://support.parashift.io/configuration-guides?hsLang=en#workflow-upload-configuration-separation-classification)
- [Release Notes](https://support.parashift.io/release-notes?hsLang=en)
- [API Documentation](https://support.parashift.io/api-documentation?hsLang=en#main-content)

    - [Platform API Configuration](https://support.parashift.io/api-documentation?hsLang=en#platform-api-configuration)
    - [Technical API Documentation](https://support.parashift.io/api-documentation?hsLang=en#technical-api-documentation)
- [Professional Services](https://support.parashift.io/professional-services?hsLang=en#main-content)

    - [Project-based Service Packages](https://support.parashift.io/professional-services?hsLang=en#project-based-service-packages)
    - [Subscription-based Service Packages](https://support.parashift.io/professional-services?hsLang=en#subscription-based-service-packages)

[![Knowledge Base Home](https://support.parashift.io/hubfs/parashift_logo_black-2.svg "Knowledge Base Home")](https://support.parashift.io/?hsLang=en)

[Platform Live Status](https://status.parashift.io/)   |   [API Documentation](https://docs.parashift.io/)

<https://www.parashift.io/> [mailto:support@parashift.io](mailto:support@parashift.io) <https://www.linkedin.com/company/parashiftag>

Copyright © 2025, Parashift AG