curl --request POST \
--url https://api.example.com/v2/mailboxes \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"email": "jsmith@example.com",
"name": "<string>",
"is_centralized_inbox": false
}
'import requests
url = "https://api.example.com/v2/mailboxes"
payload = {
"email": "jsmith@example.com",
"name": "<string>",
"is_centralized_inbox": False
}
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({email: 'jsmith@example.com', name: '<string>', is_centralized_inbox: false})
};
fetch('https://api.example.com/v2/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://api.example.com/v2/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([
'email' => 'jsmith@example.com',
'name' => '<string>',
'is_centralized_inbox' => false
]),
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.example.com/v2/mailboxes"
payload := strings.NewReader("{\n \"email\": \"jsmith@example.com\",\n \"name\": \"<string>\",\n \"is_centralized_inbox\": false\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.example.com/v2/mailboxes")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"jsmith@example.com\",\n \"name\": \"<string>\",\n \"is_centralized_inbox\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v2/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 \"email\": \"jsmith@example.com\",\n \"name\": \"<string>\",\n \"is_centralized_inbox\": false\n}"
response = http.request(request)
puts response.read_body{
"created_at": "2023-11-07T05:31:56Z",
"modified_at": "2023-11-07T05:31:56Z",
"id": "<string>",
"email": "<string>",
"email_aliases": [
"<string>"
],
"name": "<string>",
"provider": "<string>",
"permission_type": "delegated",
"is_shared": true,
"is_centralized_inbox": true,
"status": "connected",
"archived_at": "2023-11-07T05:31:56Z",
"user_id": "<string>",
"signature_html": "<string>",
"reply_to": "<string>",
"object": "<string>",
"uses_legacy_entra_app": true
}{
"type": "request-validation",
"status": 422,
"title": "<string>",
"errors": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
],
"detail": "<string>"
}Create a Shared Mailbox
Creates an application-permission shared mailbox. Mints a Nylas grant via /v3/connect/custom using the organization’s configured Microsoft credential. Requires admin consent to already be in place.
curl --request POST \
--url https://api.example.com/v2/mailboxes \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"email": "jsmith@example.com",
"name": "<string>",
"is_centralized_inbox": false
}
'import requests
url = "https://api.example.com/v2/mailboxes"
payload = {
"email": "jsmith@example.com",
"name": "<string>",
"is_centralized_inbox": False
}
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({email: 'jsmith@example.com', name: '<string>', is_centralized_inbox: false})
};
fetch('https://api.example.com/v2/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://api.example.com/v2/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([
'email' => 'jsmith@example.com',
'name' => '<string>',
'is_centralized_inbox' => false
]),
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.example.com/v2/mailboxes"
payload := strings.NewReader("{\n \"email\": \"jsmith@example.com\",\n \"name\": \"<string>\",\n \"is_centralized_inbox\": false\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.example.com/v2/mailboxes")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"jsmith@example.com\",\n \"name\": \"<string>\",\n \"is_centralized_inbox\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v2/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 \"email\": \"jsmith@example.com\",\n \"name\": \"<string>\",\n \"is_centralized_inbox\": false\n}"
response = http.request(request)
puts response.read_body{
"created_at": "2023-11-07T05:31:56Z",
"modified_at": "2023-11-07T05:31:56Z",
"id": "<string>",
"email": "<string>",
"email_aliases": [
"<string>"
],
"name": "<string>",
"provider": "<string>",
"permission_type": "delegated",
"is_shared": true,
"is_centralized_inbox": true,
"status": "connected",
"archived_at": "2023-11-07T05:31:56Z",
"user_id": "<string>",
"signature_html": "<string>",
"reply_to": "<string>",
"object": "<string>",
"uses_legacy_entra_app": true
}{
"type": "request-validation",
"status": 422,
"title": "<string>",
"errors": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
],
"detail": "<string>"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
Create an application-permission shared mailbox.
Mints a Nylas grant via /v3/connect/custom using the org's configured Microsoft credential. Requires admin consent to be in place.
Response
Successful Response
The account's email.
Email owner's name.
Mail provider — 'microsoft', 'google', 'imap', 'sendgrid', etc.
How this mailbox was authenticated (delegated vs application).
delegated, application Whether this email sender should be shared with the entire organization
Whether this sender is a centralized inbox that accepts net-new inbound emails for routing
Computed connection health. CONNECTED, EXPIRED, or DISCONNECTED.
connected, expired, disconnected When the mailbox was disconnected from Stuut. Kept around for historical email attribution rather than deleted.
Owning user. NULL for shared mailboxes.
Email signature html.
This account's default reply-to
String representing the object's type. Objects of the same type share the same value.
True when this Microsoft mailbox's grant was minted against the legacy Entra app and must be re-authenticated to migrate onto the current app.
