To access files via our API you'll need an api_key, which is available on our Business plan, and can be found here

Using the API, it's possible to retrieve file information by ID, as well as list the files in your account, with filtering & pagination options.

Get a file by ID
$ curl "https://ufile.io/v1/files/FILE_ID" \
-H "X-API-KEY: YOUR_API_KEY"


Response Example
{
"id": "8266380",
"slug": "w1wxxg9l",
"datecreated": "1610464049",
"last_updated": "2021-01-12 15:07:29",
"size": "211494",
"downloads": "0",
"hits": "1",
"name": "Screenshot 2021-01-12 at 18.43.32.png",
"filename": "w1wxxg9l-screenshot-2021-01-12-at-18.43.32.png",
"type": "image",
"dateexpired": "0",
"user_id": "1",
"archived": "0",
"datearchived": null,
"deleted": "0",
"permanent": "1",
"ip_address": "1.1.1.1",
"synced": "0",
"reportcount": "0",
"banned": "0",
"source": "",
"folder_id": "47866",
"password": null,
"price": "0.00",
"hero": "0",
"description": null,
"sell": "0",
"one_time": "0",
"display_name": null,
"recent_downloads": "0",
"destroyed": "0",
"location": "3",
"private": "0",
"session_id": null
}


List Files
$ curl -X GET "https://ufile.io/v1/files/?limit=5&sort=datecreated" \
-H "X-API-KEY: YOUR_API_KEY"


Optional Params:
$query = false; // Search the filename e.g - "my-file"
$filter = false; // Filter the file type e.g - "video"
$sort = "datecreated"; // Sort by field e.g - "id", "datecreated", "size"
$order = "DESC"; // Order direction e.g - "DESC", "ASC"
$archived = 0; // Return archived files
$deleted = 0; // Return deleted files
$days = false; // Limit by file age in days e.g - "30"
$folder_id = false; // Define folder ID to search
$expired = 0; // Return expired files
$limit = 100; // Response limit (max 100)
$offset = 0; // Response offset e.g - 100 (to return results from 100 - 200)
$active = 0; // Only return active files
$banned = 0; // Include banned files

Response Example
[
{
"id": "8266380",
"slug": "w1wxxg9l",
"datecreated": "1610464049",
"last_updated": "2021-01-12 15:07:29",
"size": "211494",
"downloads": "0",
"hits": "1",
"name": "Screenshot 2021-01-12 at 18.43.32.png",
"filename": "w1wxxg9l-screenshot-2021-01-12-at-18.43.32.png",
"type": "image",
"dateexpired": "0",
"user_id": "1",
"archived": "0",
"datearchived": null,
"deleted": "0",
"permanent": "1",
"ip_address": "1.1.1.1",
"synced": "0",
"reportcount": "0",
"banned": "0",
"source": "",
"folder_id": "47866",
"password": null,
"price": "0.00",
"hero": "0",
"description": null,
"sell": "0",
"one_time": "0",
"display_name": null,
"recent_downloads": "0",
"destroyed": "0",
"location": "3",
"private": "0",
"path": null,
"session_id": null
},
{...


Delete File
$ curl -X DELETE "https://ufile.io/v1/files/FILE_ID" \
-H "X-API-KEY: YOUR_API_KEY"
Was this article helpful?
Cancel
Thank you!