An if you speak of the expanded bar that pops up across the top of the phone when the notification comes in, that's part of the "allow interruptions" part of the notifications but it seems that's an all-or-nothing idea (on my Pixel 2 XL running Android 9 Pie anyway).