Batch Email Sending

Pro

You must be subscribed to Pro first.Send one email to hundreds of recipients in a single API call. Sendlib queues the job and delivers each email in the background, automatically respecting Gmail's rate limits.

How it works

We handle the rate limits, the exponential backoff, and the background queueing so you don't have to build any of that complex infrastructure yourself. Unlike /api/send which delivers immediately and blocks until done, /api/batch accepts your full recipient list, queues a background job, and returns a batchId instantly. Our background workers then drip the emails out one at a time, perfectly paced to stay under Google's radar. You just poll /api/batch/:id to track the progress!

1
POST /api/batch
Returns batchId immediately
2
Worker sends emails
Throttled, respects Gmail limits
3
Poll for progress
GET /api/batch/:id

Step 1: Send the batch

POST /api/batch

Request body fields

FieldTypeRequiredDescription
fromstringYesConnected Gmail account to send from. Supports display name format: "Brand <you@gmail.com>"
subjectstringYesEmail subject. Supports {{variable}} interpolation.
recipientsarrayYesList of recipient objects (see below). Max 450 for @gmail.com, 2,000 for Workspace.
htmlstringone ofHTML email body. Supports {{variable}} interpolation.
textstringone ofPlain text fallback body. Supports {{variable}} interpolation.
replyTostringOptionalReply-to email address.

Recipient object

FieldTypeRequiredDescription
emailstringYesRecipient's email address.
variablesobjectOptionalKey/value pairs used to personalise the subject, html, and text for this recipient via {{key}} placeholders.

Response: 202 Accepted

{
  "success": true,
  "batchId": "64f1a2b3c4d5e6f7a8b9c0d1",
  "total": 2,
  "status": "queued"
}

Step 2: Poll for progress

GET /api/batch/:batchId

Response

{
  "success": true,
  "batchId": "64f1a2b3c4d5e6f7a8b9c0d1",
  "status": "processing",
  "total": 2,
  "sent": 1,
  "failed": 0,
  "progress": 50,
  "recipients": [
    { "email": "john@example.com", "status": "sent", "messageId": "18b3f...", "error": null },
    { "email": "jane@example.com", "status": "pending", "messageId": null, "error": null }
  ]
}

Job statuses

StatusMeaning
queuedJob created, waiting for the worker to pick it up.
processingWorker is actively sending emails.
paused_limit_reachedGmail daily sending limit reached. Job will automatically resume when quota resets.
doneAll recipients have been processed. Check sent / failed counts.
failedUnexpected internal error. Contact support.

Limits

LimitValue
Max recipients: @gmail.com account450 per batch
Max recipients: Google Workspace account2,000 per batch
Duplicate emails in same batchAuto-deduplicated
AttachmentsNot supported (see below)
Job history retention90 days, then auto-deleted

The recipient cap matches Gmail's own daily sending limit for the connected account. If your batch hits the daily limit mid-send (e.g., you already sent emails earlier today), the job status will change to paused_limit_reached. You do not need to do anything! Sendlib automatically tracks Gmail's 24-hour rolling quota and will automatically resume sending the remaining recipients as soon as your limit resets. To send to more people immediately without waiting, connect additional Gmail accounts and split batches across them using different from addresses.

Why can't I send attachments in a batch?

Attachments are intentionally not supported on /api/batch. If you attach a file to a batch of 500 emails, Sendlib would have to base64-encode and upload that file 500 separate times to Gmail's API. That is extremely slow, memory-intensive, and would burn through your daily quota much faster than expected.

The right approach is to host your file somewhere (e.g. your own server, AWS S3, Google Drive, or any CDN) and include a download link in your html or text body. Your recipients get the same experience, and your batch sends are fast.

Error responses

StatusReason
401Missing or invalid API key.
403Free plan: upgrade to Pro to use batch sending.
400Validation error: check the message field for details.
413HTML or text body exceeds the size limit.
429Rate limit exceeded: check the Retry-After header.
500Internal server error.

Best Practices for Deliverability

When sending bulk emails from a personal @gmail.comaccount (as opposed to a verified Google Workspace custom domain), Google's spam filters can be highly aggressive. To ensure your batch reaches the primary inbox rather than the spam folder, we strongly recommend the following:

  • Send plain text or light HTML: Avoid heavy layouts, large images, and giant colorful buttons. The more your email looks like a genuine 1-on-1 human email, the better.
  • Minimize links: Try to include zero or at most one link in your first cold email to a new recipient.
  • Avoid spam trigger words: Do not use highly commercial language like "Action Required", "Free Trial", "Buy Now", or "Upgrade".
  • Only email expecting recipients: Sendlib automatically throttles your sending speed to keep you under Google's radar, but if a high percentage of recipients manually click "Report Spam", Google will permanently penalize your connected account.

Example: Avoiding Spam Triggers

High Spam Risk
Subject:Action Required: Your Account is Disconnected!
From:hello@company.com

URGENT: We detected an error.

Click the button below to fix it immediately or lose access.

Inbox Friendly
Subject:Quick update regarding your connection
From:"Alex at Company" <hello@company.com>

Hi John,

We recently rolled out an update that might have disconnected your account.

You can easily restore it by visiting your dashboard.

Thanks,
Alex

Ideal Use Cases

Sendlib is intentionally designed for high-deliverability 1-on-1 communication. It is not designed for heavy, image-packed marketing blasts.

Great for Sendlib

  • Password resets & Magic links
  • Payment receipts & Invoices
  • System alerts & Downtime Notifications
  • Welcome emails from the founder
  • Personalized cold outreach
  • New feature announcements to active users
  • Trial expiration warnings
  • Weekly usage summary reports

Bad for Sendlib

  • Weekly marketing newsletters
  • Image-heavy promotional blasts
  • E-commerce product catalogs
  • Discount code mass mailings