# Media Health API

Source: https://frameleaf.app/docs/api/reference/media-health/

Use your own server and its scoped API keys.

## List media health findings

GET /api/media-health

List missing and corrupt media health findings in timeline buckets.

```json
{
  "description": "List missing and corrupt media health findings in timeline buckets.",
  "operationId": "list",
  "parameters": [
    {
      "name": "allAccounts",
      "required": false,
      "in": "query",
      "description": "Review every account; administrators only",
      "schema": {
        "type": "boolean"
      }
    },
    {
      "name": "category",
      "required": false,
      "in": "query",
      "schema": {
        "$ref": "#/components/schemas/MediaHealthCategory"
      }
    },
    {
      "name": "needsAttention",
      "required": false,
      "in": "query",
      "description": "Only findings that still need a decision",
      "schema": {
        "type": "boolean"
      }
    },
    {
      "name": "ownerId",
      "required": false,
      "in": "query",
      "description": "Account to review; administrators only for another account",
      "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"
      }
    },
    {
      "name": "page",
      "required": false,
      "in": "query",
      "schema": {
        "minimum": 1,
        "maximum": 9007199254740991,
        "default": 1,
        "type": "integer"
      }
    },
    {
      "name": "size",
      "required": false,
      "in": "query",
      "schema": {
        "minimum": 1,
        "maximum": 200,
        "default": 100,
        "type": "integer"
      }
    },
    {
      "name": "status",
      "required": false,
      "in": "query",
      "schema": {
        "$ref": "#/components/schemas/MediaHealthStatus"
      }
    }
  ],
  "responses": {
    "200": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/MediaHealthListResponseDto"
          }
        }
      },
      "description": ""
    }
  },
  "security": [
    {
      "api_key": []
    }
  ],
  "summary": "List media health findings",
  "tags": [
    "Media Health"
  ],
  "x-frameleaf-permission": "all"
}
```

## Choose media health candidates

POST /api/media-health/candidates/choose

Record which verified exact copy each missing original should be relinked to.

```json
{
  "description": "Record which verified exact copy each missing original should be relinked to.",
  "operationId": "chooseCandidates",
  "parameters": [],
  "requestBody": {
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/MediaHealthChooseCandidatesDto"
        }
      }
    },
    "required": true
  },
  "responses": {
    "201": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/MediaHealthBulkResponseDto"
          }
        }
      },
      "description": ""
    }
  },
  "security": [
    {
      "api_key": []
    }
  ],
  "summary": "Choose media health candidates",
  "tags": [
    "Media Health"
  ],
  "x-frameleaf-permission": "all"
}
```

## Move confirmed corrupt media to trash

DELETE /api/media-health/corrupt

Move recently confirmed corrupt media findings to trash after revalidation.

```json
{
  "description": "Move recently confirmed corrupt media findings to trash after revalidation.",
  "operationId": "deleteCorrupt",
  "parameters": [],
  "requestBody": {
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/MediaHealthDeleteCorruptDto"
        }
      }
    },
    "required": true
  },
  "responses": {
    "200": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/MediaHealthBulkResponseDto"
          }
        }
      },
      "description": ""
    }
  },
  "security": [
    {
      "api_key": []
    }
  ],
  "summary": "Move confirmed corrupt media to trash",
  "tags": [
    "Media Health"
  ],
  "x-frameleaf-permission": "all"
}
```

## Recover damaged media from a verified copy

POST /api/media-health/corrupt/recover

Queue a durable job replacing confirmed damage with an exact, decoded copy while keeping the damaged file.

```json
{
  "description": "Queue a durable job replacing confirmed damage with an exact, decoded copy while keeping the damaged file.",
  "operationId": "recoverDamaged",
  "parameters": [],
  "requestBody": {
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/MediaHealthRecoverDto"
        }
      }
    },
    "required": true
  },
  "responses": {
    "201": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/MediaHealthBulkResponseDto"
          }
        }
      },
      "description": ""
    }
  },
  "security": [
    {
      "api_key": []
    }
  ],
  "summary": "Recover damaged media from a verified copy",
  "tags": [
    "Media Health"
  ],
  "x-frameleaf-permission": "all"
}
```

## Start corrupt media scan

POST /api/media-health/corrupt/scan

Queue an explicit scan that validates source media integrity.

```json
{
  "description": "Queue an explicit scan that validates source media integrity.",
  "operationId": "startCorruptScan",
  "parameters": [],
  "responses": {
    "201": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/MediaHealthScanResponseDto"
          }
        }
      },
      "description": ""
    }
  },
  "security": [
    {
      "api_key": []
    }
  ],
  "summary": "Start corrupt media scan",
  "tags": [
    "Media Health"
  ],
  "x-frameleaf-permission": "all"
}
```

## Dismiss media health findings

POST /api/media-health/dismiss

Dismiss selected media health findings without modifying assets.

