Is this possible to allow creating nodes only for Administrator via interface but for others in custom code?
If what you are asking is...

How can I allow nodes of a certain type to be created programmatically by everyone, but, at the same time, disallow everyone but the Administrator from creating them from the UI?

...the quickest way might be for you to use Rules to create a redirect away from node/add/custom_type for everyone but the Administrator.

However, if you are already creating custom module code, you could also do this pretty simply in hoot_init(), eg, something along the lines of:

global $user;
if ($_GET['q']=='node/add/custom_type') {
   if ($user-&gt;uid != 1) { // or whatever logic you want to use to determine the Administrator
     drupal_goto('somewhere else');
   }
}


In either case, you'd have to set up permissions to allow any user to create these types of nodes.