Menu

Notion Image URLs Expire in an Hour - Here's the Fix
πŸ“°

Notion Image URLs Expire in an Hour - Here's the Fix

DEV Community: apiΒ·PixelVaultΒ·1 day ago
#DgdjzET1
#devtoapi#devto#dev#notion#file
Reading 0:00
15s threshold

You wired Notion up as a CMS, pulled a page through the API, and shipped. The build looked perfect. An hour later every image on the site is a broken box, and the network tab shows 403 from an amazonaws.com host you never configured. Nothing regressed - Notion's file URLs are presigned and short-lived by design. Here's what's actually happening, and the one call that fixes it.

This hero is hosted on PixelVault itself - a stable img.pixelvault.dev URL, the same kind this post shows you how to get for a Notion image.

Why Notion image URLs break

Pull an image block out of the Notion API and look at what comes back. For a Notion-hosted file you get a short-lived signed URL - typically an S3 presigned link, something like:

https://prod-files-secure.s3.us-west-2.amazonaws.com/…?X-Amz-Algorithm=…&X-Amz-Expires=3600&X-Amz-Signature=…

Don't key off that hostname, though - Notion has served files from more than one, and its own reference shows a different S3 form.…

Continue reading β€” create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.