Skip to main content

File Management API

These endpoints manage files and media in your EverShop store. All file management endpoints require admin authentication.

File Operations

Browse Files

Lists files in a directory. The path after /files/ specifies which directory to browse.

Request Schema (application/json)
No request body required
GET/api/files/{path}
curl
-H "Accept: application/json"
-H "Authorization: Bearer <admin JWT token>"
https://<your domain>/api/files/{path}
Sample Of Response
{
"data": {
"files": [
{
"name": "product-image.jpg",
"type": "file",
"size": 45230,
"path": "catalog/products/product-image.jpg"
},
{
"name": "thumbnails",
"type": "directory",
"path": "catalog/products/thumbnails"
}
]
}
}

Upload File

Uploads a file to the specified directory path. Send the file as multipart form data.

Request Schema (application/json)
No request body required
POST/api/files/{path}
curl
-H "Accept: application/json"
-H "Authorization: Bearer <admin JWT token>"
--data-raw '<JSON DATA>'
https://<your domain>/api/files/{path}
Sample Of Response
{
"data": {
"files": [
{
"name": "uploaded-file.pdf",
"path": "documents/uploaded-file.pdf",
"size": 102400
}
]
}
}

Delete File

Deletes a file at the specified path.

Request Schema (application/json)
No request body required
DELETE/api/files/{path}
curl
-H "Accept: application/json"
-H "Authorization: Bearer <admin JWT token>"
https://<your domain>/api/files/{path}
Sample Of Response
{
"data": {
"success": true
}
}

Image Operations

Upload Image

Uploads an image file with automatic processing (resizing, thumbnail generation). Send the image as multipart form data.

Request Schema (application/json)
No request body required
POST/api/images/{path}
curl
-H "Accept: application/json"
-H "Authorization: Bearer <admin JWT token>"
--data-raw '<JSON DATA>'
https://<your domain>/api/images/{path}
Sample Of Response
{
"data": {
"files": [
{
"name": "product-photo.jpg",
"path": "catalog/products/product-photo.jpg",
"thumb": "catalog/products/product-photo-thumb.jpg"
}
]
}
}

Folder Operations

Create Folder

Creates a new directory in the media storage.

Request Schema (application/json)
Field NameField TypeRequired
pathstringYes
POST/api/folders
curl
-H "Accept: application/json"
-H "Authorization: Bearer <admin JWT token>"
--data-raw '<JSON DATA>'
https://<your domain>/api/folders
Sample Of Response
{
"data": {
"path": "catalog/new-folder",
"success": true
}
}