Skip to main content

Why a user might belong to the wrong group — and how to fix it

Updated over 2 weeks ago

If you’re seeing users assigned to the wrong group in June, this is always due to the group identify call being implemented or triggered incorrectly.

Groups are created and managed exclusively based on the group identify call your product sends — there is no other mechanism in place that assigns or reassigns users to groups. Below are the most common reasons why a user might end up in the wrong group:

A. Frequent issues

1. All users are assigned to the same group

This typically means there’s a bug in how the group identify call is implemented. For example, if your product is hardcoding a default group ID or not correctly pulling the workspace ID or organization ID per user, every user may end up in the same group.

To check your group calls, go to your developer console in the settings: https://analytics.june.so/a/go-to-my-workspace/settings/developers

2. The user logged into the wrong workspace

Once a user is assigned to a workspace, they will belong to that group permanently, unless deleted. This can happen if a user accidentally logs into or signs up via the wrong workspace even once — the group identify call will fire and assign them to that workspace.

3. Impersonation or admin access

Sometimes team members log into a customer’s account for support or debugging. If a group identify call is triggered while impersonating a customer, the team member will be assigned to the customer’s workspace. This is a common edge case and something to look out for if you see internal team members showing up in external groups.

4. Staging or testing environments

If your team is testing in staging environments but using live group identifiers, or if developers test accounts with real group IDs, this can result in incorrect group assignments being sent to production.

5. Group identifiers changing over time

If your app re-uses user IDs but updates group IDs (e.g. during migrations or workspace changes), and you’re not consistently triggering the correct group call on every login or session, users can end up lingering in a stale group.

How to fix it: Remove the user from the wrong group

To remove a user from the wrong workspace (group), you’ll need to delete them via our API. This will wipe their existing group assignment so that next time they use the product, the correct group identify call can reassign them properly.

Step-by-step: How to delete a user via the API

  1. Make an authenticated API request to the user deletion endpoint:
    DELETE https://api.june.so/users/{user_id}

  2. Replace {user_id} with the actual user ID you want to delete — this should be the same ID you send in your identify calls.

  3. Include your API key as a Bearer token in the request header:

    httpCopyEditAuthorization: Bearer YOUR_API_KEY
  4. Here’s a sample curl command you can run:

    bashCopyEditcurl -X DELETE https://api.june.so/users/12345 \ -H "Authorization: Bearer YOUR_API_KEY"

After deletion, if the user logs in again and your app correctly triggers the group identify call with the intended group ID, they’ll be re-assigned to the right group automatically.

Did this answer your question?