Aminolysis is a nucleophilic acyl substitution reaction, where ammonia or amines act as nucleophiles to give the substitution product. Acid halides react with ammonia, primary amines, and secondary amines to yield primary, secondary, and tertiary amides, respectively.
In the first step of the aminolysis mechanism, the amine attacks the carbonyl carbon of the acyl chloride to form a tetrahedral intermediate. In the second step, the carbonyl group is re-formed with the elimination of a chloride ion. In the last step, the amide nitrogen is deprotonated by another equivalent of the amine to give the final substitution product.
If the amine is expensive, the reaction is performed with one equivalent of the amine and a second equivalent of an inexpensive base like triethylamine, pyridine, or sodium hydroxide.