JavaScript
import Inbound from 'inboundemail';
const client = new Inbound({
apiKey: process.env['INBOUND_API_KEY'], // This is the default and can be omitted
});
const emailAddress = await client.emailAddresses.create({ address: 'x', domainId: 'x' });
console.log(emailAddress.id);curl --request POST \
--url https://inbound.new/api/e2/email-addresses \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"address": "<string>",
"domainId": "<string>",
"endpointId": "<string>",
"webhookId": "<string>",
"isActive": true
}
'import requests
url = "https://inbound.new/api/e2/email-addresses"
payload = {
"address": "<string>",
"domainId": "<string>",
"endpointId": "<string>",
"webhookId": "<string>",
"isActive": True
}
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/email-addresses",
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([
'address' => '<string>',
'domainId' => '<string>',
'endpointId' => '<string>',
'webhookId' => '<string>',
'isActive' => 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/email-addresses"
payload := strings.NewReader("{\n \"address\": \"<string>\",\n \"domainId\": \"<string>\",\n \"endpointId\": \"<string>\",\n \"webhookId\": \"<string>\",\n \"isActive\": 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://inbound.new/api/e2/email-addresses")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"address\": \"<string>\",\n \"domainId\": \"<string>\",\n \"endpointId\": \"<string>\",\n \"webhookId\": \"<string>\",\n \"isActive\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://inbound.new/api/e2/email-addresses")
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 \"address\": \"<string>\",\n \"domainId\": \"<string>\",\n \"endpointId\": \"<string>\",\n \"webhookId\": \"<string>\",\n \"isActive\": true\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"address": "<string>",
"domainId": "<string>",
"webhookId": "<string>",
"endpointId": "<string>",
"isActive": true,
"isReceiptRuleConfigured": true,
"receiptRuleName": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"userId": "<string>",
"domain": {
"id": "<string>",
"name": "<string>",
"status": "<string>"
},
"routing": {
"id": "<string>",
"name": "<string>",
"isActive": true,
"config": "<unknown>"
},
"warning": "<string>"
}{
"error": "<string>",
"code": "<string>",
"required": [
"<string>"
]
}{
"error": "<string>",
"code": "<string>",
"required": [
"<string>"
]
}{
"error": "<string>",
"code": "<string>",
"required": [
"<string>"
]
}{
"error": "<string>",
"code": "<string>",
"required": [
"<string>"
]
}{
"error": "<string>",
"code": "<string>",
"required": [
"<string>"
]
}Email Addresses
Create email address
Create a new email address for an authenticated user’s domain, optionally routing to a webhook or endpoint.
POST
/
api
/
e2
/
email-addresses
JavaScript
import Inbound from 'inboundemail';
const client = new Inbound({
apiKey: process.env['INBOUND_API_KEY'], // This is the default and can be omitted
});
const emailAddress = await client.emailAddresses.create({ address: 'x', domainId: 'x' });
console.log(emailAddress.id);curl --request POST \
--url https://inbound.new/api/e2/email-addresses \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"address": "<string>",
"domainId": "<string>",
"endpointId": "<string>",
"webhookId": "<string>",
"isActive": true
}
'import requests
url = "https://inbound.new/api/e2/email-addresses"
payload = {
"address": "<string>",
"domainId": "<string>",
"endpointId": "<string>",
"webhookId": "<string>",
"isActive": True
}
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/email-addresses",
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([
'address' => '<string>',
'domainId' => '<string>',
'endpointId' => '<string>',
'webhookId' => '<string>',
'isActive' => 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/email-addresses"
payload := strings.NewReader("{\n \"address\": \"<string>\",\n \"domainId\": \"<string>\",\n \"endpointId\": \"<string>\",\n \"webhookId\": \"<string>\",\n \"isActive\": 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://inbound.new/api/e2/email-addresses")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"address\": \"<string>\",\n \"domainId\": \"<string>\",\n \"endpointId\": \"<string>\",\n \"webhookId\": \"<string>\",\n \"isActive\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://inbound.new/api/e2/email-addresses")
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 \"address\": \"<string>\",\n \"domainId\": \"<string>\",\n \"endpointId\": \"<string>\",\n \"webhookId\": \"<string>\",\n \"isActive\": true\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"address": "<string>",
"domainId": "<string>",
"webhookId": "<string>",
"endpointId": "<string>",
"isActive": true,
"isReceiptRuleConfigured": true,
"receiptRuleName": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"userId": "<string>",
"domain": {
"id": "<string>",
"name": "<string>",
"status": "<string>"
},
"routing": {
"id": "<string>",
"name": "<string>",
"isActive": true,
"config": "<unknown>"
},
"warning": "<string>"
}{
"error": "<string>",
"code": "<string>",
"required": [
"<string>"
]
}{
"error": "<string>",
"code": "<string>",
"required": [
"<string>"
]
}{
"error": "<string>",
"code": "<string>",
"required": [
"<string>"
]
}{
"error": "<string>",
"code": "<string>",
"required": [
"<string>"
]
}{
"error": "<string>",
"code": "<string>",
"required": [
"<string>"
]
}Authorizations
Your Inbound API key. Include it in the Authorization header as: Bearer
Body
application/jsonapplication/x-www-form-urlencodedmultipart/form-data
Response
Response for status 201
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Was this page helpful?
⌘I