Mailmanv2.0
API REFERENCEv2.0 STABLE

Mailman Developer & AI Documentation

A high-performance universal email dispatch API with multi-provider pooling, quota management, and pre-built tool-calling schemas for autonomous AI agents.

Architecture Overview

Mailman acts as an intelligent intermediary between your applications/AI agents and various email service providers (Resend, Brevo, SendGrid, Postmark, AWS SES, and Custom SMTP).

Zero Configuration Dispatch: Developers do not need to register separate accounts with each provider. The Super Admin configures the master provider pool at /host, and developer clients are allocated individual daily quotas.

Authentication

All API requests must include two custom HTTP headers issued to your client account:

HeaderTypeDescription
x-api-access-codestringYour public client identifier (e.g. AC-9K2F-X84M)
x-api-secret-keystringYour private authorization key (e.g. sk_live_...)
View or copy your credentials anytime in the Developer Console. Keep your secret key confidential.

Dispatch Email Endpoint

POSThttps://mailman.oqens.me/api/v1/send
curl -X POST https://mailman.oqens.me/api/v1/send \
  -H "Content-Type: application/json" \
  -H "x-api-access-code: YOUR_ACCESS_CODE" \
  -H "x-api-secret-key: YOUR_SECRET_KEY" \
  -d '{
    "to": "alex@example.com",
    "recipientName": "Alex",
    "subject": "Order Confirmation #{{orderId}}",
    "html": "<h2>Hi {{name}},</h2><p>Your order #{{orderId}} is confirmed!</p>",
    "variables": {
      "orderId": "884192"
    }
  }'

Request Body Parameters

FieldTypeRequiredDescription
tostringRequiredRecipient email address
subjectstringOptional*Subject line (*Required if templateId is omitted)
htmlstringOptional*HTML content (*Required if templateId is omitted)
templateIdstringOptionalID of pre-configured template to render
variablesobjectOptionalKey-value map for replacing {{key}} placeholders
recipientNamestringOptionalDisplay name for the recipient
fromNamestringOptionalCustom display sender name override
attachmentsarrayOptionalArray of attachment objects with filename and content (base64) or path (URL)

AI Agent Tool Calling Specifications

Give autonomous LLMs the direct capability to dispatch transactional and notification emails. Simply copy the schema below into your agent framework:

{
  "type": "function",
  "function": {
    "name": "send_transactional_email",
    "description": "Send an email notification or alert to a recipient via Mailman Universal Engine.",
    "parameters": {
      "type": "object",
      "properties": {
        "to": {
          "type": "string",
          "description": "The destination email address (e.g. user@example.com)"
        },
        "recipientName": {
          "type": "string",
          "description": "Recipient full or display name"
        },
        "subject": {
          "type": "string",
          "description": "The subject line of the email"
        },
        "html": {
          "type": "string",
          "description": "The HTML content body of the email"
        },
        "templateId": {
          "type": "string",
          "description": "Optional Firestore template ID to render instead of raw HTML"
        },
        "variables": {
          "type": "object",
          "description": "Key-value dictionary for placeholder substitution in templates",
          "additionalProperties": { "type": "string" }
        }
      },
      "required": ["to"]
    }
  }
}

HTTP Status & Error Codes

StatusReasonResolution
200 OKDispatched successfullyMessage ID returned in response payload.
401 UnauthorizedMissing or invalid credentialsVerify x-api-access-code and x-api-secret-key headers.
429 Too Many RequestsDaily quota exceededYour client has reached its allocated daily sending volume. Resets at midnight or contact Super Admin.
503 UnavailableProvider pool exhaustedAll configured backend sender services have reached daily limits.

Quotas & Capacity Allocation

Daily quotas protect sender reputation and deliverability across shared IP pools. Quotas automatically reset each day at 00:00 UTC.

Need an increased quota limit?

Contact the platform Super Admin (varshith.code@gmail.com) to expand your daily capacity.

Check My Quota in Console