title: API Integration across multiple accounts within same organization
body: <p>I have had my API Integration promoted to my Production environment for a few weeks now and all is well but I ran into a new issue that I need help understanding. The process is setting up impersonation. The hierarchy of the organization is relatively simple:</p>
  <p><a href="https://i.stack.imgur.com/uJCx9.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/uJCx9.png" alt="enter image description here" /></a></p>
  <p>My Integration was built under Company A and so far 100% of Company A accounts are able to be impersonated as expected. The issue came up when Company B was added to the Organization and one of the existing accounts was included in the list to be impersonated. The following message is what I am getting back from my API call.</p>
  <p><a href="https://i.stack.imgur.com/1Xh8T.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/1Xh8T.png" alt="enter image description here" /></a></p>
  <p>I have Organization Admin permissions as well as Admin permissions on all of the Company Accounts too and this message appears even for me. My feeling is this is a simple administrative function to grant the User in Company A the permissions to access either a User in Company B or all of Company B. I am just not seeing where this gets setup. I hope anyone can point me in the right direction on this one.</p>
  <p>=== 07/06/2022 - Adding additional details ===</p>
  <p>/oauth/userinfo respose...</p>
  <pre><code>    {
          &quot;sub&quot;: &quot;xxxxx-xx-xx-xx-xxxxx&quot;,
          &quot;name&quot;: &quot;Greg Miller&quot;,
          &quot;given_name&quot;: &quot;Greg&quot;,
          &quot;family_name&quot;: &quot;Miller&quot;,
          &quot;created&quot;: &quot;2017-11-10T18:26:23.583&quot;,
          &quot;email&quot;: &quot;greg.miller@companyA.com&quot;,
          &quot;accounts&quot;: [
              {
                  &quot;account_id&quot;: &quot;xxxxx-xx-xx-xx-xxxxx&quot;,
                  &quot;is_default&quot;: true,
                  &quot;account_name&quot;: &quot;CompanyA&quot;,
                  &quot;base_uri&quot;: &quot;https://###.docusign.net&quot;,
                  &quot;organization&quot;: {
                      &quot;organization_id&quot;: &quot;xxxxx-xx-xx-xx-xxxxx&quot;,
                      &quot;links&quot;: [
                          {
                              &quot;rel&quot;: &quot;self&quot;,
                              &quot;href&quot;: &quot;https://account.docusign.com/organizations/xxxxx-xx-xx-xx-xxxxx&quot;
                          }
                      ]
                  }
              },
              {
                  &quot;account_id&quot;: &quot;zzzzz-zz-zz-zz-zzzzz&quot;,
                  &quot;is_default&quot;: false,
                  &quot;account_name&quot;: &quot;CompanyB&quot;,
                  &quot;base_uri&quot;: &quot;https://###.docusign.net&quot;,
                  &quot;organization&quot;: {
                      &quot;organization_id&quot;: &quot;zzzzz-zz-zz-zz-zzzzz&quot;,
                      &quot;links&quot;: [
                          {
                              &quot;rel&quot;: &quot;self&quot;,
                              &quot;href&quot;: &quot;https://account.docusign.com/organizations/zzzzz-zz-zz-zz-zzzzz&quot;
                          }
                      ]
                  }
              }
          ]
      }
  </code></pre>
  <p><a href="https://i.stack.imgur.com/X2xno.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/X2xno.png" alt="Admin panel User Membership screen" /></a></p>
  <h2>Additional Info Added 07/07/22</h2>
  <p>Both Company A and Company B base_uri designation is the same &quot;https://na2.docusign.net&quot;</p>
  <p>This is the /oauth/userinfo data returned using the JWT created for the Company B user account I am trying to impersonate.</p>
  <pre><code>{
      &quot;sub&quot;: &quot;xxxxx-xx-xx-xx-xxxxx&quot;,
      &quot;name&quot;: &quot;Company B&quot;,
      &quot;given_name&quot;: &quot;CompanyB&quot;,
      &quot;family_name&quot;: &quot;XYZ TEAM&quot;,
      &quot;created&quot;: &quot;2021-03-31T18:20:05.23&quot;,
      &quot;email&quot;: &quot;xyzteam@companyb.com&quot;,
      &quot;accounts&quot;: [
          {
              &quot;account_id&quot;: &quot;xxxxx-xx-xx-xx-xxxxx&quot;,
              &quot;is_default&quot;: true,
              &quot;account_name&quot;: &quot;Compan B&quot;,
              &quot;base_uri&quot;: &quot;https://na2.docusign.net&quot;,
              &quot;organization&quot;: {
                  &quot;organization_id&quot;: &quot;xxxxx-xx-xx-xx-xxxxx&quot;,
                  &quot;links&quot;: [
                      {
                          &quot;rel&quot;: &quot;self&quot;,
                          &quot;href&quot;: &quot;https://account.docusign.com/organizations/xxxxx-xx-xx-xx-xxxxx&quot;
                      }
                  ]
              }
          }
      ]
  }
  </code></pre>
  <p>The steps I take are basically the same as you outline:</p>
  <ol>
  <li>Generate JWT Access Token</li>
  <li>I am manually storing the required userinfo data userID(sub) and base_uri in a local db table.</li>
  <li>I am using CURL to make my API calls &quot; $base_uri.'/restapi/v2.1/accounts/'.$AccountID.'/views/console'&quot;</li>
  </ol>