Discover the Anyleads suite | Find emails, verify emails, install a chatbot, grow your business and more!.

What is object ID in HubSpot?

What is object ID in HubSpot?

When using HubSpot's REST APIs, there are many different representations that can be returned depending on what end-point and query parameters were requested. The most common type that may come up as part of your request is "object". For example, if you use /contacts/v2/contact (the v2 represents version 2 of the contact resource), then one possible response would be something like this:

As you can see above, we only get back the basic fields associated with a specific contact record such as firstName, lastName, etc... However, if you look at the JSON data structure it will tell you exactly which field was sent from each property within the object. This makes working with their API much easier since you know where everything came from. One thing that gets confusing though, is how does HubSpot classify these contacts into multiple categories or subtypes of contacts? What determines whether they are considered Contacts, Leads, Opportunities, Campaigns, Followers, Memberships, Events, Customers, etc...? Well, one way to think about it is by looking at all the properties contained within each class and understanding the hierarchy of relationships between them. Below is a list of some of the major classes and the relationship(s) that exist among those classes:

Contacts - Contains information about individual people who interact with our company through email, phone calls, text messages, social media, etc... It also contains details related to any follow-up activities that need to happen after said interaction has been completed. In other words, leads and customers should always be included under Contacts while opportunities and campaigns should not be included unless specifically stated otherwise. When creating new contacts, make sure to include additional relevant information such as address, phone numbers, mobile number, preferred language preference, website URL, email addresses, social network profiles, etc... If you don't provide enough info during creation, then you'll receive an error message saying that either too few or irrelevant fields were provided.

Leads - A Lead is defined as someone who expresses interest in doing business with us but hasn't yet become a customer. Therefore, once someone becomes interested in becoming a client, they must transition over into being a Customer instead. This means that every lead should contain certain fields so that they can be converted into customers later down the road. These fields include things like namePrefix, givenNames, middleInitial, gender, birthdayMonth, dateOfBirthDay, currentEmailAddress, homePhoneNumber, cellPhoneNumber, workPhoneNumber, primaryLanguageCode, countryOfResidence, industry, title, jobRole, department, officeLocation, employerType, partnerCompany, websiteUrl, notes, tags, noteToCaller1, noteToCustomer1, noteToCustomer2, and more!

Customers - Generally speaking, anyone who has done business with your organization before already qualifies as a customer. As long as a person's account has never expired due to nonpayment, then they qualify as a customer regardless of what product line they purchased items from. Also, if a customer ever tries to close out their credit card without paying, then they automatically reclassify themselves into the Accounts Receivable category. If this happens, then you want to keep track of those accounts so that you can charge them accordingly.

Opportunities - An opportunity is anything that could be sold to another party including products, services, subscriptions, licenses, memberships, event tickets, physical goods, digital downloads, webinars, etc... Anytime you're going to send out promotional emails promoting special deals or discounts, chances are good that you'll be sending out opportunities along with them. You should probably take advantage of the fact that whenever you post something online, you'll usually find yourself getting contacted by companies wanting to buy whatever is being promoted. Don't worry though, because even if you put something up for sale, you still won't own it until somebody actually buys it. That's why you need to set up a payment plan prior to putting anything up for sale.

Campaigns - Similar to Opportunities, anytime you promote something online, the very next day you'll receive inquiries regarding the promotion itself. So, you might say that it isn't really necessary to add campaign records to your database just because prospects start contacting you shortly afterwards asking questions about your promotions. But, you'd be wrong to assume that. Think of it like this: suppose you run a local restaurant. Then let's say you decide to open up shop somewhere else across town. Now, even though nobody knows about your existence outside of your immediate community, you suddenly have to deal with everyone calling and texting you daily inquiring about your menu prices. Wouldn't you feel bad if you didn't allow anybody access to your previous location? Of course you would! And that same concept applies here. Just because somebody finds out about your presence doesn't mean they've necessarily signed up to your mailing list or expressed interest in buying anything from you. They simply found out about your offer and decided to ask plenty of questions to determine if they wanted to pursue further action.

Events - Whenever you hold meetings, conferences, trade shows, workshops, training sessions, sales presentations, charity events, picnics, reunions, parties, concerts, sporting events, religious gatherings, holiday dinners, birthdays, anniversaries, graduations, awards ceremonies, team building exercises, employee appreciation days, and nearly anywhere else imaginable, odds are pretty high that you'll eventually organize some kind of event. Again, just because somebody attends an event doesn't mean that they've joined your newsletter, subscribed to your eNewsletter, placed orders with you, enrolled in any programs offered by you, or registered to win prizes. All it means is that they showed up as part of a group that happened to attend that particular event.

