# 409 Conflict problem when creating/updating contacts

**URL:** <https://community.hubspot.com/t/409-conflict-problem-when-creating-updating-contacts/75865>\
**Category:** APIs & Integrations\
**Tags:** contacts\
**Created:** [February 23, 2023, 4:12pm UTC](https://community.hubspot.com/t/409-conflict-problem-when-creating-updating-contacts/75865 "2023-02-23T16:12:03Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ncarps](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/ncarps/32/191536_2.png) [@ncarps](https://community.hubspot.com/u/ncarps)\
**Post date:** [February 23, 2023, 4:12pm UTC](https://community.hubspot.com/t/409-conflict-problem-when-creating-updating-contacts/75865/1 "2023-02-23T16:12:03Z")

</div>

I have some logic in a custom app that creates or updates a contact depending on whether it exists in Hubspot or not.

To determine whether a contact exists or not, i’m using the search API, and searching contacts by email address.

In some cases, i’m creating a contact (via the api) - and then almost immediately updating the contact. When updating at this point, the contact that’s just been created isn’t found using the search api - so my app tries to create the contact again. However, at this point, i’m getting a 409 conflict error saying that the contact already exists.

My question is how come the Search API doesn’t find contacts that have just been created?

---

<div class="post-metadata">

**Author:** ![Jaycee\_Lewis](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jaycee_lewis/32/61352_2.png) [@Jaycee\_Lewis](https://community.hubspot.com/u/Jaycee_Lewis)\
**Post date:** [February 24, 2023, 5:13pm UTC](https://community.hubspot.com/t/409-conflict-problem-when-creating-updating-contacts/75865/2 "2023-02-24T17:13:12Z")

</div>

Hi, @ncarps 👋 Have you looked at adding a slight delay into your process. I didn’t find a specific document for this behaviour. Looking at replies from other HubSpotters on similar issues in the community ([example](https://community.hubspot.com/t5/APIs-Integrations/A-delay-before-the-Events-API-returns-all-events/m-p/572774/highlight/true#M50756)), I see that there can be a delay of 5–10 seconds for this data to be fully indexed and available to the Search API.

Best,

Jaycee

---

<div class="post-metadata">

**Author:** ![ncarps](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/ncarps/32/191536_2.png) [@ncarps](https://community.hubspot.com/u/ncarps)\
**Post date:** [February 27, 2023, 9:22am UTC](https://community.hubspot.com/t/409-conflict-problem-when-creating-updating-contacts/75865/3 "2023-02-27T09:22:50Z")

</div>

Hi [@Jaycee\_Lewis](https://community.hubspot.com/t5/user/viewprofilepage/user-id/127074) - yes that’s what it looks like I’ll have to do. I was hoping there might be something a bit more solid than that but if that’s the best way to avoid the conflict errors then so be it.

Thanks 👍

---

<div class="post-metadata">

**Author:** ![Jaycee\_Lewis](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jaycee_lewis/32/61352_2.png) [@Jaycee\_Lewis](https://community.hubspot.com/u/Jaycee_Lewis)\
**Post date:** [February 27, 2023, 10:42pm UTC](https://community.hubspot.com/t/409-conflict-problem-when-creating-updating-contacts/75865/4 "2023-02-27T22:42:35Z")

</div>

Hi, @ncarps I agree 100%.

I found this bit at the very bottom of the Search API documentation — [Limitations](https://developers.hubspot.com/docs/api/crm/search#limitations). “It may take a few moments for newly created or updated CRM objects to appear in search results.”

Just non-specific enough to allow for some ~~wiggle room~~ flexibility 😊

Best,

Jaycee
