This endpoint allows you to reply to emails received through Inbound, maintaining proper email threading with In-Reply-To and References headers.
Authentication
This endpoint requires authentication via API key or session token.
curl -X POST https://inbound.new/api/v2/emails/{id}/reply \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json"
Path Parameters
The unique identifier of the email you want to reply to. This must be an email that was received through your Inbound account.
Request Body
The sender email address. Must be in the format "Name <email@domain.com>"
or just "email@domain.com"
. The domain must be verified in your account.
The recipient email address(es). If not provided, the reply will be sent to the original sender. Can be a single email string or an array of email strings.
The email subject. If not provided, “Re: ” will be prepended to the original email’s subject.
Carbon copy recipient(s). Can be a single email string or an array of email strings.
Blind carbon copy recipient(s). Can be a single email string or an array of email strings.
Reply-to address(es). Can be a single email string or an array of email strings.
The plain text version of the email body. Either text
or html
must be provided.
The HTML version of the email body. Either text
or html
must be provided.
Custom email headers as key-value pairs. These will be added to the email in addition to the standard headers.
Array of file attachments to include with the email. Show Attachment object properties
Base64 encoded file content
MIME type of the file (e.g., “application/pdf”, “image/png”)
Whether to include the original message as a quoted reply. When true, the original message will be appended to your reply with appropriate formatting.
Response
Unique identifier for the sent reply email
Email Threading
This endpoint automatically handles email threading by:
Setting the In-Reply-To header with the Message-ID of the original email
Building the References header to maintain the full conversation thread
Formatting the subject with “Re: ” prefix if not already present
Quoting the original message (when include_original
is true) with proper attribution
Email clients like Gmail, Outlook, and Apple Mail will recognize these threading headers and group the emails into a conversation.
Examples
Basic Reply
Reply to an email with minimal configuration:
curl -X POST https://inbound.new/api/v2/emails/email_abc123/reply \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"from": "support@yourdomain.com",
"text": "Thank you for your email. We have received your request and will respond shortly."
}'
Advanced Reply with Custom Recipients
Reply with custom recipients, subject, and HTML content:
curl -X POST https://inbound.new/api/v2/emails/email_abc123/reply \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"from": "John Doe <john@yourdomain.com>",
"to": ["customer@example.com"],
"cc": ["manager@yourdomain.com"],
"subject": "Re: Support Request #12345",
"text": "Dear Customer,\n\nWe have resolved your issue...",
"html": "<p>Dear Customer,</p><p>We have resolved your issue...</p>",
"headers": {
"X-Support-Ticket": "12345"
},
"include_original": true
}'
Reply Without Quoting Original
Send a reply without including the original message:
curl -X POST https://inbound.new/api/v2/emails/email_abc123/reply \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"from": "noreply@yourdomain.com",
"text": "This is an automated response.",
"include_original": false
}'
Reply with Attachments
Include attachments in your reply:
const fs = require ( 'fs' );
// Read and encode file
const fileContent = fs . readFileSync ( 'invoice.pdf' );
const base64Content = fileContent . toString ( 'base64' );
const response = await fetch ( 'https://inbound.new/api/v2/emails/email_abc123/reply' , {
method: 'POST' ,
headers: {
'Authorization' : 'Bearer YOUR_API_KEY' ,
'Content-Type' : 'application/json'
},
body: JSON . stringify ({
from: 'billing@yourdomain.com' ,
text: 'Please find the invoice attached.' ,
attachments: [{
content: base64Content ,
filename: 'invoice.pdf' ,
content_type: 'application/pdf'
}]
})
});
Error Responses
Error message describing what went wrong
Common Errors
Status Code Error Message Description 400 ”From address is required” The from
field is missing from the request 400 ”Either html or text content must be provided” No email body content was provided 400 ”Invalid email format: “ One of the email addresses is malformed 401 ”Unauthorized” Invalid or missing API key 403 ”You don’t have permission to send from domain: “ The sender domain is not verified in your account 404 ”Email not found” The email ID does not exist or belongs to another user 429 ”Email sending limit reached” You have exceeded your plan’s email sending limit 500 ”Internal server error” An unexpected error occurred
{
"error" : "You don't have permission to send from domain: unverified.com"
}
Idempotency
This endpoint supports idempotency to prevent duplicate sends. Include an Idempotency-Key
header with a unique value:
curl -X POST https://inbound.new/api/v2/emails/email_abc123/reply \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: unique-key-123" \
-d '{...}'
If you make multiple requests with the same idempotency key, only the first request will send an email. Subsequent requests will return the same response without sending a duplicate.
Best Practices
Verify sender domain
Always ensure the from
domain is verified in your account before attempting to send replies.
Include both text and HTML
For best compatibility, include both text
and html
versions of your email content.
Use idempotency keys
When sending replies programmatically, use idempotency keys to prevent accidental duplicate sends.
Handle quoted content carefully
Consider whether including the original message is appropriate for your use case. Automated responses might not need it.
Test threading
Test your replies with various email clients to ensure threading works as expected.
Rate Limits
Reply sending is subject to the same rate limits as the Send Email endpoint. Your plan determines how many emails you can send per month.