A clean and professional REST API specification for interacting with Telegram Drive programmatically.
http://localhost:8550/api/v1All endpoints (except /health) require an API key passed via request headers.
| Header | Type | Description |
|---|---|---|
X-API-Key |
String | Your Telegram Drive API access key |
curl -H "X-API-Key: YOUR_API_KEY" \
http://localhost:8550/api/v1/filesCheck API availability, status, and running version.
- URL:
/health - Method:
GET - Auth Required: No
{
"status": "ok",
"version": "1.8.8"
}Retrieve metadata for files stored in Telegram Drive.
- URL:
/files - Method:
GET - Auth Required: Yes
| Parameter | Type | Description |
|---|---|---|
page |
Integer | Page number (default: 1) |
limit |
Integer | Items per page (default: 20) |
folder_id |
Integer | Filter files inside a specific folder |
search |
String | Filter files by matching search term in filename |
offset_id |
Integer | Message ID offset for pagination |
sort |
String | Field to sort by: name, size, or created_at |
order |
String | Sort order: asc or desc |
mime_type |
String | Filter files by a specific MIME type |
size_min |
Integer | Minimum file size in bytes |
size_max |
Integer | Maximum file size in bytes |
{
"data": [],
"files": [],
"page": 1,
"limit": 20,
"total": 0
}Retrieve detailed metadata for a specific file.
- URL:
/files/{message_id} - Method:
GET - Auth Required: Yes
{
"id": 123,
"folder_id": 456,
"name": "document.pdf",
"size": 102400,
"mime_type": "application/pdf",
"created_at": "2026-06-05T10:00:00Z"
}Stream or download a file directly from Telegram Drive.
- URL:
/files/{message_id}/download - Method:
GET - Auth Required: Yes
Search files by filename with optional filtering.
- URL:
/files/search - Method:
GET - Auth Required: Yes
| Parameter | Type | Description |
|---|---|---|
q |
String | Required. Search query string |
Upload a file to Telegram Drive.
- URL:
/files - Method:
POST - Auth Required: Yes
- Content-Type:
multipart/form-data
file: Binary file contentfolder_id(Optional): ID of target folder/channel
{
"id": 123,
"folder_id": 456,
"name": "uploaded_file.txt",
"size": 1024,
"mime_type": "text/plain",
"created_at": "2026-06-16T01:00:00Z"
}Delete a specific file.
- URL:
/files/{message_id} - Method:
DELETE - Auth Required: Yes
folder_id(Optional): ID of folder containing the file
Forward a file/message to another folder.
- URL:
/files/{message_id}/copy - Method:
POST - Auth Required: Yes
{
"folder_id": 789,
"source_folder_id": 456
}Rename (edit description) or move a file.
- URL:
/files/{message_id} - Method:
PATCH - Auth Required: Yes
{
"name": "new_name.txt",
"folder_id": 789,
"source_folder_id": 456
}- URL:
/folders - Method:
GET
- URL:
/folders - Method:
POST - Request Body:
{"name": "New Folder"}
- URL:
/folders/{folder_id} - Method:
PATCH - Request Body:
{"name": "New Folder Name"}
- URL:
/folders/{folder_id} - Method:
DELETE
Retrieve total storage consumed, file counts, and breakdown by folders and MIME types.
- URL:
/storage/stats - Method:
GET
{
"total_storage_used_bytes": 10485760,
"total_file_count": 12,
"folders": [
{ "id": 456, "name": "Documents", "file_count": 5, "size_bytes": 5242880 }
],
"mime_types": [
{ "mime_type": "application/pdf", "file_count": 5, "size_bytes": 5242880 }
]
}List groups of files with identical filenames and sizes.
- URL:
/storage/duplicates - Method:
GET
List folders that do not contain any files.
- URL:
/folders/empty - Method:
GET
Return the raw binary image data for a file's thumbnail.
- URL:
/files/{message_id}/thumbnail - Method:
GET - Query Param:
folder_id(Optional)
Return video duration, resolution, audio title, or audio performer metadata.
- URL:
/files/{message_id}/media-info - Method:
GET - Query Param:
folder_id(Optional)
Perform action operations (such as move, delete, or archive) across multiple files.
- URL:
/files/bulk - Method:
POST - Auth Required: Yes
Download selected files as a zip archive stream.
{
"action": "archive",
"file_ids": [123, 124, 125],
"folder_id": 456
}{
"action": "delete",
"file_ids": [123, 124, 125],
"folder_id": 456
}{
"action": "move",
"file_ids": [123],
"folder_id": 111,
"payload": {
"folder_id": 222
}
}The API returns standardized JSON error formats on failure:
{
"error": {
"code": "UNAUTHORIZED",
"message": "Invalid API key"
}
}