Is it possible to archive a contact by email?
Referring to:
CRM API | Contacts (hubspot.com)
DELETE/crm/v3/objects/contacts/{contactId}
This works in Ruby for an update:
api_client.crm.contacts.basic_api.update(id_property: 'email', contact_id: "email@example.com, body: body)
But does not work for archiving:
api_client.crm.contacts.basic_api.archive(id_property: 'email', contact_id: "email@example.com")
Error response from HubSpot API is
Response body: {"status":"error","message":"Object not found. objectId are usually numeric.","correlationId":"a1f1f96d-9d1a-496e-a962-93aea9d0598b","context":{"id":["email@example.com"]},"category":"OBJECT_NOT_FOUND"}
Hi, @SCalderwood
I can confirm this isn’t a feature. I tried using the v1 and v3 endpoints with no success. I also tried including the email and idProperty=email as a query param, but that did not work either.
Postman example of my request:
DELETE https://api.hubapi.com/crm/v3/objects/contacts/jaycee3+test@gmail.com?archived=false&idProperty=email
Response
{
"status": "error",
"message": "Object not found. objectId are usually numeric.",
"correlationId": "14449d10-99ef-4efd-9ee9-250bf6a70f0a",
"context": {
"id": [
"jaycee3+test@gmail.com"
]
},
"category": "OBJECT_NOT_FOUND"
}
If you have a moment, adding your suggestion to the Ideas Community and getting some upvotes will be very helpful in getting your suggestion in front of the Product team. If you add a link back to your Idea post, I’ll be sure to give it an upvote to help get the ball rolling.
Best,
Jaycee