Assets API
Endpoints for managing uploaded asset files.
List Assets
GET /api/assets
Returns all assets, optionally filtered by search query.
Query Parameters
| Parameter | Type | Description |
|---|---|---|
q | string | Search query (optional) |
Example
bash
curl http://localhost:3000/api/assetsResponse
json
[
{
"name": "logo.png",
"type": "file",
"size": 24576
},
{
"name": "fonts",
"type": "folder"
}
]Upload Asset
POST /api/assets/:name
Upload a file as an asset.
Path Parameters
| Parameter | Description |
|---|---|
name | Asset filename (supports subfolder paths like fonts/custom.ttf) |
Request
Send the raw file content as the body with the appropriate Content-Type.
Example
bash
curl -X POST http://localhost:3000/api/assets/logo.png \
-H "Content-Type: image/png" \
--data-binary @logo.pngGet Asset
GET /api/assets/:name
Download an asset file.
Example
bash
curl http://localhost:3000/api/assets/logo.png -o logo.pngDelete Asset
DELETE /api/assets/:name
Delete an asset file.
Example
bash
curl -X DELETE http://localhost:3000/api/assets/old-logo.pngResponse
204 No Content
Asset Folders
List Folders
GET /api/assets/folders
Create Folder
POST /api/assets/folders
json
{
"name": "fonts"
}Delete Folder
DELETE /api/assets/folders
json
{
"name": "fonts"
}