Add an item to a custom menu without using the GUI

Is there a way to add items to a nav menu without using the GUI?
Let's say I want to use an action hook to add a page or custom link to an existing menu.