I try to relabel Organization as "Entity":

$result = civicrm_api3('ContactType', 'create', array(
  'label' => "Entity",
  'api.ContactType.get' => array('name' => "Organization"),

This errors out with

Mandatory key(s) missing from params array: name, parent_id

Apparently I don't understand chaining and the required 'id' for updating is not returned. What is wrong in my reasoning?

1 Answer 1


OK, I got it! I had to think backwards:

$result = civicrm_api3('ContactType', 'get', array(
  'sequential' => 1,
  'name' => "Organization",
  'api.ContactType.create' => array('label' => "Entity", 'id' => "\$value.id"),
  • glad you figured it out!
    – Andrei
    Commented Jun 23, 2016 at 11:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.