curl --request POST \
--url https://inbound.new/api/e2/mailboxes/{id}/folders/{folder}/messages \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"raw": "<string>",
"from": "<string>",
"to": "<string>",
"cc": "<string>",
"replyTo": "<string>",
"subject": "<string>",
"text": "<string>",
"html": "<string>",
"headers": {},
"inReplyTo": "<string>",
"references": [
"<string>"
],
"flags": [
"<string>"
],
"date": "<string>"
}
'import requests
url = "https://inbound.new/api/e2/mailboxes/{id}/folders/{folder}/messages"
payload = {
"raw": "<string>",
"from": "<string>",
"to": "<string>",
"cc": "<string>",
"replyTo": "<string>",
"subject": "<string>",
"text": "<string>",
"html": "<string>",
"headers": {},
"inReplyTo": "<string>",
"references": ["<string>"],
"flags": ["<string>"],
"date": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
raw: '<string>',
from: '<string>',
to: '<string>',
cc: '<string>',
replyTo: '<string>',
subject: '<string>',
text: '<string>',
html: '<string>',
headers: {},
inReplyTo: '<string>',
references: ['<string>'],
flags: ['<string>'],
date: '<string>'
})
};
fetch('https://inbound.new/api/e2/mailboxes/{id}/folders/{folder}/messages', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://inbound.new/api/e2/mailboxes/{id}/folders/{folder}/messages",
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([
'raw' => '<string>',
'from' => '<string>',
'to' => '<string>',
'cc' => '<string>',
'replyTo' => '<string>',
'subject' => '<string>',
'text' => '<string>',
'html' => '<string>',
'headers' => [
],
'inReplyTo' => '<string>',
'references' => [
'<string>'
],
'flags' => [
'<string>'
],
'date' => '<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/mailboxes/{id}/folders/{folder}/messages"
payload := strings.NewReader("{\n \"raw\": \"<string>\",\n \"from\": \"<string>\",\n \"to\": \"<string>\",\n \"cc\": \"<string>\",\n \"replyTo\": \"<string>\",\n \"subject\": \"<string>\",\n \"text\": \"<string>\",\n \"html\": \"<string>\",\n \"headers\": {},\n \"inReplyTo\": \"<string>\",\n \"references\": [\n \"<string>\"\n ],\n \"flags\": [\n \"<string>\"\n ],\n \"date\": \"<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/mailboxes/{id}/folders/{folder}/messages")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"raw\": \"<string>\",\n \"from\": \"<string>\",\n \"to\": \"<string>\",\n \"cc\": \"<string>\",\n \"replyTo\": \"<string>\",\n \"subject\": \"<string>\",\n \"text\": \"<string>\",\n \"html\": \"<string>\",\n \"headers\": {},\n \"inReplyTo\": \"<string>\",\n \"references\": [\n \"<string>\"\n ],\n \"flags\": [\n \"<string>\"\n ],\n \"date\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://inbound.new/api/e2/mailboxes/{id}/folders/{folder}/messages")
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 \"raw\": \"<string>\",\n \"from\": \"<string>\",\n \"to\": \"<string>\",\n \"cc\": \"<string>\",\n \"replyTo\": \"<string>\",\n \"subject\": \"<string>\",\n \"text\": \"<string>\",\n \"html\": \"<string>\",\n \"headers\": {},\n \"inReplyTo\": \"<string>\",\n \"references\": [\n \"<string>\"\n ],\n \"flags\": [\n \"<string>\"\n ],\n \"date\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"folder": "<string>",
"uid": 123,
"uidValidity": 123
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Add a message to a folder
Requires a read_write mailbox. Stores a message in a folder, like IMAP APPEND: either a raw RFC 822 message (base64) or message fields that are built into one (for example a draft). Nothing is sent. Size and storage limits are the same as over IMAP. Appending to Sent with a Message-ID that is already there returns the existing message.
curl --request POST \
--url https://inbound.new/api/e2/mailboxes/{id}/folders/{folder}/messages \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"raw": "<string>",
"from": "<string>",
"to": "<string>",
"cc": "<string>",
"replyTo": "<string>",
"subject": "<string>",
"text": "<string>",
"html": "<string>",
"headers": {},
"inReplyTo": "<string>",
"references": [
"<string>"
],
"flags": [
"<string>"
],
"date": "<string>"
}
'import requests
url = "https://inbound.new/api/e2/mailboxes/{id}/folders/{folder}/messages"
payload = {
"raw": "<string>",
"from": "<string>",
"to": "<string>",
"cc": "<string>",
"replyTo": "<string>",
"subject": "<string>",
"text": "<string>",
"html": "<string>",
"headers": {},
"inReplyTo": "<string>",
"references": ["<string>"],
"flags": ["<string>"],
"date": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
raw: '<string>',
from: '<string>',
to: '<string>',
cc: '<string>',
replyTo: '<string>',
subject: '<string>',
text: '<string>',
html: '<string>',
headers: {},
inReplyTo: '<string>',
references: ['<string>'],
flags: ['<string>'],
date: '<string>'
})
};
fetch('https://inbound.new/api/e2/mailboxes/{id}/folders/{folder}/messages', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://inbound.new/api/e2/mailboxes/{id}/folders/{folder}/messages",
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([
'raw' => '<string>',
'from' => '<string>',
'to' => '<string>',
'cc' => '<string>',
'replyTo' => '<string>',
'subject' => '<string>',
'text' => '<string>',
'html' => '<string>',
'headers' => [
],
'inReplyTo' => '<string>',
'references' => [
'<string>'
],
'flags' => [
'<string>'
],
'date' => '<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/mailboxes/{id}/folders/{folder}/messages"
payload := strings.NewReader("{\n \"raw\": \"<string>\",\n \"from\": \"<string>\",\n \"to\": \"<string>\",\n \"cc\": \"<string>\",\n \"replyTo\": \"<string>\",\n \"subject\": \"<string>\",\n \"text\": \"<string>\",\n \"html\": \"<string>\",\n \"headers\": {},\n \"inReplyTo\": \"<string>\",\n \"references\": [\n \"<string>\"\n ],\n \"flags\": [\n \"<string>\"\n ],\n \"date\": \"<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/mailboxes/{id}/folders/{folder}/messages")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"raw\": \"<string>\",\n \"from\": \"<string>\",\n \"to\": \"<string>\",\n \"cc\": \"<string>\",\n \"replyTo\": \"<string>\",\n \"subject\": \"<string>\",\n \"text\": \"<string>\",\n \"html\": \"<string>\",\n \"headers\": {},\n \"inReplyTo\": \"<string>\",\n \"references\": [\n \"<string>\"\n ],\n \"flags\": [\n \"<string>\"\n ],\n \"date\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://inbound.new/api/e2/mailboxes/{id}/folders/{folder}/messages")
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 \"raw\": \"<string>\",\n \"from\": \"<string>\",\n \"to\": \"<string>\",\n \"cc\": \"<string>\",\n \"replyTo\": \"<string>\",\n \"subject\": \"<string>\",\n \"text\": \"<string>\",\n \"html\": \"<string>\",\n \"headers\": {},\n \"inReplyTo\": \"<string>\",\n \"references\": [\n \"<string>\"\n ],\n \"flags\": [\n \"<string>\"\n ],\n \"date\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"folder": "<string>",
"uid": 123,
"uidValidity": 123
}{
"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
Body
The full RFC 822 message, base64-encoded. The decoded message must be valid UTF-8 (7-bit or UTF-8 headers and bodies); encode other 8-bit content with base64 or quoted-printable.
1402200Defaults to the mailbox's sending identity or login address
512409640964096998998100998Defaults to none for raw messages, and to \Seen (plus \Draft in Drafts) for message fields
50255Internal date (ISO 8601); defaults to now
Was this page helpful?