Mailboxes
Create a managed mailbox
POST
/
api
/
e2
/
mailboxes
TypeScript
import Inbound from "inboundemail";
const inbound = new Inbound();
const result = await inbound.mailboxes.create({
name: "Support",
loginAddress: "agent@example.com",
type: "mailbox",
accessMode: "read",
sendingMode: "identity",
sendingName: "Support",
sendingAddress: "agent@example.com",
scopes: [
{
type: "domain",
domainId: "dom_..."
}
]
});curl -X POST 'https://inbound.new/api/e2/mailboxes' \
-H "Authorization: Bearer $INBOUND_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"name": "Support",
"loginAddress": "agent@example.com",
"type": "mailbox",
"accessMode": "read",
"sendingMode": "identity",
"sendingName": "Support",
"sendingAddress": "agent@example.com",
"scopes": [
{
"type": "domain",
"domainId": "dom_..."
}
]
}'import requests
url = "https://inbound.new/api/e2/mailboxes"
payload = {
"name": "<string>",
"loginAddress": "<string>",
"sendingName": "<string>",
"sendingAddress": "<string>",
"scopes": [
{
"domainId": "<string>",
"address": "<string>"
}
],
"protocols": {
"imap": True,
"smtp": True,
"api": True
},
"allowedIps": ["<string>"],
"storageQuotaBytes": 4503599627370496,
"dailySendLimit": 500000,
"selfService": {
"filters": True,
"spam": True,
"password": True,
"activity": True
}
}
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({
name: '<string>',
loginAddress: '<string>',
sendingName: '<string>',
sendingAddress: '<string>',
scopes: [{domainId: '<string>', address: '<string>'}],
protocols: {imap: true, smtp: true, api: true},
allowedIps: ['<string>'],
storageQuotaBytes: 4503599627370496,
dailySendLimit: 500000,
selfService: {filters: true, spam: true, password: true, activity: true}
})
};
fetch('https://inbound.new/api/e2/mailboxes', 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",
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([
'name' => '<string>',
'loginAddress' => '<string>',
'sendingName' => '<string>',
'sendingAddress' => '<string>',
'scopes' => [
[
'domainId' => '<string>',
'address' => '<string>'
]
],
'protocols' => [
'imap' => true,
'smtp' => true,
'api' => true
],
'allowedIps' => [
'<string>'
],
'storageQuotaBytes' => 4503599627370496,
'dailySendLimit' => 500000,
'selfService' => [
'filters' => true,
'spam' => true,
'password' => true,
'activity' => 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://inbound.new/api/e2/mailboxes"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"loginAddress\": \"<string>\",\n \"sendingName\": \"<string>\",\n \"sendingAddress\": \"<string>\",\n \"scopes\": [\n {\n \"domainId\": \"<string>\",\n \"address\": \"<string>\"\n }\n ],\n \"protocols\": {\n \"imap\": true,\n \"smtp\": true,\n \"api\": true\n },\n \"allowedIps\": [\n \"<string>\"\n ],\n \"storageQuotaBytes\": 4503599627370496,\n \"dailySendLimit\": 500000,\n \"selfService\": {\n \"filters\": true,\n \"spam\": true,\n \"password\": true,\n \"activity\": true\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/mailboxes")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"loginAddress\": \"<string>\",\n \"sendingName\": \"<string>\",\n \"sendingAddress\": \"<string>\",\n \"scopes\": [\n {\n \"domainId\": \"<string>\",\n \"address\": \"<string>\"\n }\n ],\n \"protocols\": {\n \"imap\": true,\n \"smtp\": true,\n \"api\": true\n },\n \"allowedIps\": [\n \"<string>\"\n ],\n \"storageQuotaBytes\": 4503599627370496,\n \"dailySendLimit\": 500000,\n \"selfService\": {\n \"filters\": true,\n \"spam\": true,\n \"password\": true,\n \"activity\": true\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://inbound.new/api/e2/mailboxes")
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 \"name\": \"<string>\",\n \"loginAddress\": \"<string>\",\n \"sendingName\": \"<string>\",\n \"sendingAddress\": \"<string>\",\n \"scopes\": [\n {\n \"domainId\": \"<string>\",\n \"address\": \"<string>\"\n }\n ],\n \"protocols\": {\n \"imap\": true,\n \"smtp\": true,\n \"api\": true\n },\n \"allowedIps\": [\n \"<string>\"\n ],\n \"storageQuotaBytes\": 4503599627370496,\n \"dailySendLimit\": 500000,\n \"selfService\": {\n \"filters\": true,\n \"spam\": true,\n \"password\": true,\n \"activity\": true\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "<string>",
"name": "<string>",
"loginAddress": "<string>",
"type": "mailbox",
"accessMode": "read",
"sendingMode": "identity",
"sendingName": "<string>",
"sendingAddress": "<string>",
"enabled": true,
"scopes": [
{
"id": "<string>",
"type": "domain",
"domainId": "<string>",
"domain": "<string>",
"address": "<string>"
}
],
"protocols": {
"imap": true,
"smtp": true,
"api": true
},
"allowedIps": [
"<string>"
],
"storageQuotaBytes": 123,
"dailySendLimit": 0,
"selfService": {
"filters": true,
"spam": true,
"password": true,
"activity": true
},
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"lastUsedAt": "2023-11-07T05:31:56Z"
},
"password": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Authorizations
Body
application/jsonapplication/x-www-form-urlencodedmultipart/form-data
Was this page helpful?
⌘I
TypeScript
import Inbound from "inboundemail";
const inbound = new Inbound();
const result = await inbound.mailboxes.create({
name: "Support",
loginAddress: "agent@example.com",
type: "mailbox",
accessMode: "read",
sendingMode: "identity",
sendingName: "Support",
sendingAddress: "agent@example.com",
scopes: [
{
type: "domain",
domainId: "dom_..."
}
]
});curl -X POST 'https://inbound.new/api/e2/mailboxes' \
-H "Authorization: Bearer $INBOUND_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"name": "Support",
"loginAddress": "agent@example.com",
"type": "mailbox",
"accessMode": "read",
"sendingMode": "identity",
"sendingName": "Support",
"sendingAddress": "agent@example.com",
"scopes": [
{
"type": "domain",
"domainId": "dom_..."
}
]
}'import requests
url = "https://inbound.new/api/e2/mailboxes"
payload = {
"name": "<string>",
"loginAddress": "<string>",
"sendingName": "<string>",
"sendingAddress": "<string>",
"scopes": [
{
"domainId": "<string>",
"address": "<string>"
}
],
"protocols": {
"imap": True,
"smtp": True,
"api": True
},
"allowedIps": ["<string>"],
"storageQuotaBytes": 4503599627370496,
"dailySendLimit": 500000,
"selfService": {
"filters": True,
"spam": True,
"password": True,
"activity": True
}
}
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({
name: '<string>',
loginAddress: '<string>',
sendingName: '<string>',
sendingAddress: '<string>',
scopes: [{domainId: '<string>', address: '<string>'}],
protocols: {imap: true, smtp: true, api: true},
allowedIps: ['<string>'],
storageQuotaBytes: 4503599627370496,
dailySendLimit: 500000,
selfService: {filters: true, spam: true, password: true, activity: true}
})
};
fetch('https://inbound.new/api/e2/mailboxes', 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",
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([
'name' => '<string>',
'loginAddress' => '<string>',
'sendingName' => '<string>',
'sendingAddress' => '<string>',
'scopes' => [
[
'domainId' => '<string>',
'address' => '<string>'
]
],
'protocols' => [
'imap' => true,
'smtp' => true,
'api' => true
],
'allowedIps' => [
'<string>'
],
'storageQuotaBytes' => 4503599627370496,
'dailySendLimit' => 500000,
'selfService' => [
'filters' => true,
'spam' => true,
'password' => true,
'activity' => 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://inbound.new/api/e2/mailboxes"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"loginAddress\": \"<string>\",\n \"sendingName\": \"<string>\",\n \"sendingAddress\": \"<string>\",\n \"scopes\": [\n {\n \"domainId\": \"<string>\",\n \"address\": \"<string>\"\n }\n ],\n \"protocols\": {\n \"imap\": true,\n \"smtp\": true,\n \"api\": true\n },\n \"allowedIps\": [\n \"<string>\"\n ],\n \"storageQuotaBytes\": 4503599627370496,\n \"dailySendLimit\": 500000,\n \"selfService\": {\n \"filters\": true,\n \"spam\": true,\n \"password\": true,\n \"activity\": true\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/mailboxes")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"loginAddress\": \"<string>\",\n \"sendingName\": \"<string>\",\n \"sendingAddress\": \"<string>\",\n \"scopes\": [\n {\n \"domainId\": \"<string>\",\n \"address\": \"<string>\"\n }\n ],\n \"protocols\": {\n \"imap\": true,\n \"smtp\": true,\n \"api\": true\n },\n \"allowedIps\": [\n \"<string>\"\n ],\n \"storageQuotaBytes\": 4503599627370496,\n \"dailySendLimit\": 500000,\n \"selfService\": {\n \"filters\": true,\n \"spam\": true,\n \"password\": true,\n \"activity\": true\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://inbound.new/api/e2/mailboxes")
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 \"name\": \"<string>\",\n \"loginAddress\": \"<string>\",\n \"sendingName\": \"<string>\",\n \"sendingAddress\": \"<string>\",\n \"scopes\": [\n {\n \"domainId\": \"<string>\",\n \"address\": \"<string>\"\n }\n ],\n \"protocols\": {\n \"imap\": true,\n \"smtp\": true,\n \"api\": true\n },\n \"allowedIps\": [\n \"<string>\"\n ],\n \"storageQuotaBytes\": 4503599627370496,\n \"dailySendLimit\": 500000,\n \"selfService\": {\n \"filters\": true,\n \"spam\": true,\n \"password\": true,\n \"activity\": true\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "<string>",
"name": "<string>",
"loginAddress": "<string>",
"type": "mailbox",
"accessMode": "read",
"sendingMode": "identity",
"sendingName": "<string>",
"sendingAddress": "<string>",
"enabled": true,
"scopes": [
{
"id": "<string>",
"type": "domain",
"domainId": "<string>",
"domain": "<string>",
"address": "<string>"
}
],
"protocols": {
"imap": true,
"smtp": true,
"api": true
},
"allowedIps": [
"<string>"
],
"storageQuotaBytes": 123,
"dailySendLimit": 0,
"selfService": {
"filters": true,
"spam": true,
"password": true,
"activity": true
},
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"lastUsedAt": "2023-11-07T05:31:56Z"
},
"password": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}