curl --request GET \
--url https://api.pre.dev/v1/files \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.pre.dev/v1/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.pre.dev/v1/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.pre.dev/v1/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.pre.dev/v1/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.pre.dev/v1/files")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pre.dev/v1/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{
"object": "list",
"data": [
{
"id": "file-8Kz3pQ",
"object": "file",
"bytes": 1024000,
"created_at": 1790500000,
"filename": "contract.pdf",
"purpose": "user_data"
}
],
"first_id": "file-8Kz3pQ",
"last_id": "file-8Kz3pQ",
"has_more": false
}List files
Files this workspace uploaded, newest first, one page at a time.
curl --request GET \
--url https://api.pre.dev/v1/files \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.pre.dev/v1/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.pre.dev/v1/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.pre.dev/v1/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.pre.dev/v1/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.pre.dev/v1/files")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pre.dev/v1/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{
"object": "list",
"data": [
{
"id": "file-8Kz3pQ",
"object": "file",
"bytes": 1024000,
"created_at": 1790500000,
"filename": "contract.pdf",
"purpose": "user_data"
}
],
"first_id": "file-8Kz3pQ",
"last_id": "file-8Kz3pQ",
"has_more": false
}Authorizations
The workspace API key (pdk_…) from Integrations → Built-in in the pre.dev dashboard.
Query Parameters
Files per page, 1 to 50.
1 <= x <= 50desc for newest first, asc for oldest first.
desc, asc A file id from an earlier page, usually its last_id. It must be one of this workspace's files, or the call returns 404 not_found.
Only files with this purpose, for example user_data.
Response
One page of files.
One page of this workspace's files. To read the next page, pass last_id as after while has_more is true.
"list"Files this workspace uploaded through the gateway, in the requested order.
Show child attributes
Show child attributes
Id of the first file in data; null when the page is empty.
Id of the last file in data; pass it as after for the next page. null when the page is empty.
More files remain after this page.
Present only when files were skipped.
Show child attributes
Show child attributes
Was this page helpful?