Membership - Every time you sign up people to join your membership program, you're essentially opening up a limited liability corporation owned by whoever signs up. At least, that's true as far as legal terminology goes. From a technical standpoint, it's nothing more than giving away freebies and generating goodwill towards your brand. Regardless, if you're running a small business then you absolutely must consider offering monthly recurring billing plans to your clients. Otherwise, you'll soon find yourself overwhelmed with unpaid bills and late fees.

Followers - Each time somebody follows you, you gain ownership over their personal profile page. Depending upon your privacy settings, you can choose to display their full name, bio, headshot photo, followers count, following count, and tweets to everybody. Some businesses prefer to limit follower visibility to just their employees or partners. Others may only show their Twitter username and bio. Either way, followers shouldn't be confused with subscribers. Subscribers are individuals who have opted in to your feed while followers are actual users of your service.

So now that you understand better what constitutes an Object in HubSpot, hopefully you'll have no problem reconciling the differences between the terms used throughout its documentation. By knowing what each term means and how the system organizes its content, you'll be able to communicate clearly with internal teams responsible for implementing different parts of your platform. Keep in mind that this is often a topic that comes up quite frequently amongst developers and architects alike. Hopefully, my explanation helped clear up any confusion around what an object is. Thanks & best regards!

In HubSpot's API documentation, you'll see that there are special "objects" like Contacts and Leads. What does this mean exactly? Are these just arbitrary names or can they be related to an actual table/record within your database? And how do you know which one to use?

HubSpot recently released its latest version of the Salesforce-like cloud CMS (currently known as Apollo). This new release has some pretty unique features, but also brings with it a few quirks we've never seen before. One such quirk involves what appears to be random IDs being generated by the system - for example, if you try to edit someone's name using their own email address. How can you tell whether you're making any changes at all? Is this even safe from hackers? Shouldn't people have access to something so important?

Here's everything you need to know about Hubspot's "object IDs".

How do I create a custom property in HubSpot?

The first thing you should note here is that HubSpot uses two different sets of IDs. There is the standard set called ObjectIDs. These are numbers that look similar to the ones that Facebook generates for users. Then there is another type called CustomPropertyID. As far as I can gather, these are simply human-friendly strings of characters. The best way to explain them would be to show examples. Here are both kinds of IDs that were created while editing a Contact record:

This will not work because these are actually UserIds. If you want to add a second column to your existing records, you'll need to generate Custom Property Ids instead. They might seem confusing right now, but don't worry! Once you understand why they exist, it makes sense. To make things easier for us, let's call these "custom properties." For each user, you can choose between four distinct columns: First Name, Last Name, Email Address, and Phone Number. Each row represents a single person. You can give each individual his or her own color. So then, every time you insert a new Person row, you could assign an appropriate color. In other words, you're creating a separate entry for each person. Let's say John Doe wants to enter himself under three colors: red, blue, and green. He can choose those colors and click Create Record to save it. Now he has three rows representing him under those colors. Below are images showing how these custom properties are displayed in HubSpot:

If you ever run out of room, you can always delete unused entries. Or perhaps you'd prefer to keep them around. Either way, you can rename the columns too. That said, HubSpot doesn't allow you to rearrange or remove rows once they're inserted, nor can you duplicate certain fields. But otherwise, you can customize it however you wish.

How do I find my contact ID for HubSpot?

When you navigate through /contacts/, you'll notice that most results contain either a UserId or a CustomPropertyID. However, sometimes you may come across a result containing neither. When this happens, take a closer look at the record itself. It should provide enough information to figure out who this particular record belongs to. Sometimes, you'll discover that a given record was duplicated due to a mistake. In that case, check the modified date of the original record. If it was edited later than the copy, it means that the original record got updated without changing anything else. On the other hand, if the modification date matches up with the copied record, it probably came from somewhere else.

As mentioned earlier, it's possible to modify the order of rows inside Contact tables, meaning that you can sort your data however you want. That's great for finding items quickly, but sorting won't help you identify specific records. Fortunately, HubSpot provides easy ways to filter down to only the desired ones.

For instance, suppose you wanted to search for all leads whose last modified date falls after June 1st. You wouldn't know where to start looking unless you knew their primary key. Since HubSpot allows you to index multiple fields, you can easily find the ID of everyone who was added to a lead list since June 1st. Just perform a query like this one: SELECT * FROM [LEADS] WHERE modified > '2015-06-01' AND id = 'your_id'. Once again, the above image shows how filtered queries work:

