Skip to content

File trash (admin) API

Base URL: https://YOUR-SERVER/api. Send your API key in x-api-key where authentication is required. A key also needs the listed permission; your account's access rules still apply.

API guide · All endpoints · OpenAPI JSON

List the file trash

GET /api/admin/file-trash

Originals no library references any more, newest first, with the total disk space the file trash holds. Nothing here is deleted automatically.

Administrator access required.

Authentication: API key. Permission: maintenance.

Parameters

NameWhereRequiredDescription
pagequeryNoPage number, from 1
sizequeryNoEntries per page
Parameter types, defaults and constraints
[
  {
    "name": "page",
    "required": false,
    "in": "query",
    "description": "Page number, from 1",
    "schema": {
      "minimum": 1,
      "maximum": 9007199254740991,
      "default": 1,
      "type": "integer"
    }
  },
  {
    "name": "size",
    "required": false,
    "in": "query",
    "description": "Entries per page",
    "schema": {
      "minimum": 1,
      "maximum": 500,
      "default": 100,
      "type": "integer"
    }
  }
]

Responses

Field definitions: FileTrashResponseDto

{
  "200": {
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/FileTrashResponseDto"
        }
      }
    },
    "description": ""
  }
}

Delete a file permanently

DELETE /api/admin/file-trash/{id}

Delete the file from disk for good. This cannot be undone.

Administrator access required.

Authentication: API key. Permission: maintenance.

Parameters

NameWhereRequiredDescription
idpathYesstring
Parameter types, defaults and constraints
[
  {
    "name": "id",
    "required": true,
    "in": "path",
    "schema": {
      "format": "uuid",
      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$",
      "type": "string"
    }
  }
]

Responses

{
  "204": {
    "description": ""
  }
}

Restore a file from the file trash

POST /api/admin/file-trash/{id}/restore

Re-import the file as a new asset in the library it was last in, reading its metadata again. Answers 400 when that account is unknown or gone and 409 when its library already holds the file.

Administrator access required.

Authentication: API key. Permission: maintenance.

Parameters

NameWhereRequiredDescription
idpathYesstring
Parameter types, defaults and constraints
[
  {
    "name": "id",
    "required": true,
    "in": "path",
    "schema": {
      "format": "uuid",
      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$",
      "type": "string"
    }
  }
]

Responses

Field definitions: FileTrashRestoreResponseDto

{
  "200": {
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/FileTrashRestoreResponseDto"
        }
      }
    },
    "description": ""
  }
}