title: Deleting an user in Azure AD through graph in Express API
body: <p>I have an API through which I want to delete an user in Azure AD.</p>
  <p>The API is registered, and has the following application scope to access graph:</p>
  <ul>
  <li>User.ReadWrite.All (Which according to the <a href="https://docs.microsoft.com/en-us/graph/api/user-delete?view=graph-rest-1.0&amp;tabs=http" rel="nofollow noreferrer">documentation</a> should be enough)</li>
  </ul>
  <p>Additionally, the API has the default roles that are assigned upon creation, that is:</p>
  <ul>
  <li>Attribute assignment administrator</li>
  <li>Attribute assignment reader</li>
  <li>Cloud application administrator</li>
  <li>Reports reader</li>
  </ul>
  <p>^ Not sure if these matters though - Nonetheless, I'm not sure that I can assign any additional roles under the free tier.</p>
  <p>Anyway, I'm calling graph as follows:</p>
  <pre><code>module.exports.deleteUserById = async (objectId) =&gt; {
      const ccrRequest = {
          scopes: ['https://graph.microsoft.com/.default'],
      }
      const accessToken = await cca.acquireTokenByClientCredential(ccrRequest)
  
      const options = {
          method: &quot;DELETE&quot;,
          headers: { 'Authorization': `Bearer ${accessToken.accessToken}`, 'Content-Type': &quot;application/json&quot; },
      }
  
      return await fetch(graphUsers() + `/${objectId}`, options)
  }
  </code></pre>
  <p>The above should work, however when I'm attempting to delete any given user, the call returns an error:</p>
  <blockquote>
  <p>code:'Authorization_RequestDenied' message:'Insufficient privileges to complete the operation.'</p>
  </blockquote>