Delete a Single Conversation Directly From Your Help Desk

  • 1 April 2024
  • 0 replies
  • 52 views

Userlevel 4
Badge +5

Have you ever found yourself pounding your head against the wall trying to figure out a simple way for your team to delete a single Conversation in Intercom? For a long time the only way to delete a conversation was by deleting the Intercom User or Lead associated with the Conversation. But by doing this you not only delete that single Conversation, you also delete that User/Lead and every other conversation that is associated with them.

 

Recently our Engineering team added a ‘Delete a Conversation’ call to the Unstable version of our REST API. This new endpoint allows your team to delete a single conversation from your Intercom workspace without having to delete the associated Intercom Contact!

 

This is a step in the right direction, but making an API call isn’t always super convenient. Also, those three letters API, can strike fear in the hearts of those customers who don’t have a little bit of coding experience under their belt.

 

What follows is a solution for deleting a single conversation without ever leaving your Intercom Help Desk. It does require a little bit of set-up, but not much. And the API portion of this solution is minimal.

 

THE FLOW

A quick Overview of what we’ll do:

  1. Create a Custom Action in Intercom that makes an API call to that ‘Delete a Conversation’ endpoint.
  2. Create a Reusable Workflow that calls your new Delete Custom Action.
  3. Trigger that Reusable Workflow from your Help Desk while the conversation is open in your workspace.

STEP 1: CREATE A CUSTOM ACTION 

 

If you haven’t already created a Custom Action in Intercom, I would recommend reading up on them in our article, here, in order to get a better understanding of what they are.

  1. In your workspace go to your Custom Action menu and click on the Create action button in the top-right corner
  2. Name your Custom Action and provide it a description so it’s clear to the rest of your team what the action is designed to do.
  3. In the Request section you’ll set up your API call
    1. Open these Dev Hub docs if you want to see where I’m getting the instructions for making this API call.
    2. Set the ‘Method’ to DELETE
    3. In the ‘HTTPS URL’ field add https://api.intercom.io/conversations/{id}
    4. That {id} portion of that URL represents the id of the conversation that you want to delete. This will change depending on the conversation that you’re deleting, so you’ll want to insert a variable here that represents that id. 
    5. Delete that ‘{id}’ text from the URL and replace it with the Conversation ID variable. You can find that variable by clicking on the {..} that appears when you hover over the URL field. 
    6. Clicking that {..} icon will reveal a dropdown menu. Scroll down to the Conversation Attributes section of that dropdown and choose the Conversation ID attribute. This should insert that Conversation ID variable into the URL so it looks like this

YwA6IjjLUtvxEpzfdh7Pn1NAkaQeFDTg_9gSVO6PV4HDORifB4HdNc6orNB1iqQoptFB4EU9su8hySZl8EMPJrw-XHOFRtduc9MuzSXSPhmet9q39PyVvbMk9kbdMDU_ERh__FpA5koIxGI-wmo891o

  1. Set up your API call’s Headers
    1. If you haven’t already, you’ll need to create an app in the Developer Hub for your workspace. When you do this, it will create an Authentication Token that you can use to make API calls to your workspace. You can read up on how to do that by following along with Steps 1 and 2 in our Developer Hub docs here.
    2. Add an Authorization Header with the value of your new app’s Bearer token. If that token’s value is ‘abc123’ then you will add Bearer abc123 as the value for that token. NOTE: You should keep these token values secret. I would recommend creating a variable for your token as instructed here and then referencing that variable in your custom action under the Authentication tab. This will also save you time when creating future Custom Actions.
    3. Add a second Header with the key name of Intercom-Version and a value of Unstable. 
    4. It should look like this when you’re done. I’m using a variable for my Authorization Header so yours might look slightly different than mine.

