Skip to main content
When someone sends an email with attachments to your inbound domain, Lettr extracts and stores the attachments temporarily, providing secure URLs for you to download them.

Attachment Data Structure

Each attachment in the webhook payload includes:

Downloading Attachments

Download attachments using the provided URLs:

Attachment URL Expiration

Attachment URLs are valid for 24 hours after the email is received. Download and store attachments if you need them longer.
Handle expiration gracefully:

Storing Attachments

Save to Local Filesystem

Save to Cloud Storage (AWS S3)

Save to Cloud Storage (Google Cloud)

Validating Attachments

Always validate attachments before processing:

Security Considerations

Never trust attachment filenames or content types from emails. Always validate and sanitize before processing.

Virus Scanning

Scan attachments for malware before storing:

File Type Verification

Verify file contents match the declared content type:

Processing Specific File Types

PDF Documents

Images

CSV Files

Attachment Limits

Complete Example

Webhooks

Webhook payload structure

Security

Security best practices

Best Practices

Inbound best practices

Sending Attachments

Attach files to outgoing emails