webdew-logo-new_v2-1
   
webdew-logo-new_v2-1
Close
  • Services
  • Work
  • Resources
    • Knowledge
    • Ebooks
    • Tools
      • Website Audit
      • Website Grader
      • HubSpot ROI
  • Blog
  • About
Let's talk

  • fb-icon-01
  • tw-icon-01
  • insta-icon-01 (1)
  • linkedin-icon-01
  • youtube-icon-01
website-green-icon
Websites
  • Website Designing
  • Website Development
  • Website Migration
  • HubSpot Website
  • WordPress Website
  • Growth-Driven Design
video-blue-icon
Videos
  • 3D Videos
  • 2D Animation
  • Whiteboard Animation
  • Video Ads
  • Explainer Videos
  • Testimonial Videos
  • Onboarding Videos
  • Tutorial Videos
  • Social Media Videos
  • Product Demo Videos
marketing-yellow-icon
Marketing
  • Inbound Marketing
  • Inbound Consulting
  • Marketing Automation
  • Search Engine Optimization
  • Brand Domains
hubspot-red-icon
HubSpot
  • HubSpot Apps
  • HubSpot Themes
  • HubSpot Migration
  • HubSpot Onboarding
  • HubSpot Management
  • HubSpot Development
  • HubSpot Audit
  • Free HubSpot Demo
  • HubSpot Diamond Partner
webdew-logo-new_v2-1
  • Services
  • Work
  • Resources
    • Knowledge
    • Ebooks
    • Tools
      • Website Audit
      • Website Grader
      • HubSpot ROI
  • Blog
  • About
Let's talk

Create custom objects in HubSpot using API with this easy guide

Create custom objects in HubSpot using API with this easy guide-vbh
Tag: HubSpot
Author: Randeep Singh
Randeep Singh
Quick Links

Subscribe to Our Blog

Never Miss Any Update From Us !

An organization's success is directly dependent on the way they represent and organize their data. It is evaluated that many successful organizations have a more streamlined and organized database. Thus, to help all types of businesses, HubSpot provides the ability to create custom CRM objects to define and manage their data more efficiently. 

If you are a HubSpot Enterprise user, then you can surely leverage this feature of custom objects. Well! In HubSpot, there are four standard CRM objects, including tickets, deals, companies, and contacts.

7 essential CRM features marketers should look for in 2022

Say if you want to create more properties that will allow you better manage your data, then defining a custom object via API is the only way to fulfill your goals. 

But before we jump into the steps of creating a custom object in HubSpot, let's first know about the importance of using custom objects in HubSpot.

People using custom objects can easily; 

  • Enroll records into workflows
  • Personalize automated marketing emails
  • Report on custom object records

Are you excited about creating custom objects for your business? Now, let's learn how it actually works. 

Steps to Create Custom Objects in HubSpot using API

Let's get started….. 

Note- To get started with the creation of custom objects in HubSpot, it is vital to have a HubSpot key. 

Best HubSpot workflow examples that will nurture your leads better

How to get the HubSpot key?

Step-1 Navigate to the setting.

hubspot-setting

Step-2 Select the API key from the sidebar. Copy this API if created; if not, then create and copy HubSpot API key for permission of API. 

hubspot-api-key

Code with Request and Response

Once you get the API key, it's time to create a custom object in HubSpot using API code.

Step-3 The code added below will help you to create custom objects easily. In this code, I have named the key as "custom_users." But you can change the name as per your open requirements. 

The name and key are "custom_users." If you don't have any requirements, then you can also use this key. This code is created in PHP, and the method used is POST

Have a look at the below Curl Request- 

custom-code

code-request

Step-4 Once you run this code, you will get the response as shown in the below-added screenshot- 

custom-code-output

Step-5 If you redirect to a similar page, then it means that you have successfully created a custom object in HubSpot. Have a look at the below screenshot- 

custom-objects-successfully-created

Step-6 With the help of creating custom_users, you can create any user. In the code shared above, I have listed Name, Gender, and Email property, just as shown below. Here you can add more properties in POST requests.

custom-properties

