I want to add a custom field use for activities (meeting)?
I did that using administrator -> customize data and screen -> custom fields
How can I achieve it by API 3.

2 Answers 2


Following API call should do it.

$result = civicrm_api3('CustomField', 'create', [ 'custom_group_id' => "GROUP_NAME", 'label' => "CUSTOM_FIELD_LABEL", ]);

Replace label and group name accordingly.


You can use the API CustomGroup create to create a custom group and the CustomField API to create a custom field. I'd recommend playing with the API explorer to get exactly what you need.

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.