The API for generating or editing LV code is known as LabVIEW scripting. In recent versions of LV it's an official part of the environment and you can enable it from the options dialog. Keep in mind that it was originally created as an internal feature, so it does have some holes, but it is mostly complete. You can find materials online on working with it. Note that in general, while LV scripting is not particularly complicated, it does require a good understanding of the class hierarchy and modelling of LV block diagrams.
Also, note that if you want a more complex application, LV 2012 and later has a built-in feature which will generate a complete project from a template, and you can create your own templates. This is useful if you have projects with the same structure.