List Files
curl --request GET \
--url https://api-prod.extend.app/files \
--header 'Authorization: Bearer <token>'import requests
url = "https://api-prod.extend.app/files"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api-prod.extend.app/files', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api-prod.extend.app/files",
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;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api-prod.extend.app/files"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api-prod.extend.app/files")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-prod.extend.app/files")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"success": true,
"nextPageToken": "abc123",
"files": [
{
"object": "file",
"id": "file_1234",
"name": "example_file",
"type": "PDF",
"presignedUrl": "https://s3.example.com/file_1234.pdf",
"metadata": {
"pageCount": 10
}
"createdAt": "2024-01-01T00:00:00Z",
"updatedAt": "2024-01-01T00:00:00Z"
}
]
}
File Endpoints
List Files
List files in your account.
List Files
curl --request GET \
--url https://api-prod.extend.app/files \
--header 'Authorization: Bearer <token>'import requests
url = "https://api-prod.extend.app/files"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api-prod.extend.app/files', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api-prod.extend.app/files",
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;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api-prod.extend.app/files"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api-prod.extend.app/files")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-prod.extend.app/files")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"success": true,
"nextPageToken": "abc123",
"files": [
{
"object": "file",
"id": "file_1234",
"name": "example_file",
"type": "PDF",
"presignedUrl": "https://s3.example.com/file_1234.pdf",
"metadata": {
"pageCount": 10
}
"createdAt": "2024-01-01T00:00:00Z",
"updatedAt": "2024-01-01T00:00:00Z"
}
]
}
This endpoint allows you to fetch the files in your account.
This endpoint returns a paginated response. You can use the
nextPageToken to fetch subsequent pages.
Query Parameters
Sorts the files in ascending or descending order.Possible values include:
asc: sort in ascending orderdesc: sort in descending order
The token used to fetch the page of results from a previous request.Note: if parameters other than
nextPageToken change in subsequent requests, you are likely to receive incomplete results.The maximum number of results to return per page.You are not guaranteed to receive this many results per page, but you will not receive more than this.
- Max: 1000
- Min: 1
Response
An array of File objects.
The token used to fetch the next page of results.If there are no more pages, the token will not be present.The general pattern for collecting all results is to keep calling the endpoint with the
nextPageToken and the same parameters, until the token is not present, for example:files = []
token = None
while True:
response = list_files(nextPageToken=token)
files.extend(response.files)
token = response.nextPageToken
if not token:
break
Error Responses
Possible Errors
- 404 Not Found: If the specified file does not exist.
- 400 Bad Request: If invalid query parameters are provided.
{
"success": true,
"nextPageToken": "abc123",
"files": [
{
"object": "file",
"id": "file_1234",
"name": "example_file",
"type": "PDF",
"presignedUrl": "https://s3.example.com/file_1234.pdf",
"metadata": {
"pageCount": 10
}
"createdAt": "2024-01-01T00:00:00Z",
"updatedAt": "2024-01-01T00:00:00Z"
}
]
}

