Hello guys,
I got stuck while creating an integration on creating records for new created custom objects. The issue is that i cannot find the api that helps get the records under a specific custom object and also updating them
Hi, @ABello86
Here’s a few quick examples from the Custom Objects documentation:
In the tab group for Basic, on the Endpoints tab, you’ll find
- Create a record (for your Custom Object) POST
/crm/v3/objects/{objectType} - Get a record by ID GET
/crm/v3/objects/{objectType}/{objectId} - Update a record PATCH
/crm/v3/objects/{objectType}/{objectId}
For example, I have a custom object called Cats with one record named Tuxedo:
- its Object ID is 2-12170198
- the Record ID is 5419757487
- I have a property called Skill
-
to update this record, my request would look like this:
curl --request PATCH \ --url https://api.hubapi.com/crm/v3/objects/2-12170198/5419757487 \ --header 'authorization: Bearer YOUR_ACCESS_TOKEN' \ --header 'content-type: application/json' \ --data '{ "properties": { "skill": "juggling;culinary arts" } }' -
and the successful response:
HTTP 200 { "id": "5419757487", "properties": { "hs_all_accessible_team_ids": "12073943", "hs_created_by_user_id": "10233975", "hs_createdate": "2023-03-03T21:16:43.245Z", "hs_lastmodifieddate": "2023-03-14T19:26:31.077Z", "hs_object_id": "5419757487", "hs_updated_by_user_id": "10233975", "hs_user_ids_of_all_owners": "10233975", "hubspot_owner_assigneddate": "2023-03-06T18:47:26.168Z", "hubspot_owner_id": "198670650", "hubspot_team_id": "12073943", "skill": "juggling;culinary arts" }, "createdAt": "2023-03-03T21:16:43.245Z", "updatedAt": "2023-03-14T19:26:31.077Z", "archived": false }
Have fun building! — Jaycee
How do I make an update like this using a unique value aside from the object ID? For example, if I enforce unique names for pets, how do I update a custom pet object using their name instead of the HubSpot ID?
Hey, @DarMan
To clarify, you are asking about this part of the instructions of Updating a Custom Object record? — “or optionally any unique property value as specified by the idProperty query param”
Meaning, if I have a custom object property called `cat_mood` with unique values enforced? If so, I can get a quick example posted here.
Best,
Jaycee
Yes. In this example, I might want to update all records of the `cat` object where `cat_mood` was `none` and use `n.a.` as the value instead. Another way would be to update `cat` records based on the name of the owner, which is a string.

