Skip to main content

Media

The media endpoints handle generic file attachments — images, documents, or other assets that can be attached to scene blocks.

Endpoints overview

MethodEndpointPermissionDescription
GET/api/media/file/*Download media file (public)
POST/api/media/uploadscene:block:media:attachUpload a media file
DELETE/api/media/file/*scene:block:media:deleteDelete a media file

Endpoints

Download media file

GET /api/media/file/*

Public — no authentication required. The wildcard supports arbitrarily nested paths.

Example: GET /api/media/file/proj-uuid/ep-uuid/scene-uuid/media/image.png


Upload media file

POST /api/media/upload — Auth required, multipart/form-data, Permission: scene:block:media:attach

Form fields:

FieldTypeRequired
fileany fileyes
projectIdstring (UUID)no — used to build storage path
episodeIdstring (UUID)no — used to build storage path
sceneIdstring (UUID)no — used to build storage path

When projectId, episodeId, and sceneId are all provided, the file is stored at {projectId}/{episodeId}/{sceneId}/media/{filename}. Otherwise a flat path is used.

Response201

{
"data": {
"url": "/api/media/file/proj-uuid/ep-uuid/scene-uuid/media/image.png",
"filename": "image.png"
}
}

Delete media file

DELETE /api/media/file/* — Auth required, Permission: scene:block:media:delete

Deletes the file at the specified path.

Example: DELETE /api/media/file/proj-uuid/ep-uuid/scene-uuid/media/image.png

Response204