Answers.Body: <p>Open API Explorer - <code>Support menu &gt; Developer &gt; API Explorer</code> and use <code>GroupContact</code> API to add contacts to group. See an eg in the screenshot below -</p>
  
  <p><a href="https://i.sstatic.net/Ap1HE.png" rel="noreferrer"><img src="https://i.sstatic.net/Ap1HE.png" alt="enter image description here"></a></p>
  
  <p>API formed for PHP is -</p>
  
  <pre><code>$result = civicrm_api3('GroupContact', 'create', [
    'group_id' =&gt; &lt;group_id&gt;,
    'contact_id' =&gt; &lt;contact id&gt;,
  ]);
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-05-10T08:36:10.293Z
Answers.LastActivityDate: 2019-05-10T08:36:10.293Z
Answers.UserDisplayName: jitendra - fuzion
Body: <p>I looked in the documentation but I can't seem to find a way to add a contact to a group using the API.</p>
  
Tags: <api><groups>
Title: How do I add a contact to a group using the API?
ThreadText: # How do I add a contact to a group using the API?
  
  (Asked by: username_0 on 2019-05-10)
  
  I looked in the documentation but I can't seem to find a way to add a contact to a group using the API.
  
  **Tags:** api, groups
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2019-05-10. Score: 8 | Accepted answer
  
  Open API Explorer - Support menu > Developer > API Explorer and use GroupContact API to add contacts to group. See an eg in the screenshot below -
  
  API formed for PHP is -
  $result = civicrm_api3('GroupContact', 'create', [
    'group_id' => ,
    'contact_id' => ,
  ]);
  
  
  ---
  
  