How to render videos with placeholders using API / command line interface? I would like to be able to automate video creation and rendering. 

I imagine the process as creating placeholders, which then can take my dynamic input (images/videos/text). 

I would like to know the process of creating videos with placeholders as https://placeit.net/instagram-story-video-template here. Clearly, the video contains a placeholder for the text that we specify. How is this done on the low level? 

None of the softwares for video rendering e.g. Final cut Pro etc. can be run on a server using CLI (command line interface). 

Which backend / libraries can be used to create something like that?
You could write a simple shell script (either for mac or windows) which consists of basic if - then clauses to read the input of the user, then use ffmpeg by calling it from within the script. I believe that ffmpeg might be the most painless option, since scripting for Premiere and After Effects can be a bit tedious.