5

A contact subtype is an "entity" - it exists as a record in the civicrm_contact_type table. So that means you can use the "managed entity" approach described here: https://civicrm.org/blog/totten/api-and-art-installation and documented here: https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_managed/ You could instead implement the install hook (...


1

If you mean which api functions to call to create/update/delete the type, as a general rule you look in api explorer (available via the admin menu in civicrm under Support -> Developer) to see if there's something there (which shows there is ContactType -> create), and if had turned out there wasn't anything you could look in the core code to see how civi ...


Only top voted, non community-wiki answers of a minimum length are eligible