The CRM properties endpoints allow you to manage custom properties as well as view default property details for any object.
type
and a set of properties
. Each type has a unique set of standard properties, represented by a map of name-value pairs.
Learn more about default properties for different objects:
type
and fieldType
values are required. The type
value determines the type of the property, i.e. a string or a number. The fieldType
property determines how the property will appear in HubSpot or on a form, i.e. as a plain text field, a dropdown menu, or a date picker.
In the table below, learn about the available property type
and corresponding fieldType
values.
type | Description | Valid fieldType values |
---|---|---|
bool | A field containing binary options (e.g., Yes or No , True or False ). | booleancheckbox , calculation_equation |
enumeration | A string representing a set of options, with options separated by a semicolon. | booleancheckbox , checkbox , radio , select , calculation_equation |
date | A value representing a specific day, month, and year. Values must be represented in UTC time and can be formatted as ISO 8601 strings or EPOCH-timestamps in milliseconds (i.e. midnight UTC). | date |
datetime | A value representing a specific day, month, year, and time of day. Values must be represented in UTC time and can be formatted as ISO 8601 strings or UNIX-timestamps in milliseconds. | date |
string | A plain text string, limited to 65,536 characters. | file , text , textarea , calculation_equation , html , phonenumber |
number | A number value containing numeric digits and at most one decimal. | number , calculation_equation |
object_coordinates | A text value used to reference other HubSpot objects, used only for internal properties. Properties of this type cannot be created or edited, and are not visible in HubSpot. | text |
json | A text value stored as formatted JSON, used only for internal properties. Properties of this type cannot be created or edited, and are not visible in HubSpot. | text |
fieldType
include:
Fieldtype | Description |
---|---|
booleancheckbox | An input that will allow users to selected one of either Yes or No. When used in a form, it will be displayed as a single checkbox. Learn how to add a value to single checkbox properties. |
calculation_equation | A custom equation that can calculate values based on other property values and/or associations. Learn how to define calculation properties. |
checkbox | A list of checkboxes that will allow a user to select multiple options from a set of options allowed for the property. Learn how to format values when updating multiple checkbox properties. |
date | A date value, displayed as a date picker. |
file | Allows for a file to be uploaded on a record or via a form. Stores a file ID. |
html | A string, rendered as sanitized html, that enables the use of a rich text editor for the property. |
number | A string of numerals or numbers written in decimal or scientific notation. |
phonenumber | A plain text string, displayed as a formatted phone number. |
radio | An input that will allow users to select one of a set of options allowed for the property. When used in a form, this will be displayed as a set of radio buttons. |
select | A dropdown input that will allow users to select one of a set of options allowed for the property. |
text | A plain text string, displayed in a single line text input. |
textarea | A plain text string, displayed as a multi-line text input. |
POST
request to /crm/v3/properties/{objectType}
. In your request body, include the following required fields:
groupName
: the property group the property will be in.name
: the internal name of the property (e.g., favorite_food).label
: the name of the property as it appears in HubSpot (e.g., Favorite Food).type
: the type of property.fieldType
: the field type of the property.hs_object_id
) is automatically generated and should be treated as a string. These IDs are unique only within that object type, so there can be both a contact and company with the same ID. For contacts and companies, there are additional unique identifiers, including a contact’s email address (email
) and a company’s domain name (domain
).
In some cases, you want may to create your own unique identifier property so that you can’t enter the same value for multiple records. You can have up to ten unique ID properties per object. To create a property requiring unique values via API:
POST
request to /crm/v3/properties/{objectType}
.hasUniqueValue
field, set the value to true
.abc
for the system_a_unique
property, your request URL would be: /crm/v3/objects/deals/abc?idProperty=system_a_unique
.
You can then use this unique identifier property value to identify and update specific records in the same way you could use hs_object_id
, email
(contacts), or domain
(companies).
calculation_equation
and a type of number
, bool
, string
, or enumeration
.
You can define the property’s calculation formula with the calculationFormula
field.
calculationFormula
, you can write your formula with arithmetic operators, comparison operators, logic operators, conditional statements, and other functions.
'constant'
) or double quotes ("constant"
).1005
and 1.5589
are both valid constant numbers.true
or false
.string
function. For example, string(var1)
will be interpreted as the value for the string property var1.var1
will be interpreted as the value for the number property var1.bool
function. For example, the identifier bool(var1)
will be interpreted as the value for the boolean property var1.If A ThEn B
is exactly the same as if a then b
but 'a'
is not the same as 'A'
. Spaces, tabs, and new lines will be used for tokenization but will be ignored.Operator | Description | Examples |
---|---|---|
+ | Add numbers or strings. | property1 + 100 |
- | Subtract numbers. | property1 + 100 - property2 |
* | Multiply numbers. | 10property1 = 10 * property1 |
/ | Divide numbers. | property1 * (100 - property2/(50 - property3)) |
< | Checks if a value is less than another. Supported by number properties or constants. | a < 100 |
> | Checks if a value is greater than another. Supported by number properties or constants. | a > 50 |
<= | Checks if a value is less than or equal to another. Supported by number properties or constants. | a <= b |
>= | Checks if a value is greater than or equal to another. Supported by number properties or constants. | b>= c |
= | Checks if a value is equal to another. Supported by both numbers and strings. | (a + b - 100c * 150.652) = 150-230b |
equals | Checks if a value is equal to another. Supported by both numbers and strings. | a + b - 100.2c * 150 equals 150 - 230 |
!= | Checks if a value is not equal to another. Supported by both numbers and strings. | string(property1) != 'test_string' |
or | Checks if either or two values are true. | a > b or b <= c |
and | Checks if both values are true. | bool(a) and bool(c) |
not | Checks if none of the values are true. | not (bool(a) and bool(c)) |
Function | Description | Examples |
---|---|---|
max | Will have between 2 and 100 input numbers, and will return the maximum number out of all the inputs. | max(a, b, c, 100) or max(a, b) |
min | Will have between 2 and 100 input numbers, and will return the minimum number of out all the inputs. | min(a, b, c, 100) or min(a, b) |
is_present | Evaluates whether an expression can be evaluated. | is_present(bool(a)) = true if the property is boolean, but is_present(bool(a)) = false if the property is empty or not boolean. |
contains | Has two strings as inputs and will return true if the first input contains the second. | contains('hello', 'ello') = true while contains('ello', 'hello') = false. |
concatenate | Joins a list of strings. The list of inputs can go from 2 up to 100. | concatenate('a', 'b', string(a), string(b)) |
number_to_string
: tries to convert the input number expression to a string.string_to_number
: tries to convert the input string expression to a number."Number of cars: " + num_cars
is not a valid property because you can’t add a string with a number, but "Number of cars: " + number_to_string(num_cars)
is.
if
, elseif
, endif
, and else
.
For example, a conditional statement could look like: if boolean_expression then statement [elseif expression then statement]* [else statement | endif]
where the [a]
brackets represent that a is optional, the a|b
represent that either a or b will work, and *
means 0 or more. endif
can be used to finish a conditional statement prematurely, ensuring that the parser can identify which if
the next elseif
belongs to.
GET
request to crm/v3/properties/{object}/{propertyName}
. For example, to retrieve the favorite_food
property, your request URL would be /crm/v3/properties/contacts/favorite_food
.GET
request to /crm/v3/properties/{objectType}
.dataSensitivity
query parameter with the value sensitive
. Learn more about managing sensitive data via API (BETA, Enterprise only).PATCH
request to crm/v3/objects/{objectType}/{recordId}
. In your request body, include the properties and their values in an array. Learn more about updating records via the object APIs.
2020-02-29
)2020-02-29T03:30:17.000Z
). All times are represented in UTC, so the values will always use the UTC designator “Z.”1427997766000
translates to 02 Apr 2015 18:02:46 UTC, or April 2nd, 2015, 2:02:46 PM EDT (Eastern Daylight Saving Time).date
and datetime
) which also affect how you format values:
date
properties store the date, not the time. date
properties display the date they’re set to, regardless of the time zone setting of the account or user. For date
property values, it is recommended to use the ISO 8601 complete date format. If you use the UNIX timestamp format, you must use an EPOCH millisecond timestamp (i.e. the value must be set to midnight UTC for the date). For example, to represent May 1, 2015 in either format:
datetime
properties store both the date and time. Either timestamp format will be accepted. In HubSpot, datetime
properties are displayed based on the time zone of the user viewing the record, so the value will be converted to the local time zone of the user.true
. To display as No or not checked in HubSpot, your value must be false
.DECISION_MAKER
for the hs_buying_role
property. To add additional values without replacing the existing value, your request would look like this:id
, which you can find in your property settings or via the owners API. For example, to assign a user as owner of a contact, send a PATCH
request to crm/v3/objects/contacts/{contactId}
, with the body { "properties":{ "hubspot_owner_id": "41629779"}}
.
firstname
from a contact object, send a PATCH
request to /crm/v3/objects/contacts/{contactId}
with the body { "properties": { "firstname": ""}}
.