ID ranges

Hi,

What are the ID ranges used in the API? I need to know in order to find the correct type to handle them in our integration. Please mention a general range in the form [start,end], and possible exceptions if there are any.

Thanks

If you’re referring to object IDs, for practical purposes we use 64-bit unsigned integers, so something like a Java long should allow you to store any object IDs.

If you’re referring to some other IDs, can you clarify which they are?

Hi Derek,

Well, I am interested in all IDs that you expose in the API really. Are there other IDs I need to consider that have a different format? Maybe the portal id is a non object ID? I explicitly asked for a specific range rather than a datatype, so that I can better validate them; So is the ID range actually [0,18446744073709551615], or rather [1,18446744073709551615]?

Regards,

Johanens M.

Hey @Johannes-mue,

There are a number of different types of ID that HubSpot uses in different tools. Some tools like forms use GUIDs, like the old example from my account below. There is no hard range on a GUID like this, but they’ll all generally follow the same format.

Object records have numeric IDs, and these are stored in memory as 64 bit unsigned integers. While technically you’re correct that the current full range of object IDs is between 1 and (2^64) -1, in reality the highest existing object ID is significant lower. Portal IDs are the same, except the highest portal ID is even lower, given that each portal can have many objects.

I’m not 100% sure what specifically you’re looking to do: If you have any other questions and/or details on what your goal is, I’d be happy to keep digging into this with you.

I did run into an issue with the Conversations API - HubSpot docs API

I have a newer inbox id that is 7952967017, which I am getting an error that it is out of bounds.

When I call the following endpoint https://api.hubapi.com/conversations/v3/conversations/threads?inboxId=7952967017’

I am passing the inboxId to get the threads for that inbox. But with newer inboxes, I am noticing that the inboxId is numerically out of bounds because the API is trying to parse it as an integer instead of a string. The error I am getting is

%{“correlationId” => “da3cc9c1-abc8-46ab-92d1-c21a5cf66aad”, “message” => “Invalid input JSON on line -1, column -1: Cannot deserialize value of type `int` from String \“7952967017\”: Overflow: numeric value (7952967017) out of range of int (-2147483648 -2147483647)”, “status” => “error”}

Any help is appreciated

I did have an issue with an out of bounds integer on the Conversations API - HubSpot docs API.

When I call the following endpoint https://api.hubapi.com/conversations/v3/conversations/threads?inboxId=7952967017’

I am passing the inboxId to get the threads for that inbox. But with newer inboxes, I am noticing that the inboxId is numerically out of bounds because the API is trying to parse it as an integer instead of a string. The error I am getting is

%{“correlationId” => “da3cc9c1-abc8-46ab-92d1-c21a5cf66aad”, “message” => “Invalid input JSON on line -1, column -1: Cannot deserialize value of type `int` from String \“7952967017\”: Overflow: numeric value (7952967017) out of range of int (-2147483648 -2147483647)”, “status” => “error”}

Any help is apprecaited!