Skip to content

The Storage Management endpoints let you list, retrieve, and delete files that have been saved to local storage by curl jobs. Files are organized using three directory structures — by-job, by-domain, and by-date — but all three paths point to the same physical files via symlinks. Use these endpoints to audit downloads, find files by domain or date, or clean up old data.

Retrieve a paginated list of all files saved to storage from HTTP requests.

Storage Organization:

  • by-job/{uuid}/filename — Primary location, organized by storage UUID
  • by-domain/{domain}/{uuid} — Grouped by source domain
  • by-date/{YYYY-MM-DD}/{uuid} — Grouped by download date
NameInTypeRequiredDescription
pagequeryintegerNo1-based page number (optional)
limitqueryintegerNoItems per page (optional; current handler returns all items when omitted)
{
"items": [
{
"path": "by-job/550e8400-e29b-41d4-a716-446655440000/report.pdf",
"size": 1048576,
"created_at": "2024-01-15T10:30:00Z",
"job_id": "550e8400-e29b-41d4-a716-446655440000",
"url": "https://api.example.com/reports/q4.pdf"
},
{
"path": "by-date/2024-01-15/660e8400-e29b-41d4-a716-446655440111",
"size": 2048,
"created_at": "2024-01-15T11:45:12Z",
"job_id": "660e8400-e29b-41d4-a716-446655440111",
"url": "https://cdn.example.com/data.json"
}
],
"meta": {
"total": 2,
"page": 1,
"limit": 50
}
}
const result = await client.curl.storage.listIterator();
for await (const file of result) {
console.log(file.path, file.size);
}

With pagination parameters:

const result = await client.curl.storage.listIterator({
page: 1,
limit: 50,
});

Retrieve the contents of a file previously saved to storage. The file is returned as a binary stream with Content-Type: application/octet-stream, making it suitable for downloads of any file type.

Path Examples:

  • by-job/550e8400-e29b-41d4-a716-446655440000/report.pdf
  • by-domain/api.example.com/660e8400-e29b-41d4-a716-446655440111
  • by-date/2024-01-15/770e8400-e29b-41d4-a716-446655440222
NameInTypeRequiredDescription
pathpathstringYesRelative path to file in storage (supports nested paths)

The file body is returned as a binary stream. Example (text content shown for illustration; actual responses are raw bytes):

%PDF-1.4
%âãÏÓ
1 0 obj
<< /Type /Catalog /Pages 2 0 R >>
endobj
...
const file = await client.curl.storage.getFile({
path: "by-job/550e8400-e29b-41d4-a716-446655440000/report.pdf",
});

Permanently delete a file from storage. This action cannot be undone.

NameInTypeRequiredDescription
pathpathstringYesRelative path to file in storage
{
"ok": true,
"deleted": "by-job/550e8400-e29b-41d4-a716-446655440000/report.pdf"
}
await client.curl.storage.deleteFile({
path: "by-job/550e8400-e29b-41d4-a716-446655440000/report.pdf",
});