Assign Intercom Conversations to the Current Oncall
Route Intercom conversations and tickets to the support engineer who is on call right now, and mirror the thread into Slack so they can reply from there.
Support rotas have a sharper version of the queue problem than engineering ones: a conversation sitting unassigned is a customer waiting. Pagerly's Intercom integration covers two halves of this.
Assignment β put the current on-call support engineer on the conversation or ticket, via the Intercom API driven by Pagerly's on-call endpoint.
Response β mirror the Intercom thread into Slack so the on-call can read and reply without opening Intercom.
Prerequisites
A Pagerly team with a support schedule.
Intercom connected to Pagerly (Slack:
/pagerlyβ Integrations β Intercom β Connect). This authorises Pagerly over OAuth.Your on-call users must exist as admins (teammates) in Intercom, with the same email they use in Pagerly.
How assignment works
Intercom assigns to an admin ID, not an email. So the flow is three steps:
Ask Pagerly who is on call β get an email.
Look that email up in Intercom's admin list β get an admin ID.
Assign the conversation or ticket to that admin ID.
Step 1 β who is on call
curl -s 'https://api.pagerly.io/pagerly/o/currentusers?teamname=support' \
-H "X-APIKEY: $PAGERLY_API_KEY"Step 2 β email to Intercom admin ID
The admin list is small and changes rarely β cache it and refresh on a miss rather than calling it per conversation.
Step 3a β assign a conversation
Assignment on a conversation is a conversation part:
admin_id is the actor performing the assignment β use the admin whose token you are calling with. assignee_id is the on-call engineer resolved in step 2.
Step 3b β assign a ticket
Wiring it to a trigger
Intercom fires webhooks on conversation.user.created and conversation.user.replied. Point one at a small handler that runs the three steps above, or build the same sequence in Zapier, Make or n8n:
Trigger
Intercom β New Conversation
1
Webhook GET https://api.pagerly.io/pagerly/o/currentusersformake?teamname=support, header X-APIKEY
2
Webhook GET https://api.intercom.io/admins, filter where email matches step 1
3
Webhook POST to /conversations/{id}/parts with the assignment body
Bring the conversation into Slack
Assignment tells you who owns it. The other half is letting them act without a context switch.
Once Intercom is connected, Pagerly can mirror an Intercom conversation into a Slack thread β new customer messages appear in the thread, and the on-call replies in Slack. Pagerly posts the reply back to Intercom as an admin, so the customer sees a normal support response.
This means the on-call support engineer works one surface. New conversation lands, Pagerly assigns it to them and opens a Slack thread, they answer in the thread, the customer gets the reply in the Messenger.
You can also raise an Intercom ticket from Slack directly, with priority and description, and Pagerly keeps the Slack thread and the Intercom ticket linked from then on.
Handling the gaps
Support rotas have more edges than engineering rotas. Decide these deliberately:
Out of hours. If the schedule has no cover at 03:00,
/o/currentusersreturns[]. Assign to an Intercom team rather than an admin as the fallback so the conversation still lands somewhere with an SLA.Handover. A conversation assigned at 17:55 to a shift ending at 18:00 is about to be orphaned. Either reassign open conversations at handover, or set your assignment trigger on customer reply rather than only on creation, so a conversation naturally moves to whoever is on when the customer comes back.
Escalations. An assignment that needs an engineer, not a support agent, should page rather than reassign. Use escalations for that path.
Troubleshooting
No admin matches the on-call email
User is on the rota but not a teammate in Intercom
Add them in Intercom, or exclude them from the support rota
404 on the assignment call
Conversation ID vs ticket ID mixed up β they use different endpoints
Conversations use POST /conversations/{id}/parts, tickets use PUT /tickets/{id}
Assignment succeeds but nobody is notified
Intercom notification preferences, not an assignment problem
Mirror the thread into Slack so the ping is where the on-call already is
401 after months of working
OAuth token expired or the connection was revoked
Reconnect Intercom from /pagerly β Integrations
Related
Last updated