> ## Documentation Index
> Fetch the complete documentation index at: https://developers.hubspot.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

---
id: b9780486-d34e-44e5-b1ff-f15f0f3ce25f
---

# CRM API | Property validations

>  The property validations endpoints allow you to view, create, and update validation rules for your properties.

export const ScopesList = ({scopes = [], description = "This API requires one of the following scopes:"}) => {
  if (!scopes || scopes.length === 0) {
    return null;
  }
  const sortedScopes = scopes.sort((a, b) => a.localeCompare(b));
  return <div>
      <div className="text-sm mb-2">{description}</div>
      <div>
        {sortedScopes.map((scope, index) => <div key={index}>
            <code>
              <span className="text-xs">{scope}</span>
            </code>
          </div>)}
      </div>
    </div>;
};

[Property validation rules](https://knowledge.hubspot.com/properties/set-validation-rules-for-properties) determine formatting requirements for text, date picker, date and time picker, and number properties. For example, an *Account ID* property that can only include numbers. You can use the property validations API to set up validation rules, edit existing validation rules, or retrieve validation rules so you’re aware of formatting requirements when setting or updating property values.

<Accordion title="Scope requirements">
  <ScopesList
    scopes={[
  'automation',
  'crm.objects.appointments.read',
  'crm.objects.appointments.sensitive.read.v2',
  'crm.objects.appointments.sensitive.write.v2',
  'crm.objects.appointments.write',
  'crm.objects.carts.read',
  'crm.objects.carts.write',
  'crm.objects.commercepayments.write',
  'crm.objects.companies.highly_sensitive.read.v2',
  'crm.objects.companies.highly_sensitive.write.v2',
  'crm.objects.companies.read',
  'crm.objects.companies.sensitive.read.v2',
  'crm.objects.companies.sensitive.write.v2',
  'crm.objects.companies.write',
  'crm.objects.contacts.highly_sensitive.read.v2',
  'crm.objects.contacts.highly_sensitive.write.v2',
  'crm.objects.contacts.read',
  'crm.objects.contacts.sensitive.read.v2',
  'crm.objects.contacts.sensitive.write.v2',
  'crm.objects.contacts.write',
  'crm.objects.courses.read',
  'crm.objects.courses.write',
  'crm.objects.custom.highly_sensitive.read.v2',
  'crm.objects.custom.highly_sensitive.write.v2',
  'crm.objects.custom.read',
  'crm.objects.custom.sensitive.read.v2',
  'crm.objects.custom.sensitive.write.v2',
  'crm.objects.custom.write',
  'crm.objects.deals.highly_sensitive.read.v2',
  'crm.objects.deals.highly_sensitive.write.v2',
  'crm.objects.deals.read',
  'crm.objects.deals.sensitive.read.v2',
  'crm.objects.deals.sensitive.write.v2',
  'crm.objects.deals.write',
  'crm.objects.feedback_submissions.read',
  'crm.objects.goals.read',
  'crm.objects.goals.write',
  'crm.objects.invoices.read',
  'crm.objects.invoices.write',
  'crm.objects.leads.read',
  'crm.objects.leads.write',
  'crm.objects.line_items.read',
  'crm.objects.line_items.write',
  'crm.objects.listings.read',
  'crm.objects.listings.write',
  'crm.objects.marketing_events.read',
  'crm.objects.marketing_events.write',
  'crm.objects.orders.read',
  'crm.objects.orders.write',
  'crm.objects.owners.read',
  'crm.objects.products.write',
  'crm.objects.quotes.read',
  'crm.objects.quotes.write',
  'crm.objects.services.read',
  'crm.objects.services.write',
  'crm.objects.subscriptions.read',
  'crm.objects.subscriptions.write',
  'crm.objects.users.read',
  'crm.objects.users.write',
  'crm.pipelines.orders.read',
  'crm.pipelines.orders.write',
  'crm.schemas.appointments.read',
  'crm.schemas.appointments.write',
  'crm.schemas.carts.read',
  'crm.schemas.carts.write',
  'crm.schemas.commercepayments.read',
  'crm.schemas.commercepayments.write',
  'crm.schemas.companies.read',
  'crm.schemas.companies.write',
  'crm.schemas.contacts.read',
  'crm.schemas.contacts.write',
  'crm.schemas.courses.read',
  'crm.schemas.courses.write',
  'crm.schemas.custom.read',
  'crm.schemas.custom.write',
  'crm.schemas.deals.read',
  'crm.schemas.deals.write',
  'crm.schemas.invoices.read',
  'crm.schemas.invoices.write',
  'crm.schemas.line_items.read',
  'crm.schemas.listings.read',
  'crm.schemas.listings.write',
  'crm.schemas.orders.read',
  'crm.schemas.orders.write',
  'crm.schemas.quotes.read',
  'crm.schemas.services.read',
  'crm.schemas.services.write',
  'crm.schemas.subscriptions.read',
  'crm.schemas.subscriptions.write',
  'e-commerce',
  'media_bridge.read',
  'tickets',
  'tickets.highly_sensitive.v2',
  'tickets.sensitive.v2',
  'timeline'
]}
  />
</Accordion>

To complete more actions with properties, refer to the [Properties API](/api-reference/latest/crm/properties/guide).

## Add or update validation rules for a property

To add or update validation rules, make a `PUT` request to `/crm/property-validations/2026-03/{objectTypeId}/{propertyName}/rule-type/{ruleType}`.

The `ruleType` is a category for the rule, for which options depend on the [property `type` and `fieldType`](/api-reference/latest/crm/properties/guide#property-type-and-fieldtype-values). When you make the request, if there’s an existing validation rule with that `ruleType`, the rule you’ve created will overwrite the existing rule. The rule will not overwrite rules of other types.

In your request body, include the following:

* `ruleArguments`: an array containing the arguments that define the specific conditions or parameters for the validation rule. Arguments depend on the `ruleType`.
* `shouldApplyNormalization` (optional): a boolean that indicates whether to normalize input before validation.

The available `ruleType` values and their arguments are:

| `ruleType` values                         | Supported `type` (and `fieldType`)               | Rule description                                                           | Arguments                                               | Examples                            |
| ----------------------------------------- | ------------------------------------------------ | -------------------------------------------------------------------------- | ------------------------------------------------------- | ----------------------------------- |
| `AFTER_DATETIME_DURATION`                 | `datetime`                                       | Require a duration after the current date and time.                        | ISO-8601 period                                         | `["P1Y"]` (1 year)                  |
| `AFTER_DURATION`                          | `date`                                           | Require a duration after the current date.                                 | ISO-8601 period                                         | `["P7D"]` (7 days)                  |
| `ALPHANUMERIC`                            | `string` (`text` and `textarea`)                 | Restrict values to certain alphanumeric characters.                        | One of `ALPHANUMERIC`, `ALPHA_ONLY`, or `NUMERIC_ONLY`. | `["ALPHA_ONLY"]`                    |
| `BEFORE_DATETIME_DURATION`                | `datetime`                                       | Require a duration before the current date and time.                       | ISO-8601 period                                         | `["P1M"]` (1 month)                 |
| `BEFORE_DURATION`                         | `date`                                           | Require a duration before the current date.                                | ISO-8601 period                                         | `["P30D"]` (30 days)                |
| `DAYS_OF_WEEK`                            | `date`, `datetime`                               | Restrict values to specific days.                                          | One to seven days by name (e.g, `MONDAY`, `TUESDAY`).   | `["MONDAY", "WEDNESDAY", "FRIDAY"]` |
| `DECIMAL`                                 | `number`                                         | Restrict the number of decimal places in values.                           | Integer (0-20)                                          | `["2"]`                             |
| `DOMAIN`                                  | `string` (`text`)                                | Validate domain formatting.                                                | None                                                    | `[]`                                |
| `EMAIL`                                   | `string` (`text`)                                | Validate email address formatting.                                         | None                                                    | `[]`                                |
| `EMAIL_ALLOWED_DOMAINS`                   | `string` (`text`)                                | Restrict to specific email domains.                                        | One to 20 domain strings.                               | `["company.com", "partner.com"]`.   |
| `EMAIL_BLOCKED_DOMAINS`                   | `string` (`text`)                                | Block specific email domains.                                              | One to 20 domain strings.                               | `["competitor.com"]`                |
| `END_DATE`                                | `date`                                           | Set a maximum date.                                                        | Unix timestamp (ms)                                     | `["1640995200000"]`                 |
| `END_DATETIME`                            | `datetime`                                       | Set a maximum date and time.                                               | Unix timestamp (ms)                                     | `["1640995200000"]`                 |
| `FORMAT`                                  | `string` (`text` and `textarea`)                 | Require specific text case formatting.                                     | One of `CAPITALIZATION`, `UPPER`, or `LOWER`.           | `["UPPER"]`                         |
| `MAX_LENGTH`                              | `string` (`text`, `textarea`, and `phonenumber`) | Set a maximum character length.                                            | Integer (1-10000)                                       | `["100"]`                           |
| `MAX_NUMBER`                              | `number`                                         | Set a maximum numeric value.                                               | Numeric value                                           | `["1000"]` or `["99.99"]`           |
| `MIN_LENGTH`                              | `string` (`text`, `textarea`, and `phonenumber`) | Set a minimum character length.                                            | Integer (greater than 1)                                | `["5"]`                             |
| `MIN_NUMBER`                              | `number`                                         | Set a minimum numeric value.                                               | Numeric value                                           | `["0"]` or `["-10.5"]`              |
| `PHONE_NUMBER_WITH_EXPLICIT_COUNTRY_CODE` | `string` (`phonenumber`)                         | Validate phone number formatting, with option to validate by country code. | None, or optional 2-letter country code (lowercase).    | `[]` or `["us"]`                    |
| `REGEX`                                   | `string` (`text` and `textarea`)                 | Validate values with custom regular expressions.                           | Regex pattern (RE2 syntax), error message.              | `["^[A-Z]+$", "Must be uppercase"]` |
| `SPECIAL_CHARACTERS`                      | `string` (`text` and `textarea`)                 | Restrict special characters.                                               | `NOT_ALLOWED`                                           | `["NOT_ALLOWED"]`                   |
| `START_DATE`                              | `date`                                           | Set a minimum date.                                                        | Unix timestamp (ms)                                     | `["1640995200000"]`                 |
| `START_DATETIME`                          | `datetime`                                       | Set a minimum date and time.                                               | Unix timestamp (ms)                                     | `["1640995200000"]`                 |
| `URL`                                     | `string` (`text`)                                | Validate URL formatting.                                                   | None                                                    | `[]`                                |
| `URL_ALLOWED_DOMAINS`                     | `string` (`text`)                                | Restrict to certain domains.                                               | One to 20 domain strings.                               | `["hubspot.com", "example.com"]`    |
| `URL_BLOCKED_DOMAINS`                     | `string` (`text`)                                | Block specific domains.                                                    | One to 20 domain strings.                               | `["spam.com", "bad-site.net"]`      |
| `WHITESPACE`                              | `string` (`text`)                                | Set rules for handling whitespace.                                         | None, or optional `ALL` (default) or `TRIM`.            | `[]` or `["TRIM"]`                  |

For example:

* To set an `ALPHANUMERIC` rule that allows only numeric characters for the *Order ID* deal property, make a `PUT` request to `/crm/property-validations/2026-03/0-3/order_id/rule-type/ALPHANUMERIC` with the following request body:

```json theme={null}
{
  "ruleArguments": [
    "NUMERIC_ONLY"
  ],
  "shouldApplyNormalization": false
}
```

* To set a `MIN_LENGTH` rule that requires at least one character for the *Pet name* property, make a `PUT` request to `/crm/property-validations/2026-03/{custom object type ID}/pet_name/rule-type/MIN_LENGTH` with the following request body:

```json theme={null}
{
  "ruleArguments": [
    "1"
  ]
}
```

## Retrieve all properties with validation rules for an object

To view all properties of an object that have validation rules, make a `GET` request to `/crm/property-validations/2026-03/{objectTypeId}`. Refer to [this guide](/guides/crm/understanding-the-crm#object-type-ids) for a full list of `objectTypeId` values.

Properties with validation rules are returned with the following fields:

* `propertyName`: the name of the property with validation rules.
* `propertyValidationRules`: an array with the rules set for the property. Includes each rule’s `ruleType` (the category for the rule) and `ruleArguments` (specific requirements of the rule).

For example, to request contact properties with validation rules, make a `GET` request to `/crm/property-validations/2026-03/0-1`. In the following response, there are two properties with rules, the `zip` (Postal Code) property which only allows numeric characters and the `age` property which requires a minimum value of 1.

```json theme={null}
{
  "results": [
    {
      "propertyName": "zip",
      "propertyValidationRules": [
        {
          "ruleType": "ALPHANUMERIC",
          "ruleArguments": ["NUMERIC_ONLY"]
        }
      ]
    },
    {
      "propertyName": "age",
      "propertyValidationRules": [
        {
          "ruleType": "MIN_NUMBER",
          "ruleArguments": ["1"]
        }
      ]
    }
  ]
}
```

## Retrieve all validation rules for a property

To view the validation rules set for a specific property, make a `GET` request to `/crm/property-validations/2026-03/{objectTypeId}/{propertyName}`. You can refer to [this guide](#object-type-ids) for a full list of `objectTypeId` values and use the [Properties API](/api-reference/latest/crm/properties/guide) to retrieve `propertyName` values.

The property’s rules are returned with the `ruleType` and `ruleArguments` for each.

For example, to view validation rules for an Order ID deal property, make a `GET` request to `/crm/property-validations/2026-03/0-3/order_id`. In the following response, the property has three rules that require the value to contain between one and eight numeric characters.

```json theme={null}
{
  "results": [
    {
      "ruleType": "ALPHANUMERIC",
      "ruleArguments": ["NUMERIC_ONLY"]
    },
    {
      "ruleType": "MAX_LENGTH",
      "ruleArguments": ["10"]
    },
    {
      "ruleType": "MIN_LENGTH",
      "ruleArguments": ["1"]
    }
  ]
}
```

## Retrieve a specific type of validation rule for a property

To view more information about a specific validation rule for a property, make a `GET` request to `/crm/property-validations/2026-03/{objectTypeId}/{propertyName}/rule-type/{ruleType}`. The response includes the `ruleType`, `ruleArguments`, and the optional `shouldApplyNormalization` field.

For example, to view more details about the alphanumeric character rule for the *Order ID* property, make a `GET` request to `/crm/property-validations/2026-03/0-3/order_id/rule-type/ALPHANUMERIC`.
