Answers.Body: <p>You will have to use the Email API with the contact_id of the just created contact. You can do this in a chained API call if you want to.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-06-01T15:49:30.410Z
Answers.Text: See the docs for how to do chaining: https://docs.civicrm.org/dev/en/latest/api/chaining/
Answers.UserDisplayName: Jaap Jansma - CiviCooP
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-06-01T18:02:12.123Z
Answers.Text: @JaapJansma-CiviCooP thanks
Answers.UserDisplayName: harshal
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-06-01T14:27:09.540Z
Answers.LastActivityDate: 2018-06-01T14:27:09.540Z
Answers.UserDisplayName: ErikH - CiviCooP
Body: <p><a href="https://i.sstatic.net/QYSeW.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/QYSeW.png" alt="enter image description here"></a></p>
  
  <p>I want to add email address to create a contact of type Household , how I can achieve it as while checking in API explorer I don't see it.</p>
  
  <pre><code>$result = civicrm_api3('Contact', 'create', [
    'contact_type' =&gt; "Household",
    'household_name' =&gt; "Test",
    'email' =&gt; 'abc@gmail.com
  ]];
  </code></pre>
  
  <p>I was trying to convert civicrm API v2 to civicrm API v3.
  In civicrm API v2, I saw this, so I thought we may have some way to add email directly in API v3 (also not sure if api v2 below is correct)</p>
  
  <pre><code>$householdParams = array(
                      'household_name' =&gt; $familyName,
                      'contact_type'   =&gt; 'Household',
                      'email'          =&gt; $form_state['storage']['contactInfoValues']['emailAddress']
                      );
  $householdContact =&amp;civicrm_contact_add($householdParams);
  </code></pre>
  
Tags: <api><households>
Title: How to add email while trying to create a Household contact using civicrm api v3?
ThreadText: # How to add email while trying to create a Household contact using civicrm api v3?
  
  (Asked by: username_0 on 2018-06-01)
  
  [![enter image description here](https://i.sstatic.net/QYSeW.png)](https://i.sstatic.net/QYSeW.png)
  
  I want to add email address to create a contact of type Household , how I can achieve it as while checking in API explorer I don't see it.
  
  ```
  $result = civicrm_api3('Contact', 'create', [
    'contact_type' => "Household",
    'household_name' => "Test",
    'email' => 'abc@gmail.com
  ]];
  
  ```
  
  I was trying to convert civicrm API v2 to civicrm API v3.
  In civicrm API v2, I saw this, so I thought we may have some way to add email directly in API v3 (also not sure if api v2 below is correct)
  
  ```
  $householdParams = array(
                      'household_name' => $familyName,
                      'contact_type'   => 'Household',
                      'email'          => $form_state['storage']['contactInfoValues']['emailAddress']
                      );
  $householdContact =&civicrm_contact_add($householdParams);
  
  ```
  
  **Tags:** api, households
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2018-06-01. Score: 5 | Accepted answer
  
  You will have to use the Email API with the contact\_id of the just created contact. You can do this in a chained API call if you want to.
  
  > **Comments:**
  > **username_2**: See the docs for how to do chaining: https://docs.civicrm.org/dev/en/latest/api/chaining/  
  > **username_0**: @JaapJansma-username_1 thanks  
  
  ---
  
  