From any given non-epic issue, the JIRA UI allows the user to "Add to Epic," and is presented with a drop-down containing a list of existing Epics to link to. In case one has already been chosen, the user is able to change it via a similar menu.


So where is this functionality in the API?
The closest I've been able to find is `/rest/api/2/issueLink`
https://docs.atlassian.com/software/jira/docs/api/REST/6.4.9/#d2e1577
This successfully links two issues in terms of "contains" or "blocks" or "duplicate," but does not establish it as child issue, the way linking an Epic does.
Furthermore, linked issues and child issues are displayed separately on the UI:

So how do I create child issues (ie link Epic to issue) via the API?