You can even apply filters to entire lists, including leads and accounts. Say you wanted to pull up all Accounts owned by Bob Smith. All you have to do is add &filter=leadOwner%7D&filter=createdAfter%5Bdate%20of%20June%2010%2C2016%24ORDERBYupdatedDESC&sortColumn=modified DESC&offset=0 onto GET requests.

How do contacts get into HubSpot?

HubSpot utilizes APIs provided by third parties. Some of these providers include Twitter, LinkedIn, Google Maps, Uber, etc. Whenever anyone logs into their account, HubSpot checks to see if these services have authorized authorization. If they did, HubSpot automatically imports their profile details into its databases. Otherwise, users must authorize it manually.

However, HubSpot offers several security measures to protect against unauthorized profiles. Most importantly, whenever a customer signs up for HubSpot, their password gets encrypted using SSL certificates. Also, customers can enable 2FA authentication to further secure their login credentials. Lastly, HubSpot takes extra steps to prevent malicious bots from accessing sensitive information like emails and addresses.

How do I change my contact info on HubSpot?

Changing your personal information requires additional permissions. Users must explicitly grant permission to update their contact info. Only verified administrators can do this task. Verified Administrators can request updates directly from customers.

Once you log in, go to Customers -> View Customer Details. From here, select Edit Personal Info. A pop-up window will appear asking for confirmation. Click Update My Information. This process usually takes less than 10 seconds. Afterward, you can view the resulting page to double-check that everything looks good.

Now, you can repeat these same instructions with phone number and email address. Simply replace Personal Info with Phones/Emails below:

I hope this guide helped you better understand HubSpot's complex world of IDs. Hopefully, it helps you avoid headaches later on. We'll continue to explore more exciting parts of the platform soon. Stay tuned!

When you use HubSpot's enterprise-level APIs, there will come times where your code might need some extra information that isn't available in HubSpot itself. For example, if you want to get all Contacts with department_id=XYZ and add them into an array or list, it's not easy because each Contact has different properties such as firstName, lastName, etc. So how do we solve this problem? We call these "objects" since they're basically containers for individual records from database tables. These objects are identified by IDs (unique numbers). In short, every record/object stored in their databases have unique identification number called ObjectID.

Let’s take one example - The table below shows a sample contact data set which consists of three contacts with name “John Doe”. Their ObjectIDs are 1, 2, 3 respectively.

The above image also illustrates what happens when no primary key column exists in a given table. If we don’t specify any value, then SqlServer would assign it its own ID starting at 1000000 up till 9999999. This means that even though you may see two contacts having same Name but different ObjectIDs, SQL Server doesn’t guarantee uniqueness between those.

So now let’s move on to getting more specific about our topic. What exactly does this mean when referring to Objects in HubSpot? Let me explain with examples...

What are objects in HubSpot?

In plain English, objects in HubSpot refer to the rows of data returned from query results. It could be records pulled out from multiple sources like SOAP requests, RESTful web services, etc. All these queries are processed by the Engine component of the SDK. When you execute a query using the SDK, the engine returns result sets consisting of collections of objects based upon your search criteria. Each collection contains instances of particular class type say e.g. List or Collection depending on whether you queried Lead or Contact model(which represents a single row in database) respectively.

An important thing to note here is that while executing the query, the engine creates separate threads per object instance. One thread handles processing request made against that object whereas other threads handle concurrent calls coming simultaneously from clients. As mentioned earlier, each object within this set is uniquely identifiable by a numerical identifier known as ObjectID. You'll find this ID associated under the property named id whenever you access the source field of that object.

For reference purpose, you can check out the following screenshot showing how the engine processes incoming client requests and responds back to them accordingly.

As you can see from the picture above, once a query finishes execution, the engine starts returning response codes right away rather than waiting for next scheduled heartbeat cycle as most programming languages usually do. However, if there were errors during query execution or network connectivity issues preventing responses from reaching clients, the engine stops responding immediately until error handling routines kick in and process the rest of failed requests.

Now moving onto another interesting aspect of the engine - Concurrency Control feature. Anytime you make concurrent calls to retrieve large amount of data from server, chances are very high that some duplicate entries may occur due to concurrency problems. To prevent this situation, the engine employs a built-in lock mechanism inside the C++ core library. Whenever a new client makes a request, the system checks if that Client already owns a lock for that particular resource and if so, throws exception to notify caller. Otherwise, client gets exclusive permission to perform operation.

