List Uploads API Documentation¶
Overview¶
The List Uploads API retrieves upload records for the authenticated user.
It supports filtering by upload status (e.g., pending, completed, failed, etc.) and returns metadata for each uploaded file.
This API is typically used to list files the user has uploaded or is currently processing.
Base URL:
https://api.apidatatools.com/list-uploads-api
Endpoint (GET)¶
GET https://api.apidatatools.com/list-uploads-api
Headers¶
| Header | Description | Required | Example |
|---|---|---|---|
x-api-key | User’s API key for authentication | Yes | abcdef1234567890 |
x-upload-status | Filter uploads by status | Optional | completed |
Example Request (All Uploads)¶
curl -X GET "https://api.apidatatools.com/list-uploads-api" \
-H "x-api-key: your_api_key"
Example Request (Filter by Status)¶
curl -X GET "https://api.apidatatools.com/list-uploads-api" \
-H "x-api-key: your_api_key" \
-H "x-upload-status: pending"
Example Response¶
{
"uploads": [
{
"upload_id": "upl_a37bf29dfed142158abcd123",
"user_id": "user_123",
"status": "pending",
"filename": "project_data.json",
"s3_key": "user_123/upl_a37bf29dfed142158abcd123/project_data.json",
"file_size": 1048576,
"created_at": 1712345678,
"expires_at": 1712345978
},
{
"upload_id": "upl_34987ac0bb9d4ce2ae76b78f",
"user_id": "user_123",
"status": "completed",
"filename": "report.csv",
"s3_key": "user_123/upl_34987ac0bb9d4ce2ae76b78f/report.csv",
"file_size": 2048,
"created_at": 1712341000,
"expires_at": 1712344300
}
]
}
Example with Python¶
import requests
url = "https://api.apidatatools.com/list-uploads-api"
headers = {"x-api-key": "your_api_key"}
r = requests.get(url, headers=headers)
uploads = r.json()["uploads"]
for file in uploads:
print(file["filename"], file["status"])
Example with JavaScript (fetch)¶
async function listUploads(status) {
const headers = { "x-api-key": "your_api_key" };
if (status) headers["x-upload-status"] = status;
const res = await fetch("https://api.apidatatools.com/list-uploads-api", {
method: "GET",
headers
});
const data = await res.json();
console.log(data.uploads);
}
listUploads("completed");
Error Handling¶
| Error Code | HTTP Status | Description | Example |
|---|---|---|---|
Unauthorized | 401 | Missing or invalid API key | {"error":"Unauthorized"} |
Failed to retrieve uploads | 500 | Unexpected or internal error | {"error":"Failed to retrieve uploads"} |
Notes for Developers¶
- Without a status filter, uploads are returned in descending order of creation time (newest first).
- Expired, inaccessible, or deleted uploads may be omitted from the list.