yEd does not provide a programmatic interface.
The best option you have is creating a graph exchange file in one of the formats yEd supports and then open your programmatically created file in yEd.
yEd's native file format, GraphML, is an XML fomat that offers full control over structure, geometry, and visualization of all elements.
GML is a simpler text-based markup format which offers control over structure and geometry but limited control over visualization of elements.
TGF is a very simple text-based format for importing the structure of a diagram only.
Finally, yEd supports importing graph structures from Excel spreadsheets.
yEd uses custom dialects of GraphML and GML for which no comprehensive public documentation exists. When working with these formats, you need to create sample diagrams in yEd, save them in the desired format, and reverse-engineer the format features you need from the save files.