Duplicates users (same email and same userID) | Community
Skip to main content
Answered

Duplicates users (same email and same userID)


Hi,

 

We are experiencing duplicates creation on intercom for the same userIds and emails, the example is below:

I think that the problem is on SDK side or/and API calls to Intercom.

For example, to update existing user we do a post request to search by email intercom id and update that contact, but it looks like sometimes (event if a user exists on Intercom ) by some reason we are not always getting intercom id back and then the script creates "a new contact"  (or it is something within SDK). The issue is that it is not a new contact and it should not work like that. Eventually these duplicated users go to "onboarding" series, but they are old and should not get any onboarding emails..

What could be the issue and solve it? Maybe it is about API/SDK update?...

 

Best,

Anastasia

Best answer by mateusz.leszkiewicz

Hi ​@Anastasia Markina and ​@Inés B.

Thank you for bringing up this important issue about duplicate user creation. This is actually a known behavior in Intercom that can occur due to several technical reasons. Let me explain what's happening and how to address it.

 

Why Duplicates Are Created

Intercom's user identification system works with multiple identifiers: email, user_id, and anonymous_id. Duplicates can be created in these scenarios:

1. Identifier Mismatch

If you have an existing user with an email but no user_id, and you make a request with both the same email AND a new user_id, Intercom may create a new user instead of updating the existing one. This is by design to prevent accidental data merging.

2. Race Conditions

When multiple API calls happen simultaneously (which is common in high-traffic applications), two requests might try to create the same user at nearly the same time. The first request might not complete before the second one starts, causing both to think the user doesn't exist.

3. API Search Failures

Sometimes when you search by email to get the Intercom ID, the API call might:

  • Time out
  • Return an error
  • Have temporary connectivity issues
  • Face rate limiting

In these cases, your script doesn't get the ID back even though the user exists, so it creates what it thinks is a "new" contact.

4. SDK Caching Issues

Some SDKs implement local caching that might not be immediately updated when users are created through other channels, leading to stale data.

 

Solutions & Best Practices

Immediate Fixes:

  • Implement Retry Logic: Add retry mechanisms with exponential backoff when searching for users
  • Use Robust Error Handling: Check for specific error types and handle them appropriately
  • Implement Proper Logging: Log all user creation attempts to identify patterns

API Best Practices:

  • Use Consistent Identifiers: Always use the same combination of identifiers (email + user_id)

  • Implement Idempotency: Make your user creation calls idempotent by checking multiple times

  • Handle Rate Limits: Implement proper rate limiting and retry logic

  • Use Webhooks: Consider using Intercom webhooks to get notified of user events instead of polling


    // Pseudo-code for robust user handling
    async function findOrCreateUser(email, userId) {
      try {
        // First attempt - search with retry logic
        let user = await searchUserWithRetry(email, userId);
        if (user) return user;
        
        // If not found, attempt creation
        return await createUserWithRetry(email, userId);
        
      } catch (error) {
        // Log and handle specific error types
        handleUserCreationError(error, email, userId);
      }
    }

Prevention Strategies:

  • Regular Duplicate Cleanup: Implement a process to regularly identify and merge duplicates
  • Monitoring: Set up alerts for unusual duplicate creation patterns
  • User Journey Mapping: Review your user onboarding flow to identify duplicate creation points

Onboarding Series Issue

The reason duplicates are entering your onboarding series is likely because they're being treated as "new" users. You can prevent this by:

  • Adding filters to your onboarding series based on user creation date vs. account age
  • Using custom attributes to track actual user lifecycle stage
  • Implementing duplicate detection before triggering campaigns

@Anastasia Markina - I noticed you started a conversation with Fin but didn't respond in time for it to reach a human agent. Did you see Fin's reply, and is everything working properly on your end?

This is definitely a solvable issue, and with the right implementation patterns, you can significantly reduce duplicate creation. The key is implementing robust error handling and retry logic in your integration code.

Hope this helps! Let me know if you need clarification on any of these points.
It is best to reach out to us directly via Messenger in your workspaces so we can definitely investigate why duplicates are created in your particular situation.
Although issue with user duplicates might seem similar in both Ines and Anastasia workspaces the root cause might be totally different in those cases.

View original
Did this topic help you find an answer to your question?

3 replies

Anastasia Markina wrote:

Hi,

 

We are experiencing duplicates creation on intercom for the same userIds and emails, the example is below:

