Skip to main content
CLI:
puffle thread attachment upload --id <id>

Overview

Uploads a file for a draft one-off email thread. The endpoint stores the file in private Supabase storage and returns attachment metadata that can be saved on the draft or sent with Send message. Uploads are only allowed for email threads that are still drafts or still have draft email fields. Maximum file size is 10 MB.

Path Parameters

ParameterTypeDescription
idstringDraft email thread ID.

Request Body

Send multipart/form-data with one field:
FieldTypeDescription
filefileAttachment file, max 10 MB.

Example

curl -X POST "https://app.puffle.ai/api/threads/3d986dd1-9d70-45b7-8e36-5d5b8b1c9337/attachments" \
  -H "Authorization: Bearer $PUFFLE_API_KEY" \
  -F "file=@proposal.pdf"
{
  "attachment": {
    "name": "proposal.pdf",
    "bucket": "campaign-email-attachments",
    "path": "user-id/unibox/3d986dd1-9d70-45b7-8e36-5d5b8b1c9337/file-id-proposal.pdf",
    "mime_type": "application/pdf",
    "size": 42310,
    "content_disposition": "attachment",
    "url": "https://..."
  }
}
The returned url is a signed preview URL. Store and send the durable bucket and path fields; Puffle refreshes signed URLs when returning thread and message data.

Error Notes

StatusWhen it happens
400Missing file, file over 10 MB, or thread is not draft-editable.
404The thread is missing, belongs to another workspace, or is not an email thread.
500Storage bucket or upload failure.

AI agent notes

Upload attachments before sending. Include returned attachment metadata in draft_attachments when saving the draft or in attachments when calling Send message.