# Handle Custom Object unique constraint error

**URL:** <https://community.hubspot.com/t/handle-custom-object-unique-constraint-error/66382>\
**Category:** APIs & Integrations\
**Created:** [October 3, 2022, 5:29pm UTC](https://community.hubspot.com/t/handle-custom-object-unique-constraint-error/66382 "2022-10-03T17:29:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![robyn1](https://avatars.discourse-cdn.com/v4/letter/r/a6a055/32.png) [@robyn1](https://community.hubspot.com/u/robyn1)\
**Post date:** [October 3, 2022, 5:29pm UTC](https://community.hubspot.com/t/handle-custom-object-unique-constraint-error/66382/1 "2022-10-03T17:29:52Z")

</div>

Is there a way to reliable identify errors thrown when creating a custom object due to unique constraint/the object already exists?

An example error response from a sandbox account is below. Is the error body reliable or possibly differ in the future?

Error: HTTP-Code: 400

Message: An error occurred.

Body: {“status”:“error”,“message”:“Cannot set PropertyValueCoordinates{objectTypeId=ObjectTypeId{metaTypeId=2}, propertyName=line\_id, value=robyn-test-id} on XXXX259. XXXX905 already has that value.”,

“category”:“VALIDATION\_ERROR”}

---

<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:** [October 4, 2022, 9:21pm UTC](https://community.hubspot.com/t/handle-custom-object-unique-constraint-error/66382/2 "2022-10-04T21:21:01Z")

</div>

Hi, @robyn1 👋 Are you asking if there is set list of error responses for this endpoint? Or something you can reference?

Thanks for clarifying! — Jaycee

---

<div class="post-metadata">

**Author:** ![robyn1](https://avatars.discourse-cdn.com/v4/letter/r/a6a055/32.png) [@robyn1](https://community.hubspot.com/u/robyn1)\
**Post date:** [October 4, 2022, 9:33pm UTC](https://community.hubspot.com/t/handle-custom-object-unique-constraint-error/66382/3 "2022-10-04T21:33:15Z")

</div>

Hey [@Jaycee\_Lewis](https://community.hubspot.com/t5/user/viewprofilepage/user-id/127074) , I’m looking for a set list of error responses for this endpoint. I really only need a reliable way to check the error above was thrown. We want to catch this error and respond by using the search endpoint vs throwing in all other instences.

Is the error body text reliable to query or likely to change?