igN8EIrX7PNdiPassbFJ9fkM_-GxP-QJagyrRvF25W3FVvBHVKkJZgQCSy0AELJpTT6PjERgjHGQAFL47piK8XzF4jRQtCsWVbyoV5wngLQziYinr4L7mWdQVMXXlC2Gy0qLuxcS3Q44kxYNNkvKG7c

  1. Finally, you’ll want to Test this call in the Testing section.
    1. Click on the Testing tab to open it.
    2. You will see a Templated Value field that says Conversation ID and an empty Test Value field to the right of that. Insert a Conversation ID of an actual conversation from your workspace here. An easy way to find a Conversation’s ID is to open a Conversation in your Help Desk and look at the URL in the browser bar. It will look like this (those with EU or AU data hosting will see a slightly different URL): https://app.intercom.com/a/inbox/abdefg/inbox/shared/all/conversation/238 that number after ‘conversation/’ is the Conversation ID
    3. Find a conversation that you are okay with deleting and copy that ID value and paste it into that Test Value field. Even though this is a test, the conversation WILL actually delete. So you don’t want to use any conversation for your testing that you aren’t okay with deleting!!
    4. To test the delete call on this conversation, click on the ‘Test’ button.
    5. If it works, you should get a ‘200 OK’ response along with a response object like the one below. You will also no longer be able to open that conversation in your workspace.

sJ5qfPycbUrwkqUlX1AuLuIV0q4m2Tmrt_oVeAfJFdhcbv5_Y3Jl-sV21QnmiJ_91NJ-hGorkrrVh0W8xZ9Rs3PmPQVGwovrxx8F-uaOYmkVIOLBhEkgErhGzN2xxhe2dVylD8UoblAsqyHW1FaI3Eo

 

Congrats! That was the hardest part of this process. It should be a breeze from here.

 

STEP 2: CREATE A REUSABLE WORKFLOW

  1. Go to your Workflows menu and click on the New workflow button in the top right corner of the screen.
  2. Choose to create a Reusable Workflow from the selection of Workflow triggers.
  3. Click on the first box of the Workflow (it says ‘Reusable Workflow’) and toggle on the Allow teammates to trigger this Workflow from the Inbox feature.

TkQEaeKprEXjU13xArP5sAI1jCCVeuOEQwygGGirGcQmg7ZiSSttZbsz0EMG0tKSgX-fDUAnIrC1OvyJ5RkuxYtBmcgEa8qh7XlI7rdrL3RICeSaregnsxk2sCwD-Gic9CpGo46bqIZQXlYh9ZB_F5I

  1. Add your Custom Action to the path of your new Workflow.
  2. In the ‘If the Action Fails’ path, I like to add a note that lets the admin know that the action failed, just so it’s clear to them.
  3. It will look like this when you’re done

 mGFambeCD6t_zOPwQz8fQMA2abncUP45A-rvRr2_Vxee53h8Lr6a0Rd3xUcuXQOEodlk8QTIKgmCYW6XTJZFbLKP_5bWGeUokRUMfZcuFK1EMsTGN4VQjt68wCGreb5EN65nHHq7JMIMpyzJy0kuDT4

STEP 3: CALL THE WORKFLOW FROM THE CONVERSATION

  1. In your workspace’s Help Desk, open a conversation that you want to delete.
  2. Open up the shortcuts dialog box by pressing command-k.
  3. Choose the Trigger Reusable Workflows option and select your new Workflow.

9Hv05Wy6iv57qqFJJwFJxVAD6jRdtOmtLzVTUn4BGtMvvQsJk3TCFwqNlyVOvBuvTgQDr8uqwYnLUesFVHfegk0qfuFbytxWZf9a-7tlT-nZ9_mD83Z1hytrdOn8rt_l4vXGpwq9LWWr6Rh-cbWl4Mw

  1. If your workflow runs successfully, it will delete your conversation! If you try to reload that conversation now, it will no longer load. If the call fails for some reason, the fail Note from your Workflow will get added to the conversation to let you know.

 

Your team can now easily delete a conversation from your Help Desk by triggering a Reusable Workflow. There isn’t currently a way to limit which admin can use a Reusable Workflow so you’ll want to make sure that your team fully understands the power of it before they indiscriminately trigger it in a conversation.

 

I hope this is helpful for those customers who are looking for a more painless way to delete a single conversation!

 

If you’ve come up with any other clever ways of making use of Custom Actions or Reusable Workflows be sure to share them with the Community in the User Tips section!

 


0 replies

Be the first to reply!

Reply