The Messenger of Allah ﷺ said, "Reconciliation between Muslims is permissible, except for a reconciliation that forbids what is lawful or permits what is forbidden. Muslims are bound by their conditions, except a condition that forbids what is lawful or permits what is forbidden."
حدثنا الحسن بن علي الخلال حدثنا أبو عامر العقدي حدثنا
أن رسول الله ﷺ قال الصلح جائز بين المسلمين إلا صلحا حرم حلالا أو أحل حراما والمسلمون على شروطهم إلا شرطا حرم حلالا أو أحل حراما
[Sahih]. Ibn Majah also reported it in the Book of Judgments, chapter on reconciliation, no. 2353, from the hadith of Kathir Awfi, and its chain is very daif, but it has corroborating narrations in Abu Dawud, no. 3594, and elsewhere, so the hadith is sahih because of them.