Messaging Settings API
- Base URL:
https://email-settings.sls.epilot.io - Full API Docs: https://docs.epilot.io/api/email-settings
Usageโ
import { epilot } from '@epilot/sdk'
epilot.authorize(() => '<token>')
const { data } = await epilot.emailSettings.provisionEpilotEmailAddress(...)
Tree-shakeable importโ
import { getClient, authorize } from '@epilot/sdk/email-settings'
const emailSettingsClient = getClient()
authorize(emailSettingsClient, () => '<token>')
const { data } = await emailSettingsClient.provisionEpilotEmailAddress(...)
Operationsโ
Email addresses
provisionEpilotEmailAddresssetEmailAddressPrimarygetEmailAddressdeleteEmailAddressupdateEmailAddresslistEmailAddressesaddEmailAddress
Shared inboxes
Inbox buckets
O365 Outlook Connection
connectOutlookgetOutlookConnectionStatusgetCalendarAdminConsentStatusgetMyCalendarConnectiondisconnectMyCalendardisconnectOutlookconnectOutlookMailboxdisconnectOutlookMailboxstartMailboxSyncgetMailboxSyncStatusgetMailboxSyncEstimateretryMailboxSynccancelMailboxSyncgetConnectedOutlookEmailsoutlookOAuthCallback
Channels
Custom SMTP
listSmtpConnectionscreateSmtpConnectiongetSmtpConnectionupdateSmtpConnectiondeleteSmtpConnectiontestSmtpConnectionlistSmtpSendersconnectSmtpSenderdisconnectSmtpSender
Settings
Domains
Schemas
ConnectOutlookRequestMailboxSyncStatusMailboxSyncStatusesMailboxSyncFolderStatusesMailboxSyncEstimateMailboxSyncTimeframePeriodsInboxBucketResponseProvisionEpilotEmailAddressPayloadSetEmailAddressPrimaryPayloadUpdateEmailAddressPayloadCreateEmailAddressPayloadEmailAddressResponseOutlookDisconnectErrorErrorResponseSettingMetaUpdateSharedInboxPayloadCreateSharedInboxPayloadSharedInboxResponseSettingsResponseConnectedOutlookEmailOutlookConnectionErrorCalendarAdminConsentStatusMyCalendarConnectionResponseCalendarConnectionInfoOutlookConnectionStatusSmtpConnectionCreateSmtpConnectionRequestUpdateSmtpConnectionRequestSmtpSenderConnectSmtpSenderRequestSmtpTestResultSignatureSettingEmailDomainSettingEmailAddressSettingWhitelistEmailAddressSettingRestrictDuplicatesWithinSettingAllowedRecipientDomainsSettingAutoLinkIdentifierAttributesSettingAutoLinkIdentifierAttributeSettingTypeSettingDomain
provisionEpilotEmailAddressโ
Provisions or reactivates an epilot-managed email address for the organization.
PUT /v2/email-settings/email-addresses/epilot:provision
const { data } = await client.provisionEpilotEmailAddress(
null,
{
address: 'mycompany@epilot.cloud'
},
)
Response
{
"id": "a10bd0ff-4391-4cfc-88ee-b19d718a9bf7",
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-20T14:45:00Z",
"created_by": "user-123",
"updated_by": "user-456",
"address": "sales@yourcompany.com",
"name": "Sales Team",
"user_ids": ["user-123", "user-456"],
"group_ids": ["group-789"],
"default_signature_id": "sig-abc",
"shared_inbox_id": "inbox-xyz",
"is_active": true,
"is_primary": false,
"is_epilot_email_address": false,
"provider": "outlook"
}
setEmailAddressPrimaryโ
Sets the specified email address as the primary address for the organization.
POST /v2/email-settings/email-addresses/primary
const { data } = await client.setEmailAddressPrimary(
null,
{
address: 'sales@yourcompany.com'
},
)
Response
{
"id": "a10bd0ff-4391-4cfc-88ee-b19d718a9bf7",
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-20T14:45:00Z",
"created_by": "user-123",
"updated_by": "user-456",
"address": "sales@yourcompany.com",
"name": "Sales Team",
"user_ids": ["user-123", "user-456"],
"group_ids": ["group-789"],
"default_signature_id": "sig-abc",
"shared_inbox_id": "inbox-xyz",
"is_active": true,
"is_primary": false,
"is_epilot_email_address": false,
"provider": "outlook"
}
getEmailAddressโ
Retrieves the details of a specific email address by its ID.
GET /v2/email-settings/email-addresses/{id}
const { data } = await client.getEmailAddress({
id: '123e4567-e89b-12d3-a456-426614174000',
})
Response
{
"id": "a10bd0ff-4391-4cfc-88ee-b19d718a9bf7",
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-20T14:45:00Z",
"created_by": "user-123",
"updated_by": "user-456",
"address": "sales@yourcompany.com",
"name": "Sales Team",
"user_ids": ["user-123", "user-456"],
"group_ids": ["group-789"],
"default_signature_id": "sig-abc",
"shared_inbox_id": "inbox-xyz",
"is_active": true,
"is_primary": false,
"is_epilot_email_address": false,
"provider": "outlook"
}
deleteEmailAddressโ
Permanently deletes an email address from the organization.
DELETE /v2/email-settings/email-addresses/{id}
const { data } = await client.deleteEmailAddress({
id: '123e4567-e89b-12d3-a456-426614174000',
})
updateEmailAddressโ
Updates the configuration of an existing email address.
PUT /v2/email-settings/email-addresses/{id}
const { data } = await client.updateEmailAddress(
{
id: '123e4567-e89b-12d3-a456-426614174000',
},
{
name: 'Sales Team',
user_ids: ['user-123', 'user-456'],
group_ids: ['group-789'],
default_signature_id: 'sig-abc',
shared_inbox_id: 'inbox-xyz',
is_active: true
},
)
Response
{
"id": "a10bd0ff-4391-4cfc-88ee-b19d718a9bf7",
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-20T14:45:00Z",
"created_by": "user-123",
"updated_by": "user-456",
"address": "sales@yourcompany.com",
"name": "Sales Team",
"user_ids": ["user-123", "user-456"],
"group_ids": ["group-789"],
"default_signature_id": "sig-abc",
"shared_inbox_id": "inbox-xyz",
"is_active": true,
"is_primary": false,
"is_epilot_email_address": false,
"provider": "outlook"
}
listEmailAddressesโ
Retrieves all email addresses configured for the organization.
GET /v2/email-settings/email-addresses
const { data } = await client.listEmailAddresses()
Response
[
{
"id": "a10bd0ff-4391-4cfc-88ee-b19d718a9bf7",
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-20T14:45:00Z",
"created_by": "user-123",
"updated_by": "user-456",
"address": "sales@yourcompany.com",
"name": "Sales Team",
"user_ids": ["user-123", "user-456"],
"group_ids": ["group-789"],
"default_signature_id": "sig-abc",
"shared_inbox_id": "inbox-xyz",
"is_active": true,
"is_primary": false,
"is_epilot_email_address": false,
"provider": "outlook"
}
]
addEmailAddressโ
Adds a new email address to the organization.
POST /v2/email-settings/email-addresses
const { data } = await client.addEmailAddress(
null,
{
address: 'support@yourcompany.com',
name: 'Customer Support',
user_ids: ['user-123'],
group_ids: ['group-456'],
default_signature_id: 'sig-789',
shared_inbox_id: 'inbox-abc'
},
)
Response
{
"id": "a10bd0ff-4391-4cfc-88ee-b19d718a9bf7",
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-20T14:45:00Z",
"created_by": "user-123",
"updated_by": "user-456",
"address": "sales@yourcompany.com",
"name": "Sales Team",
"user_ids": ["user-123", "user-456"],
"group_ids": ["group-789"],
"default_signature_id": "sig-abc",
"shared_inbox_id": "inbox-xyz",
"is_active": true,
"is_primary": false,
"is_epilot_email_address": false,
"provider": "outlook"
}
getSharedInboxโ
Retrieves the details of a specific shared inbox by its ID.
GET /v2/email-settings/shared-inboxes/{id}
const { data } = await client.getSharedInbox({
id: '123e4567-e89b-12d3-a456-426614174000',
})
Response
{
"id": "a10bd0ff-4391-4cfc-88ee-b19d718a9bf7",
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-20T14:45:00Z",
"created_by": "user-123",
"updated_by": "user-456",
"name": "Customer Support",
"color": "#4CAF50",
"assignees": ["user-123", "user-456"],
"description": "Incoming customer support requests",
"bucket_id": "bucket-xyz"
}
deleteSharedInboxโ
Deletes a shared inbox and reroutes all associated emails to a successor inbox.
DELETE /v2/email-settings/shared-inboxes/{id}
const { data } = await client.deleteSharedInbox({
id: '123e4567-e89b-12d3-a456-426614174000',
successorInboxId: 'example',
})
updateSharedInboxโ
Updates the configuration of an existing shared inbox.
PUT /v2/email-settings/shared-inboxes/{id}
const { data } = await client.updateSharedInbox(
{
id: '123e4567-e89b-12d3-a456-426614174000',
},
{
color: '#4CAF50',
name: 'Customer Support',
assignees: ['user-123', 'user-456'],
description: 'Incoming customer support requests'
},
)
Response
{
"id": "a10bd0ff-4391-4cfc-88ee-b19d718a9bf7",
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-20T14:45:00Z",
"created_by": "user-123",
"updated_by": "user-456",
"name": "Customer Support",
"color": "#4CAF50",
"assignees": ["user-123", "user-456"],
"description": "Incoming customer support requests",
"bucket_id": "bucket-xyz"
}
listSharedInboxesโ
Retrieves all shared inboxes configured for the organization.
GET /v2/email-settings/shared-inboxes
const { data } = await client.listSharedInboxes()
Response
[
{
"id": "a10bd0ff-4391-4cfc-88ee-b19d718a9bf7",
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-20T14:45:00Z",
"created_by": "user-123",
"updated_by": "user-456",
"name": "Customer Support",
"color": "#4CAF50",
"assignees": ["user-123", "user-456"],
"description": "Incoming customer support requests",
"bucket_id": "bucket-xyz"
}
]
addSharedInboxโ
Creates a new shared inbox for the organization.
POST /v2/email-settings/shared-inboxes
const { data } = await client.addSharedInbox(
null,
{
id: 'support-inbox',
color: '#2196F3',
name: 'Sales Inquiries',
assignees: ['user-123', 'user-456'],
description: 'Inbound sales and pricing requests'
},
)
Response
{
"id": "a10bd0ff-4391-4cfc-88ee-b19d718a9bf7",
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-20T14:45:00Z",
"created_by": "user-123",
"updated_by": "user-456",
"name": "Customer Support",
"color": "#4CAF50",
"assignees": ["user-123", "user-456"],
"description": "Incoming customer support requests",
"bucket_id": "bucket-xyz"
}
listInboxBucketsโ
Retrieves all inbox buckets for the organization.
GET /v2/email-settings/inbox-buckets
const { data } = await client.listInboxBuckets()
Response
[
{
"id": "bucket-abc",
"inbox_id": "inbox-xyz"
}
]
connectOutlookโ
Returns the Microsoft authorization URL for Outlook OAuth.
POST /v2/outlook/connect
const { data } = await client.connectOutlook(
null,
{
mail: true,
calendar: true,
return_to: 'string'
},
)
Response
{
"authorization_url": "string"
}
getOutlookConnectionStatusโ
Returns all Microsoft 365 / Outlook connections for the organization. Supports multiple connections (one per Azure AD tenant).
GET /v2/outlook/connection/status
const { data } = await client.getOutlookConnectionStatus()
Response
{
"connections": [
{
"status": "connected",
"action": "connect",
"action_reason": "expired",
"connected_by_display_name": "string",
"connected_by_email": "user@example.com",
"connected_by_user_id": "string",
"connected_at": "1970-01-01T00:00:00.000Z",
"updated_at": "1970-01-01T00:00:00.000Z",
"tenant_id": "string",
"scopes": ["string"],
"expires_at": "1970-01-01T00:00:00.000Z",
"is_token_valid": true
}
],
"has_connections": true,
"teams_enabled": true
}
getCalendarAdminConsentStatusโ
Reports whether the caller's organization can connect personal Outlook calendars.
GET /v2/outlook/calendar/admin-consent-status
const { data } = await client.getCalendarAdminConsentStatus()
Response
{
"admin_consented": true,
"admin_consent_url": "https://example.com/path"
}
getMyCalendarConnectionโ
Returns the calling user's personal Outlook calendar connection, or null when the user hasn't connected yet.
GET /v2/outlook/calendar/me
const { data } = await client.getMyCalendarConnection()
Response
{
"connection": {
"user_id": "string",
"tenant_id": "string",
"status": "connected",
"scopes": ["string"],
"connected_by_display_name": "string",
"connected_by_email": "user@example.com",
"connected_at": "1970-01-01T00:00:00.000Z",
"updated_at": "1970-01-01T00:00:00.000Z",
"expires_at": "1970-01-01T00:00:00.000Z"
}
}
disconnectMyCalendarโ
Removes the calling user's personal calendar connection.
DELETE /v2/outlook/calendar/me
const { data } = await client.disconnectMyCalendar()
disconnectOutlookโ
Removes the Microsoft 365 / Outlook connection for a specific tenant. This deletes the stored tokens and disconnects the integration.
POST /v2/outlook/connection/disconnect
const { data } = await client.disconnectOutlook(
null,
{
tenant_id: 'string'
},
)
Response
{
"success": true,
"tenant_id": "string",
"affected_shared_inboxes": ["string"]
}
connectMsTeamsโ
Connects Microsoft Teams channel (click-to-call deep links, meetings) for the organization. Independent of the Microsoft 365 / Outlook connection.
POST /v2/channels/msteams/connect
const { data } = await client.connectMsTeams()
Response
{
"connected": true,
"connected_at": "1970-01-01T00:00:00.000Z"
}
disconnectMsTeamsโ
Disconnects Microsoft Teams channel for the organization.
POST /v2/channels/msteams/disconnect
const { data } = await client.disconnectMsTeams()
Response
{
"connected": true
}
getMsTeamsStatusโ
Returns the connection status of the Microsoft Teams channel for the organization.
GET /v2/channels/msteams/status
const { data } = await client.getMsTeamsStatus()
Response
{
"connected": true,
"connected_at": "1970-01-01T00:00:00.000Z",
"connected_by_user_id": "string"
}
connectOutlookMailboxโ
Connects an Outlook mailbox:
- Validates the user has access to the mailbox via Microsoft Graph API
- Creates a mapping between the email address of the mailbox and the outlook connection
- E
POST /v2/outlook/mailbox/connect
const { data } = await client.connectOutlookMailbox(
null,
{
email: 'user@example.com',
shared_inbox_id: 'default',
name: 'string',
user_ids: ['string'],
group_ids: ['string'],
default_signature_id: 'string',
mailboxSyncTimeframe: '5m'
},
)
Response
{
"email_address": {
"id": "a10bd0ff-4391-4cfc-88ee-b19d718a9bf7",
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-20T14:45:00Z",
"created_by": "user-123",
"updated_by": "user-456",
"address": "sales@yourcompany.com",
"name": "Sales Team",
"user_ids": ["user-123", "user-456"],
"group_ids": ["group-789"],
"default_signature_id": "sig-abc",
"shared_inbox_id": "inbox-xyz",
"is_active": true,
"is_primary": false,
"is_epilot_email_address": false,
"provider": "outlook"
},
"outlook_email": "user@example.com",
"tenant_id": "string",
"provider": "outlook"
}
disconnectOutlookMailboxโ
Disconnect Outlook Mailbox
POST /v2/outlook/mailbox/{email}/disconnect
const { data } = await client.disconnectOutlookMailbox({
email: 'example',
})
Response
{
"success": true,
"email": "user@example.com"
}
startMailboxSyncโ
Start Mailbox Sync
POST /v2/outlook/mailbox/{email}/sync
const { data } = await client.startMailboxSync(
{
email: 'example',
},
{
timeframe: '5m',
since: '1970-01-01T00:00:00.000Z'
},
)
getMailboxSyncStatusโ
Get Mailbox Sync Status
GET /v2/outlook/mailbox/{email}/sync/status
const { data } = await client.getMailboxSyncStatus({
email: 'example',
})
Response
{
"execution_id": "string",
"status": "RUNNING",
"timeframe": "5m",
"timeframe_start": "1970-01-01T00:00:00.000Z",
"started_at": "1970-01-01T00:00:00.000Z",
"completed_at": "1970-01-01T00:00:00.000Z",
"inbox": {
"status": "PENDING",
"total_messages": 0,
"processed_messages": 0,
"failed_messages": 0
},
"sent_items": {
"status": "PENDING",
"total_messages": 0,
"processed_messages": 0,
"failed_messages": 0
}
}
getMailboxSyncEstimateโ
Estimate Mailbox Sync
GET /v2/outlook/mailbox/{email}/sync/estimate
const { data } = await client.getMailboxSyncEstimate({
email: 'example',
timeframes: 'example',
since: 'example',
})
Response
{
"estimates": [
{
"timeframe": "5m",
"since": "1970-01-01T00:00:00.000Z",
"inbox_messages": 0,
"sent_messages": 0,
"total_messages": 0,
"estimated_duration_seconds": 0
}
]
}
retryMailboxSyncโ
Retry Failed Messages
POST /v2/outlook/mailbox/{email}/sync/retry
const { data } = await client.retryMailboxSync(
{
email: 'example',
},
{
sync_id: 'string',
scope: 'all_failed',
message_ids: ['string']
},
)
cancelMailboxSyncโ
Stop Mailbox Sync
POST /v2/outlook/mailbox/{email}/sync/cancel
const { data } = await client.cancelMailboxSync({
email: 'example',
})
Response
{
"execution_id": "string",
"status": "RUNNING"
}
getConnectedOutlookEmailsโ
Returns all Outlook email addresses connected to the organization.
GET /v2/outlook/mailbox/mappings
const { data } = await client.getConnectedOutlookEmails()
Response
{
"outlook_emails": [
{
"outlook_email": "user@example.com",
"tenant_id": "string",
"provider": "outlook",
"connected_at": "1970-01-01T00:00:00.000Z",
"connected_by_user_id": "string"
}
],
"count": 0
}
listSmtpConnectionsโ
Returns all custom SMTP connections configured for the organization. Passwords are never returned.
GET /v2/smtp/connections
const { data } = await client.listSmtpConnections()
Response
{
"connections": [
{
"connection_id": "string",
"smtp_host": "string",
"smtp_port": "string",
"smtp_secure": "tls",
"smtp_username": "string",
"smtp_password": "string",
"connected_by_display_name": "string",
"connected_by_email": "user@example.com",
"connected_by_user_id": "string",
"connected_at": "1970-01-01T00:00:00.000Z",
"updated_at": "1970-01-01T00:00:00.000Z",
"last_tested_at": "1970-01-01T00:00:00.000Z",
"last_test_status": "ok",
"last_test_error": "string"
}
],
"has_connections": true
}
createSmtpConnectionโ
Creates a new custom SMTP connection. Runs a live verify against the SMTP server
before persisting; on failure the request is rejected and nothing is saved. Pass
skip_test=true to store the configur
POST /v2/smtp/connections
const { data } = await client.createSmtpConnection(
{
skip_test: true,
},
{
smtp_host: 'string',
smtp_port: 'string',
smtp_secure: 'tls',
smtp_username: 'string',
smtp_password: '{{ env.smtp_password }}'
},
)
Response
{
"connection_id": "string",
"smtp_host": "string",
"smtp_port": "string",
"smtp_secure": "tls",
"smtp_username": "string",
"smtp_password": "string",
"connected_by_display_name": "string",
"connected_by_email": "user@example.com",
"connected_by_user_id": "string",
"connected_at": "1970-01-01T00:00:00.000Z",
"updated_at": "1970-01-01T00:00:00.000Z",
"last_tested_at": "1970-01-01T00:00:00.000Z",
"last_test_status": "ok",
"last_test_error": "string"
}
getSmtpConnectionโ
Returns a single custom SMTP connection by id. The password is never returned.
GET /v2/smtp/connections/{connectionId}
const { data } = await client.getSmtpConnection({
connectionId: 'example',
})
Response
{
"connection_id": "string",
"smtp_host": "string",
"smtp_port": "string",
"smtp_secure": "tls",
"smtp_username": "string",
"smtp_password": "string",
"connected_by_display_name": "string",
"connected_by_email": "user@example.com",
"connected_by_user_id": "string",
"connected_at": "1970-01-01T00:00:00.000Z",
"updated_at": "1970-01-01T00:00:00.000Z",
"last_tested_at": "1970-01-01T00:00:00.000Z",
"last_test_status": "ok",
"last_test_error": "string"
}
updateSmtpConnectionโ
Partial update; omitted fields keep their existing values. The merged
configuration is verified against the SMTP server before persisting. Pass
skip_test=true to store it untested instead, which als
PUT /v2/smtp/connections/{connectionId}
const { data } = await client.updateSmtpConnection(
{
connectionId: 'example',
skip_test: true,
},
{
smtp_host: 'string',
smtp_port: 'string',
smtp_secure: 'tls',
smtp_username: 'string',
smtp_password: 'string'
},
)
Response
{
"connection_id": "string",
"smtp_host": "string",
"smtp_port": "string",
"smtp_secure": "tls",
"smtp_username": "string",
"smtp_password": "string",
"connected_by_display_name": "string",
"connected_by_email": "user@example.com",
"connected_by_user_id": "string",
"connected_at": "1970-01-01T00:00:00.000Z",
"updated_at": "1970-01-01T00:00:00.000Z",
"last_tested_at": "1970-01-01T00:00:00.000Z",
"last_test_status": "ok",
"last_test_error": "string"
}
deleteSmtpConnectionโ
Deletes a custom SMTP connection. Messages already sent are unaffected.
DELETE /v2/smtp/connections/{connectionId}
const { data } = await client.deleteSmtpConnection({
connectionId: 'example',
})
Response
{
"success": true,
"connection_id": "string"
}
testSmtpConnectionโ
Re-runs a live SMTP verify against the saved configuration (EHLO + AUTH + NOOP + QUIT)
and updates last_test_status / last_tested_at on the connection.
POST /v2/smtp/connections/{connectionId}/test
const { data } = await client.testSmtpConnection({
connectionId: 'example',
})
Response
{
"status": "ok",
"error": "string",
"tested_at": "1970-01-01T00:00:00.000Z"
}
listSmtpSendersโ
Returns every address registered to send through a custom SMTP connection.
GET /v2/smtp/senders
const { data } = await client.listSmtpSenders()
Response
{
"senders": [
{
"email": "user@example.com",
"connection_id": "string",
"reply_to_email": "string",
"connected_at": "1970-01-01T00:00:00.000Z",
"connected_by_user_id": "string"
}
]
}
connectSmtpSenderโ
Registers an address as a sender on a custom SMTP connection:
- Creates the email address so it can be picked in the composer
- Binds it to the connection, so outgoing mail from it is routed the
POST /v2/smtp/senders
const { data } = await client.connectSmtpSender(
null,
{
email: 'user@example.com',
connection_id: 'string',
name: 'string',
reply_to_email: 'string',
shared_inbox_id: 'default',
user_ids: ['string'],
group_ids: ['string'],
default_signature_id: 'string'
},
)
Response
{
"email_address": {
"id": "a10bd0ff-4391-4cfc-88ee-b19d718a9bf7",
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-20T14:45:00Z",
"created_by": "user-123",
"updated_by": "user-456",
"address": "sales@yourcompany.com",
"name": "Sales Team",
"user_ids": ["user-123", "user-456"],
"group_ids": ["group-789"],
"default_signature_id": "sig-abc",
"shared_inbox_id": "inbox-xyz",
"is_active": true,
"is_primary": false,
"is_epilot_email_address": false,
"provider": "outlook"
},
"sender": {
"email": "user@example.com",
"connection_id": "string",
"reply_to_email": "string",
"connected_at": "1970-01-01T00:00:00.000Z",
"connected_by_user_id": "string"
}
}
disconnectSmtpSenderโ
Removes a sender address: deletes the email address and its binding to the SMTP connection. The connection itself and messages already sent are unaffected.
DELETE /v2/smtp/senders/{email}
const { data } = await client.disconnectSmtpSender({
email: 'example',
})
Response
{
"success": true,
"email": "user@example.com"
}
outlookOAuthCallbackโ
Exchanges authorization code for tokens and stores them.
GET /v2/outlook/oauth/callback
const { data } = await client.outlookOAuthCallback({
code: 'example',
state: 'example',
session_state: 'example',
error: 'example',
error_description: 'example',
error_subcode: 'example',
client_info: 'example',
error_uri: 'example',
admin_consent: 'example',
tenant: 'example',
clientdata: 'example',
})
Response
{
"connected": true,
"expires_at": "1970-01-01T00:00:00.000Z",
"scope": "string"
}
getSettingsโ
Retrieves settings of a specific type for the organization.
GET /v1/email-settings
const { data } = await client.getSettings({
type: 'example',
id: '123e4567-e89b-12d3-a456-426614174000',
})
Response
[
{
"id": "a10bd0ff-4391-4cfc-88ee-b19d718a9bf7",
"name": "Default Signature",
"org_id": "org-123",
"type": "signature",
"value": "Best regards, The Team",
"html": "<p>Best regards,<br/><strong>The Team</strong></p>",
"schemas": {},
"excluded_senders": ["newsletter@partner.de", "@noreply.example.com"],
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-20T14:45:00Z",
"created_by": "user-123",
"updated_by": "user-456"
}
]
addSettingโ
Creates a new setting of the specified type.
POST /v1/email-settings
const { data } = await client.addSetting(
null,
{
id: 'a10bd0ff-4391-4cfc-88ee-b19d718a9bf7',
name: 'Default Signature',
org_id: 'org-123',
type: 'signature',
value: 'Best regards, The Team',
html: '<p>Best regards,<br/><strong>The Team</strong></p>',
schemas: {},
excluded_senders: ['newsletter@partner.de', '@noreply.example.com'],
created_at: '2024-01-15T10:30:00Z',
updated_at: '2024-01-20T14:45:00Z',
created_by: 'user-123',
updated_by: 'user-456'
},
)
Response
[
{
"id": "a10bd0ff-4391-4cfc-88ee-b19d718a9bf7",
"name": "Default Signature",
"org_id": "org-123",
"type": "signature",
"value": "Best regards, The Team",
"html": "<p>Best regards,<br/><strong>The Team</strong></p>",
"schemas": {},
"excluded_senders": ["newsletter@partner.de", "@noreply.example.com"],
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-20T14:45:00Z",
"created_by": "user-123",
"updated_by": "user-456"
}
]
deleteSettingโ
Deletes a setting by its ID and type.
DELETE /v1/email-settings
const { data } = await client.deleteSetting(
null,
{
type: 'signature',
id: 'a10bd0ff-4391-4cfc-88ee-b19d718a9bf7'
},
)
updateSettingโ
Updates an existing setting identified by its ID.
POST /v1/email-settings/{id}
const { data } = await client.updateSetting(
{
id: '123e4567-e89b-12d3-a456-426614174000',
},
{
id: 'a10bd0ff-4391-4cfc-88ee-b19d718a9bf7',
name: 'Default Signature',
org_id: 'org-123',
type: 'signature',
value: 'Best regards, The Team',
html: '<p>Best regards,<br/><strong>The Team</strong></p>',
schemas: {},
excluded_senders: ['newsletter@partner.de', '@noreply.example.com'],
created_at: '2024-01-15T10:30:00Z',
updated_at: '2024-01-20T14:45:00Z',
created_by: 'user-123',
updated_by: 'user-456'
},
)
Response
{
"id": "a10bd0ff-4391-4cfc-88ee-b19d718a9bf7",
"name": "Default Signature",
"org_id": "org-123",
"type": "signature",
"value": "Best regards, The Team",
"html": "<p>Best regards,<br/><strong>The Team</strong></p>",
"schemas": {},
"excluded_senders": ["newsletter@partner.de", "@noreply.example.com"],
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-20T14:45:00Z",
"created_by": "user-123",
"updated_by": "user-456"
}
addDomainโ
Adds a custom email domain to the organization.
POST /v1/email-settings/domain
const { data } = await client.addDomain(
null,
{
domain: 'mail.yourcompany.com'
},
)
Response
[
{
"id": "a10bd0ff-4391-4cfc-88ee-b19d718a9bf7",
"name": "Default Signature",
"org_id": "org-123",
"type": "signature",
"value": "Best regards, The Team",
"html": "<p>Best regards,<br/><strong>The Team</strong></p>",
"schemas": {},
"excluded_senders": ["newsletter@partner.de", "@noreply.example.com"],
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-20T14:45:00Z",
"created_by": "user-123",
"updated_by": "user-456"
}
]
deleteDomainโ
Removes a custom email domain from the organization.
DELETE /v1/email-settings/domain
const { data } = await client.deleteDomain(
null,
{
domain: 'mail.yourcompany.com'
},
)
getDomainsโ
Retrieves all custom email domains for the organization.
GET /v1/email-settings/domain
const { data } = await client.getDomains()
Response
["string"]
verifyNameServersโ
Verifies that the domain's name server (NS) records are correctly configured.
POST /v1/email-settings/domain/name-servers:verify
const { data } = await client.verifyNameServers(
null,
{
domain: 'mail.yourcompany.com'
},
)
Response
[
{
"id": "a10bd0ff-4391-4cfc-88ee-b19d718a9bf7",
"name": "Default Signature",
"org_id": "org-123",
"type": "signature",
"value": "Best regards, The Team",
"html": "<p>Best regards,<br/><strong>The Team</strong></p>",
"schemas": {},
"excluded_senders": ["newsletter@partner.de", "@noreply.example.com"],
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-20T14:45:00Z",
"created_by": "user-123",
"updated_by": "user-456"
}
]
verifyDnsRecordsโ
Verifies that the domain's DNS records (MX, TXT, CNAME) are correctly configured in the customer's DNS provider.
POST /v1/email-settings/domain/dns-records:verify
const { data } = await client.verifyDnsRecords(
null,
{
domain: 'mail.yourcompany.com'
},
)
Response
[
{
"id": "a10bd0ff-4391-4cfc-88ee-b19d718a9bf7",
"name": "Default Signature",
"org_id": "org-123",
"type": "signature",
"value": "Best regards, The Team",
"html": "<p>Best regards,<br/><strong>The Team</strong></p>",
"schemas": {},
"excluded_senders": ["newsletter@partner.de", "@noreply.example.com"],
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-20T14:45:00Z",
"created_by": "user-123",
"updated_by": "user-456"
}
]
verifyDomainโ
Verifies ownership and configuration of a custom email domain.
POST /v1/email-settings/domain:verify
const { data } = await client.verifyDomain(
null,
{
domain: 'mail.yourcompany.com'
},
)
Response
[
{
"id": "a10bd0ff-4391-4cfc-88ee-b19d718a9bf7",
"name": "Default Signature",
"org_id": "org-123",
"type": "signature",
"value": "Best regards, The Team",
"html": "<p>Best regards,<br/><strong>The Team</strong></p>",
"schemas": {},
"excluded_senders": ["newsletter@partner.de", "@noreply.example.com"],
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-20T14:45:00Z",
"created_by": "user-123",
"updated_by": "user-456"
}
]
Schemasโ
ConnectOutlookRequestโ
Feature flags selecting which Microsoft Graph scopes to request. At least one flag must be true. Passing a superset of previously granted features triggers incremental consent for the delta only.
type ConnectOutlookRequest = {
mail?: boolean
calendar?: boolean
return_to?: string
}
MailboxSyncStatusโ
type MailboxSyncStatus = {
execution_id: string
status: "RUNNING" | "COMPLETED" | "COMPLETED_WITH_ERRORS" | "FAILED" | "CANCELLED"
timeframe: "5m" | "1d" | "1w" | "2w" | "1m" | "3m" | "6m" | "1y" | "2y" | "custom"
timeframe_start?: string // date-time
started_at: string // date-time
completed_at?: string // date-time
inbox?: {
status?: "PENDING" | "RUNNING" | "COMPLETED" | "FAILED" | "SKIPPED"
total_messages?: number
processed_messages?: number
failed_messages?: number
}
sent_items?: {
status?: "PENDING" | "RUNNING" | "COMPLETED" | "FAILED" | "SKIPPED"
total_messages?: number
processed_messages?: number
failed_messages?: number
}
}
MailboxSyncStatusesโ
type MailboxSyncStatuses = "RUNNING" | "COMPLETED" | "COMPLETED_WITH_ERRORS" | "FAILED" | "CANCELLED"
MailboxSyncFolderStatusesโ
type MailboxSyncFolderStatuses = "PENDING" | "RUNNING" | "COMPLETED" | "FAILED" | "SKIPPED"
MailboxSyncEstimateโ
type MailboxSyncEstimate = {
timeframe: "5m" | "1d" | "1w" | "2w" | "1m" | "3m" | "6m" | "1y" | "2y" | "custom"
since: string // date-time
inbox_messages: number
sent_messages: number
total_messages: number
estimated_duration_seconds: number
}
MailboxSyncTimeframePeriodsโ
Mailbox sync period. custom is a sync started with an explicit since.
type MailboxSyncTimeframePeriods = "5m" | "1d" | "1w" | "2w" | "1m" | "3m" | "6m" | "1y" | "2y" | "custom"
InboxBucketResponseโ
Inbox bucket representing the storage container for a shared inbox.
type InboxBucketResponse = {
id: string
inbox_id: string
}
ProvisionEpilotEmailAddressPayloadโ
Request payload for provisioning an epilot-managed email address.
type ProvisionEpilotEmailAddressPayload = {
address: string
}
SetEmailAddressPrimaryPayloadโ
Request payload for setting an email address as the organization's primary address.
type SetEmailAddressPrimaryPayload = {
address: string
}
UpdateEmailAddressPayloadโ
Request payload for updating an email address configuration. All fields are optional; only provided fields will be updated.
type UpdateEmailAddressPayload = {
name?: string
user_ids?: string[]
group_ids?: string[]
default_signature_id?: string
shared_inbox_id?: string
is_active?: boolean
}
CreateEmailAddressPayloadโ
Request payload for creating a new email address.
type CreateEmailAddressPayload = {
address: string
name?: string
user_ids?: string[]
group_ids?: string[]
default_signature_id?: string
shared_inbox_id?: string
}
EmailAddressResponseโ
Email address configuration with all associated metadata.
type EmailAddressResponse = {
id: string
created_at: string // date-time
updated_at?: string // date-time
created_by?: string
updated_by?: string
address: string
name?: string
user_ids?: string[]
group_ids?: string[]
default_signature_id?: string
shared_inbox_id?: string
is_active?: boolean
is_primary?: boolean
is_epilot_email_address?: boolean
provider?: "outlook" | "smtp"
}
OutlookDisconnectErrorโ
Why an Outlook mailbox or connection was not disconnected. Nothing was removed.
type OutlookDisconnectError = {
error: "email_address_in_use" | "email_address_deletion_failed"
message: string
email_addresses?: string // email[]
}
ErrorResponseโ
Standard error response format for all API errors.
type ErrorResponse = {
error: string
status: number
}
SettingMetaโ
Common metadata fields for all settings and resources.
type SettingMeta = {
id: string
created_at: string // date-time
updated_at?: string // date-time
created_by?: string
updated_by?: string
}
UpdateSharedInboxPayloadโ
Request payload for updating a shared inbox configuration. All fields are optional; only provided fields will be updated.
type UpdateSharedInboxPayload = {
color?: string
name?: string
assignees?: string[]
description?: string
}
CreateSharedInboxPayloadโ
Request payload for creating a new shared inbox.
type CreateSharedInboxPayload = {
id?: string
color: string
name: string
assignees?: string[]
description?: string
}
SharedInboxResponseโ
Shared inbox configuration with all associated metadata.
type SharedInboxResponse = {
id: string
created_at: string // date-time
updated_at?: string // date-time
created_by?: string
updated_by?: string
name: string
color: string
assignees: string[]
description?: string
bucket_id: string
}
SettingsResponseโ
type SettingsResponse = Array<{
id?: string
name?: string
org_id?: string
type: "signature" | "email_domain" | "email_address" | "whitelist_email_address" | "restrict_duplicates_within" | "allowed_recipient_domains" | "auto_link_identifier_attributes"
value?: string
html?: string
schemas?: Record<string, Array<{
name: string
labels?: string[]
}>>
excluded_senders?: string[]
created_at?: string
updated_at?: string
created_by?: string
updated_by?: string
}> | {
id?: string
name?: string
org_id?: string
type: "signature" | "email_domain" | "email_address" | "whitelist_email_address" | "restrict_duplicates_within" | "allowed_recipient_domains" | "auto_link_identifier_attributes"
value?: string
html?: string
schemas?: Record<string, Array<{
name: string
labels?: string[]
}>>
excluded_senders?: string[]
created_at?: string
updated_at?: string
created_by?: string
updated_by?: string
}
ConnectedOutlookEmailโ
Mapping between an Outlook email and its Outlook Connection. This tracks which provider/tenant provisions each Outlook email.
type ConnectedOutlookEmail = {
outlook_email: string // email
tenant_id?: string
provider?: "outlook"
connected_at?: string // date-time
connected_by_user_id?: string
}
OutlookConnectionErrorโ
type OutlookConnectionError = {
error: string
error_description?: string
admin_consent_url?: string // uri
}
CalendarAdminConsentStatusโ
type CalendarAdminConsentStatus = {
admin_consented: boolean
admin_consent_url?: string // uri
}
MyCalendarConnectionResponseโ
Per-user calendar connection metadata, or null when the caller has not connected their personal calendar yet.
type MyCalendarConnectionResponse = {
connection?: {
user_id: string
tenant_id: string
status: "connected" | "expired"
scopes?: string[]
connected_by_display_name?: string
connected_by_email?: string // email
connected_at?: string // date-time
updated_at?: string // date-time
expires_at?: string // date-time
}
}
CalendarConnectionInfoโ
type CalendarConnectionInfo = {
user_id: string
tenant_id: string
status: "connected" | "expired"
scopes?: string[]
connected_by_display_name?: string
connected_by_email?: string // email
connected_at?: string // date-time
updated_at?: string // date-time
expires_at?: string // date-time
}
OutlookConnectionStatusโ
type OutlookConnectionStatus = {
status: "connected" | "expired" | "pending_auth" | "not_connected"
action: "connect" | "authorize" | "reconnect" | "none"
action_reason?: "expired" | "permission_update"
connected_by_display_name?: string
connected_by_email?: string // email
connected_by_user_id?: string
connected_at?: string // date-time
updated_at?: string // date-time
tenant_id: string
scopes?: string[]
expires_at?: string // date-time
is_token_valid?: boolean
}
SmtpConnectionโ
type SmtpConnection = {
connection_id: string
smtp_host: string
smtp_port: string
smtp_secure: "tls" | "starttls"
smtp_username: string
smtp_password?: string
connected_by_display_name?: string
connected_by_email?: string // email
connected_by_user_id?: string
connected_at?: string // date-time
updated_at?: string // date-time
last_tested_at?: string // date-time
last_test_status?: "ok" | "auth_failed" | "tls_failed" | "host_unreachable" | "timeout" | "secret_missing" | "unknown"
last_test_error?: string
}
CreateSmtpConnectionRequestโ
type CreateSmtpConnectionRequest = {
smtp_host: string
smtp_port: string | number
smtp_secure: "tls" | "starttls"
smtp_username: string
smtp_password: string
}
UpdateSmtpConnectionRequestโ
Partial update; omitted fields keep their existing values.
type UpdateSmtpConnectionRequest = {
smtp_host?: string
smtp_port?: string | number
smtp_secure?: "tls" | "starttls"
smtp_username?: string
smtp_password?: string
}
SmtpSenderโ
An address allowed to send through a custom SMTP connection. Mirrors an Outlook mailbox: the address, its display name and its assignees live on the shared email-address record, while this row binds it to a set of SMTP credentials.
type SmtpSender = {
email: string // email
connection_id: string
reply_to_email?: string
connected_at?: string // date-time
connected_by_user_id?: string
}
ConnectSmtpSenderRequestโ
type ConnectSmtpSenderRequest = {
email: string // email
connection_id: string
name?: string
reply_to_email?: string
shared_inbox_id?: string
user_ids?: string[]
group_ids?: string[]
default_signature_id?: string
}
SmtpTestResultโ
type SmtpTestResult = {
status: "ok" | "auth_failed" | "tls_failed" | "host_unreachable" | "timeout" | "secret_missing" | "unknown"
error?: string
tested_at: string // date-time
}
SignatureSettingโ
Setting that allows to add a signature.
type SignatureSetting = "signature"
EmailDomainSettingโ
Setting that allows to add a custom domain. For e.g; doe.com
type EmailDomainSetting = "email_domain"
EmailAddressSettingโ
Setting that allows to add an email address on the custom domain. For e.g; john@doe.com
type EmailAddressSetting = "email_address"
WhitelistEmailAddressSettingโ
- Setting that specifies a list of addresses exempt from being flagged as duplicate emails.
- An email will be flagged as a duplicate if it has the same content and is sent to the same recipient within the time frame specified in the RestrictDuplicatesWithinSetting.
type WhitelistEmailAddressSetting = "whitelist_email_address"
RestrictDuplicatesWithinSettingโ
- Restrict duplicates within:
- 10s
- 5m
- 1d
- 5000 // It converts to 5 seconds.When expressed as a numerical value, it will be interpreted as being in milliseconds.
- Defaults to 3 minutes
- Negative values will be treated same as positive values
- If not set, defaults to 3 min
- If set as
type RestrictDuplicatesWithinSetting = "restrict_duplicates_within"
AllowedRecipientDomainsSettingโ
- Extra recipient domain allowed for outbound email from a sandbox organization.
- Sandbox orgs (organization_use) with the sandbox recipient allowlist enabled may only send unattended emails (workflow/automation/bulk/system) to epilot domains, the verified sending domains of the org and its par
type AllowedRecipientDomainsSetting = "allowed_recipient_domains"
AutoLinkIdentifierAttributesSettingโ
- Extra attributes, per entity schema, that inbound email auto-linking treats as identifiers,
on top of the built-in ones (e.g.
contract_number). - Stored in
schemas: entity schema slug โ attributes of that schema. - Only one value per organization: posting again replaces it, and listing retur
type AutoLinkIdentifierAttributesSetting = "auto_link_identifier_attributes"
AutoLinkIdentifierAttributeโ
type AutoLinkIdentifierAttribute = {
name: string
labels?: string[]
}
SettingTypeโ
type SettingType = "signature" | "email_domain" | "email_address" | "whitelist_email_address" | "restrict_duplicates_within" | "allowed_recipient_domains" | "auto_link_identifier_attributes"
Settingโ
Generic setting object used for various email configuration types. The applicable fields depend on the setting type:
- signature: Uses
name,value(plain text), andhtml(rich text) - email_domain: Uses
value(domain name) - whitelist_email_address: Uses
value(email address)
type Setting = {
id?: string
name?: string
org_id?: string
type: "signature" | "email_domain" | "email_address" | "whitelist_email_address" | "restrict_duplicates_within" | "allowed_recipient_domains" | "auto_link_identifier_attributes"
value?: string
html?: string
schemas?: Record<string, Array<{
name: string
labels?: string[]
}>>
excluded_senders?: string[]
created_at?: string
updated_at?: string
created_by?: string
updated_by?: string
}
Domainโ
Custom email domain configuration.
type Domain = {
domain?: string
}