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.send({
from: 'from',
subject: 'subject',
to: 'string',
});
console.log(response.id);curl --request POST \
--url https://inbound.new/api/e2/emails \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"from": "<string>",
"to": "<string>",
"subject": "<string>",
"html": "<string>",
"text": "<string>",
"cc": "<string>",
"bcc": "<string>",
"reply_to": "<string>",
"headers": {},
"attachments": [
{
"filename": "<string>",
"content": "<string>",
"content_type": "<string>",
"path": "<string>"
}
],
"tags": [
{
"name": "<string>",
"value": "<string>"
}
],
"scheduled_at": "<string>",
"timezone": "<string>"
}
'import requests
url = "https://inbound.new/api/e2/emails"
payload = {
"from": "<string>",
"to": "<string>",
"subject": "<string>",
"html": "<string>",
"text": "<string>",
"cc": "<string>",
"bcc": "<string>",
"reply_to": "<string>",
"headers": {},
"attachments": [
{
"filename": "<string>",
"content": "<string>",
"content_type": "<string>",
"path": "<string>"
}
],
"tags": [
{
"name": "<string>",
"value": "<string>"
}
],
"scheduled_at": "<string>",
"timezone": "<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",
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>',
'cc' => '<string>',
'bcc' => '<string>',
'reply_to' => '<string>',
'headers' => [
],
'attachments' => [
[
'filename' => '<string>',
'content' => '<string>',
'content_type' => '<string>',
'path' => '<string>'
]
],
'tags' => [
[
'name' => '<string>',
'value' => '<string>'
]
],
'scheduled_at' => '<string>',
'timezone' => '<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"
payload := strings.NewReader("{\n \"from\": \"<string>\",\n \"to\": \"<string>\",\n \"subject\": \"<string>\",\n \"html\": \"<string>\",\n \"text\": \"<string>\",\n \"cc\": \"<string>\",\n \"bcc\": \"<string>\",\n \"reply_to\": \"<string>\",\n \"headers\": {},\n \"attachments\": [\n {\n \"filename\": \"<string>\",\n \"content\": \"<string>\",\n \"content_type\": \"<string>\",\n \"path\": \"<string>\"\n }\n ],\n \"tags\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"scheduled_at\": \"<string>\",\n \"timezone\": \"<string>\"\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")
.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 \"cc\": \"<string>\",\n \"bcc\": \"<string>\",\n \"reply_to\": \"<string>\",\n \"headers\": {},\n \"attachments\": [\n {\n \"filename\": \"<string>\",\n \"content\": \"<string>\",\n \"content_type\": \"<string>\",\n \"path\": \"<string>\"\n }\n ],\n \"tags\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"scheduled_at\": \"<string>\",\n \"timezone\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://inbound.new/api/e2/emails")
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 \"cc\": \"<string>\",\n \"bcc\": \"<string>\",\n \"reply_to\": \"<string>\",\n \"headers\": {},\n \"attachments\": [\n {\n \"filename\": \"<string>\",\n \"content\": \"<string>\",\n \"content_type\": \"<string>\",\n \"path\": \"<string>\"\n }\n ],\n \"tags\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"scheduled_at\": \"<string>\",\n \"timezone\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"message_id": "<string>",
"scheduled_at": "<string>",
"timezone": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Emails
Send an email
Send an email immediately or schedule it for later using the scheduled_at parameter. Supports HTML/text content, attachments, and custom headers.
POST
/
api
/
e2
/
emails
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.send({
from: 'from',
subject: 'subject',
to: 'string',
});
console.log(response.id);curl --request POST \
--url https://inbound.new/api/e2/emails \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"from": "<string>",
"to": "<string>",
"subject": "<string>",
"html": "<string>",
"text": "<string>",
"cc": "<string>",
"bcc": "<string>",
"reply_to": "<string>",
"headers": {},
"attachments": [
{
"filename": "<string>",
"content": "<string>",
"content_type": "<string>",
"path": "<string>"
}
],
"tags": [
{
"name": "<string>",
"value": "<string>"
}
],
"scheduled_at": "<string>",
"timezone": "<string>"
}
'import requests
url = "https://inbound.new/api/e2/emails"
payload = {
"from": "<string>",
"to": "<string>",
"subject": "<string>",
"html": "<string>",
"text": "<string>",
"cc": "<string>",
"bcc": "<string>",
"reply_to": "<string>",
"headers": {},
"attachments": [
{
"filename": "<string>",
"content": "<string>",
"content_type": "<string>",
"path": "<string>"
}
],
"tags": [
{
"name": "<string>",
"value": "<string>"
}
],
"scheduled_at": "<string>",
"timezone": "<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",
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>',
'cc' => '<string>',
'bcc' => '<string>',
'reply_to' => '<string>',
'headers' => [
],
'attachments' => [
[
'filename' => '<string>',
'content' => '<string>',
'content_type' => '<string>',
'path' => '<string>'
]
],
'tags' => [
[
'name' => '<string>',
'value' => '<string>'
]
],
'scheduled_at' => '<string>',
'timezone' => '<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"
payload := strings.NewReader("{\n \"from\": \"<string>\",\n \"to\": \"<string>\",\n \"subject\": \"<string>\",\n \"html\": \"<string>\",\n \"text\": \"<string>\",\n \"cc\": \"<string>\",\n \"bcc\": \"<string>\",\n \"reply_to\": \"<string>\",\n \"headers\": {},\n \"attachments\": [\n {\n \"filename\": \"<string>\",\n \"content\": \"<string>\",\n \"content_type\": \"<string>\",\n \"path\": \"<string>\"\n }\n ],\n \"tags\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"scheduled_at\": \"<string>\",\n \"timezone\": \"<string>\"\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")
.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 \"cc\": \"<string>\",\n \"bcc\": \"<string>\",\n \"reply_to\": \"<string>\",\n \"headers\": {},\n \"attachments\": [\n {\n \"filename\": \"<string>\",\n \"content\": \"<string>\",\n \"content_type\": \"<string>\",\n \"path\": \"<string>\"\n }\n ],\n \"tags\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"scheduled_at\": \"<string>\",\n \"timezone\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://inbound.new/api/e2/emails")
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 \"cc\": \"<string>\",\n \"bcc\": \"<string>\",\n \"reply_to\": \"<string>\",\n \"headers\": {},\n \"attachments\": [\n {\n \"filename\": \"<string>\",\n \"content\": \"<string>\",\n \"content_type\": \"<string>\",\n \"path\": \"<string>\"\n }\n ],\n \"tags\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"scheduled_at\": \"<string>\",\n \"timezone\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"message_id": "<string>",
"scheduled_at": "<string>",
"timezone": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Authorizations
Your Inbound API key. Include it in the Authorization header as: Bearer
Body
application/jsonapplication/x-www-form-urlencodedmultipart/form-data
Sender email address
Recipient email address(es)
Email subject
HTML content of the email
Plain text content of the email
Custom email headers
Show child attributes
Show child attributes
Show child attributes
Show child attributes
ISO 8601 date or natural language for scheduling
Timezone for natural language parsing
Was this page helpful?
⌘I