This is a YouTube video titled "Create and Update Records in a Single Upsert Endpoint" created on July 11, 2024. The content features a single speaker named Brooke from HubSpot explaining how to use the new upsert endpoints in the CRM objects API to create or update records efficiently, including setting unique properties to prevent duplicates.
Hey y', all, It's Brooke with HubSpot. Today we're going to go over the new upsert endpoints. These endpoints are available for the CRM objects API. The upsert endpoints can be used to create new HubSpot records or update existing records in bulk. These batch endpoints reduce the risk of creating duplicate records, and they consolidate create and update operations into a single endpoint. Also, you don't need to perform lookups to check whether a record already exists before submitting the request. The endpoint handles this for you and will create a new record if the unique ID property doesn't exist or will update the existing record it finds. So let's go ahead and see how we can use the new upsert endpoint. The first thing that we'll want to do is make sure that we have a unique property for one of our objects. You can use this endpoint for custom objects. So let's go ahead and look at the custom objects I have available here. In the main navigation, click on CRM and it should list out the different custom objects you have available to you. And this one we have a Books custom object, and it just lists out different books and their authors and publishers. So in order to make this work with our upsert endpoint, we need to create a unique property of. A unique property must be special for each record, which is why we're using it inside of the Upsert API. This means that when you look for that unique record, it should only show up once in the different records you have available, and that means it'll stop duplication from happening. So to go ahead and add a property to our Books record, let's go into the settings in the top navigation, click on the Settings icon, and then when we're on the book setting page, go ahead and click on Manage Book Properties. Each object that you create can have up to 10 unique properties. So now let's go ahead and click on Create Property. In the group dropdown, we're going to select Book Information. And then for the label, let's do the ISBN, which is the International Standard Book number. We can leave the description blank. And then we're going to click Next for our field type. Because the ISBN is a 13 digit number that is formatted specifically, let's just go ahead and make it a single line text. And then we're going to click on Next. And now here when we select our property rules, this is where you're going to go ahead and click on the validation.