import { CommuneClient } from 'commune-ai';
const commune = new CommuneClient({ apiKey: process.env.COMMUNE_API_KEY });
const updated = await commune.inboxes.setWebhook(
'domain_xyz789',
'3d4f5a6b-7c8d-9e0f-a1b2-c3d4e5f6a7b8',
{
endpoint: 'https://myapp.com/webhooks/email',
events: ['inbound'],
}
);
console.log(updated.data.webhook.endpoint);
from commune import CommuneClient
client = CommuneClient()
updated = client.inboxes.set_webhook(
domain_id="domain_xyz789",
inbox_id="3d4f5a6b-7c8d-9e0f-a1b2-c3d4e5f6a7b8",
endpoint="https://myapp.com/webhooks/email",
events=["inbound"],
)
print(updated.data.webhook.endpoint)
update_inbox(
domain_id="domain_xyz789",
inbox_id="3d4f5a6b-7c8d-9e0f-a1b2-c3d4e5f6a7b8",
webhook_endpoint="https://myapp.com/webhooks/email",
webhook_events=["inbound"]
)
curl -X PUT "https://api.commune.email/v1/domains/domain_xyz789/inboxes/3d4f5a6b-7c8d-9e0f-a1b2-c3d4e5f6a7b8" \
-H "Authorization: Bearer comm_..." \
-H "Content-Type: application/json" \
-d '{
"webhook": {
"endpoint": "https://myapp.com/webhooks/email",
"events": ["inbound"]
}
}'
commune inboxes update 3d4f5a6b-7c8d-9e0f-a1b2-c3d4e5f6a7b8 \
--webhook-endpoint "https://myapp.com/webhooks/email" \
--webhook-events inbound
{
"data": {
"id": "3d4f5a6b-7c8d-9e0f-a1b2-c3d4e5f6a7b8",
"localPart": "support",
"address": "support@mycompany.com",
"displayName": "Support Agent",
"webhook": {
"endpoint": "https://myapp.com/webhooks/email",
"events": ["inbound"],
"secret": "whsec_abc123..."
},
"status": "active",
"createdAt": "2026-02-25T10:00:00.000Z"
}
}
{
"error": "Missing required field: local_part"
}
{
"error": "Inbox not found"
}
{
"error": "unauthorized",
"message": "Invalid or missing API key"
}
Inboxes
Update inbox
Update an inbox’s local part, webhook configuration, or status.
PUT
/
v1
/
domains
/
:domainId
/
inboxes
/
:inboxId
import { CommuneClient } from 'commune-ai';
const commune = new CommuneClient({ apiKey: process.env.COMMUNE_API_KEY });
const updated = await commune.inboxes.setWebhook(
'domain_xyz789',
'3d4f5a6b-7c8d-9e0f-a1b2-c3d4e5f6a7b8',
{
endpoint: 'https://myapp.com/webhooks/email',
events: ['inbound'],
}
);
console.log(updated.data.webhook.endpoint);
from commune import CommuneClient
client = CommuneClient()
updated = client.inboxes.set_webhook(
domain_id="domain_xyz789",
inbox_id="3d4f5a6b-7c8d-9e0f-a1b2-c3d4e5f6a7b8",
endpoint="https://myapp.com/webhooks/email",
events=["inbound"],
)
print(updated.data.webhook.endpoint)
update_inbox(
domain_id="domain_xyz789",
inbox_id="3d4f5a6b-7c8d-9e0f-a1b2-c3d4e5f6a7b8",
webhook_endpoint="https://myapp.com/webhooks/email",
webhook_events=["inbound"]
)
curl -X PUT "https://api.commune.email/v1/domains/domain_xyz789/inboxes/3d4f5a6b-7c8d-9e0f-a1b2-c3d4e5f6a7b8" \
-H "Authorization: Bearer comm_..." \
-H "Content-Type: application/json" \
-d '{
"webhook": {
"endpoint": "https://myapp.com/webhooks/email",
"events": ["inbound"]
}
}'
commune inboxes update 3d4f5a6b-7c8d-9e0f-a1b2-c3d4e5f6a7b8 \
--webhook-endpoint "https://myapp.com/webhooks/email" \
--webhook-events inbound
{
"data": {
"id": "3d4f5a6b-7c8d-9e0f-a1b2-c3d4e5f6a7b8",
"localPart": "support",
"address": "support@mycompany.com",
"displayName": "Support Agent",
"webhook": {
"endpoint": "https://myapp.com/webhooks/email",
"events": ["inbound"],
"secret": "whsec_abc123..."
},
"status": "active",
"createdAt": "2026-02-25T10:00:00.000Z"
}
}
{
"error": "Missing required field: local_part"
}
{
"error": "Inbox not found"
}
{
"error": "unauthorized",
"message": "Invalid or missing API key"
}
import { CommuneClient } from 'commune-ai';
const commune = new CommuneClient({ apiKey: process.env.COMMUNE_API_KEY });
const updated = await commune.inboxes.setWebhook(
'domain_xyz789',
'3d4f5a6b-7c8d-9e0f-a1b2-c3d4e5f6a7b8',
{
endpoint: 'https://myapp.com/webhooks/email',
events: ['inbound'],
}
);
console.log(updated.data.webhook.endpoint);
from commune import CommuneClient
client = CommuneClient()
updated = client.inboxes.set_webhook(
domain_id="domain_xyz789",
inbox_id="3d4f5a6b-7c8d-9e0f-a1b2-c3d4e5f6a7b8",
endpoint="https://myapp.com/webhooks/email",
events=["inbound"],
)
print(updated.data.webhook.endpoint)
update_inbox(
domain_id="domain_xyz789",
inbox_id="3d4f5a6b-7c8d-9e0f-a1b2-c3d4e5f6a7b8",
webhook_endpoint="https://myapp.com/webhooks/email",
webhook_events=["inbound"]
)
curl -X PUT "https://api.commune.email/v1/domains/domain_xyz789/inboxes/3d4f5a6b-7c8d-9e0f-a1b2-c3d4e5f6a7b8" \
-H "Authorization: Bearer comm_..." \
-H "Content-Type: application/json" \
-d '{
"webhook": {
"endpoint": "https://myapp.com/webhooks/email",
"events": ["inbound"]
}
}'
commune inboxes update 3d4f5a6b-7c8d-9e0f-a1b2-c3d4e5f6a7b8 \
--webhook-endpoint "https://myapp.com/webhooks/email" \
--webhook-events inbound
{
"data": {
"id": "3d4f5a6b-7c8d-9e0f-a1b2-c3d4e5f6a7b8",
"localPart": "support",
"address": "support@mycompany.com",
"displayName": "Support Agent",
"webhook": {
"endpoint": "https://myapp.com/webhooks/email",
"events": ["inbound"],
"secret": "whsec_abc123..."
},
"status": "active",
"createdAt": "2026-02-25T10:00:00.000Z"
}
}
{
"error": "Missing required field: local_part"
}
{
"error": "Inbox not found"
}
{
"error": "unauthorized",
"message": "Invalid or missing API key"
}
Path Parameters
string
required
The domain ID the inbox belongs to.
string
required
The inbox ID (UUID) to update.
Body
All body fields are optional. Only provided fields are updated; others retain their existing values.string
New local part for the inbox address. Accepts either
local_part or localPart.object
string
New inbox status. Example values:
"active", "inactive".Response
object
The updated inbox object. Same shape as Get inbox.
Hide properties
Hide properties
string
Inbox ID (unchanged).
string
Updated local part of the inbox address.
string
Full email address of the inbox.
string
Display name shown in outbound
From headers.object
string
Current inbox status.
string
ISO 8601 creation timestamp.
Last modified on March 19, 2026
Was this page helpful?

