Files

List files

GET /api/v1/files

Returns a paginated list of your files.

Query parameters

ParameterTypeDefaultDescription
limitinteger20Results per page (max 100)
offsetinteger0Pagination offset
folderIdstringFilter by folder
typestringFilter by file type: IMAGE, VIDEO, AUDIO, DOCUMENT
searchstringSearch by filename or tag

Example

curl "https://medianest.app/api/v1/files?type=IMAGE&limit=10" \
  -H "X-API-Key: mn_your_key"

Get a file

GET /api/v1/files/:id

Returns a single file by ID.

Example

curl https://medianest.app/api/v1/files/clx1abc123 \
  -H "X-API-Key: mn_your_key"

Update file metadata

PATCH /api/v1/files

Requires write permission. Updates tags, description, visibility, or folder assignment.

Body

{
  "id": "clx1abc123",
  "tags": ["hero", "landing"],
  "description": "Homepage hero image",
  "isPublic": true
}

Delete a file

DELETE /api/v1/files/:id

Requires delete permission. Files are soft-deleted and not immediately removed from storage.

Example

curl -X DELETE https://medianest.app/api/v1/files/clx1abc123 \
  -H "X-API-Key: mn_your_key"

Response

{ "success": true, "data": { "deleted": true, "id": "clx1abc123" } }