MOLTED EMAIL

Batch Operations

Send, classify, and get recommendations for up to 500 recipients in a single request.

Batch endpoints let you process multiple items in a single API call — up to 500 per request. Each item is evaluated independently with full policy enforcement.

Batch send

Send email to up to 500 recipients in one request.

POST https://api.molted.email/v1/agent/batch/request-send
curl
curl -X POST https://api.molted.email/v1/agent/batch/request-send \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "tenantId": "tenant_abc123",
    "agentId": "agent-1",
    "requests": [
      {
        "recipientEmail": "user1@example.com",
        "templateId": "campaign-march",
        "dedupeKey": "march-user1@example.com",
        "payload": { "subject": "March update", "html": "...", "text": "..." }
      },
      {
        "recipientEmail": "user2@example.com",
        "templateId": "campaign-march",
        "dedupeKey": "march-user2@example.com",
        "payload": { "subject": "March update", "html": "...", "text": "..." }
      }
    ]
  }'

Response

Response
{
  "results": [
    { "recipientEmail": "user1@example.com", "requestId": "req_001", "status": "queued" },
    { "recipientEmail": "user2@example.com", "requestId": "req_002", "status": "blocked", "reason": "suppressed" }
  ]
}

Each item gets its own result — some may be queued while others are blocked.

Batch next-best-action

Get recommendations for up to 500 contacts at once.

POST https://api.molted.email/v1/agent/batch/next-best-action
curl
curl -X POST https://api.molted.email/v1/agent/batch/next-best-action \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "tenantId": "tenant_abc123",
    "contacts": [
      { "contactEmail": "user1@example.com" },
      { "contactEmail": "user2@example.com" }
    ]
  }'

Response

Response
{
  "results": [
    { "contactEmail": "user1@example.com", "recommendation": "nudge", "reasoning": "No reply in 5 days" },
    { "contactEmail": "user2@example.com", "recommendation": "wait", "reasoning": "Recent send 2 hours ago" }
  ]
}

Batch classify intent

Classify up to 500 inbound messages at once.

POST https://api.molted.email/v1/agent/batch/classify-intent
curl
curl -X POST https://api.molted.email/v1/agent/batch/classify-intent \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "tenantId": "tenant_abc123",
    "messages": [
      { "contactEmail": "user1@example.com", "messageText": "Sure, let'\''s set up a call" },
      { "contactEmail": "user2@example.com", "messageText": "We already have a vendor for this, not interested" }
    ]
  }'

Response

Response
{
  "results": [
    { "contactEmail": "user1@example.com", "intent": "interested", "confidence": 0.94, "suggestedAction": "notify_owner" },
    { "contactEmail": "user2@example.com", "intent": "objection", "confidence": 0.88, "suggestedAction": "escalate" }
  ]
}

Limits

All batch endpoints accept a maximum of 500 items per request. Requests exceeding this limit are rejected with a 400 Bad Request response.