I'm trying to find a more efficient way to update (enable/disable) a large list of users. Currently we use the following API endpoint, passing the user's keycloak id.
const userEnabled = formData.enabled ? 1 : 0;
awaitfetch(`${keycloakApiUrl}/admin/realms/myRealm/users/${user.keycloakId}`, {
method: 'PUT',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
enabled: userEnabled,
})
});
But what if I have a list of users that need to be disabled? Is there a more efficient way to disable/enable users without making a http request for each one? Please advise