Skip to main content

I have a script, which attempts to create a contact, and if it already exists but is archived, parses the id from the failed message and deletes the contact. Here are the logs from that script:

 

```

Original contact id: 672291a52c6b471a4b20e202


--- now let’s call the delete contact endpoint ---
Deleted contact response: {"id":"672291a52c6b471a4b20e202","external_id":"<excluded>","type":"contact","deleted":true}

 

-- now let’s attempt to recreate the contact --
<16:45:54.629] FATAL (64427): Failed to recreate contact: {"type":"error.list","request_id":"0011vqbd9jo6drvesao0","errors":r{"code":"conflict","message":"An archived contact matching those details already exists with id=672291a52c6b471a4b20e202"}]}

```

 

As you can see, the delete contact endpoint is returning success, but it’s not actually deleting the contact, because my subsequent attempt to recreate the contact fails.

Hey @Makeswift Support! Jacques here from support engineering.

When you delete a contact in Intercom using the delete endpoint, it acts as a soft delete initially, which means the contact is not actually deleted until after a grace period. This is why you're seeing a successful deletion response but are unable to recreate the contact immediately. The contact has entered the permanent deletion process and cannot be restored or re-imported until after the grace period has passed. This grace period is in place to prevent user IDs and emails from being immediately reused, which ensures that deleted objects are not immediately replaced by new ones with the same identifiers.

To resolve this issue, you should wait for the grace period to expire before attempting to re-import the contact (The grace period after deleting a contact in Intercom is 7 days).

Hope this clears things up!


Reply