curl --request POST \
--url https://api.openmail.sh/v1/inboxes \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"mailboxName": "<string>",
"displayName": "<string>",
"domain": "<string>",
"webhookUrl": "<string>",
"forwardTo": "jsmith@example.com",
"podId": "<string>"
}
'import requests
url = "https://api.openmail.sh/v1/inboxes"
payload = {
"mailboxName": "<string>",
"displayName": "<string>",
"domain": "<string>",
"webhookUrl": "<string>",
"forwardTo": "jsmith@example.com",
"podId": "<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({
mailboxName: '<string>',
displayName: '<string>',
domain: '<string>',
webhookUrl: '<string>',
forwardTo: 'jsmith@example.com',
podId: '<string>'
})
};
fetch('https://api.openmail.sh/v1/inboxes', 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://api.openmail.sh/v1/inboxes",
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([
'mailboxName' => '<string>',
'displayName' => '<string>',
'domain' => '<string>',
'webhookUrl' => '<string>',
'forwardTo' => 'jsmith@example.com',
'podId' => '<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://api.openmail.sh/v1/inboxes"
payload := strings.NewReader("{\n \"mailboxName\": \"<string>\",\n \"displayName\": \"<string>\",\n \"domain\": \"<string>\",\n \"webhookUrl\": \"<string>\",\n \"forwardTo\": \"jsmith@example.com\",\n \"podId\": \"<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://api.openmail.sh/v1/inboxes")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"mailboxName\": \"<string>\",\n \"displayName\": \"<string>\",\n \"domain\": \"<string>\",\n \"webhookUrl\": \"<string>\",\n \"forwardTo\": \"jsmith@example.com\",\n \"podId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.openmail.sh/v1/inboxes")
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 \"mailboxName\": \"<string>\",\n \"displayName\": \"<string>\",\n \"domain\": \"<string>\",\n \"webhookUrl\": \"<string>\",\n \"forwardTo\": \"jsmith@example.com\",\n \"podId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"podId": "<string>",
"address": "jsmith@example.com",
"displayName": "<string>",
"webhookUrl": "<string>",
"webhookSecret": "<string>",
"forwardTo": "<string>",
"forwardWhen": "always",
"forwardStatus": "pending",
"createdAt": "2023-11-07T05:31:56Z"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}Create inbox
Create a new email inbox. Optionally set a sender display name.
curl --request POST \
--url https://api.openmail.sh/v1/inboxes \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"mailboxName": "<string>",
"displayName": "<string>",
"domain": "<string>",
"webhookUrl": "<string>",
"forwardTo": "jsmith@example.com",
"podId": "<string>"
}
'import requests
url = "https://api.openmail.sh/v1/inboxes"
payload = {
"mailboxName": "<string>",
"displayName": "<string>",
"domain": "<string>",
"webhookUrl": "<string>",
"forwardTo": "jsmith@example.com",
"podId": "<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({
mailboxName: '<string>',
displayName: '<string>',
domain: '<string>',
webhookUrl: '<string>',
forwardTo: 'jsmith@example.com',
podId: '<string>'
})
};
fetch('https://api.openmail.sh/v1/inboxes', 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://api.openmail.sh/v1/inboxes",
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([
'mailboxName' => '<string>',
'displayName' => '<string>',
'domain' => '<string>',
'webhookUrl' => '<string>',
'forwardTo' => 'jsmith@example.com',
'podId' => '<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://api.openmail.sh/v1/inboxes"
payload := strings.NewReader("{\n \"mailboxName\": \"<string>\",\n \"displayName\": \"<string>\",\n \"domain\": \"<string>\",\n \"webhookUrl\": \"<string>\",\n \"forwardTo\": \"jsmith@example.com\",\n \"podId\": \"<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://api.openmail.sh/v1/inboxes")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"mailboxName\": \"<string>\",\n \"displayName\": \"<string>\",\n \"domain\": \"<string>\",\n \"webhookUrl\": \"<string>\",\n \"forwardTo\": \"jsmith@example.com\",\n \"podId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.openmail.sh/v1/inboxes")
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 \"mailboxName\": \"<string>\",\n \"displayName\": \"<string>\",\n \"domain\": \"<string>\",\n \"webhookUrl\": \"<string>\",\n \"forwardTo\": \"jsmith@example.com\",\n \"podId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"podId": "<string>",
"address": "jsmith@example.com",
"displayName": "<string>",
"webhookUrl": "<string>",
"webhookSecret": "<string>",
"forwardTo": "<string>",
"forwardWhen": "always",
"forwardStatus": "pending",
"createdAt": "2023-11-07T05:31:56Z"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
Inbox local part (default: random)
3 - 30Sender display name shown in the From header
200Domain for the inbox address. Defaults to your account domain (e.g. openmail.sh). Pass a verified custom domain you own to create the inbox on it (e.g. agent-mail.example.com). The domain must already be added and verified for your account; the account default never switches automatically.
URL to receive signed webhook events for this inbox (e.g. inbound mail). Overrides the account-level webhook for this inbox only. A signing secret is generated and returned once in the response body.
Email address that receives a copy of inbound messages, e.g. your own Gmail. Members of your organisation are confirmed at once; any other address is emailed a confirmation link and nothing is forwarded until they click it (forwardStatus is pending meanwhile). Spam and bulk mail are never forwarded. Replies go to the original sender.
When to forward. always (default); needs_human only mail the agent should not auto-handle (autoReplyable false); webhook_failed only once webhook delivery has exhausted its retries or there was no webhook or WebSocket to deliver to.
always, needs_human, webhook_failed Pod to create the inbox in. Accepts the pod ID or your own clientId. Omit to place the inbox in your account's default pod.
Response
Inbox created
Inbox created
OpenMail inbox ID
ID of the pod this inbox belongs to. Inboxes created without an explicit pod land in your account's default pod.
Full email address
Sender display name
URL that receives signed webhook events for this inbox, if set. Overrides the account-level webhook for this inbox only.
Signing secret for this inbox's webhook. Only present in the response when the secret is generated or rotated (on create, on first setting a webhook URL, or via the rotate-secret endpoint) — it is never returned afterward.
Address that receives copies of this inbox's inbound mail, if set.
Which inbound mail is forwarded. Null when forwarding is not set.
always, needs_human, webhook_failed, null pending until the address confirms via the emailed link (members of your organisation are confirmed at once); active once copies are flowing; disabled when forwarding paused itself after the address hard-bounced repeatedly or complained — set forwardTo again to resume. Null when forwarding is not set.
pending, active, disabled, null Was this page helpful?