This reaction is known as acylation You can consider
this reaction as the replacement of hydrogen atom of –NH2 or >N–H
group by the acyl group The products obtained by acylation reaction
are known as amides The reaction is carried out in the presence of
a base stronger than the amine, like pyridine, which removes HCl so
formed and shifts the equilibrium to the right hand side