What bundle and entity_type do I use in field_create_instance to add a field to a taxonomy vocab? I have a vocab with the machine_name = the_bundle. This is my call to field_create_instance:

field_create_instance(array(
  'field_name' =&gt; 'category',
  'label' =&gt; 'Some label',
  'required' =&gt; true,
  'widget' =&gt; array('type' =&gt; 'autocomplete_deluxe_taxonomy'), // I've also tried options_buttons
  'entity_type' =&gt; 'taxonomy_vocabulary',
  'bundle' =&gt; 'the_bundle'
));


However when I use the drupal UI to manage the fields on the vocabulary, the instance does not exist. I have verified that the field I'm attempting to create an instance of does in fact exist. I'm also not getting any errors when I enable the module.

What am I doing wrong?
The taxonomy module doesn't define any bundle types for taxonomy_vocabulary (see taxonomy_entity_info()) so Drupal's entity/field system assigns it a default one with the same name as the entity type (taxonomy_vocabulary).

field_create_instance(array(
  'field_name' =&gt; 'category',
  'label' =&gt; 'Some label',
  'required' =&gt; true,
  'widget' =&gt; array('type' =&gt; 'autocomplete_deluxe_taxonomy'), // I've also tried options_buttons
  'entity_type' =&gt; 'taxonomy_vocabulary',
  'bundle' =&gt; 'taxonomy_vocabulary'
));


I have to ask though, are you absolutely sure you want to add a field to the vocabulary rather than the term entity? I haven't come across many use cases where adding fields to the vocabulary itself is necessary. Drupal doesn't even have a UI to manage the fields (but I guess that could be why you're going this in code!)