Programatically Attach a Field to a CCK Type in Drupal 6
Anything in the UI eventually has to call a function, so...  

The UI for editing a content type goes to path:

admin/content/node-type/NODETYPE


This path is "owned" by the cck module.  Looking in there, you can dig through the forms and hook_menu()s etc to see it eventually calls a function:

content_field_instance_create($field)


which is defined in

content.crud.inc


inside the cck module's inc directory.