<div dir="ltr">There&#39;s no bulk operations available yet I&#39;m afraid</div><div class="gmail_extra"><br><div class="gmail_quote">On 27 June 2016 at 14:51, Haim Vana <span dir="ltr">&lt;<a href="mailto:haimv@perfectomobile.com" target="_blank">haimv@perfectomobile.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">





<div lang="EN-US" link="blue" vlink="purple">
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d">Thanks – it will work.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d">I wonder if they have bulk operations in the API, for example for deleting all users, now I have to get all of them and delete them one by one.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif">From:</span></b><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif"> Thomas Darimont [mailto:<a href="mailto:thomas.darimont@googlemail.com" target="_blank">thomas.darimont@googlemail.com</a>]
<br>
<b>Sent:</b> Monday, June 27, 2016 3:49 PM<br>
<b>To:</b> Haim Vana &lt;<a href="mailto:haimv@perfectomobile.com" target="_blank">haimv@perfectomobile.com</a>&gt;<br>
<b>Cc:</b> <a href="mailto:keycloak-user@lists.jboss.org" target="_blank">keycloak-user@lists.jboss.org</a><br>
<b>Subject:</b> Re: [keycloak-user] Listing all realm users programmatically<u></u><u></u></span></p><div><div class="h5">
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal">Hello Haim,<u></u><u></u></p>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">I think the following does what you are look for.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">int pageIndex = 0;<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">int pageSize = 1000;<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">String realmName = &quot;master&quot;;<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">List&lt;UserRepresentation&gt; results =  keycloak.realm(realmName).users().search(null, null, null, null, pageIndex * pageSize, pageSize)<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">where Keycloak is org.keycloak.admin.client.Keycloak.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Cheers,<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">Thomas<u></u><u></u></p>
</div>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal">2016-06-27 11:59 GMT+02:00 Haim Vana &lt;<a href="mailto:haimv@perfectomobile.com" target="_blank">haimv@perfectomobile.com</a>&gt;:<u></u><u></u></p>
<blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<div>
<div>
<p class="MsoNormal">Hi,<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">Is there a way to list all realm users programmatically via the API ? also is there a way to delete all of them ?<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">I think I should use the below, however what should I insert in the search method for getting all the users ?<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal" style="background:white">
<b><i>keyCloakClient.realms().realm(realmName).users().search()</i></b><u></u><u></u></p>
<p class="MsoNormal" style="background:white">
<span style="font-size:11.5pt;font-family:&quot;Courier New&quot;;color:black"> </span><u></u><u></u></p>
<p class="MsoNormal" style="background:white">
<span style="font-size:11.5pt;font-family:&quot;Courier New&quot;;color:black"> </span><u></u><u></u></p>
<p class="MsoNormal" style="background:white">
Thanks,<u></u><u></u></p>
<p class="MsoNormal" style="background:white">
Haim.<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
<p class="MsoNormal">The information contained in this message is proprietary to the sender, protected from disclosure, and may be privileged. The information is intended to be conveyed only to the designated recipient(s) of the message. If the reader of this
 message is not the intended recipient, you are hereby notified that any dissemination, use, distribution or copying of this communication is strictly prohibited and may be unlawful. If you have received this communication in error, please notify us immediately
 by replying to the message and deleting it from your computer. Thank you. <u></u><u></u></p>
</div>
<p class="MsoNormal"><br>
_______________________________________________<br>
keycloak-user mailing list<br>
<a href="mailto:keycloak-user@lists.jboss.org" target="_blank">keycloak-user@lists.jboss.org</a><br>
<a href="https://emea01.safelinks.protection.outlook.com/?url=https%3a%2f%2flists.jboss.org%2fmailman%2flistinfo%2fkeycloak-user&amp;data=01%7c01%7chaimv%40perfectomobile.com%7c98803c82d8774a42632a08d39e8986b0%7cceb4c662d6994e7da0bd272619a46977%7c1&amp;sdata=mwtkqt04R%2bkcj6V9tGCBFdI818kB%2fgEYY1oNx4elTHA%3d" target="_blank">https://lists.jboss.org/mailman/listinfo/keycloak-user</a><u></u><u></u></p>
</blockquote>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div></div></div><div><div class="h5">
The information contained in this message is proprietary to the sender, protected from disclosure, and may be privileged. The information is intended to be conveyed only to the designated recipient(s) of the message. If the reader of this message is not the
 intended recipient, you are hereby notified that any dissemination, use, distribution or copying of this communication is strictly prohibited and may be unlawful. If you have received this communication in error, please notify us immediately by replying to
 the message and deleting it from your computer. Thank you.
</div></div></div>

<br>_______________________________________________<br>
keycloak-user mailing list<br>
<a href="mailto:keycloak-user@lists.jboss.org">keycloak-user@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/keycloak-user" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/keycloak-user</a><br></blockquote></div><br></div>