Answers.Body: <p>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.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-11-06T07:48:50.057Z
Answers.LastActivityDate: 2018-11-06T07:48:50.057Z
Answers.UserDisplayName: ErikH - CiviCooP
Answers.Body: <p>Following API call should do it.</p>
  
  <p><code>$result = civicrm_api3('CustomField', 'create', [
    'custom_group_id' =&gt; "GROUP_NAME",
    'label' =&gt; "CUSTOM_FIELD_LABEL",
  ]);</code></p>
  
  <p>Replace label and group name accordingly.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-11-07T21:15:50.107Z
Answers.LastActivityDate: 2018-11-07T21:15:50.107Z
Answers.UserDisplayName: Hassan Farooq
Body: <p>I want to add a custom field use for activities (meeting)?<br>
  I did that using <strong>administrator -> customize data and screen -> custom fields</strong>
  <br> 
  How can I achieve it by API 3.</p>
  
Tags: <api><extension>
Title: How to add custom field using API?
ThreadText: # How to add custom field using API?
  
  (Asked by: username_0 on 2018-11-05)
  
  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.
  
  **Tags:** api, extension
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_2 on 2018-11-07. Score: 4 | Accepted answer
  
  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.
  
  
  ---
  
  ### Answer by username_1 on 2018-11-06. Score: 3
  
  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.
  
  
  ---
  
  