Letter images are returned as short-lived S3 URLs
Summary
Letter.body can now include short-lived S3 GET URLs for images stored with the letter. Inline data: images and other https URLs are returned unchanged.
These S3 URLs expire after 2 hours. Do not save them as lasting image sources. Query the letter again when you need to display it.
What changed
- On
letter,letters, and theLetterreturned bycreateLetterandupdateLetter, stored images for your practice are S3 GET URLs. A presigned URL includes query parameters such asX-Amz-SignatureandX-Amz-Expires. createLetterandupdateLetterdo not store those signed URLs or their AWS query parameters. Send the HTML you want saved. If you send back a signed URL from an earlier read, the image is kept and the next read returns a new URL.- Inline
data:images and external https URLs are stored and returned as sent. - Requesting
bodyon a list or sync page signs each stored image. Omitbodyunless you need the HTML.
Integration guidance
- Treat S3 image URLs in
bodyas temporary. Fetch the letter again to render it later. - Keep using
data:or your own https URLs when you want an image source that does not expire. - You can tell a presigned URL from a normal URL by the
X-Amz-Signaturequery parameter.