title: As a reseller, how do I create a new Google Apps user using the Admin SDK Directory API?
body: <p>As we transition from the deprecated Provisioning API over to the new Directory API, I see some gaping holes in the documentation in regards to how I as a reseller can manage my customers (Google Apps customers). Specifically, I'd like to know how I can use my Reseller OAUTH credentials to create a new user on behalf of one of my customers (as was possible in the Provisioning API) using the following endpoint:</p>
  
  <p><a href="https://developers.google.com/admin-sdk/directory/v1/reference/users/insert" rel="nofollow">https://developers.google.com/admin-sdk/directory/v1/reference/users/insert</a></p>
  
  <p>In the above documentation, I don't see a reference to a customer's account. The only parameters that I believe may be useful are <code>organizations</code> and <code>externalIds</code>. There's little documentation as to what these do. I was thinking of testing the following scenarios:</p>
  
  <pre><code>            $params = array(
              'externalIds' =&gt; array(
                  array(
                      'type'          =&gt; 'customer', // or 'account'?
                      'value'         =&gt; $data['domain']
                  )
              ),
              'organizations'     =&gt; array(
                  array(
                      'name'          =&gt; $data['domain'],
                      'domain'        =&gt; $data['domain'],
                      'type'          =&gt; 'domain_only',
                      'primary'       =&gt; true
                  )
              )
              );
  </code></pre>
  
  <p>Likewise, when performing operations on an existing user such as retrieval of a customer, I don't see where I can specify which Google Apps account the specific user is tied to:</p>
  
  <p><a href="https://developers.google.com/admin-sdk/directory/v1/reference/users/get" rel="nofollow">https://developers.google.com/admin-sdk/directory/v1/reference/users/get</a></p>
  
  <p>In this case, there's not even parameters for organization or externalIds, so I have no idea how retrieval could be specific to a particular customer under my reseller account.</p>
  
  <p>I need to be able to perform these actions as I was able to in the old Provisioning API on behalf of my customers using only my Reseller account OAUTH credentials.</p>
  
  <p>Any help would be appreciated.</p>