> This page is for version v2024-12-23.
> For other versions, use one of these documentation indexes:
> - v2026-02-09 (default): https://docs.extend.ai/2026-02-09/llms.txt
> - v2025-04-21: https://docs.extend.ai/2025-04-21/llms.txt
> - v2024-12-23: https://docs.extend.ai/2024-12-23/llms.txt

> ## Documentation Index
> Fetch the complete documentation index at: https://docs.extend.ai/llms.txt
> Use this file to discover all available pages before exploring further.
>
> ## API version
> The current API version is `2026-02-09`, served at the site root (no version prefix in URLs).
> If this page URL contains `/2025-04-21/` or `/2024-12-23/`, you are reading an older API version.
> Prefer the current docs at https://docs.extend.ai/llms.txt unless the user explicitly needs that older version.
> Do not treat older-version pages as the source of truth for new integrations.

# Get File

### Path

**`id`** `string`

The ID of the File to fetch. This is the ID returned when creating a new File or the value on `fileId` of a [WorkflowRun object](/2024-12-23/developers/objects/workflow-run).

---

### Query Parameters

You can add additional parameters to the request to modify the file contents returned. Currently only rawText is supported.

**`markdown`** `boolean` — default: false

If set to true, the markdown content of the file will be included in the response. This is useful for indexing very clean content into RAG pipelines for files like PDFs, Word Documents, etc.

\*Only available for files with a type of PDF, IMG.

\*or .doc/.docx files that were auto-converted to PDFs.

---

**`rawText`** `boolean` — default: false

If set to true, the raw text content of the file will be included in the response. This is useful for indexing text-based files like PDFs, Word Documents, etc.

---

**`html`** `boolean` — default: false

If set to true, the html content of the file will be included in the response. This is useful for indexing html content into RAG pipelines for files like PDFs, Word Documents, etc.

\*Only available for files with a type of DOCX.

---

### Response

**`success`** `boolean`

A true or false value for whether the file was fetched successfully or not.

---

**`file`** `File`

A File object representing the fetched file. See the [File object](/2024-12-23/developers/objects/file) for more details.

---

```curl
curl --request GET \
  --url https://api-prod.extend.app/files/:id \
  --header 'Authorization: Bearer <token>'
```

```python
import requests

url = "https://api-prod.extend.app/files/:id"

headers = {"Authorization": "Bearer <token>"}

response = requests.request("GET", url, headers=headers)

print(response.text)
```

```javascript
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

fetch('https://api-prod.extend.app/files/:id', options)
  .then(response => response.json())
  .then(response => console.log(response))
  .catch(err => console.error(err));
```

```php
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://api-prod.extend.app/files/:id",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => [
    "Authorization: Bearer <token>"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://api-prod.extend.app/files/:id"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```java
HttpResponse<String> response = Unirest.get("https://api-prod.extend.app/files/:id")
  .header("Authorization", "Bearer <token>")
  .asString();
```

**`Example File`**

```json Example File
{
  "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"
}
```