I think that the problem is on SDK side or/and API calls to Intercom.

For example, to update existing user we do a post request to search by email intercom id and update that contact, but it looks like sometimes (event if a user exists on Intercom ) by some reason we are not always getting intercom id back and then the script creates "a new contact"  (or it is something within SDK). The issue is that it is not a new contact and it should not work like that. Eventually these duplicated users go to "onboarding" series, but they are old and should not get any onboarding emails..

What could be the issue and solve it? Maybe it is about API/SDK update?...

 

Best,

Anastasia

example:
 

 


  • New Participant
  • 1 reply
  • August 1, 2025

Hello! We are also experiencing the same problem, Anastasia. We contacted support, but they told us that the problem is on our end. If the problem occurs repeatedly with different companies or businesses, perhaps they can help us find a solution.

 

We look forward to your help!

 

Thank you very much in advance.


mateusz.leszkiewicz
Intercom Team
Forum|alt.badge.img+7

Hi ​@Anastasia Markina and ​@Inés B.

Thank you for bringing up this important issue about duplicate user creation. This is actually a known behavior in Intercom that can occur due to several technical reasons. Let me explain what's happening and how to address it.

 

Why Duplicates Are Created

Intercom's user identification system works with multiple identifiers: email, user_id, and anonymous_id. Duplicates can be created in these scenarios:

1. Identifier Mismatch

If you have an existing user with an email but no user_id, and you make a request with both the same email AND a new user_id, Intercom may create a new user instead of updating the existing one. This is by design to prevent accidental data merging.

2. Race Conditions

When multiple API calls happen simultaneously (which is common in high-traffic applications), two requests might try to create the same user at nearly the same time. The first request might not complete before the second one starts, causing both to think the user doesn't exist.

3. API Search Failures

Sometimes when you search by email to get the Intercom ID, the API call might:

  • Time out
  • Return an error
  • Have temporary connectivity issues
  • Face rate limiting

In these cases, your script doesn't get the ID back even though the user exists, so it creates what it thinks is a "new" contact.

4. SDK Caching Issues

Some SDKs implement local caching that might not be immediately updated when users are created through other channels, leading to stale data.

 

Solutions & Best Practices

Immediate Fixes:

  • Implement Retry Logic: Add retry mechanisms with exponential backoff when searching for users
  • Use Robust Error Handling: Check for specific error types and handle them appropriately
  • Implement Proper Logging: Log all user creation attempts to identify patterns

API Best Practices:

  • Use Consistent Identifiers: Always use the same combination of identifiers (email + user_id)

  • Implement Idempotency: Make your user creation calls idempotent by checking multiple times

  • Handle Rate Limits: Implement proper rate limiting and retry logic

  • Use Webhooks: Consider using Intercom webhooks to get notified of user events instead of polling


    // Pseudo-code for robust user handling
    async function findOrCreateUser(email, userId) {
      try {
        // First attempt - search with retry logic
        let user = await searchUserWithRetry(email, userId);
        if (user) return user;
        
        // If not found, attempt creation
        return await createUserWithRetry(email, userId);
        
      } catch (error) {
        // Log and handle specific error types
        handleUserCreationError(error, email, userId);
      }
    }

Prevention Strategies:

  • Regular Duplicate Cleanup: Implement a process to regularly identify and merge duplicates
  • Monitoring: Set up alerts for unusual duplicate creation patterns
  • User Journey Mapping: Review your user onboarding flow to identify duplicate creation points

Onboarding Series Issue

The reason duplicates are entering your onboarding series is likely because they're being treated as "new" users. You can prevent this by:

  • Adding filters to your onboarding series based on user creation date vs. account age
  • Using custom attributes to track actual user lifecycle stage
  • Implementing duplicate detection before triggering campaigns

@Anastasia Markina - I noticed you started a conversation with Fin but didn't respond in time for it to reach a human agent. Did you see Fin's reply, and is everything working properly on your end?

This is definitely a solvable issue, and with the right implementation patterns, you can significantly reduce duplicate creation. The key is implementing robust error handling and retry logic in your integration code.

Hope this helps! Let me know if you need clarification on any of these points.
It is best to reach out to us directly via Messenger in your workspaces so we can definitely investigate why duplicates are created in your particular situation.
Although issue with user duplicates might seem similar in both Ines and Anastasia workspaces the root cause might be totally different in those cases.


Reply