I was trying to assigning a new Users to CiviCRM ACL role through ACL Role API, but it is not showing me in database.

Input json

     $result = civicrm_api3('AclRole', 'create', [
  'debug' => 1,
  'sequential' => 1,
  'acl_role_id' => 14,
  'entity_table' => "civicrm_group",
  'entity_id' => 54,
  'is_active' => 1,


Output json

"values": [
        "id": "14",
        "acl_role_id": "",
        "entity_table": "civicrm_group",
        "entity_id": "54",
        "is_active": "1"

I already providing a "acl_role_id", but in the output json object, it is showing a blank

1 Answer 1


Make sure the value 14 for acl_role_id is correct.

ACL role is an option value pair and should to be set as one of the existing value available from civicrm/admin/options/acl_role?reset=1.

UPDATE - just tried on my local and looks like a bug to me. Can you raise this as a new ticket at https://lab.civicrm.org/dev/core/issues/new?

  • The acl_role_id is correct (I checked both civicrm_group and role_id in database). I tried by using UI and it worked. But not working using API.
    – deepak
    Jan 17, 2019 at 11:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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