JavaScript
import Inbound from 'inboundemail';
const client = new Inbound({
apiKey: process.env['INBOUND_API_KEY'], // This is the default and can be omitted
});
const response = await client.emails.reply('id', { from: 'from' });
console.log(response.id);curl --request POST \
--url https://inbound.new/api/e2/emails/{id}/reply \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"from": "<string>",
"to": "<string>",
"subject": "<string>",
"html": "<string>",
"text": "<string>",
"headers": {},
"attachments": [
{
"filename": "<string>",
"content": "<string>",
"content_type": "<string>",
"path": "<string>"
}
],
"reply_all": true,
"tags": [
{
"name": "<string>",
"value": "<string>"
}
]
}
'import requests
url = "https://inbound.new/api/e2/emails/{id}/reply"
payload = {
"from": "<string>",
"to": "<string>",
"subject": "<string>",
"html": "<string>",
"text": "<string>",
"headers": {},
"attachments": [
{
"filename": "<string>",
"content": "<string>",
"content_type": "<string>",
"path": "<string>"
}
],
"reply_all": True,
"tags": [
{
"name": "<string>",
"value": "<string>"
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://inbound.new/api/e2/emails/{id}/reply",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'from' => '<string>',
'to' => '<string>',
'subject' => '<string>',
'html' => '<string>',
'text' => '<string>',
'headers' => [
],
'attachments' => [
[
'filename' => '<string>',
'content' => '<string>',
'content_type' => '<string>',
'path' => '<string>'
]
],
'reply_all' => true,
'tags' => [
[
'name' => '<string>',
'value' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://inbound.new/api/e2/emails/{id}/reply"
payload := strings.NewReader("{\n \"from\": \"<string>\",\n \"to\": \"<string>\",\n \"subject\": \"<string>\",\n \"html\": \"<string>\",\n \"text\": \"<string>\",\n \"headers\": {},\n \"attachments\": [\n {\n \"filename\": \"<string>\",\n \"content\": \"<string>\",\n \"content_type\": \"<string>\",\n \"path\": \"<string>\"\n }\n ],\n \"reply_all\": true,\n \"tags\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://inbound.new/api/e2/emails/{id}/reply")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"from\": \"<string>\",\n \"to\": \"<string>\",\n \"subject\": \"<string>\",\n \"html\": \"<string>\",\n \"text\": \"<string>\",\n \"headers\": {},\n \"attachments\": [\n {\n \"filename\": \"<string>\",\n \"content\": \"<string>\",\n \"content_type\": \"<string>\",\n \"path\": \"<string>\"\n }\n ],\n \"reply_all\": true,\n \"tags\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://inbound.new/api/e2/emails/{id}/reply")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"from\": \"<string>\",\n \"to\": \"<string>\",\n \"subject\": \"<string>\",\n \"html\": \"<string>\",\n \"text\": \"<string>\",\n \"headers\": {},\n \"attachments\": [\n {\n \"filename\": \"<string>\",\n \"content\": \"<string>\",\n \"content_type\": \"<string>\",\n \"path\": \"<string>\"\n }\n ],\n \"reply_all\": true,\n \"tags\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"message_id": "<string>",
"aws_message_id": "<string>",
"replied_to_email_id": "<string>",
"is_thread_reply": true,
"replied_to_thread_id": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Emails
Reply to an email
Reply to an email or thread. Accepts either an email ID or thread ID (replies to latest message in thread). Supports reply all functionality.
POST
/
api
/
e2
/
emails
/
{id}
/
reply
JavaScript
import Inbound from 'inboundemail';
const client = new Inbound({
apiKey: process.env['INBOUND_API_KEY'], // This is the default and can be omitted
});
const response = await client.emails.reply('id', { from: 'from' });
console.log(response.id);curl --request POST \
--url https://inbound.new/api/e2/emails/{id}/reply \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"from": "<string>",
"to": "<string>",
"subject": "<string>",
"html": "<string>",
"text": "<string>",
"headers": {},
"attachments": [
{
"filename": "<string>",
"content": "<string>",
"content_type": "<string>",
"path": "<string>"
}
],
"reply_all": true,
"tags": [
{
"name": "<string>",
"value": "<string>"
}
]
}
'import requests
url = "https://inbound.new/api/e2/emails/{id}/reply"
payload = {
"from": "<string>",
"to": "<string>",
"subject": "<string>",
"html": "<string>",
"text": "<string>",
"headers": {},
"attachments": [
{
"filename": "<string>",
"content": "<string>",
"content_type": "<string>",
"path": "<string>"
}
],
"reply_all": True,
"tags": [
{
"name": "<string>",
"value": "<string>"
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://inbound.new/api/e2/emails/{id}/reply",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'from' => '<string>',
'to' => '<string>',
'subject' => '<string>',
'html' => '<string>',
'text' => '<string>',
'headers' => [
],
'attachments' => [
[
'filename' => '<string>',
'content' => '<string>',
'content_type' => '<string>',
'path' => '<string>'
]
],
'reply_all' => true,
'tags' => [
[
'name' => '<string>',
'value' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://inbound.new/api/e2/emails/{id}/reply"
payload := strings.NewReader("{\n \"from\": \"<string>\",\n \"to\": \"<string>\",\n \"subject\": \"<string>\",\n \"html\": \"<string>\",\n \"text\": \"<string>\",\n \"headers\": {},\n \"attachments\": [\n {\n \"filename\": \"<string>\",\n \"content\": \"<string>\",\n \"content_type\": \"<string>\",\n \"path\": \"<string>\"\n }\n ],\n \"reply_all\": true,\n \"tags\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://inbound.new/api/e2/emails/{id}/reply")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"from\": \"<string>\",\n \"to\": \"<string>\",\n \"subject\": \"<string>\",\n \"html\": \"<string>\",\n \"text\": \"<string>\",\n \"headers\": {},\n \"attachments\": [\n {\n \"filename\": \"<string>\",\n \"content\": \"<string>\",\n \"content_type\": \"<string>\",\n \"path\": \"<string>\"\n }\n ],\n \"reply_all\": true,\n \"tags\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://inbound.new/api/e2/emails/{id}/reply")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"from\": \"<string>\",\n \"to\": \"<string>\",\n \"subject\": \"<string>\",\n \"html\": \"<string>\",\n \"text\": \"<string>\",\n \"headers\": {},\n \"attachments\": [\n {\n \"filename\": \"<string>\",\n \"content\": \"<string>\",\n \"content_type\": \"<string>\",\n \"path\": \"<string>\"\n }\n ],\n \"reply_all\": true,\n \"tags\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"message_id": "<string>",
"aws_message_id": "<string>",
"replied_to_email_id": "<string>",
"is_thread_reply": true,
"replied_to_thread_id": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Authorizations
Your Inbound API key. Include it in the Authorization header as: Bearer
Path Parameters
Email ID or Thread ID to reply to
Body
application/jsonapplication/x-www-form-urlencodedmultipart/form-data
Sender email address
Recipient email address(es) - defaults to original sender
Email subject - defaults to Re: original subject
HTML content of the email
Plain text content of the email
Custom email headers
Show child attributes
Show child attributes
Include original CC recipients
Show child attributes
Show child attributes
Was this page helpful?
⌘I