title: How to Create User with REST Post Request in KeyCloak?
body: <p>Hi I try to create or get users from KeyCloak with an API Request.</p>
  <p>My Keycloak Client Configuration is as follows:</p>
  <pre><code>Client Protocol: openid-connect
  Access Type: confidential
  Direct Access Grants Enabled: ON
  Service Accounts Enabled: ON
  </code></pre>
  <p>In <code>&quot;MyRealm&quot; -&gt; &quot;Cients&quot; -&gt; &quot;Service Account Roles&quot;</code> in <code>&quot;Client Roles&quot;</code> I added <code>&quot;view-users&quot;</code> and <code>&quot;manage-users&quot;</code>
  <a href="https://i.stack.imgur.com/caY5m.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/caY5m.png" alt="enter image description here" /></a></p>
  <p>After retrieving an Access Token with <code>&quot;client-id&quot;</code>, <code>&quot;client-secret&quot;</code>, <code>&quot;username&quot;</code>, <code>&quot;password&quot;</code> and <code>&quot;grant-type&quot; : &quot;password&quot;</code> which works fine, I try the following REST API Call:</p>
  <pre><code>GET http://localhost:8180/auth/admin/realms/MyRealm/users
  -Header &quot;Authorization&quot; &quot;Bearer &quot; + {accesstoken}&quot;
  </code></pre>
  <p>but I only get {&quot;error&quot;:&quot;unknown_error&quot;} back</p>
  <p>Same while trying to create a user with</p>
  <pre><code>POST http://localhost:8180/auth/admin/realms/MyRealm/users
  -Header &quot;Authorization&quot; &quot;Bearer &quot; + {accesstoken}&quot;
          &quot;Content-Type&quot;  &quot;application/json&quot;
  
  -Body {&quot;username&quot;:&quot;mid&quot;,
         &quot;email&quot;:&quot;bla@gtestmail.com&quot;, 
         &quot;firstName&quot;:&quot;mi&quot;,
         &quot;lastName&quot;:&quot;di&quot;,
         &quot;enabled&quot;:&quot;true&quot;
         }
  </code></pre>
  <p>Do I need to change any specific configurations in Keycloak to get or create Users?</p>