I want to send different events tags to GA4 from GTM, and for every custom parameter used, I have to manually create it inside GA4 (to be available in the GA4 UI). Is there a way to custom code it in GTM and create it along with the tag?
Did not find anything that could help.
No, it's not possible to do it via GTM. Either you have to create it manually in GA4 UI or use the GA4 Admin API to create it programmatically.
Alternatively, you may try Google Analytics Utilities to create custom dimensions/metrics using Google Sheets/Appscript.