All pages

Get the featured image

Returns the image itself, not a redirect and not a JSON wrapper. This is the endpoint that image.featured_url points at, and it is authenticated like every other route, so it cannot be used as a public image source in a browser.

GET/v1/editions/{slug}/articles/{article_id}/image

Parameters

ParamInNotes
slugpathThe edition UUID.
article_idpathThe article UUID.

Request

curl -o hero.webp \
  https://api.mastheads.app/v1/editions/3f9c1e84-2b7a-4d6e-9c15-8a0d7e6b4f21/articles/a1d4c7b2-5e83-4f19-b06c-2d9f8e3a7c54/image \
  -H "Authorization: Bearer mh_live_your_key_here"

Response

200 OK
HTTP/1.1 200 OK
Content-Type: image/webp
Cache-Control: private, max-age=300
X-Content-Type-Options: nosniff

<binary image data>

The content type is whatever the stored image really is, echoed from our own storage rather than assumed. Responses are marked private and cacheable for 5 minutes, and nosniff is set because the type is echoed. Images above 8 MB are not served.

Errors

StatusCodeWhen
401invalid_keyMissing, invalid, or revoked API key.
429rate_limitedOver 120 requests/minute on this key. Retry-After: 60.
503unavailableThe data store could not be reached.
404not_foundNo such edition or article, or the article has no image, or the image could not be read.

Every request needs a key - Authentication. The error shape and the full status table are on Rate limits & errors.