function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Suman MSuman M 

create a public group through API without having manager user permission on profile

Hi, Need help with below requirement.
We are supposed to create public group through apex, where users running the apex will NOT have manage users permission. 
We are getting the below exception when we try to create a public group with a user without manage users permission on profile.
System.DmlException: Insert failed. First exception on row 0; first error: FIELD_INTEGRITY_EXCEPTION, As a delegated administrator, you can't create a public group using the API. Create public groups using the user interface.: []

how can we acheive this. Please help. Thanks!
Raj VakatiRaj Vakati
You can create an public group through API .. Here is the example 
 
/services/data/v43.0/sobjects/Group

But Still you need   manage users permission  permission