Skip to main content

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 the Letter returned by createLetter and updateLetter, stored images for your practice are S3 GET URLs. A presigned URL includes query parameters such as X-Amz-Signature and X-Amz-Expires.
  • createLetter and updateLetter do 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 body on a list or sync page signs each stored image. Omit body unless you need the HTML.

Integration guidance​

  1. Treat S3 image URLs in body as temporary. Fetch the letter again to render it later.
  2. Keep using data: or your own https URLs when you want an image source that does not expire.
  3. You can tell a presigned URL from a normal URL by the X-Amz-Signature query parameter.

See also​