Intercom
Intercom is a messenger and help desk for websites and apps. An app in the Developer Hub — made in the interface, without code — subscribes to webhooks: a customer started a conversation, an agent closed it, a ticket was created, changed its state or was closed. Sent to the Flows address, these webhooks start your flows: a conversation is closed — and the customer gets a thank-you in Viber or SMS.
The catch is the phone: Intercom webhooks carry no phone number, only the id of the contact and the email of the author of a conversation. So a message goes only to a person AlphaFlow already knows with a phone.
This page is written from the public documentation of Intercom and has not been checked on a live account yet.
What you need
- A paid Intercom workspace, or a development workspace.
- An app in the Developer Hub. The way in from Settings → Integrations is not confirmed by the documentation.
- A way for AlphaFlow to find the customer: the
user_idof the contact from your system (in Intercom it is the external id) or the email. The contact has to be known to AlphaFlow with a phone already, for example from your shop or CRM.
Step 1. Create a connection
- Open
Flows → Connections, press Connect a system and choose Intercom. - Press Copy address. It looks like
https://events.alphasms.net/hooks/<TOKEN>— keep it secret.
Step 2. Set up webhooks in Intercom
- In the Developer Hub press New app — an internal app of your workspace.
- In Authentication give the app the rights Read conversations and Read tickets.
- Open Configure → Webhooks. Endpoint URL — the address from the cabinet. Topics —
conversation.user.createdandconversation.admin.closed; for tickets alsoticket.created,ticket.state.updatedandticket.closed. Press Save. - Intercom checks the address with a
HEADrequest. AlphaFlow accepts any method, so the check passes.
Step 3. Send a test
Start a conversation from the Messenger as a test user and close it. The events appear in
Flows → Connections → Event journal, and the connection shows
Recognised: Intercom. If the event has neither an email nor a user_id known to AlphaFlow, it is refused with
no_contact — that is expected.
Events
| Intercom topic | AlphaFlow event | Properties |
|---|---|---|
conversation.user.created — a customer started a conversation | ticket_created | conversation_id, topic |
conversation.admin.closed — an agent closed the conversation | ticket_closed | conversation_id, topic |
ticket.created | ticket_created | ticket_id, status |
ticket.state.updated | ticket_status_changed; the state resolved — ticket_closed | ticket_id, status |
ticket.closed | ticket_closed | ticket_id, status |
ping | — | taken and skipped |
statusis the state of a ticket:submitted,in_progress,waiting_on_customer,resolved. Onlysubmittedis confirmed by the documentation. Which state becomesticket_closedis set by a table in the connection, and you can correct it there.
The contact is found only by the email of the author of a conversation and by the external id of the contact — the
user_id from your system; leads and visitors have none. Both fields are taken from the Intercom models of
conversations and tickets; that webhooks carry them is not confirmed by the documentation. There is no phone. An
event with neither an email nor an external id known to AlphaFlow is refused with no_contact; ticket events carry no
email.
Support events are not among the events of the ready-made templates (see Recommended events): create the flow From scratch and choose the event as its start.
With the phone: a data connector
A Data connector step in Intercom Workflows sends a request with a body you write — and the body can carry the phone of the user. Which plans have data connectors is not confirmed by the documentation, nor are the names of the attributes.
- Open Settings → Integrations → Data connectors and press + New. HTTP method —
POST; URL — the address of the connection; in HTTP headers → Key value pair addContent-Typewith the valueapplication/json. - Paste the body below. Insert the values in
<…>from the menu of attributes. - Press Test request. It is a real request: an event comes.
- Switch the Fin tab of the connector to Disabled — then the connector is available in Workflows.
- In Fin AI Agent → Workflows open the workflow you need (for example, on a new conversation), press + Add step, choose Data connector (using API) and this connector, and set the branches of success and failure.
{
"event": "ticket_created",
"contact": {
"phone": "<User → Phone>",
"email": "<User → Email>",
"external_id": "<User → User ID>"
},
"traits": { "first_name": "<User → First name>" },
"properties": { "conversation_id": "<Conversation → ID>" },
"context": { "source": "intercom" }
}
event is fixed in the body, so make one connector per event. Series Webhook steps do not fit: they send only
flat pairs of keys and values and cannot build this body.
Good to know
- Intercom waits 5 seconds for the answer. Without an answer, or after a
4xxor5xx, it repeats once in a minute. The Flows address answers200at once, so there is nothing to repeat. - Intercom signs every webhook (
X-Hub-Signature). Checking the signature is optional: the secret in the address is enough. - The address always answers
200. Above the daily event limit the event is refused in AlphaFlow withquota_exceededand shown in the journal; the subscription of the app stays on.