For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
GuidesAPI ReferenceChangelogModel Versioning
GuidesAPI ReferenceChangelogModel Versioning
    • Getting Started
    • Authentication
    • API Versioning
    • SDKs
    • Deployments
    • Error Codes
    • Async Processing
  • Endpoints
      • POSTUpload File
      • GETGet File
      • GETList Files
      • DELDelete File
  • Webhook Events
LogoLogo
EndpointsFiles

Get File

GET
/files/:id
GET
/files/:id
1import { ExtendClient } from "extend-ai";
2
3const client = new ExtendClient({ token: "YOUR_TOKEN" });
4await client.files.retrieve("file_id_here");
1{
2 "object": "file",
3 "id": "file_xK9mLPqRtN3vS8wF5hB2cQ",
4 "name": "Invoices.pdf",
5 "type": "PDF",
6 "presignedUrl": "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf",
7 "parentFileId": "file_Zk9mNP12Qw4yTv8BdR3H",
8 "metadata": {
9 "pageCount": 30,
10 "parentSplit": {
11 "id": "string",
12 "type": "Invoice",
13 "identifier": "other_2_9",
14 "startPage": 1,
15 "endPage": 10
16 }
17 },
18 "createdAt": "2024-03-21T16:45:00Z",
19 "updatedAt": "2024-03-21T16:45:00Z",
20 "contents": {
21 "rawText": "string",
22 "pages": [
23 {
24 "pageNumber": 1,
25 "pageHeight": 792,
26 "pageWidth": 612,
27 "markdown": "# Heading\n\nThis is a paragraph with **bold** and *italic* text.\n\n- List item 1\n- List item 2\n\n> This is a blockquote",
28 "html": "<div>This is the html of the page.</div>"
29 }
30 ],
31 "sections": [
32 {
33 "startPageNumber": 1,
34 "endPageNumber": 3,
35 "markdown": "# Section Header\n\nContent spanning multiple pages...\n"
36 }
37 ],
38 "sheets": [
39 {
40 "sheetName": "Sheet1",
41 "rawText": "Column1,Column2\nValue1,Value2"
42 }
43 ]
44 }
45}
Fetch a file by its ID.
Was this page helpful?
Previous

List Files

Next
Built with

Authentication

AuthorizationBearer

Bearer authentication of the form Bearer <token>, where token is your auth token.

Path parameters

idstringRequired

ID for the file. It will always start with "file_".

Example: "file_Xj8mK2pL9nR4vT7qY5wZ"

Headers

x-extend-api-version"2026-02-09"Optional
API version to use for the request. If you're using an SDK, you can ignore this parameter. If you are not using an SDK and do not specify a version, you will either receive a `400 Bad Request` or be set to a previous legacy version. See [API Versioning](https://docs.extend.ai/2026-02-09/developers/api-versioning) for more details.
x-extend-workspace-idstringOptional
The workspace ID to target. **Required** when using an organization-scoped API key; optional for workspace-scoped keys (the key is already tied to a workspace). See [Authentication](https://docs.extend.ai/2026-02-09/developers/authentication) for details on API key scopes.

Query parameters

rawTextbooleanOptionalDefaults to falseDeprecated

Deprecated: Use POST /parse_runs instead to parse file contents.

If set to true, the raw text content of the file will be included in the response.

markdownbooleanOptionalDefaults to falseDeprecated

Deprecated: Use POST /parse_runs instead to parse file contents.

If set to true, the markdown content of the file will be included in the response.

Only available for files with a type of PDF, IMG, or DOCX files that were auto-converted to PDFs.

htmlbooleanOptionalDefaults to falseDeprecated

Deprecated: Use POST /parse_runs instead to parse file contents.

If set to true, the html content of the file will be included in the response.

Only available for files with a type of DOCX.

Response

Retrieved file
objectenum

The type of object. Will always be "file".

Allowed values:
idstring

ID for the file.

Example: "file_xK9mLPqRtN3vS8wF5hB2cQ"

namestring

The name of the file

Example: "Invoices.pdf"

typeenum or null

The type of the file.

Availability: Present when the file type could be determined.

presignedUrlstring or null

A presigned URL to download the file. Expires after 15 minutes.

Availability: Present on GET /files/{id}. Not present on POST /files/upload or when the file is embedded in other resources (e.g., in run responses).

parentFileIdstring or null

ID of the parent file.

Availability: Present for files created via a Splitter in a workflow.

metadataobject
createdAtstringformat: "date-time"

The time (in UTC) at which the object was created. Will follow the RFC 3339 format.

Example: "2024-03-21T16:45:00Z"

updatedAtstringformat: "date-time"

The time (in UTC) at which the object was last updated. Will follow the RFC 3339 format.

Example: "2024-03-21T16:45:00Z"

contentsobject or nullDeprecated

Deprecated: Use the POST /parse_runs endpoint instead to parse and retrieve file contents. The parse runs endpoint provides more control over parsing configuration and better performance.

The parsed content of the file. This field will only contain data after the file has been parsed via a parse run, extract run, classify run, split run, edit run, or workflow run.

Availability: Only present and populated on GET /files/{id} when the file has been previously parsed and the corresponding query parameters are set to true. Will be null on POST /files/upload and for files that haven’t been parsed. The structure varies based on file type.

Errors

400
Bad Request Error
401
Unauthorized Error
402
Payment Required Error
403
Forbidden Error
404
Not Found Error
422
Unprocessable Entity Error
429
Too Many Requests Error
500
Internal Server Error

API version to use for the request. If you’re using an SDK, you can ignore this parameter. If you are not using an SDK and do not specify a version, you will either receive a 400 Bad Request or be set to a previous legacy version. See API Versioning for more details.

The workspace ID to target. Required when using an organization-scoped API key; optional for workspace-scoped keys (the key is already tied to a workspace). See Authentication for details on API key scopes.