JavaScript
import AIInbx from 'aiinbx';
const client = new AIInbx({
apiKey: process.env['AI_INBX_API_KEY'], // This is the default and can be omitted
});
const response = await client.emails.reply('emailId', { from: 'dev@stainless.com', html: 'html' });
console.log(response.emailId);import os
from aiinbx import AIInbx
client = AIInbx(
api_key=os.environ.get("AI_INBX_API_KEY"), # This is the default and can be omitted
)
response = client.emails.reply(
email_id="emailId",
from_="dev@stainless.com",
html="html",
)
print(response.email_id)curl --request POST \
--url https://api.aiinbx.com/api/v1/emails/{emailId}/reply \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"from": "jsmith@example.com",
"html": "<string>",
"to": "jsmith@example.com",
"from_name": "<string>",
"subject": "<string>",
"text": "<string>",
"cc": "jsmith@example.com",
"bcc": "jsmith@example.com",
"reply_all": false,
"is_draft": false,
"attachments": [
{
"file_name": "<string>",
"content": "<string>",
"content_type": "<string>",
"cid": "<string>"
}
],
"track_opens": true,
"track_clicks": true
}
'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.aiinbx.com/api/v1/emails/{emailId}/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' => 'jsmith@example.com',
'html' => '<string>',
'to' => 'jsmith@example.com',
'from_name' => '<string>',
'subject' => '<string>',
'text' => '<string>',
'cc' => 'jsmith@example.com',
'bcc' => 'jsmith@example.com',
'reply_all' => false,
'is_draft' => false,
'attachments' => [
[
'file_name' => '<string>',
'content' => '<string>',
'content_type' => '<string>',
'cid' => '<string>'
]
],
'track_opens' => true,
'track_clicks' => true
]),
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://api.aiinbx.com/api/v1/emails/{emailId}/reply"
payload := strings.NewReader("{\n \"from\": \"jsmith@example.com\",\n \"html\": \"<string>\",\n \"to\": \"jsmith@example.com\",\n \"from_name\": \"<string>\",\n \"subject\": \"<string>\",\n \"text\": \"<string>\",\n \"cc\": \"jsmith@example.com\",\n \"bcc\": \"jsmith@example.com\",\n \"reply_all\": false,\n \"is_draft\": false,\n \"attachments\": [\n {\n \"file_name\": \"<string>\",\n \"content\": \"<string>\",\n \"content_type\": \"<string>\",\n \"cid\": \"<string>\"\n }\n ],\n \"track_opens\": true,\n \"track_clicks\": true\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://api.aiinbx.com/api/v1/emails/{emailId}/reply")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"from\": \"jsmith@example.com\",\n \"html\": \"<string>\",\n \"to\": \"jsmith@example.com\",\n \"from_name\": \"<string>\",\n \"subject\": \"<string>\",\n \"text\": \"<string>\",\n \"cc\": \"jsmith@example.com\",\n \"bcc\": \"jsmith@example.com\",\n \"reply_all\": false,\n \"is_draft\": false,\n \"attachments\": [\n {\n \"file_name\": \"<string>\",\n \"content\": \"<string>\",\n \"content_type\": \"<string>\",\n \"cid\": \"<string>\"\n }\n ],\n \"track_opens\": true,\n \"track_clicks\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aiinbx.com/api/v1/emails/{emailId}/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\": \"jsmith@example.com\",\n \"html\": \"<string>\",\n \"to\": \"jsmith@example.com\",\n \"from_name\": \"<string>\",\n \"subject\": \"<string>\",\n \"text\": \"<string>\",\n \"cc\": \"jsmith@example.com\",\n \"bcc\": \"jsmith@example.com\",\n \"reply_all\": false,\n \"is_draft\": false,\n \"attachments\": [\n {\n \"file_name\": \"<string>\",\n \"content\": \"<string>\",\n \"content_type\": \"<string>\",\n \"cid\": \"<string>\"\n }\n ],\n \"track_opens\": true,\n \"track_clicks\": true\n}"
response = http.request(request)
puts response.read_body{
"emailId": "<string>",
"threadId": "<string>",
"messageId": "<string>"
}{
"code": "BAD_REQUEST",
"message": "Invalid input data",
"issues": []
}{
"code": "UNAUTHORIZED",
"message": "Authorization not provided",
"issues": []
}{
"code": "FORBIDDEN",
"message": "Insufficient access",
"issues": []
}{
"code": "INTERNAL_SERVER_ERROR",
"message": "Internal server error",
"issues": []
}Emails
Reply to an email
Reply to an existing email. Automatically handles reply headers (In-Reply-To, References) and thread association. The reply will be sent from a verified domain belonging to the organization.
POST
/
emails
/
{emailId}
/
reply
JavaScript
import AIInbx from 'aiinbx';
const client = new AIInbx({
apiKey: process.env['AI_INBX_API_KEY'], // This is the default and can be omitted
});
const response = await client.emails.reply('emailId', { from: 'dev@stainless.com', html: 'html' });
console.log(response.emailId);import os
from aiinbx import AIInbx
client = AIInbx(
api_key=os.environ.get("AI_INBX_API_KEY"), # This is the default and can be omitted
)
response = client.emails.reply(
email_id="emailId",
from_="dev@stainless.com",
html="html",
)
print(response.email_id)curl --request POST \
--url https://api.aiinbx.com/api/v1/emails/{emailId}/reply \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"from": "jsmith@example.com",
"html": "<string>",
"to": "jsmith@example.com",
"from_name": "<string>",
"subject": "<string>",
"text": "<string>",
"cc": "jsmith@example.com",
"bcc": "jsmith@example.com",
"reply_all": false,
"is_draft": false,
"attachments": [
{
"file_name": "<string>",
"content": "<string>",
"content_type": "<string>",
"cid": "<string>"
}
],
"track_opens": true,
"track_clicks": true
}
'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.aiinbx.com/api/v1/emails/{emailId}/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' => 'jsmith@example.com',
'html' => '<string>',
'to' => 'jsmith@example.com',
'from_name' => '<string>',
'subject' => '<string>',
'text' => '<string>',
'cc' => 'jsmith@example.com',
'bcc' => 'jsmith@example.com',
'reply_all' => false,
'is_draft' => false,
'attachments' => [
[
'file_name' => '<string>',
'content' => '<string>',
'content_type' => '<string>',
'cid' => '<string>'
]
],
'track_opens' => true,
'track_clicks' => true
]),
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://api.aiinbx.com/api/v1/emails/{emailId}/reply"
payload := strings.NewReader("{\n \"from\": \"jsmith@example.com\",\n \"html\": \"<string>\",\n \"to\": \"jsmith@example.com\",\n \"from_name\": \"<string>\",\n \"subject\": \"<string>\",\n \"text\": \"<string>\",\n \"cc\": \"jsmith@example.com\",\n \"bcc\": \"jsmith@example.com\",\n \"reply_all\": false,\n \"is_draft\": false,\n \"attachments\": [\n {\n \"file_name\": \"<string>\",\n \"content\": \"<string>\",\n \"content_type\": \"<string>\",\n \"cid\": \"<string>\"\n }\n ],\n \"track_opens\": true,\n \"track_clicks\": true\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://api.aiinbx.com/api/v1/emails/{emailId}/reply")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"from\": \"jsmith@example.com\",\n \"html\": \"<string>\",\n \"to\": \"jsmith@example.com\",\n \"from_name\": \"<string>\",\n \"subject\": \"<string>\",\n \"text\": \"<string>\",\n \"cc\": \"jsmith@example.com\",\n \"bcc\": \"jsmith@example.com\",\n \"reply_all\": false,\n \"is_draft\": false,\n \"attachments\": [\n {\n \"file_name\": \"<string>\",\n \"content\": \"<string>\",\n \"content_type\": \"<string>\",\n \"cid\": \"<string>\"\n }\n ],\n \"track_opens\": true,\n \"track_clicks\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aiinbx.com/api/v1/emails/{emailId}/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\": \"jsmith@example.com\",\n \"html\": \"<string>\",\n \"to\": \"jsmith@example.com\",\n \"from_name\": \"<string>\",\n \"subject\": \"<string>\",\n \"text\": \"<string>\",\n \"cc\": \"jsmith@example.com\",\n \"bcc\": \"jsmith@example.com\",\n \"reply_all\": false,\n \"is_draft\": false,\n \"attachments\": [\n {\n \"file_name\": \"<string>\",\n \"content\": \"<string>\",\n \"content_type\": \"<string>\",\n \"cid\": \"<string>\"\n }\n ],\n \"track_opens\": true,\n \"track_clicks\": true\n}"
response = http.request(request)
puts response.read_body{
"emailId": "<string>",
"threadId": "<string>",
"messageId": "<string>"
}{
"code": "BAD_REQUEST",
"message": "Invalid input data",
"issues": []
}{
"code": "UNAUTHORIZED",
"message": "Authorization not provided",
"issues": []
}{
"code": "FORBIDDEN",
"message": "Insufficient access",
"issues": []
}{
"code": "INTERNAL_SERVER_ERROR",
"message": "Internal server error",
"issues": []
}Authorizations
API Key authentication using Bearer token
Path Parameters
The ID of the email being replied to
Body
application/json
Maximum string length:
320Maximum string length:
998Show child attributes
Show child attributes
Was this page helpful?
⌘I