Knowledge Base Fact Grounding
Grounds generated responses strictly in your company knowledge base facts, documentation, and refund policies.
Context-aware email reply generation API grounded in business knowledge bases, custom rules, and tone controls.
https://rsflowhub.com/api/v1/ai/email-reply
X-API-Key header{
"email_text": "Hi, I was charged $49 but I cancelled my account yesterday. Please refund me immediately.",
"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"
}
{
"result": {
"reply_text": "Hi there, thanks for flagging this. I can see the duplicate charge on your March invoice and have started a refund for the second payment. You should see it within 5-7 business days.",
"confidence_score": 0.91,
"requires_human_escalation": false,
"escalation_reason": null,
"triggered_actions": []
}
}
Automated Professional Email Reply Generator API is a REST API on RSFlowHub for web, mobile and AI agent applications. Send a JSON request to POST /api/v1/ai/email-reply with your API key; RSFlowHub runs it on a tuned AI model, falls back to a backup provider if needed, and returns a structured JSON result, usually within 1 to 3 seconds.
Try it without code or signup: Free email reply generator
POST /api/v1/ai/email-replyX-API-Key headerSend these fields as a JSON body. An invalid or missing field returns a 422 error that names the field.
| Field | Type | Required | Description |
|---|---|---|---|
email_text |
string | Required | The raw text of the incoming email (Max: 20,000 characters). |
context |
string | Optional | Optional general context or instructions for drafting the reply. |
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. |
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"]). |
Copy, replace rfh_your_api_key with your key and run. Prefer a client library? See the official SDKs.
curl -X POST "https://rsflowhub.com/api/v1/ai/email-reply" \
-H "Content-Type: application/json" \
-H "X-API-Key: rfh_your_api_key" \
-d '{"email_text":"Hi, I was charged $49 but I cancelled my account yesterday. Please refund me immediately.","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"}'
<?php
$client = new \GuzzleHttp\Client();
$response = $client->post('https://rsflowhub.com/api/v1/ai/email-reply', [
'headers' => [
'Content-Type' => 'application/json',
'X-API-Key' => 'rfh_your_api_key',
],
'json' => array (
'email_text' => 'Hi, I was charged $49 but I cancelled my account yesterday. Please refund me immediately.',
'sender_name' => 'John Doe',
'recipient_name' => 'Support Team',
'knowledge_base' =>
array (
0 => 'Refunds are only issued if requested within 14 days of the charge.',
1 => 'Standard response time is 24 hours.',
),
'rules' =>
array (
0 => 'Never promise a refund if you are unsure.',
1 => 'Be empathetic but firm.',
2 => 'If the user threatens a chargeback, escalate to a human.',
),
'tone' => 'professional',
),
]);
echo $response->getBody();
const response = await fetch('https://rsflowhub.com/api/v1/ai/email-reply', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-API-Key': 'rfh_your_api_key'
},
body: JSON.stringify({"email_text":"Hi, I was charged $49 but I cancelled my account yesterday. Please refund me immediately.","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"})
});
const data = await response.json();
console.log(data);
import requests
url = "https://rsflowhub.com/api/v1/ai/email-reply"
headers = {
"Content-Type": "application/json",
"X-API-Key": "rfh_your_api_key"
}
payload = {"email_text":"Hi, I was charged $49 but I cancelled my account yesterday. Please refund me immediately.","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"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
Every RSFlowHub endpoint uses the same envelope, so one parser handles all of them. Failed calls are not charged.
{
"success": true,
"request_id": "req_3f9a2c7e-5b1d-4e8a-9c2f-7d6e1a0b4c8d",
"data": {
"result": {
"reply_text": "Hi there, thanks for flagging this. I can see the duplicate charge on your March invoice and have started a refund for the second payment. You should see it within 5-7 business days.",
"confidence_score": 0.91,
"requires_human_escalation": false,
"escalation_reason": null,
"triggered_actions": []
}
},
"meta": {
"version": "v1",
"timestamp": "2026-10-05T09:30:00Z"
}
}
{
"success": false,
"request_id": "req_8c1d4e2a-7f3b-4a9c",
"error": {
"code": "VALIDATION_ERROR",
"message": "The given data was invalid.",
"details": {
"email_text": [
"This field is required."
]
}
},
"meta": {
"version": "v1",
"timestamp": "2026-10-05T09:30:00Z"
}
}
| Field | Type | Meaning |
|---|---|---|
success | boolean | true when the call worked, false on any error. |
request_id | string | Unique id for this call. Quote it when you contact support. |
data.result | object | The result of this endpoint (see the example). |
error | object | Only on failure: code, message and details per field. |
meta | object | API version and server timestamp. |
All error codes: Errors reference
Grounds generated responses strictly in your company knowledge base facts, documentation, and refund policies.
Enforces strict operational guardrails e.g. "Never promise a refund if unsure" or "Escalate chargeback threats".
Select between professional, empathetic, firm, concise, or friendly communication tones.
Formats professional email greetings, recipient names, sender titles, and signature blocks automatically.
How teams use the Automated Professional Email Reply Generator API in production.
Generate instant professional draft replies for support agents answering billing and account inquiries.
Dear John,\n\nThank you for contacting RSFlowHub Support. I understand you were charged after requesting cancellation. Our team is processing your $49 refund, which will post in 3-5 business days.\n\nBest regards,\nSupport TeamSaves support representatives 3+ minutes per ticket response.
Generate context-aware out-of-office replies providing targeted contact links depending on sender query.
Hi,\n\nI am currently out of the office until Monday. For urgent financial report inquiries, please contact finance@company.com.Provides instant guidance even when staff is offline.
Automatically respond to buyer refund inquiries following exact store 14-day policy rules.
Hello,\n\nYes! We accept returns within 14 days of purchase. Please visit our Returns Portal at example.com/returns to print your shipping label.Drafts accurate answers to order-status emails for one-click sending.
The same job done three ways.
| Topic | RSFlowHub API | Raw LLM prompts | Rules / regex |
|---|---|---|---|
| Output | Validated JSON fields | Free text you have to parse | Fixed patterns only |
| Setup | One POST request, no prompts | Write and maintain prompts and parsing | Write and maintain rule lists |
| Provider outage | Automatic fallback to a backup model | You build retries and a second vendor | Not applicable |
| Pricing | 2 credits per call, failed calls free | Per token, per vendor | Your own servers and upkeep |
| Understands context | Yes, AI model | Yes, AI model | No, keywords only |
Free plan with 100 credits/month + 1,000 bonus credits when you sign in before 23 Nov. Test it in the playground first, no code needed.
Flowy
AI assistant