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

# The File object

The File object represents a file in Extend. Files are created for each workflow run, and can also be created directly via API for use in evaluation sets.

<Expandable title="properties" defaultOpen>
  <ResponseField name="object" type="string">
    The type of the object, in this case it will always be "file".
  </ResponseField>

  <ResponseField name="id" type="string">
    The file ID.
  </ResponseField>

  <ResponseField name="name" type="string">
    The name of the file.
  </ResponseField>

  <ResponseField name="type" type="string">
    The Extend normalized type of the file. One of `IMG` `PDF` `TXT` `DOCX` `CSV` `EXCEL`.
  </ResponseField>

  <ResponseField name="parentFileId" type="string" optional>
    The ID of the parent file. Only included if this file is a derivative of another file, for instance if it was created via a Splitter in a workflow.
  </ResponseField>

  <ResponseField name="presignedUrl" type="string">
    A presigned URL to download the file. Expires after 15 minutes.
  </ResponseField>

  <ResponseField name="contents" type="object">
    <Expandable title="properties" defaultOpen>
      <ResponseField name="rawText" type="string" optional>
        The raw text content of the file. This is included for all file types if the `rawText` query parameter is set to true in the endpoint request.
      </ResponseField>

      <ResponseField name="pages" type="array">
        An array of page objects representing the content of each page in the file.

        <Expandable title="properties" defaultOpen>
          <ResponseField name="pageNumber" type="number">
            The page number of this page in the document.
          </ResponseField>

          <ResponseField name="markdown" type="string" optional>
            Cleaned and structured markdown content of the page.
            Available for PDF and IMG file types.
            Only included if the `markdown` query parameter is set to true in the endpoint request.
          </ResponseField>

          <ResponseField name="html" type="string" optional>
            Cleaned and structured html content of the page.
            Available for DOCX file types (that were not auto-converted to PDFs).
            Only included if the `html` query parameter is set to true in the endpoint request.
          </ResponseField>
        </Expandable>
      </ResponseField>
    </Expandable>
  </ResponseField>

  <ResponseField name="metadata" type="object" optional>
    <Expandable title="properties" defaultOpen>
      <ResponseField name="pageCount" type="number" optional>
        The number of pages in the file. This is only set for PDF/DOCX files.
      </ResponseField>

      <ResponseField name="parentSplit" type="object">
        The split metadata details. Only included if this file is a derivative of another file, for instance if it was created via a Splitter in a workflow.

        <Expandable title="properties" defaultOpen>
          <ResponseField name="id" type="string">
            The ID of the split.
          </ResponseField>

          <ResponseField name="type" type="string">
            The type of the split.
          </ResponseField>

          <ResponseField name="identifier" type="string">
            The identifier of the split.
          </ResponseField>

          <ResponseField name="startPage" type="number">
            The start page of the split.
          </ResponseField>

          <ResponseField name="endPage" type="number">
            The end page of the split.
          </ResponseField>
        </Expandable>
      </ResponseField>
    </Expandable>
  </ResponseField>

  <ResponseField name="createdAt" type="string">
    The date and time the file was created.
  </ResponseField>

  <ResponseField name="updatedAt" type="string">
    The date and time the file was last updated.
  </ResponseField>
</Expandable>

**Note:** There are several deprecated fields that are still in the payload for backwards compatibility. These are:

* markdown/rawText in IMGs not nested under pages array. These will still be included in payloads until full deprecation in December 2024.

<ResponseExample>
  ```json Example File theme={null}
  {
    "object": "file",
    "id": "file_1234",
    "name": "example_file",
    "type": "PDF",
    "presignedUrl": "https://s3.example.com/file_1234.pdf",
    "parentFileId": "file_5678", // Optional, only set if this file is a derivative of another file
    "contents": {
      "rawText": "This is the raw text content of the file...",
      "pages": [
        {
          "pageNumber": 1,
          "markdown": "This is the markdown content of the page...",
        }
      ]
    },
    "metadata": {
      "parentSplit": { // Optional, only set if this file is a derivative of another file
        "id": "324kjlfsd",
        "type": "addendum",
        "identifier": "addendum_1",
        "startPage": 7,
        "endPage": 9
      }
    }
    "createdAt": "2024-01-01T00:00:00Z",
    "updatedAt": "2024-01-01T00:00:00Z"
  }
  ```
</ResponseExample>