```json
{
  "description": "Dismiss selected media health findings without modifying assets.",
  "operationId": "dismiss",
  "parameters": [],
  "requestBody": {
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/MediaHealthBulkActionDto"
        }
      }
    },
    "required": true
  },
  "responses": {
    "204": {
      "description": ""
    }
  },
  "security": [
    {
      "api_key": []
    }
  ],
  "summary": "Dismiss media health findings",
  "tags": [
    "Media Health"
  ],
  "x-frameleaf-permission": "all"
}
```

## Locate missing media

POST /api/media-health/missing/locate

Queue a durable exact-checksum search of the chosen locations for missing originals or copies of confirmed damage.

```json
{
  "description": "Queue a durable exact-checksum search of the chosen locations for missing originals or copies of confirmed damage.",
  "operationId": "locateMissing",
  "parameters": [],
  "requestBody": {
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/MediaHealthLocateDto"
        }
      }
    },
    "required": true
  },
  "responses": {
    "201": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/MediaHealthScanResponseDto"
          }
        }
      },
      "description": ""
    }
  },
  "security": [
    {
      "api_key": []
    }
  ],
  "summary": "Locate missing media",
  "tags": [
    "Media Health"
  ],
  "x-frameleaf-permission": "all"
}
```

## Relink missing media

POST /api/media-health/missing/relink

Queue a durable job relinking missing originals to their verified exact copies.

```json
{
  "description": "Queue a durable job relinking missing originals to their verified exact copies.",
  "operationId": "relinkMissing",
  "parameters": [],
  "requestBody": {
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/MediaHealthBulkActionDto"
        }
      }
    },
    "required": true
  },
  "responses": {
    "201": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/MediaHealthBulkResponseDto"
          }
        }
      },
      "description": ""
    }
  },
  "security": [
    {
      "api_key": []
    }
  ],
  "summary": "Relink missing media",
  "tags": [
    "Media Health"
  ],
  "x-frameleaf-permission": "all"
}
```

## Start missing media scan

POST /api/media-health/missing/scan

Queue an owner-scoped scan that identifies missing files and restores supported untracked media.

```json
{
  "description": "Queue an owner-scoped scan that identifies missing files and restores supported untracked media.",
  "operationId": "startMissingScan",
  "parameters": [],
  "responses": {
    "201": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/MediaHealthScanResponseDto"
          }
        }
      },
      "description": ""
    }
  },
  "security": [
    {
      "api_key": []
    }
  ],
  "summary": "Start missing media scan",
  "tags": [
    "Media Health"
  ],
  "x-frameleaf-permission": "all"
}
```

## Reopen media health findings

POST /api/media-health/reopen

Undo a dismissal, or reopen confirmed damage whose item was restored from the trash, putting the findings back in review.

```json
{
  "description": "Undo a dismissal, or reopen confirmed damage whose item was restored from the trash, putting the findings back in review.",
  "operationId": "reopen",
  "parameters": [],
  "requestBody": {
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/MediaHealthBulkActionDto"
        }
      }
    },
    "required": true
  },
  "responses": {
    "201": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/MediaHealthBulkResponseDto"
          }
        }
      },
      "description": ""
    }
  },
  "security": [
    {
      "api_key": []
    }
  ],
  "summary": "Reopen media health findings",
  "tags": [
    "Media Health"
  ],
  "x-frameleaf-permission": "all"
}
```

## List Library Care search locations

GET /api/media-health/roots

Locations the caller may search for exact copies of missing or damaged originals.

```json
{
  "description": "Locations the caller may search for exact copies of missing or damaged originals.",
  "operationId": "getRoots",
  "parameters": [],
  "responses": {
    "200": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/MediaHealthRootsResponseDto"
          }
        }
      },
      "description": ""
    }
  },
  "security": [
    {
      "api_key": []
    }
  ],
  "summary": "List Library Care search locations",
  "tags": [
    "Media Health"
  ],
  "x-frameleaf-permission": "all"
}
```

## Get Library Care summary

GET /api/media-health/summary

Queue sizes for missing, damaged, duplicate, import and enrichment work, the latest scan or search, and recent Library Care jobs.

```json
{
  "description": "Queue sizes for missing, damaged, duplicate, import and enrichment work, the latest scan or search, and recent Library Care jobs.",
  "operationId": "getSummary",
  "parameters": [
    {
      "name": "allAccounts",
      "required": false,
      "in": "query",
      "description": "Review every account; administrators only",
      "schema": {
        "type": "boolean"
      }
    },
    {
      "name": "ownerId",
      "required": false,
      "in": "query",
      "description": "Account to review; administrators only for another account",
      "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": {
    "200": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/MediaHealthSummaryResponseDto"
          }
        }
      },
      "description": ""
    }
  },
  "security": [
    {
      "api_key": []
    }
  ],
  "summary": "Get Library Care summary",
  "tags": [
    "Media Health"
  ],
  "x-frameleaf-permission": "all"
}
```
