Limits & QuotasLimits & Quotas

Limits & Quotas

This page documents all rate limits, payload limits, and quotas in FormaMail. We believe in transparency - knowing your limits before you hit them.

API Rate Limits

Rate limits protect the platform and ensure fair usage. Limits are applied per API key.

Email Endpoints

EndpointMethodLimitWindow
/api/emails/sendPOST30 requestsper minute
/api/emails/send/bulkPOST5 requestsper minute
/api/emailsGET300 requestsper minute
/api/emails/:idGET300 requestsper minute
/api/emails/:id/retryPOST10 requestsper minute

Template Endpoints

EndpointMethodLimitWindow
/api/templatesGET300 requestsper minute
/api/templatesPOST30 requestsper minute
/api/templates/:idPATCH30 requestsper minute
/api/templates/:idDELETE30 requestsper minute

Analytics Endpoints

EndpointMethodLimitWindow
/api/analytics/*GET100 requestsper minute
/api/dashboard/*GET100 requestsper minute

Webhook Subscription Endpoints

EndpointMethodLimitWindow
/api/v1/webhook-subscriptionsGET/POST/PATCH/DELETE30 requestsper minute
/api/v1/webhook-subscriptions/:id/testPOST10 requestsper minute

Rate Limit Headers

Every API response includes rate limit headers:

X-RateLimit-Limit: 30
X-RateLimit-Remaining: 25
X-RateLimit-Reset: 1732723200
HeaderDescription
X-RateLimit-LimitMaximum requests allowed in the window
X-RateLimit-RemainingRemaining requests in current window
X-RateLimit-ResetUnix timestamp when the window resets

Rate Limit Exceeded Response

When you exceed the rate limit:

{
  "statusCode": 429,
  "code": "ERR_QUOTA_001",
  "message": "Rate limit exceeded. Please retry after 45 seconds.",
  "retryAfter": 45
}

Best Practice: Implement exponential backoff when you receive a 429 response.

Payload Limits

Request Limits

LimitValueNotes
Request body size10 MBJSON payload maximum
URL length8 KBIncluding query parameters
Header size16 KBTotal header size

Email Limits

LimitValueNotes
Recipients per email50Use bulk endpoint for more
Attachments per email10Files or generated
Total attachment size25 MBCombined size
Single attachment10 MBPer file
Email body (HTML)1 MBRendered template
Subject line998 charactersRFC 2822 limit

Bulk Send Limits

LimitValueNotes
Recipients per request1,000Batch size
Unique emails per batch1,000De-duplicated
Variables size per recipient100 KBJSON per recipient

Attachment Generation Limits

FormaMail enforces “Safe Harbor” limits on attachment generation to protect system resources and ensure reliable email delivery via AWS SES.

⚠️

Why these limits? AWS SES has a 10 MB raw message limit (~7.5 MB after base64 encoding). Our limits ensure your emails always deliver successfully.

PDF Limits

LimitValueWhy
Pages per PDF30Protects CPU/compute costs
Images per PDF50Protects memory usage
Output file size7 MBGuarantees AWS SES delivery
Page sizeA4 / LetterStandard sizes
Generation timeout60 secondsPer document

Excel Limits

LimitValueWhy
Rows per workbook10,000Protects memory/RAM
Columns per sheet50Protects file size
Sheets per workbook10Maximum sheets
Output file size7 MBGuarantees AWS SES delivery
Cell content32,767 charsExcel standard limit
Generation timeout120 secondsPer workbook

Template Processing Limits

LimitValueWhy
Loop iterations1,000Prevents hang-ups from large arrays
Nesting depth10 levelsPrevents infinite recursion
Components per template500Protects rendering performance

Limit Violation Errors

When you exceed attachment limits, FormaMail immediately stops processing and returns a 400 Bad Request with a specific error code:

Error CodeLimitExample Message
ERR_LIMIT_001PDF pages”PDF generation exceeded 30 page limit. Your PDF has 45 pages.”
ERR_LIMIT_002PDF images”PDF contains 75 images, exceeding the 50 image limit.”
ERR_LIMIT_003Excel rows”Excel generation exceeded 10,000 row limit. Your data has 15,000 rows.”
ERR_LIMIT_004Excel sheets”Excel workbook exceeded 10 sheet limit. Your workbook has 12 sheets.”
ERR_LIMIT_005Excel columns”Excel sheet exceeded 50 column limit. Your sheet has 75 columns.”
ERR_LIMIT_006File size”Generated attachment (7.5MB) exceeds safe email limit of 7MB.”
ERR_LIMIT_007Loop iterations”Loop “items” has 2,500 items but maximum is 1,000. Consider pagination or splitting data.”
ERR_LIMIT_008Nesting depth”Template exceeded 10 level nesting depth. Current depth: 12 levels.”
ERR_LIMIT_009Component count”Template exceeded 500 component limit. Your template has 650 components.”

Example Error Response

{
  "statusCode": 400,
  "code": "ERR_LIMIT_001",
  "message": "PDF generation exceeded maximum page limit",
  "timestamp": "2025-12-09T10:30:00.000Z",
  "path": "/api/attachments/generate",
  "relatedInfo": {
    "actualPages": 45,
    "maxPages": 30,
    "message": "PDF generation exceeded 30 page limit. Your PDF has 45 pages."
  }
}

How to Handle Limit Errors

  1. Split large datasets: Break data into multiple attachments
  2. Paginate loops: Use pagination for arrays over 1,000 items
  3. Optimize images: Compress images before including in PDFs
  4. Simplify templates: Reduce nesting and component count

Pro tip: Validate your data size before calling the API. Check array lengths and estimate row counts client-side to avoid limit errors.

Template Limits

Content Limits

LimitValue
Variables per template500
Components per template200
Nested loop depth3 levels
Conditional nesting5 levels
Formula complexity1,000 operations
Template name255 characters
Template slug100 characters

Template Counts by Plan

PlanEmail TemplatesAttachment Templates
Free52
Starter2510
ProUnlimitedUnlimited
EnterpriseUnlimitedUnlimited

Account Quotas

Email Quotas by Plan

PlanEmails/MonthOverage
Free1,000Not available
Starter50,000$0.001/email
Pro200,000$0.0008/email
EnterpriseCustomCustom

Credit System

FormaMail uses a credit-based system:

  • 1 email = 1 credit
  • 1 PDF attachment = 1 credit
  • 1 Excel attachment = 1 credit

Example: Sending an email with a PDF attachment uses 2 credits.

Credits never expire and roll over month-to-month. Buy what you need, use when ready.

Team Limits

PlanTeam MembersTeams
Free11
Starter51
Pro103
EnterpriseUnlimitedUnlimited

API Key Limits

PlanAPI Keys
Free2
Starter10
Pro25
EnterpriseUnlimited

Webhook Limits

Subscription Limits

PlanWebhook Subscriptions
Free2
Starter10
Pro25
EnterpriseUnlimited

Delivery Limits

LimitValueNotes
Timeout30 secondsPer delivery attempt
Retries3 attemptsExponential backoff
Payload size256 KBMaximum webhook payload
Events per second100Per subscription

OAuth Limits

Token Limits

LimitValue
Access token lifetime1 hour
Refresh token lifetime30 days
Authorization code lifetime10 minutes
Active access tokens per user50
Active refresh tokens per user10

OAuth App Limits

PlanOAuth Apps
Free1
Starter5
Pro10
EnterpriseUnlimited

Storage Limits

Asset Storage

PlanStorageFile Size
Free100 MB5 MB/file
Starter1 GB10 MB/file
Pro10 GB25 MB/file
EnterpriseCustomCustom

Generated File Retention

File TypeRetention
PDF attachments7 days
Excel attachments7 days
Temporary files24 hours

Requesting Limit Increases

If you need higher limits, you have options:

Upgrade Your Plan

Higher plans come with increased limits. See Pricing.

Enterprise Custom Limits

Enterprise customers can request custom limits:

  • Dedicated infrastructure
  • Custom rate limits
  • Higher storage quotas
  • Dedicated IP addresses

Contact sales@formamail.com

Temporary Increases

For one-time events (product launches, campaigns), request a temporary limit increase:

Email: support@formamail.com

Include:

  • Account/Team ID
  • Requested limit increase
  • Duration needed
  • Use case description

Temporary increases are reviewed within 1 business day. Plan ahead for time-sensitive events.

Monitoring Your Usage

Dashboard

View your current usage in the dashboard:

  • Overview: Current email/credit usage
  • Settings → Usage: Detailed usage breakdown
  • Settings → API Keys: Per-key usage statistics

API

Query usage programmatically:

GET /api/emails/usage/stats

Response:

{
  "period": "2024-11",
  "emailsSent": 15420,
  "creditsUsed": 18500,
  "creditsRemaining": 31500,
  "quota": 50000
}

Alerts

Set up usage alerts in Settings → Notifications:

  • 50% quota usage
  • 80% quota usage
  • 100% quota usage
  • Rate limit warnings

Best Practices

Avoid Rate Limits

  1. Batch operations: Use bulk endpoints instead of multiple single requests
  2. Cache responses: Don’t re-fetch unchanged data
  3. Implement backoff: Exponential backoff on 429 responses
  4. Use webhooks: Don’t poll for status updates

Optimize Payload Size

  1. Compress images: Before including in templates
  2. Limit data: Only include necessary variables
  3. Paginate queries: Use pagination for large datasets

Handle Limits Gracefully

async function sendWithRetry(payload, maxRetries = 3) {
  for (let i = 0; i < maxRetries; i++) {
    const response = await fetch('/api/emails/send', {
      method: 'POST',
      headers: { 'Authorization': `Bearer ${API_KEY}` },
      body: JSON.stringify(payload)
    });
 
    if (response.status === 429) {
      const retryAfter = response.headers.get('Retry-After') || 60;
      await sleep(retryAfter * 1000);
      continue;
    }
 
    return response.json();
  }
  throw new Error('Max retries exceeded');
}