title: Gmail API using service account is getting delegation denied error message
body: <p>I am developing a web-based application using Google API. I am using server-to-server which is obviously with a service account. I am almost done.</p>
  
  <p>I can now insert new users through Google api. I can even create and/or give newly created users access to a Team Drive through Google API. Meaning, I have a service-account that can impersonate all domain users.</p>
  
  <p>The Problem:
  But why am I getting errors when trying to impersonate a user through Gmail API? I need to add Gmail Labels and Filters to newly created users but I am getting  an error message stating "Deligation denied". Am I missing something? </p>
  
  <p>Obviously I have a working service-account settings already with proper scopes in G Suite. I guess userID "me" is  not an option since my application needs to impersonate a newly created G Suite user. Please correct me if I am wrong.</p>
  
  <pre><code>$service = new \Google_Service_Gmail($this-&gt;client($scopes));
  
  $serviceLabel = new \Google_Service_Gmail_Label();
  $serviceLabel-&gt;setLabelListVisibility('labelShow');
  $serviceLabel-&gt;setMessageListVisibility('show');
  $serviceLabel-&gt;setName($label_name);
  
  try {
      $resp = $service-&gt;users_labels-&gt;create($email, $serviceLabel);    
  } catch (Google_Service_Exception $e) {
     return false;
  }
  </code></pre>
  
  <p>Here is the error I am getting</p>
  
  <pre><code>{#398 ▼
    +"statusCode": 403
    +"errors": array:1 [▼
      0 =&gt; array:3 [▼
        "domain" =&gt; "global"
        "reason" =&gt; "forbidden"
        "message" =&gt; "Delegation denied for service-account-user@domain.com"
      ]
    ]
    +"message": """
      {
       "error": {
        "errors": [
         {
          "domain": "global",
          "reason": "forbidden",
          "message": "Delegation denied for service-account-user@domain.com"
         }
        ],
        "code": 403,
        "message": "Delegation denied for service-account-user@domain.com"
       }
      }
      """
  }
  </code></pre>
  
  <p>A Gmail Label is expected to be added automatically for each user being created through the application.</p>