GET /api/media

Authorization
string
required
Firebase IDトークン
siteId
string
required
対象サイトID(UUID または u-xxxx.site
curl "https://app.hirameki-web.com/api/media?siteId=2f9e07d7-bf4a-4df8-9d7a-xxxx" \
  -H "Authorization: Bearer {token}"

Example Response

{
  "success": true,
  "files": [
    {
      "filename": "hero-1715604823.jpg",
      "url": "/grav/u-1234.site/images/hero-1715604823.jpg",
      "size": "420 KB",
      "uploadedAt": "2025-02-05T06:20:00.000Z"
    }
  ]
}

POST /api/delete-media

Authorization
string
required
Firebase IDトークン
siteId
string
required
filename
string
required
削除したいファイル名(リストAPIのfilenameをそのまま指定)
curl -X POST https://app.hirameki-web.com/api/delete-media \
  -H "Authorization: Bearer {token}" \
  -H "Content-Type: application/json" \
  -d '{"siteId":"2f9e07d7-bf4a-4df8-9d7a-xxxx","filename":"hero-1715604823.jpg"}'
{ "success": true, "message": "File deleted successfully" }
削除後もCDNキャッシュに画像が残る場合があります。必要に応じてパスを指定してパージしてください。