I found the following command to toggle mute the default mic input:
[code]
pactl set-source-mute @[email protected] toggle
[/code]

I also wanted to map a key to this command, but wanted some visual feedback to see if the mic was muted or not. I found out that there is a key code defined named XF86AudioMicMute which, at least in Linux Mint/Cinnamon, shows a OSD notification. I think it might also work on Ubuntu. I mapped Scroll Lock to it using xmodmap:
[code]
xmodmap -e "keycode 78 = XF86AudioMicMute"
[/code]

If you want to map another key then scroll lock (code 78), you can find all keycodes using:
[code]
xmodmap -pk
[/code]