Document d = Document.MakeNew("New node name", DocumentType.GetByAlias("myDoctype"), User.GetCurrent(), parentNodeId);
Replace the parameters with the appropriate values to create a new node called "New node name" of type "MyDoctype". If you do this through external (public) code, use the admin user, replacing User.GetCurrent() with new User(-1) .
source share