Scope requirements
Scope requirements
Create properties
To create a custom property, make aPOST request to /crm/schemas/2027-03-beta/objects/{objectTypeId}/properties.
For example, your request body may look similar to:
The response includes the newly created property, with the default fields and any other fields you set in the request. A
400 error is returned for invalid input, such as a duplicate name, invalid option values, or an incompatible type and fieldType pairing.
Create a batch of properties
To create up to 100 properties in one request, make aPOST request to /crm/schemas/2027-03-beta/objects/{objectTypeId}/properties/batch/create. In the request body, include an inputs array.
For example, to create two properties, your request would look similar to:
207 status code with the details for each failed item. An empty inputs array returns a 400 error.
Create calculation properties
Calculation properties compute their value from other properties on the same record. To create a calculation property, set thefieldType to CALCULATION_EQUATION and include your formula in the calculationFormulafield.
For example, to create a deal property that calculates a probability-weighted amount, your request body would look similar to:
400 error is returned if the formula can’t be parsed or references a property that doesn’t exist.
Create rollup properties
Rollup properties aggregate values from the records associated with the current record. To create a rollup property, set thefieldType to CALCULATION_ROLLUP and include a rollupConfig object.
For example, to create a contact property that sums the amount of all associated closed won deals, your request body would look similar to:
rollupConfig, associatedRecordType, associatedRecordProperty, associationSpec, and rollupType are required. conditionalFormula is optional and filters which associated records are included, using the same formula syntax as calculation properties. When omitted, all associated records are included. Learn more about the rollupConfig fields.
The MIN, MAX, AVG, and SUM rollup types only work with number properties. A 400 error is returned if rollupConfig is included without a fieldType of CALCULATION_ROLLUP, or if the associationSpec doesn’t exist between the two object types.
Create sync properties
Sync properties copy a value from an associated record onto the current record. To create a sync property, include asyncConfig object and set type and fieldType to values to match the value being synced.
For example, to create a contact property that syncs the amount of the contact’s most recently created deal, your request body would look similar to:
syncConfig, all fields are required. syncPreference determines which associated record the value is synced from: FIRST_CREATED, MOST_RECENTLY_CREATED, or SYNC_VALUE (the only record of a one-to-one association). Learn more about the syncConfig fields.
Retrieve properties
Retrieve a single property
To retrieve a property, make aGET request to /crm/schemas/2027-03-beta/objects/{objectTypeId}/properties/{propertyName}.
For example, a GET request to /crm/schemas/2027-03-beta/objects/0-1/properties/favorite_food?fields=label&fields=options would return a response similar to the following:
category, name, type, fieldType, createdAt, updatedAt, and archived. To return additional fields, include the fields query parameters in your request. Learn more about the supported fields. A 404 error is returned if the property doesn’t exist for the object.
Retrieve all properties for an object
To retrieve a paginated list of properties for an object, make aGET request to /crm/schemas/2027-03-beta/objects/{objectTypeId}/properties.
The following query parameters are available:
The response includes a page of properties, along with a cursor for the next page when more results exist.
Retrieve a batch of properties
To retrieve multiple properties by name, make aPOST request to /crm/schemas/2027-03-beta/objects/{objectTypeId}/properties/batch/read.
For example, your request body may look similar to:
category, name, type, fieldType, createdAt, updatedAt, and archived. To return additional fields, include the fields query parameters in your request. Learn more about the supported fields.
Any name that doesn’t match a property returns a not-found error for that item, and the request returns a 207 status code. An empty inputs array returns a 400 error.
Retrieve options for an option source
Some enumeration properties derive their options dynamically instead of storing static options on the property. For these properties, theoptionsSource field is set. The supported values are OWNER (for properties that reference owners), PERSONA, and CALL_DISPOSITION.
To retrieve the options for an option source, make a GET request to /crm/schemas/2027-03-beta/objects/{objectTypeId}/properties/option-sources/{optionSource}. For example, a request to /crm/schemas/2027-03-beta/objects/0-1/properties/option-sources/OWNER returns all the options for an owner-referencing contact property.
The following query parameters are available:
The response includes a page of options, along with a cursor for the next page when more results exist. A
400 error is returned for an invalid limit or after value, and a 404 error is returned if the option source doesn’t exist.
Update properties
To update a property, make aPATCH request to /crm/schemas/2027-03-beta/objects/{objectTypeId}/properties/{propertyName}. In the request body, include only the fields that you want to update. Omitted fields are left unchanged.
For example, the following request body updates a property’s label and description:
rollupConfig or syncConfig object. The object replaces the existing configuration rather than appending it, so you should include every field you want to keep.
When you update a field that holds an array (e.g., options or validationRules), the array you send replaces the existing value rather than appending to it. For example, the following request body replaces any existing validation rules on the property with a single MAX_LENGTH rule:
404 error is returned if the property doesn’t exist, and a 400 error is returned for an invalid update, such as an incompatible type and fieldType change or a change to a field that cannot be modified for that property.
Update a batch of properties
To update up to 100 properties in one request, make aPOST request to /crm/schemas/2027-03-beta/objects/{objectTypeId}/properties/batch/update. In the request body, include an inputs array, where each item names the property it applies to along with the fields to change.
For example, to change one property’s label and another property’s description, your request body would look similar to:
207 status code.
Archive and restore properties
You can archive a property, with the option to restore it later. Thearchived field on a property reflects its current state, and you can change it with a PATCH request.
- To archive up to 100 properties in one request, make a
POSTrequest to/crm/schemas/2027-03-beta/objects/{objectTypeId}/properties/batch/archive. - To restore up to 100 archived properties, make a
POSTrequest to/crm/schemas/2027-03-beta/objects/{objectTypeId}/properties/batch/restore.
inputs array of objects, each containing the internal property name in its name field.
For example, your request body would look similar to:
204 with no response body. A successful batch restore request returns 200 with the restored properties in the results array.
If any inputs fail, the response returns 207 with per-item errors. For restore requests, successfully restored properties are included in results. Archive responses do not include successful items in results.
An item fails with a 404 error if the property does not exist, or a 400 error if it’s already in the target state (i.e., already restored or archived).
Delete properties
Once you’ve archived a property, you can permanently delete it. To delete a single property, make aDELETE request to /crm/schemas/2027-03-beta/objects/{objectTypeId}/properties/{propertyName}. A successful request returns no content. A 404 error is returned if the property doesn’t exist, and a 400 error is returned if the property hasn’t been archived.
Delete a batch of properties
To delete up to 100 properties in one request, make aPOST request to /crm/schemas/2027-03-beta/objects/{objectTypeId}/properties/batch/purge. In the request body, include an inputs array of objects, each containing the internal property name in its name field.
For example, your request body may look similar to:
204 with no body. If some inputs fail, the response returns a 207 status code with per-item errors.
Property fields reference
The following tables describe the fields included in property responses.Property type and fieldType values
When creating properties, bothtype and fieldType are required. The type value determines the underlying value type of the property, and the fieldType value determines how the property appears in HubSpot and on forms. A property’s type and fieldType combination must be compatible.
Please note: unlike the properties API, the properties schemas API uses uppercase values (e.g.,
STRING instead of string, and TEXT instead of text). URL and EMAIL are also separate fieldType values, rather than text with a textDisplayHint.type values and the fieldType values supported for each.
Options
Each item in theoptions array includes the following fields:
Option decorators and colors
TheoptionDecorators object sets up the visual presentation settings for enumeration options, including their decoration style and assigned colors.
Each item in the
optionColors array includes the following fields:
Rollup configuration
TherollupConfig object is present for rollup properties and includes the following fields:
Sync configuration
ThesyncConfig object is present for sync properties and includes the following fields:
Calculation formula reference
ThecalculationFormula field, and the conditionalFormula field in rollupConfig, use the same formula syntax.
Please note: this syntax differs from the formulas in the properties API. For example, conditionals are written as
if(condition, value_if_true, value_if_false) instead of if ... then ... endif, and is_known replaces is_present.Values and properties
Operators
Use parentheses to control the order of arithmetic operations:
amount * (1 - discount_rate).
Functions
Function names are case-sensitive.Example formulas
To return a value based on a condition:Formula behavior
- A
400error is returned if a formula can’t be parsed, references a property that doesn’t exist, or passes invalid arguments to a function. - You can’t clear
calculationFormulawith aPATCHrequest. Calculation properties require a formula, so send a new formula to change it. - Some calculation properties, such as those created in HubSpot with functions that aren’t listed above, don’t return a
calculationFormula. Thecalculatedfield is stilltrue.
Access allowlist
Each item in theaccessAllowlist array includes the following fields:
Validation rules
Each item in thevalidationRules array includes the following fields:
The following table lists the available
ruleType values, the property type (and fieldType) each supports, and the ruleArguments each requires.