We don't really have an externally documented API for any part of the site.
There are basically two pathways for repertoire creation, one is via PGN import, the other is by adding moves move by move. Without knowing exactly what you're trying to achieve, I'm not sure which approach will be easier for you to deal with.
The import PGN path has a call on the RepertoireController object with this signature:
importRepertoireFromPGN(pgn,name,ourColour,dialog,commentVisibility,alternativeLineTreatment,showPostCreateMessageFn=null)
However it is not really designed to be used for external automation use, as it requires you to feedi in UI elements required for the path to have access to in order to complete the UI interactions.
I'm not sure the effort involved in working out how to do this might not be worth the work you save over manually importing the repertoires yourself, given the lack of documentation and lack of thought and consideration for external automation in the current implementation.