Email Auto-Responder API

POST Email Auto-Responder API

/api/v1/ai/email-reply

Generate highly accurate, context-aware email replies optimized for automated customer support systems and Zapier/Make integrations.

Request Body Parameters

Field Type Required Description
email_text string Required The raw text of the incoming email.
knowledge_base array of strings Optional Array of factual sentences the AI must use to answer questions (e.g., ["Business hours are 9-5", "No refunds after 30 days"]).
rules array of strings Optional Strict rules for the AI to follow (e.g., ["Never promise a refund", "Always escalate chargebacks"]).
tone string Optional Tone of the reply (e.g., "professional", "empathetic", "casual").
sender_name string Optional Name of the person who sent the email.
recipient_name string Optional Name of your team or agent.
model string Optional Optional AI model to use.

Example Request (Autopilot Mode)

Pass specific rules and a knowledge base to strictly constrain the AI's behavior, ensuring it never hallucinates dangerous promises to customers.

JSON Request
{
  "email_text": "Hi, I was charged $49 but I cancelled my account yesterday. Please refund me immediately or I will dispute the charge.",
  "sender_name": "John Doe",
  "recipient_name": "Support Team",
  "knowledge_base": [
    "Refunds are only issued if requested within 14 days of the charge.",
    "Standard response time is 24 hours."
  ],
  "rules": [
    "Never promise a refund if you are unsure.",
    "Be empathetic but firm.",
    "If the user threatens a chargeback, escalate to a human."
  ],
  "tone": "professional"
}
cURL
curl -X POST https://rsflowhub.com/api/v1/ai/email-reply \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "email_text": "Hi, I was charged $49 but I cancelled my account yesterday. Please refund me immediately or I will dispute the charge.",
    "knowledge_base": ["Refunds are only issued if requested within 14 days of the charge."],
    "rules": ["If the user threatens a chargeback, escalate to a human."],
    "tone": "professional"
  }'

Example Response

The API safely structures the response. In this example, because the customer threatened a chargeback, the AI followed the rule and flagged requires_human_escalation: true so your automation platform knows to pause the email.

JSON Response
{
  "success": true,
  "data": {
    "result": {
      "reply_text": "Hi John, Thank you for reaching out to the Support Team. I understand you are frustrated about the recent $49 charge after cancelling your account. I have escalated this ticket to a billing specialist who will review your account and get back to you within 24 hours.",
      "confidence_score": 0.85,
      "requires_human_escalation": true,
      "escalation_reason": "Customer threatened a chargeback dispute.",
      "triggered_actions": ["escalate_to_billing_specialist"]
    }
  },
  "meta": {
    "credits_used": 2,
    "credits_remaining": 988
  }
}

API Request Example

Use the cURL snippet below to test the endpoint.

cURL
curl -X POST 'https://rsflowhub.com/api/v1/ai/email-reply' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
    "email_text": "Hi, I need help logging in.",
    "knowledge_base": [
        "Password resets can be done at /reset"
    ],
    "rules": [
        "Keep it short"
    ]
}'

Ready to build?

Create your free account and make your first API call in minutes.