It's a bit unclear what's your exact goal and how you are going to use whatever possible answer you are going to get.
Will you have all previous SEF URLs changed? Will you do a search and replace inside the database for all old links of the content? And how you could combine a possible API usage with the database operations.
I think the whole task needs a good plan on how this migration/transformation should be done, considering the content, the urls and how the new URLs structure will look like...
But anyway, if we focus only on how to link to other articles from inside an article in Joomla, I would recommend to use non-sef URLs inside your content, instead of SEF ones.
The non-SEF would convert to SEF once you enable SEF URLs on Joomla.
An example of how a non-SEF URL link to another article, from inside an article would be like:
Or if you would want to include the Category ID:
Or also include the language:
So, if I had to update all internal articles links to other Joomla articles, this is how my new links would like.
I would also consider to install a SEF extension like sh404SEF to help managing all the new SEF URLs more efficiently.