Suspected external REST API not updating Drupal entities
We believe the bug may be caused by the Drupal hook model which expects to receive Drupal form data which the Civi API is not capable of invoking since, of course, it does not use forms. Shimming the data would have been messy and clunky so in the end we hooked directly into the LDAP module using CiviCRM's edit hooks. Like this:

function ldap_user_civicrm_post($op, $objectName, $objectId, &amp;$objectRef) {
  if ($op=="edit") {
    try {
      $cms_user_id = civicrm_api3('UFMatch', 'getvalue', array(
        'return' =&gt; "uf_id",
        'contact_id' =&gt; $objectId,
      ));
      if ($cms_user_id) {
        $account = user_load($cms_user_id);

        $ldap_user_conf = ldap_user_conf();

        $bool_result = $ldap_user_conf-&gt;synchToLdapEntry($account);
        if ($bool_result) {
          ldap_user_ldap_provision_semaphore('synch', 'set', $account-&gt;name);
        }
      }
    } catch (Exception $e) {

    }
  }
}