REST: Admin, media

Management endpoints. Each operation names the permission it needs: Owner only, a permission such as Manage members, Ban members or Manage channels, or the Administrator permission. Generated from mnema-talk v3.3.13 (cca4f0fdb723).

List all media, newest first

GET /api/admin/media

Owner only (403 otherwise).

Authentication: Session cookie

Parameters

NameInTypeRequiredDescription
limitqueryintegernoPage size. Values below 1 or non-numeric fall back to the default; larger values are clamped to 100.
offsetqueryintegernoNumber of items to skip.

Responses

StatusMeaningBody
200Media page.DashboardItem[]
401No valid session (UNAUTHORIZED): missing, expired or revoked cookie, or the account was disabled.ErrorResponse
403FORBIDDEN: only the Owner may do this.ErrorResponse
429RATE_LIMITED: too many requests.ErrorResponse
500INTERNAL_ERROR: sanitized server failure.ErrorResponse

Count orphaned media objects

GET /api/admin/media/orphans

Objects in storage (uploads/, avatars/, banners/, covers/, exports/) that no row refers to (a media row, or for exports/ the row of a data export), older than 24 hours: left behind by a failed delete or a crash during an upload or an export. Nothing shows them; they only take space. Lists the whole bucket prefix, so it may take a while. Owner only (403 otherwise).

Authentication: Session cookie

Responses

StatusMeaningBody
200Orphaned objects (deleted is 0).Orphans
401No valid session (UNAUTHORIZED): missing, expired or revoked cookie, or the account was disabled.ErrorResponse
403FORBIDDEN: only the Owner may do this.ErrorResponse
429RATE_LIMITED: too many requests.ErrorResponse
500INTERNAL_ERROR: sanitized server failure.ErrorResponse
503UNAVAILABLE: a dependency (database, file storage) is not available.ErrorResponse
Orphans
FieldTypeDescription
bytes (required)integer
count (required)integer
deleted (required)integerDeleted is how many were removed (cleanup only).

Delete orphaned media objects

POST /api/admin/media/orphans/cleanup

Deletes the objects GET /api/admin/media/orphans counts. Never touches an object a media row or the row of a data export refers to, nor one younger than 24 hours. Owner only (403 otherwise).

Authentication: Session cookie

Responses

StatusMeaningBody
200Orphaned objects found and deleted.Orphans
401No valid session (UNAUTHORIZED): missing, expired or revoked cookie, or the account was disabled.ErrorResponse
403FORBIDDEN: only the Owner may do this, or cross-origin request rejected.ErrorResponse
409CONFLICT: an online backup is running; nothing was deleted.ErrorResponse
429RATE_LIMITED: too many requests.ErrorResponse
500INTERNAL_ERROR: sanitized server failure.ErrorResponse
503UNAVAILABLE: a dependency (database, file storage) is not available.ErrorResponse
Orphans
FieldTypeDescription
bytes (required)integer
count (required)integer
deleted (required)integerDeleted is how many were removed (cleanup only).

Delete old chat attachments

POST /api/admin/media/prune

Avatars are never pruned. Without days, uses MEDIA_RETENTION_DAYS; 400 when that is disabled. When storage refuses some objects the run still succeeds and skipped counts them. Owner only (403 otherwise).

Authentication: Session cookie

Parameters

NameInTypeRequiredDescription
daysqueryintegernoDelete attachments older than this many days; defaults to MEDIA_RETENTION_DAYS.

Responses

StatusMeaningBody
200Prune result. skipped counts old objects that storage refused to delete.PruneResult
400Invalid input (INVALID_INPUT): malformed JSON, unknown JSON fields, bad IDs or failed validation.ErrorResponse
401No valid session (UNAUTHORIZED): missing, expired or revoked cookie, or the account was disabled.ErrorResponse
403FORBIDDEN: only the Owner may do this, or cross-origin request rejected.ErrorResponse
429RATE_LIMITED: too many requests.ErrorResponse
500INTERNAL_ERROR: sanitized server failure.ErrorResponse
503UNAVAILABLE: a dependency (database, file storage) is not available.ErrorResponse
PruneResult
FieldTypeDescription
cutoff_days (required)integer
pruned_count (required)integer
skippedintegerSkipped counts the old objects storage refused to delete; they stay.

Storage totals

GET /api/admin/media/stats

Owner only (403 otherwise).

Authentication: Session cookie

Responses

StatusMeaningBody
200Totals.Stats
401No valid session (UNAUTHORIZED): missing, expired or revoked cookie, or the account was disabled.ErrorResponse
403FORBIDDEN: only the Owner may do this.ErrorResponse
429RATE_LIMITED: too many requests.ErrorResponse
500INTERNAL_ERROR: sanitized server failure.ErrorResponse
Stats
FieldTypeDescription
deleted_files (required)integer
total_files (required)integer
total_size_bytes (required)integer

Delete a media object

DELETE /api/admin/media/{id}

Removes the object from storage and marks it deleted; chat shows a placeholder. Broadcasts message_update for the message the file was attached to. Idempotent. Owner only (403 otherwise).

Authentication: Session cookie

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)yesResource ID.

Responses

StatusMeaningBody
204Success, no content.
400Invalid input (INVALID_INPUT): malformed JSON, unknown JSON fields, bad IDs or failed validation.ErrorResponse
401No valid session (UNAUTHORIZED): missing, expired or revoked cookie, or the account was disabled.ErrorResponse
403FORBIDDEN: only the Owner may do this, or cross-origin request rejected.ErrorResponse
404NOT_FOUND: the resource, or the route, does not exist.ErrorResponse
429RATE_LIMITED: too many requests.ErrorResponse
500INTERNAL_ERROR: sanitized server failure.ErrorResponse
503UNAVAILABLE: a dependency (database, file storage) is not available.ErrorResponse

Something wrong on this page? Tell us.