Files
List files
List uploaded files in a workspace.
GET
/
files
List files
curl --request GET \
--url https://www.orgo.ai/api/files \
--header 'Authorization: Bearer <token>'import requests
url = "https://www.orgo.ai/api/files"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://www.orgo.ai/api/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://www.orgo.ai/api/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://www.orgo.ai/api/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://www.orgo.ai/api/files")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.orgo.ai/api/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{
"files": [
{
"id": "<string>",
"filename": "<string>",
"size_bytes": 123,
"content_type": "<string>",
"created_at": "2023-11-07T05:31:56Z"
}
]
}{
"error": "Invalid API key"
}{
"error": "Resource not found"
}Lists all files in a workspace, optionally filtered by computer.
Query parameters
string
required
Workspace ID.
string
Optional computer ID to filter files by.
Response
array
Array of file objects.
Example
# List all files in a workspace
curl "https://www.orgo.ai/api/files?projectId=550e8400-e29b-41d4-a716-446655440000" \
-H "Authorization: Bearer $ORGO_API_KEY"
# List files for a specific computer
curl "https://www.orgo.ai/api/files?projectId=550e8400-e29b-41d4-a716-446655440000&desktopId=a3bb189e-8bf9-3888-9912-ace4e6543002" \
-H "Authorization: Bearer $ORGO_API_KEY"
import requests
response = requests.get(
"https://www.orgo.ai/api/files",
headers={"Authorization": f"Bearer {api_key}"},
params={
"projectId": workspace_id,
"desktopId": computer_id # optional
}
)
files = response.json()["files"]
for f in files:
print(f"{f['filename']} ({f['size_bytes']} bytes)")
const params = new URLSearchParams({
projectId: workspaceId,
desktopId: computerId // optional
});
const response = await fetch(`https://www.orgo.ai/api/files?${params}`, {
headers: { 'Authorization': `Bearer ${apiKey}` }
});
const { files } = await response.json();
files.forEach(f => {
console.log(`${f.filename} (${f.size_bytes} bytes)`);
});
Response
{
"files": [
{
"id": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"filename": "document.pdf",
"size_bytes": 102400,
"content_type": "application/pdf",
"source": "upload",
"created_at": "2024-01-15T10:30:00Z"
},
{
"id": "c3d4e5f6-a7b8-9012-cdef-345678901234",
"filename": "results.txt",
"size_bytes": 1024,
"content_type": "text/plain",
"source": "export",
"created_at": "2024-01-15T11:00:00Z"
}
]
}
⌘I
List files
curl --request GET \
--url https://www.orgo.ai/api/files \
--header 'Authorization: Bearer <token>'import requests
url = "https://www.orgo.ai/api/files"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://www.orgo.ai/api/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://www.orgo.ai/api/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://www.orgo.ai/api/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://www.orgo.ai/api/files")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.orgo.ai/api/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{
"files": [
{
"id": "<string>",
"filename": "<string>",
"size_bytes": 123,
"content_type": "<string>",
"created_at": "2023-11-07T05:31:56Z"
}
]
}{
"error": "Invalid API key"
}{
"error": "Resource not found"
}