Skip to content
Docs
On this page Connected accounts 1/13
Internal — not published

A channel is a way to reach people: email, LinkedIn, Telegram or Zalo. Phone numbers are stored on people and can be searched, but nothing can be sent to them. Each channel has a client that knows how to read a handle a user typed, identify the account it connects, send a message and receive one. The backend keeps one running client per connected channel account. It starts them all when it boots and restarts one when its account is changed. Every send and every inbound message passes through these clients.

ChannelSends throughReceives throughInbound check
EmailThe account’s SMTP serverReading the mailbox over IMAP every minute, or Amazon SES receipt noticesAWS signature on SES notices
LinkedInUnipileUnipile webhookShared secret in a header
TelegramTelegram Bot APITelegram webhook, one per botNone
ZaloZalo Official Account APIZalo webhookSignature over the exact body

Slack and the HubSpot and Salesforce import are outside apps, described at the end of this page.

Connected accounts

A connected account is a channel account, an AI provider key or an outside app, owned by one workspace.

KindProviders
ChannelEmail, LinkedIn, Telegram, Zalo
AIAmazon Bedrock, OpenAI, Anthropic
Outside appSlack, HubSpot, Salesforce
  • Each channel account records the identity of what it connects (the mailbox address, the LinkedIn account, the bot), and that identity is unique across the installation. Two workspaces cannot connect the same mailbox, which would make both of them answer the same person.
  • Secrets in an account are masked in every response, with one star per character. When a form sends a masked value back, the stored secret is kept, so a form can resend what it read.
  • The secret data is encrypted in the database; see Backend.
  • A connection test runs against the provider and stores the result on the account: an SMTP check and, when reply reading is on, an IMAP sign-in, each with a 10-second timeout; the Unipile account status; the bot’s own identity on Telegram. Changing the account clears the last result. A provider error that the client does not already explain comes back as an invalid-account error that names the provider.
  • The status, start and stop actions on an account are stubs: they answer online or offline and do not touch the running client.

Email

Sending

Email goes out through the SMTP server of the account. The body is sent as HTML, with line breaks turned into HTML breaks and any attachments added. A message without a subject goes out as “(no subject)”. When the caller names the message it answers, the email carries the reply header that mail clients use to thread it.

When the SMTP server is Amazon SES, the message id in SES’s reply is kept with the send, so later delivery, bounce and complaint notices can be matched to it. SMTP failures that a user can fix come back as one of three clear errors: sign-in failed, message rejected, or server unreachable.

Replies typed in the Inbox composer go out with no subject and no reply header, so they do not thread in the recipient’s mail client. Replies sent by the agent do carry the reply header.

Reading replies over IMAP

An email account with reply reading on is read every 60 seconds. For Gmail, Office 365 and Zoho the IMAP host is guessed from the SMTP host; the IMAP sign-in defaults to the SMTP one and the port to 993.

  1. The reader takes a 5-minute lease on the mailbox, so one backend instance reads a mailbox at a time.
  2. It opens the inbox read-only. On the first read, or after the mail server resets the mailbox, it starts from the newest message and imports nothing older.
  3. It fetches up to 50 new messages, at most 2 MB of each, and skips any it has seen before.
  4. It sorts each message into skip, bounce report or reply.
  5. A bounce report opts the bounced address out and writes the bounce on the timeline of the people in that workspace who have it.
  6. A reply is passed on only when the sender is already a channel of someone in the workspace. Newsletters and cold mail in a shared mailbox are dropped.

A failed read stores its error, which the app shows on the account. Turning reading off forgets the position, and turning it back on starts from new mail.

Receiving through Amazon SES

LinkedIn through Unipile

LinkedIn accounts are connected through Unipile’s hosted sign-in.

  1. The app asks the backend for a sign-in link, passing the saved account when it is a reconnect.
  2. The backend asks Unipile for a hosted link that lives one hour. The link carries a state that names the workspace and the account and is signed by the backend; the state is valid for two hours.
  3. The user signs in on Unipile and is sent back to the app’s settings.
  4. Unipile calls the backend. A forged or expired state is refused. On success or reconnect, an event saves the LinkedIn account: it updates the account being reconnected, or finds or creates one for that LinkedIn identity in the workspace.

Messages arrive on a webhook that checks a shared secret in a header, compared in constant time. Only messages received by the account are handled, not ones it sent. When the backend starts, it registers its messaging webhook with Unipile or replaces the old one. Without a secret configured it skips this, and every LinkedIn message is refused.

Telegram

A Telegram account is a bot token. When its client starts, it asks Telegram who the bot is, uses the bot’s id as the account’s identity, and registers a webhook address for that bot. The webhook handles text messages from people and ignores other bots.

The Bot API cannot send to a username. When a person was added by @name, the backend stores that user’s numeric id the first time they write, and later sends go to the id. A user who never started the bot, or who blocked it, gives a clear error.

Zalo

Zalo Official Accounts post to one webhook. The backend keeps the exact bytes of the body and checks Zalo’s signature over them before anything else, and refuses a mismatch with 401. When the client renews its access token, it saves the new token back to the account, merged with the current stored value.

Webhooks

WebhookVerified by
SES inbound mailAWS signature (broken, see above)
LinkedIn messagesShared secret in a header
LinkedIn sign-in callbackThe signed state
TelegramNothing
ZaloZalo signature over the exact body
SES delivery notices (analytics)AWS signature
Meeting bookingCalendly or Cal.com signature, with the workspace’s own secret

The channel webhooks are attached to the web server directly, outside the normal request path, so the sign-in check, input validation and the error shape do not apply to them. They answer 200 before doing the work, and an error after that is only logged.

From inbound message to thread

An inbound message becomes a thread message Step 1 of 6

The channel client turns the provider's payload into one inbound message event that names the receiving account, the sender and the content.

The whole handler catches its own errors and logs them, so an inbound message that fails is not retried by the bus.

Threads

There is no separate thread record. Each person is one thread across all channels, and the thread’s messages are the message entries on their timeline. Read, snooze, close and reopen are marker entries on the same timeline, and the thread’s state is worked out from the newest marker when it is read: closed until a message arrives after the close, snoozed until the time passes or a message arrives. Agent drafts and agent tool calls are timeline entries too.

Outbound

Sending a message
  1. 1 Compose Reply or new conversation
  2. 2 Pick Identity and account
  3. 3 Check Opt-out
  4. 4 Send Through the channel client
  5. 5 Record Timeline and send event

A send either replies to a person or starts a new conversation from a handle. It uses the person’s first identity on that channel that has not opted out, and the chosen account or the workspace’s oldest account on that channel. Up to 3 Knowledge documents can be attached. A new conversation that fails to send deletes the person it just created.

The opt-out is checked on the identity and, for Telegram, on the numeric id behind a username. After the client sends, an outbound message event writes the timeline entry and, when the caller passed analytics context, a send event. Inbox sends, agent replies and campaign steps pass that context, and a template test send writes neither the timeline entry nor the send event.

Outside apps

AppWhat it does
SlackPosts to an incoming webhook when a conversation is handed to a person, a draft waits for review, a deal is won or a campaign gets a reply. Each one can be switched off. Notifications older than 6 hours are dropped. A webhook Slack refuses marks the account as failed.
HubSpot, SalesforceA one-way import of contacts and companies into People and Companies, every few hours (6 by default, 0 for by hand only) or on demand. Each outside record is mapped to what it became, and a field edited in eDGR is left alone on later imports. A lock per account keeps two imports from running at once.
Docs
EN VI