Assets API
Upload, list, get, update, and delete image assets.
Assets are image files uploaded to a project. All endpoints require JWT authentication.
Upload asset
Upload an image file using multipart form data.
POST
/api/projects/{projectId}/assetsJWTcurl
curl -X POST https://your-api.com/api/projects/{projectId}/assets \
-H "Authorization: Bearer {token}" \
-F "file=@photo.jpg"Response 201
Response
{
"id": "880e8400-e29b-41d4-a716-446655440000",
"projectId": "770e8400-e29b-41d4-a716-446655440000",
"filename": "photo.jpg",
"originalUrl": "https://storage.example.com/projects/.../photo.jpg",
"contentType": "image/jpeg",
"sizeBytes": 245760,
"width": 1920,
"height": 1080,
"altText": null,
"tags": [],
"metadata": "{}",
"createdAt": "2026-01-15T10:30:00",
"updatedAt": "2026-01-15T10:30:00"
}List assets
List assets in a project with pagination.
GET
/api/projects/{projectId}/assetsJWTQuery parameters
| Name | Type | Default | Description |
|---|---|---|---|
page | int | 0 | Zero-based page number |
size | int | 20 | Items per page |
Response 200
Returns a paginated response with content, totalElements, totalPages, etc.
Get asset
GET
/api/projects/{projectId}/assets/{assetId}JWTResponse 200
Returns the asset object.
Update asset
Update asset metadata (filename, alt text, tags, custom metadata).
PUT
/api/projects/{projectId}/assets/{assetId}JWTRequest body
| Name | Type | Default | Description |
|---|---|---|---|
filename | string | — | Updated filename |
altText | string | — | Accessibility description |
tags | string[] | — | Searchable tags |
metadata | object | — | Custom key-value metadata |
Request
{
"filename": "hero-banner.jpg",
"altText": "A scenic mountain landscape",
"tags": ["hero", "landscape"],
"metadata": { "photographer": "Jane Doe" }
}Response 200
Returns the updated asset object.
Delete asset
DELETE
/api/projects/{projectId}/assets/{assetId}JWTResponse 204
No content. The asset is removed from storage and database.
Deleting an asset removes it from any folder and from all widgets that reference it.