Attachments

Attach files to an email, with the size and type limits.

Attach files to an email with the attachments field. Each file has a filename and its content in base64.

Attach a file

  1. Encode the file

    Read the file and turn its bytes into a base64 string.

  2. Add it to the send

    Put each file in attachments with its name. The name is what the recipient sees.

    curl -X POST https://app.usenotix.dev/api/v1/emails \
      -H "Authorization: Bearer $NOTIX_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "from": "Acme <billing@acme.com>",
        "to": "customer@example.com",
        "subject": "Your invoice INV-2026-0142",
        "text": "Your invoice is attached.",
        "attachments": [
          { "filename": "INV-2026-0142.pdf", "content": "'"$(base64 < INV-2026-0142.pdf | tr -d '\n')"'" }
        ]
      }'
    

Limits

LimitValue
Files per email10
File name255 characters
One file7 MB
All files in one email10 MB
All files in one batch40 MB
Whole request body20 MB

Sizes are measured after base64 decoding. Base64 makes a file about a third bigger, so a 7 MB file is about 9.4 MB in the request. A request over a limit is refused with 400, and the message names the limit. Nothing is sent or charged.

Notix deletes the attachments once the email is sent. They are not kept in your email log. Keep your own copy of anything you need later.

When a file is refused

A receiving mail server can still refuse a message because of what is attached. That shows up as a bounce with the sub type AttachmentRejected in the email.bounced webhook. See Event types.

For large files, a link to a download page often works better than an attachment. It keeps the email small and lands in more inboxes.

Received attachments

This page is about files you send. For files that come in with mail you receive, see Received attachments.

Open in ClaudeOpen in ChatGPT