Logo White

Media

Upload featured images and inline post media to the BlogHunch CDN (cdn.bloghunch.com). Static images are automatically optimized to WebP and returned with dimensions and a blurhash placeholder.

POST/v1/media

Upload or import media

Accepts either a multipart/form-data file field (jpg, jpeg, png, webp, gif up to 5 MB) or a JSON { "url": "https://..." } payload to fetch a remote image safely (SSRF-validated). Requires media:write.

Request

curl -X POST https://api.bloghunch.com/v1/media \
  -H "Authorization: Bearer {token}" \
  -F file=@./hero.png

Response

{
  "data": {
    "filename": "aB3dE5fG7hJ9kL1m.webp",
    "url": "https://cdn.bloghunch.com/uploads/aB3dE5fG7hJ9kL1m.webp",
    "mime_type": "image/webp",
    "size_bytes": 48210,
    "width": 1200,
    "height": 630,
    "blurhash": "LKO2?U%2Tw=w]~RBVZRi};RPxuwH"
  }
}

DELETE/v1/media

Delete media

Pass { "filename": "aB3dE5fG7hJ9kL1m.webp" } in the JSON body to permanently remove an uploaded file. Requires media:delete.