This ensures only one user can access a certain resource at a time hence reducing possibility of race conditions occurring due to simultaneous retrieval operations.

Next question is probably why did we bother talking about this detail when we know the engine automatically generates ObjectID anyway? Well, consider the scenario where you've got a big chunk of data retrieved from DB. Suppose you wish to create a copy of that set so that you can work on it later. Since the engine retrieves items sequentially according to order defined in select statement, creating copies becomes tedious. That's why instead of retrieving entire dataset, engine skips over duplicates and directly fetches required portion of data without bothering to generate new IDs.

Another reason behind this decision was to avoid unnecessary overhead incurred by generating unique IDs for each item in the resulting dataset. This is especially true for multi-threaded applications wherein several worker threads run independently on multiple cores. Generating unique ID for each entry became quite impractical since it'd require additional CPU cycles to compare newly generated ID against existing ones thus slowing down overall performance significantly.

Lastly, we should mention that although default engine uses 4 bytes unsigned integer for storing ObjectIds, developers are free to choose whatever size suits best for their needs. Just keep in mind that smaller sizes produce faster speed but lower memory usage. However, beware! Using negative values in Integer columns may lead to unexpected behavior when converting ObjectIds back to original format. Also, larger integers increase chance of collisions and potential conflicts.

What is custom objects in HubSpot?

Custom objects represent classes created specifically for performing complex tasks beyond capabilities of standard models provided by HubSpot. There are plenty of reasons why someone might need to build custom object. Some common scenarios include building simple forms, designing workflow automation logic, integrating third party apps, etc. Custom objects provide flexibility to easily modify business requirements without needing to rewrite whole application. But before writing a custom method, ensure that you familiarize yourself well with the base models provided by HubSpot. They often contain useful attributes and methods that can help implement functionality much easier.

One good practice is to start by reading documentation published online regarding whichever models you intend to customize. It provides detailed explanation regarding general structure of underlying schema, supported fields, etc. Next step would be to study the actual implementation of related functions available within those base models. Finally, try implementing something similar to validate your design approach. By doing so, you'll learn valuable skills needed to write custom methods efficiently.

There are 5 steps listed below outlining basic procedure followed by experienced engineers who have successfully developed customized objects.

1. Identify Use Case & Requirements

2. Research Models Available

3. Design Model Classes

4. Create Implementation Code

5. Test&Validate Methodology

Here's one practical example of developing custom object that implements EmailSendRequest. First off, identify use case and requirements that trigger creation of email send action. Once done, research relevant models provided by HubSpot. Search through documentations for details describing characteristics of target models. Then extract useful attributes and methods suitable for fulfilling your objective. Most importantly, remember to follow proper naming conventions. After extracting useful attributes and methods, design model classes representing specific entities involved in this task. Here's how my model looks after completion of second step.

After completing step four, go ahead and implement respective logic. Write corresponding code for calling appropriate methods found in custom model classes. Now comes the tricky part. Try testing your solution thoroughly. Don't forget to validate output produced by your script. If possible, test your solution along side real production environment to catch bugs early. Lastly, deploy your solution somewhere outside localhost and monitor traffic closely using tools like Fiddler.

How many custom objects can HubSpot have?

It depends on what kind of app you plan to develop. If your goal is to integrate external software into HubSpot, you must define custom object beforehand. On the contrary, if you're planning to simply expose your endpoints to public users, you can skip defining custom objects altogether. HubSpot allows unlimited number of custom objects for both Enterprise level customers and Developers. Only major limitation being imposed is that custom objects cannot be accessed publicly and exposed externally unless explicitly allowed.

HubSpot support team maintains a complete knowledgebase containing extensive information regarding customization guidelines including technical specifications, coding considerations, security restrictions, etc. Refer to official guides published online if you still face difficulties.

Best regards,



San Francisco

We are the leading marketing automation platform serving more than 100,000 businesses daily. We operate in 3 countries, based in San Francisco, New York, Paris & London.

Join Anyleads to generate leads

Error! Impossible to register please verify the fields or the account already exists.. Error, domain not allowed. Error, use a business email. Welcome to the Anyleads experience!
More than +200 features to generate leads
Register to start generating leads

Create your account and start your 7 day free trial!

Error! Impossible to register please verify the fields or the account already exists.. Error, domain not allowed. Error, use a business email. Welcome to the Anyleads experience! By registering you agree to the Terms and conditions agreement.
More than +200 features to generate leads

We offer multiple products for your lead generation, discover them below!

>> Unlimited access to all products with one single licensecheck our pricing.