Best answer

How to show color bar on Slack messages created by Zap

  • 28 June 2021
  • 4 replies

I can create a zap to post a message to Slack, but can’t see how to get the coloured bar at the left edge of the slack message (good, warning, danger). Does anyone know if this is possible in Zaps?


Best answer by SamB 18 March 2022, 15:23

View original

This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

4 replies

Userlevel 7
Badge +14

Hi @trevski 

Can you post a screenshot to clarify the colored bar you mean in Slack?

You may have to create a custom Slack App:

NOTE: This is doable via Zaps, but involves the Slack API, which can be used with the Webhooks app:

Screenshot. Slack lets you highlight as standard with red, yellow or green.

Userlevel 7
Badge +14


Yes, that is being done using the Slack API, which offers more advanced formatting options:

Userlevel 7
Badge +11

Hey folks! I just wanted to follow up to further build on Troy’s suggestion here for anyone that might not be very familiar with setting up Slack Apps/webhooks.

I wrote up a guide a little while back that has a section which explains how to set up a Slack App which is a good starting point to reference:

One difference from that guide will be the OAuth scope that’s needed when setting up your Slack App. You’ll need to make sure your Slack app has the chat:write OAuth Scope in order to be able to post a message:


Another difference is that you’d want to use the Custom Response action event instead of the GET action event that’s mentioned in the guide. This is because you’ll using the chat.postMessage endpoint instead: Slack > Composing your message

Since colour bars can only be added to secondary attachments you’ll need to follow the format outlined by Slack here: Adding secondary attachments

You’ll need to specify the Channel ID which you can find within Slack by clicking on the channel name to bring up the Channel Details. In the pop up window that appears the Channel ID will be listed at the bottom.

Next, you’d take the OAuth token (See guide on How to count reactions in Slack for details on how to generate that) and Channel ID. Then add them into the webhook request, along with the text for the message and set a colour, like so:

This would then post a message to the channel with a green coloured bar like this: