{ "openapi" : "3.0.1", "info" : { "title" : "CRM Property Validations", "description" : "Basepom for all HubSpot Projects", "version" : "v3", "x-hubspot-product-tier-requirements" : { "marketing" : "FREE", "sales" : "FREE", "service" : "FREE", "cms" : "FREE", "commerce" : "FREE", "crmHub" : "FREE", "dataHub" : "FREE" }, "x-hubspot-related-documentation" : [ { "name" : "Property validations guide", "url" : "https://developers.hubspot.com/docs/guides/api/crm/property-validations" } ] }, "servers" : [ { "url" : "https://api.hubapi.com" } ], "tags" : [ { "name" : "Basic" } ], "paths" : { "/crm/v3/property-validations/{objectTypeId}" : { "get" : { "tags" : [ "Basic" ], "summary" : "Read all property validation rules for an object", "description" : "Read all properties with validation rules for a given object.", "operationId" : "get-/crm/v3/property-validations/{objectTypeId}_/crm/v3/property-validations/{objectTypeId}", "parameters" : [ { "name" : "objectTypeId", "in" : "path", "description" : "", "required" : true, "style" : "simple", "explode" : false, "schema" : { "type" : "string", "example" : null } } ], "responses" : { "200" : { "description" : "successful operation", "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/CollectionResponsePublicPropertyValidationRuleMapNoPaging" }, "example" : null } } }, "default" : { "description" : "", "$ref" : "#/components/responses/Error" } }, "security" : [ { "oauth2" : [ "properties-settings-read" ] } ] } }, "/crm/v3/property-validations/{objectTypeId}/{propertyName}" : { "get" : { "tags" : [ "Basic" ], "summary" : "Read validation rules for a property", "description" : "Read a property's validation rules identified by {propertyName}.", "operationId" : "get-/crm/v3/property-validations/{objectTypeId}/{propertyName}_/crm/v3/property-validations/{objectTypeId}/{propertyName}", "parameters" : [ { "name" : "objectTypeId", "in" : "path", "description" : "", "required" : true, "style" : "simple", "explode" : false, "schema" : { "type" : "string", "example" : null } }, { "name" : "propertyName", "in" : "path", "description" : "", "required" : true, "style" : "simple", "explode" : false, "schema" : { "type" : "string", "example" : null } } ], "responses" : { "200" : { "description" : "successful operation", "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/CollectionResponsePublicPropertyValidationRuleNoPaging" }, "example" : null } } }, "default" : { "description" : "", "$ref" : "#/components/responses/Error" } }, "security" : [ { "oauth2" : [ "properties-settings-read" ] } ] } }, "/crm/v3/property-validations/{objectTypeId}/{propertyName}/rule-type/{ruleType}" : { "get" : { "tags" : [ "Basic" ], "summary" : "Retrieve a validation rule for a specific property and rule type, providing details on how property values should be formatted.", "description" : "Retrieve a specific validation rule for a property identified by its name and rule type.", "operationId" : "get-/crm/v3/property-validations/{objectTypeId}/{propertyName}/rule-type/{ruleType}_/crm/v3/property-validations/{objectTypeId}/{propertyName}/rule-type/{ruleType}", "parameters" : [ { "name" : "objectTypeId", "in" : "path", "description" : "", "required" : true, "style" : "simple", "explode" : false, "schema" : { "type" : "string", "example" : null } }, { "name" : "propertyName", "in" : "path", "description" : "", "required" : true, "style" : "simple", "explode" : false, "schema" : { "type" : "string", "example" : null } }, { "name" : "ruleType", "in" : "path", "description" : "", "required" : true, "style" : "simple", "explode" : false, "schema" : { "type" : "string", "example" : null, "enum" : [ "AFTER_DATETIME_DURATION", "AFTER_DURATION", "ALPHANUMERIC", "BEFORE_DATETIME_DURATION", "BEFORE_DURATION", "DAYS_OF_WEEK", "DECIMAL", "DOMAIN", "EMAIL", "EMAIL_ALLOWED_DOMAINS", "EMAIL_BLOCKED_DOMAINS", "END_DATE", "END_DATETIME", "FORMAT", "MAX_LENGTH", "MAX_NUMBER", "MIN_LENGTH", "MIN_NUMBER", "PHONE_NUMBER_WITH_EXPLICIT_COUNTRY_CODE", "REGEX", "SPECIAL_CHARACTERS", "START_DATE", "START_DATETIME", "URL", "URL_ALLOWED_DOMAINS", "URL_BLOCKED_DOMAINS", "WHITESPACE" ] } } ], "responses" : { "200" : { "description" : "successful operation", "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/PublicPropertyValidationRule" }, "example" : null } } }, "default" : { "description" : "", "$ref" : "#/components/responses/Error" } }, "security" : [ { "oauth2" : [ "properties-settings-read" ] } ] }, "put" : { "tags" : [ "Basic" ], "summary" : "Update a validation rule for a specific property and rule type, allowing customization of property value constraints.", "description" : "Update a specific validation rule for a property identified by its name and rule type.", "operationId" : "put-/crm/v3/property-validations/{objectTypeId}/{propertyName}/rule-type/{ruleType}_/crm/v3/property-validations/{objectTypeId}/{propertyName}/rule-type/{ruleType}", "parameters" : [ { "name" : "objectTypeId", "in" : "path", "description" : "", "required" : true, "style" : "simple", "explode" : false, "schema" : { "type" : "string", "example" : null } }, { "name" : "propertyName", "in" : "path", "description" : "", "required" : true, "style" : "simple", "explode" : false, "schema" : { "type" : "string", "example" : null } }, { "name" : "ruleType", "in" : "path", "description" : "", "required" : true, "style" : "simple", "explode" : false, "schema" : { "type" : "string", "example" : null, "enum" : [ "AFTER_DATETIME_DURATION", "AFTER_DURATION", "ALPHANUMERIC", "BEFORE_DATETIME_DURATION", "BEFORE_DURATION", "DAYS_OF_WEEK", "DECIMAL", "DOMAIN", "EMAIL", "EMAIL_ALLOWED_DOMAINS", "EMAIL_BLOCKED_DOMAINS", "END_DATE", "END_DATETIME", "FORMAT", "MAX_LENGTH", "MAX_NUMBER", "MIN_LENGTH", "MIN_NUMBER", "PHONE_NUMBER_WITH_EXPLICIT_COUNTRY_CODE", "REGEX", "SPECIAL_CHARACTERS", "START_DATE", "START_DATETIME", "URL", "URL_ALLOWED_DOMAINS", "URL_BLOCKED_DOMAINS", "WHITESPACE" ] } } ], "requestBody" : { "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/PublicPropertyValidationRuleUpdate" }, "example" : null } }, "required" : true }, "responses" : { "204" : { "description" : "No content", "content" : { } }, "default" : { "description" : "", "$ref" : "#/components/responses/Error" } }, "security" : [ { "oauth2" : [ "properties-settings-write" ] } ] } } }, "components" : { "schemas" : { "CollectionResponsePublicPropertyValidationRuleMapNoPaging" : { "required" : [ "results" ], "type" : "object", "properties" : { "results" : { "type" : "array", "description" : "Collection of properties with their validation rules. Each item maps a property name to its configured validation rules for the specified object type.", "example" : null, "items" : { "$ref" : "#/components/schemas/PublicPropertyValidationRuleMap" } } }, "example" : null }, "CollectionResponsePublicPropertyValidationRuleNoPaging" : { "required" : [ "results" ], "type" : "object", "properties" : { "results" : { "type" : "array", "description" : "Collection of validation rules configured for the specified property. Each rule defines a constraint that property values must satisfy (e.g., format requirements, length limits, allowed values).", "example" : null, "items" : { "$ref" : "#/components/schemas/PublicPropertyValidationRule" } } }, "example" : null }, "Error" : { "required" : [ "category", "correlationId", "message" ], "type" : "object", "properties" : { "category" : { "type" : "string", "description" : "The error category", "example" : null }, "context" : { "type" : "object", "additionalProperties" : { "type" : "array", "example" : null, "items" : { "type" : "string", "example" : null } }, "description" : "Context about the error condition", "example" : "{invalidPropertyName=[propertyValue], missingScopes=[scope1, scope2]}" }, "correlationId" : { "type" : "string", "description" : "A unique identifier for the request. Include this value with any error reports or support tickets", "format" : "uuid", "example" : "aeb5f871-7f07-4993-9211-075dc63e7cbf" }, "errors" : { "type" : "array", "description" : "further information about the error", "example" : null, "items" : { "$ref" : "#/components/schemas/ErrorDetail" } }, "links" : { "type" : "object", "additionalProperties" : { "type" : "string", "example" : null }, "description" : "A map of link names to associated URIs containing documentation about the error or recommended remediation steps", "example" : null }, "message" : { "type" : "string", "description" : "A human readable message describing the error along with remediation steps where appropriate", "example" : "An error occurred" }, "subCategory" : { "type" : "string", "description" : "A specific category that contains more specific detail about the error", "example" : null } }, "example" : { "message" : "Invalid input (details will vary based on the error)", "correlationId" : "aeb5f871-7f07-4993-9211-075dc63e7cbf", "category" : "VALIDATION_ERROR", "links" : { "knowledge-base" : "https://www.hubspot.com/products/service/knowledge-base" } } }, "ErrorDetail" : { "required" : [ "message" ], "type" : "object", "properties" : { "code" : { "type" : "string", "description" : "The status code associated with the error detail", "example" : null }, "context" : { "type" : "object", "additionalProperties" : { "type" : "array", "example" : null, "items" : { "type" : "string", "example" : null } }, "description" : "Context about the error condition", "example" : "{missingScopes=[scope1, scope2]}" }, "in" : { "type" : "string", "description" : "The name of the field or parameter in which the error was found.", "example" : null }, "message" : { "type" : "string", "description" : "A human readable message describing the error along with remediation steps where appropriate", "example" : null }, "subCategory" : { "type" : "string", "description" : "A specific category that contains more specific detail about the error", "example" : null } }, "example" : null }, "PublicPropertyValidationRule" : { "required" : [ "ruleArguments", "ruleType" ], "type" : "object", "properties" : { "ruleArguments" : { "type" : "array", "description" : "A list of arguments that define the specific conditions or parameters for the validation rule.", "example" : null, "items" : { "type" : "string", "example" : null } }, "ruleType" : { "type" : "string", "description" : "The category of validation applied to the property, such as FORMAT, ALPHANUMERIC, or MAX_LENGTH.", "example" : null, "enum" : [ "AFTER_DATETIME_DURATION", "AFTER_DURATION", "ALPHANUMERIC", "BEFORE_DATETIME_DURATION", "BEFORE_DURATION", "DAYS_OF_WEEK", "DECIMAL", "DOMAIN", "EMAIL", "EMAIL_ALLOWED_DOMAINS", "EMAIL_BLOCKED_DOMAINS", "END_DATE", "END_DATETIME", "FORMAT", "MAX_LENGTH", "MAX_NUMBER", "MIN_LENGTH", "MIN_NUMBER", "PHONE_NUMBER_WITH_EXPLICIT_COUNTRY_CODE", "REGEX", "SPECIAL_CHARACTERS", "START_DATE", "START_DATETIME", "URL", "URL_ALLOWED_DOMAINS", "URL_BLOCKED_DOMAINS", "WHITESPACE" ] }, "shouldApplyNormalization" : { "type" : "boolean", "example" : null } }, "example" : null }, "PublicPropertyValidationRuleMap" : { "required" : [ "propertyName", "propertyValidationRules" ], "type" : "object", "properties" : { "propertyName" : { "type" : "string", "description" : "The name of the property for which validation rules are defined.", "example" : null }, "propertyValidationRules" : { "type" : "array", "description" : "A list of validation rules applicable to the property.", "example" : null, "items" : { "$ref" : "#/components/schemas/PublicPropertyValidationRule" } } }, "example" : null }, "PublicPropertyValidationRuleUpdate" : { "required" : [ "ruleArguments" ], "type" : "object", "properties" : { "ruleArguments" : { "type" : "array", "description" : "A list of arguments that define the constraints for the validation rule.", "example" : null, "items" : { "type" : "string", "example" : null } }, "shouldApplyNormalization" : { "type" : "boolean", "example" : null } }, "example" : null } }, "responses" : { "Error" : { "description" : "An error occurred.", "content" : { "*/*" : { "schema" : { "$ref" : "#/components/schemas/Error" }, "example" : null } } } }, "securitySchemes" : { "developer_hapikey" : { "type" : "apiKey", "name" : "hapikey", "in" : "query" }, "hapikey" : { "type" : "apiKey", "name" : "hapikey", "in" : "query" }, "oauth2" : { "type" : "oauth2", "flows" : { "authorizationCode" : { "authorizationUrl" : "https://app.hubspot.com/oauth/authorize", "tokenUrl" : "https://api.hubapi.com/oauth/v1/token", "scopes" : { "properties-settings-read" : "", "properties-settings-write" : "" } } } }, "private_apps" : { "type" : "apiKey", "name" : "private-app", "in" : "header" }, "private_apps_legacy" : { "type" : "apiKey", "name" : "private-app-legacy", "in" : "header" } } }, "x-hubspot-product-tier-requirements" : { "marketing" : "FREE", "sales" : "FREE", "service" : "FREE", "cms" : "FREE", "commerce" : "FREE", "crmHub" : "FREE", "dataHub" : "FREE" } }