Note- Many of you might be wondering about the association. The good news here is that you don't need to perform extra steps. When you run the above code of API, the association will be done automatically. 

associated-properties

5 most secured CRM software tools and tips to work more efficiently

Step-7 Now, if you want to get the entire data definition of custom object schema, then using the below code will help you succeed. 

With this PHP code, you can get the custom object layout to get more details. 

Method- GET

Curl Request- 

code-to-get-data-defination

Step-8 Once you run this code, you will get an output as shown below- 

data-defination-output

Step-9 Now, if you want to update the custom objects such as name, gender, etc., or want to add more fields, then you can use the below URL request. 

Here, the method used is PATCH.

https://api.hubapi.com/crm/v3/schemas/p<PORTAL_ID>_custom_users?portalId=<PORTAL_ID>&hapikey=demo

Here, you have to use your own portal ID and the name of your custom object. 

Curl Request:

code-to-update-custom-objects

Step-10 Many times, we are in a situation where we want to delete a custom object. For deletion, you can use the below code, which is written in PHP.

Here the method used is DELETE.

Curl request- 

code-to-delete-custom-objects

How to create Association Definition? 

Step-11 Usually, the above code will automatically associate each property. But if you want to associate another property that is not listed in the above code, then the below URL request will allow you to proceed further. 

The below code is created using PHP, and the method here is- POST.

https://api.hubapi.com/crm/v3/schemas/p<PORTAL_ID>_custom_users/associations?portalId=<PORTAL_ID>&hapikey=demo

Make sure you use your own portal ID. 

Curl request- 

code-to-create-association-definition

HubSpot CRM platform- affiliate

How to create an Association to an object Instance? 

Step-12 If you want to associate with different objects, then you can use the below API, where you have to use your own portal ID and custom object name. 

Here the method used is POST.

https://api.hubapi.com/crm/v3/associations/p<PORTAL_ID>_custom_users/contact/batch/create?portalId=<PORTAL_ID>&hapikey=demo

Curl Request:

creat-association-to-object-instance

create-association-to-object-Instance-2

Note- Many times; people don't know where to find the custom object ID. Well! You can refer to the below screenshot to know where you can get this ID. 

custom-object-id

Read more about- How to use HubSpot contact API.

Final Thoughts

It's well said that" Custom objects are a game-changer. They provide the flexibility to store any kind of data in HubSpot, maintaining all of the power and ease-of-use that teams need to scale and grow."

Well! Creating custom objects in HubSpot is not easy, but hopefully, the above steps will help you in creating custom objects in HubSpot using API without any hassle. By following each point and exact code, you can easily create custom objects for your unique business case. 

Still, if you face any challenges in creating custom objects in HubSpot, feel free to reach us. 
                                                                                                                               Editor- Divya Verma

Top 10 Tips to Hire HubSpot Expert for Business Growth

Related Blogs

How to develop a case study listing and detailed page using HubDB?-vbh
HubSpot

How to develop a case study listing and detailed page using HubDB?

How to create a blog listing page in HubSpot Boilerplate?-vbh
HubSpot

Create blog template in HubSpot Boilerplate with this easy guide

zc-vbh
HubSpot

HubSpot product updates January 2022

review-star

Based on 1000+ Reviews on

footer-dot-logo-img
  • Hubspot_Logo-icon
  • clutch_Logo-icon
  • upwork_Logo-icon
  • designrush_Logo-icon
  • goodfirms_Logo-icon
  • g2_Logo-icon
WE ARE GLOBAL
  • US-flag
  • CA-flag
  • IN-flag
  • GB-flag

Copyright © 2019 - 2021 Webdew, Inc. All Rights Reserved

Copyright © 2019 - 2021 Webdew Labs Inc. All Rights Reserved

Copyright © 2016 - 2021 Webdew Private Limited. All Rights Reserved

Copyright © 2019 - 2021 Webdew, Inc. All Rights Reserved

WE ARE SOCIAL
  • fb-icon-01
  • tw-icon-01
  • insta-icon-01 (1)
  • linkedin-icon-01
  • youtube-icon-01
Terms of Services
Privacy Policy