Answers.Body: <p>The default organization contact id is stored in civicrm_domain table. You can use domain api to retrieve the contact id i.e</p>
  
  <pre><code>  $result = civicrm_api3('Domain', 'getvalue', array(
        'sequential' =&gt; 1,
        'return' =&gt; "contact_id",
        'id' =&gt; 1,
      ));
  </code></pre>
  
  <p>HTH</p>
  
  <p>Pradeep</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-06-06T20:43:01.097Z
Answers.Text: If you run multi-domain, you'll need to specify which domain you want instead of the `'id' => 1` above
Answers.UserDisplayName: Aidan
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-06-05T18:35:31.107Z
Answers.LastActivityDate: 2018-06-05T18:35:31.107Z
Answers.UserDisplayName: Pradeep Nayak
Body: <p>Is there any way to get the "default organization" contact id through the API? </p>
  
Tags: <api><organization>
Title: Get the ID for the default organization through API
ThreadText: # Get the ID for the default organization through API
  
  (Asked by: username_0 on 2018-06-05)
  
  Is there any way to get the "default organization" contact id through the API?
  
  **Tags:** api, organization
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2018-06-05. Score: 3 | Accepted answer
  
  The default organization contact id is stored in civicrm\_domain table. You can use domain api to retrieve the contact id i.e
  
  ```
    $result = civicrm_api3('Domain', 'getvalue', array(
        'sequential' => 1,
        'return' => "contact_id",
        'id' => 1,
      ));
  
  ```
  
  HTH
  
  username_1
  
  > **Comments:**
  > **username_2**: If you run multi-domain, you'll need to specify which domain you want instead of the `'id' => 1` above  
  
  ---
  
  