Read a path
curl --request GET \
--url https://api.cloudsquid.io/api/projects/{project_name}/files \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.cloudsquid.io/api/projects/{project_name}/files"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.cloudsquid.io/api/projects/{project_name}/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.cloudsquid.io/api/projects/{project_name}/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 => [
"X-API-Key: <api-key>"
],
]);
$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.cloudsquid.io/api/projects/{project_name}/files"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
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.cloudsquid.io/api/projects/{project_name}/files")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cloudsquid.io/api/projects/{project_name}/files")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"ftype": "file",
"name": "<string>",
"size": 123,
"mimetype": "<string>",
"modified_at": "2023-11-07T05:31:56Z",
"url": "<string>"
}{
"errorMessage": "<string>"
}{
"errorMessage": "<string>"
}{
"errorMessage": "<string>"
}{
"errorMessage": "<string>"
}Filesystem
Read by Path
Resolve a path: returns a presigned URL for a file, or a listing for a folder.
GET
/
projects
/
{project_name}
/
files
Read a path
curl --request GET \
--url https://api.cloudsquid.io/api/projects/{project_name}/files \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.cloudsquid.io/api/projects/{project_name}/files"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.cloudsquid.io/api/projects/{project_name}/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.cloudsquid.io/api/projects/{project_name}/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 => [
"X-API-Key: <api-key>"
],
]);
$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.cloudsquid.io/api/projects/{project_name}/files"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
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.cloudsquid.io/api/projects/{project_name}/files")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cloudsquid.io/api/projects/{project_name}/files")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"ftype": "file",
"name": "<string>",
"size": 123,
"mimetype": "<string>",
"modified_at": "2023-11-07T05:31:56Z",
"url": "<string>"
}{
"errorMessage": "<string>"
}{
"errorMessage": "<string>"
}{
"errorMessage": "<string>"
}{
"errorMessage": "<string>"
}Polymorphic response: The response shape depends on what exists at the path. Check the
ftype field — "file" returns a download URL, "folder" returns a listing of direct children.What this does
Reads whatever exists at the given path. If the path resolves to a file, returns a File object with a short-lived presigned download URL (15-minute TTL). If it resolves to a folder, returns a Folder object listing its direct children.Examples
curl "https://api.cloudsquid.io/api/projects/my-project/files?path=/invoices/2024/jan.pdf" \
-H "X-API-Key: YOUR_API_KEY"
curl "https://api.cloudsquid.io/api/projects/my-project/files?path=/invoices/2024" \
-H "X-API-Key: YOUR_API_KEY"
import requests
response = requests.get(
"https://api.cloudsquid.io/api/projects/my-project/files",
params={"path": "/invoices/2024"},
headers={"X-API-Key": "YOUR_API_KEY"}
)
node = response.json()
if node["ftype"] == "file":
print(f"Download URL: {node['url']}")
else:
for entry in node["entries"]:
print(f" {entry['ftype']}: {entry['name']}")
const response = await fetch(
"https://api.cloudsquid.io/api/projects/my-project/files?path=/invoices/2024",
{ headers: { "X-API-Key": "YOUR_API_KEY" } }
);
const node = await response.json();
if (node.ftype === "file") {
console.log("Download:", node.url);
} else {
node.entries.forEach(e => console.log(e.ftype, e.name));
}
200):
{
"ftype": "file",
"name": "jan.pdf",
"size": 48210,
"mimetype": "application/pdf",
"modified_at": "2026-06-01T12:00:00Z",
"url": "https://storage.googleapis.com/presigned?..."
}
200):
{
"ftype": "folder",
"name": "2024",
"entries": [
{
"ftype": "file",
"name": "jan.pdf",
"size": 48210,
"mimetype": "application/pdf",
"modified_at": "2026-06-01T12:00:00Z",
"url": "https://storage.googleapis.com/presigned?..."
},
{
"ftype": "folder",
"name": "archive"
}
]
}
Authorizations
Path Parameters
The name of the project
Query Parameters
Absolute path inside the project
Was this page helpful?
