{ "openapi" : "3.0.1", "info" : { "title" : "Schemas", "description" : "The CRM uses schemas to define how custom objects should store and represent information in the HubSpot CRM. Schemas define details about an object's type, properties, and associations. The schema can be uniquely identified by its **object type ID**.", "version" : "v3", "x-hubspot-product-tier-requirements" : { "marketing" : "ENTERPRISE", "sales" : "ENTERPRISE", "service" : "ENTERPRISE", "cms" : "ENTERPRISE", "commerce" : "ENTERPRISE", "crmHub" : "ENTERPRISE", "dataHub" : "ENTERPRISE" }, "x-hubspot-api-use-case" : "Create a new object for storing information about cars at a car dealership. Your object definition could include properties to store information as well as the filters available on the custom object index page.", "x-hubspot-related-documentation" : [ { "name" : "Custom Object Guide", "url" : "https://developers.hubspot.com/docs/guides/api/crm/objects/custom-objects" } ], "x-hubspot-introduction" : "Use the custom objects schema API to define new types of CRM records in your account. After setting up an object schema, you'll then be able to create records for that custom object both in HubSpot and using the objects API." }, "servers" : [ { "url" : "https://api.hubapi.com" } ], "tags" : [ { "name" : "Advanced" }, { "name" : "Basic" }, { "name" : "Batch" } ], "paths" : { "/crm-object-schemas/v3/schemas" : { "get" : { "tags" : [ "Basic" ], "summary" : "Retrieve all custom object schemas.", "description" : "Retrieve all custom object schemas, with options to include property definitions, association definitions, and audit metadata.", "operationId" : "get-/crm-object-schemas/v3/schemas_getAll", "parameters" : [ { "name" : "archived", "in" : "query", "description" : "Whether to return only results that have been archived.", "required" : false, "style" : "form", "explode" : true, "schema" : { "type" : "boolean", "example" : null, "default" : false } }, { "name" : "includeAssociationDefinitions", "in" : "query", "description" : "", "required" : false, "style" : "form", "explode" : true, "schema" : { "type" : "boolean", "example" : null, "default" : true } }, { "name" : "includeAuditMetadata", "in" : "query", "description" : "", "required" : false, "style" : "form", "explode" : true, "schema" : { "type" : "boolean", "example" : null, "default" : true } }, { "name" : "includePropertyDefinitions", "in" : "query", "description" : "", "required" : false, "style" : "form", "explode" : true, "schema" : { "type" : "boolean", "example" : null, "default" : true } } ], "responses" : { "200" : { "description" : "successful operation", "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/CollectionResponseObjectSchemaNoPaging" }, "example" : null } } }, "default" : { "description" : "", "$ref" : "#/components/responses/Error" } }, "security" : [ { "app_cookie" : [ "custom-object-read" ] }, { "hapikey" : [ ] }, { "internal_cookie" : [ "custom-object-read" ] }, { "oauth2" : [ "custom-object-read" ] }, { "shhkey" : [ ] } ], "x-hubspot-auth-scoping-type" : "ALL" }, "post" : { "tags" : [ "Basic" ], "summary" : "Create a new custom object schema.", "description" : "Create a new custom object schema by defining its properties and associations.", "operationId" : "post-/crm-object-schemas/v3/schemas_create", "parameters" : [ ], "requestBody" : { "description" : "Object schema definition, including properties and associations.", "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/ObjectSchemaEgg" }, "example" : null } }, "required" : true }, "responses" : { "201" : { "description" : "successful operation", "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/ObjectSchema" }, "example" : null } } }, "default" : { "description" : "", "$ref" : "#/components/responses/Error" } }, "security" : [ { "app_cookie" : [ "custom-object-access", "custom-object-write" ] }, { "hapikey" : [ ] }, { "internal_cookie" : [ "custom-object-access", "custom-object-write" ] }, { "oauth2" : [ "custom-object-access", "custom-object-write" ] }, { "shhkey" : [ ] } ], "x-hubspot-auth-scoping-type" : "ALL" } }, "/crm-object-schemas/v3/schemas/batch/read" : { "post" : { "tags" : [ "Batch" ], "summary" : "Retrieve multiple custom object schemas in a batch request.", "description" : "Retrieve details of multiple custom object schemas by providing a batch request with specified inputs. This operation allows you to fetch schema information, including properties and associations, for multiple custom objects in a single API call.", "operationId" : "post-/crm-object-schemas/v3/schemas/batch/read_/crm-object-schemas/v3/schemas/batch/read", "parameters" : [ ], "requestBody" : { "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/ObjectSchemaBatchReadRequest" }, "example" : null } }, "required" : true }, "responses" : { "200" : { "description" : "successful operation", "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/CollectionResponseObjectSchemaNoPaging" }, "example" : null } } }, "default" : { "description" : "", "$ref" : "#/components/responses/Error" } }, "security" : [ { "app_cookie" : [ "custom-object-read", "oauth-access" ] }, { "hapikey" : [ ] }, { "internal_cookie" : [ "custom-object-read", "oauth-access" ] }, { "oauth2" : [ "custom-object-read", "oauth-access" ] }, { "shhkey" : [ ] } ], "x-hubspot-auth-scoping-type" : "ANY" } }, "/crm-object-schemas/v3/schemas/{objectType}" : { "get" : { "tags" : [ "Basic" ], "summary" : "Retrieve the schema of a specified custom object.", "description" : "Retrieve details of a custom object schema, including its properties and associations, using the object type ID or fully qualified name.", "operationId" : "get-/crm-object-schemas/v3/schemas/{objectType}_getById", "parameters" : [ { "name" : "objectType", "in" : "path", "description" : "Fully qualified name or object type ID of your schema.", "required" : true, "style" : "simple", "explode" : false, "schema" : { "type" : "string", "example" : null } }, { "name" : "includeAssociationDefinitions", "in" : "query", "description" : "", "required" : false, "style" : "form", "explode" : true, "schema" : { "type" : "boolean", "example" : null, "default" : true } }, { "name" : "includeAuditMetadata", "in" : "query", "description" : "", "required" : false, "style" : "form", "explode" : true, "schema" : { "type" : "boolean", "example" : null, "default" : true } }, { "name" : "includePropertyDefinitions", "in" : "query", "description" : "", "required" : false, "style" : "form", "explode" : true, "schema" : { "type" : "boolean", "example" : null, "default" : true } } ], "responses" : { "200" : { "description" : "successful operation", "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/ObjectSchema" }, "example" : null } } }, "default" : { "description" : "", "$ref" : "#/components/responses/Error" } }, "security" : [ { "app_cookie" : [ "custom-object-read", "oauth-access" ] }, { "hapikey" : [ ] }, { "internal_cookie" : [ "custom-object-read", "oauth-access" ] }, { "oauth2" : [ "custom-object-read", "oauth-access" ] }, { "shhkey" : [ ] } ], "x-hubspot-auth-scoping-type" : "ANY" }, "delete" : { "tags" : [ "Basic" ], "summary" : "Delete the schema of a specified custom object.", "description" : "Remove a custom object schema from the account using its object type ID or fully qualified name.", "operationId" : "delete-/crm-object-schemas/v3/schemas/{objectType}_archive", "parameters" : [ { "name" : "objectType", "in" : "path", "description" : "Fully qualified name or object type ID of your schema.", "required" : true, "style" : "simple", "explode" : false, "schema" : { "type" : "string", "example" : null } }, { "name" : "archived", "in" : "query", "description" : "Whether to return only results that have been archived.", "required" : false, "style" : "form", "explode" : true, "schema" : { "type" : "boolean", "example" : null, "default" : false } } ], "responses" : { "204" : { "description" : "No content", "content" : { } }, "default" : { "description" : "", "$ref" : "#/components/responses/Error" } }, "security" : [ { "app_cookie" : [ "custom-object-delete" ] }, { "hapikey" : [ ] }, { "internal_cookie" : [ "custom-object-delete" ] }, { "oauth2" : [ "custom-object-delete" ] }, { "shhkey" : [ ] } ], "x-hubspot-auth-scoping-type" : "ALL" }, "patch" : { "tags" : [ "Basic" ], "summary" : "Update the schema of a specified custom object.", "description" : "Update attributes of a custom object schema, such as properties and labels, using the object type ID or fully qualified name.", "operationId" : "patch-/crm-object-schemas/v3/schemas/{objectType}_update", "parameters" : [ { "name" : "objectType", "in" : "path", "description" : "Fully qualified name or object type ID of your schema.", "required" : true, "style" : "simple", "explode" : false, "schema" : { "type" : "string", "example" : null } } ], "requestBody" : { "description" : "Attributes to update in your schema.", "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/ObjectTypeDefinitionPatch" }, "example" : null } }, "required" : true }, "responses" : { "200" : { "description" : "successful operation", "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/ObjectTypeDefinition" }, "example" : null } } }, "default" : { "description" : "", "$ref" : "#/components/responses/Error" } }, "security" : [ { "app_cookie" : [ "custom-object-access", "custom-object-write" ] }, { "hapikey" : [ ] }, { "internal_cookie" : [ "custom-object-access", "custom-object-write" ] }, { "oauth2" : [ "custom-object-access", "custom-object-write" ] }, { "shhkey" : [ ] } ], "x-hubspot-auth-scoping-type" : "ALL" } }, "/crm-object-schemas/v3/schemas/{objectType}/associations" : { "post" : { "tags" : [ "Advanced" ], "summary" : "Create an association for a specified object type.", "description" : "Create a new association between the specified object type and another object type. This operation requires the definition of the association attributes, such as the primary and target object type IDs.", "operationId" : "post-/crm-object-schemas/v3/schemas/{objectType}/associations_createAssociation", "parameters" : [ { "name" : "objectType", "in" : "path", "description" : "Fully qualified name or object type ID of your schema.", "required" : true, "style" : "simple", "explode" : false, "schema" : { "type" : "string", "example" : null } } ], "requestBody" : { "description" : "Attributes that define the association.", "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/AssociationDefinitionEgg" }, "example" : null } }, "required" : true }, "responses" : { "201" : { "description" : "successful operation", "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/AssociationDefinition" }, "example" : null } } }, "default" : { "description" : "", "$ref" : "#/components/responses/Error" } }, "security" : [ { "app_cookie" : [ "custom-object-access", "custom-object-write" ] }, { "hapikey" : [ ] }, { "internal_cookie" : [ "custom-object-access", "custom-object-write" ] }, { "oauth2" : [ "custom-object-access", "custom-object-write" ] }, { "shhkey" : [ ] } ], "x-hubspot-auth-scoping-type" : "ALL" } }, "/crm-object-schemas/v3/schemas/{objectType}/associations/{associationIdentifier}" : { "delete" : { "tags" : [ "Basic" ], "summary" : "Delete an existing association for a specified object type.", "description" : "Remove an association between two object types identified by the association identifier and object type. This operation is irreversible and will permanently delete the specified association.", "operationId" : "delete-/crm-object-schemas/v3/schemas/{objectType}/associations/{associationIdentifier}_archiveAssociation", "parameters" : [ { "name" : "associationIdentifier", "in" : "path", "description" : "Unique ID of the association to remove.", "required" : true, "style" : "simple", "explode" : false, "schema" : { "type" : "string", "example" : null } }, { "name" : "objectType", "in" : "path", "description" : "Fully qualified name or object type ID of your schema.", "required" : true, "style" : "simple", "explode" : false, "schema" : { "type" : "string", "example" : null } } ], "responses" : { "204" : { "description" : "No content", "content" : { } }, "default" : { "description" : "", "$ref" : "#/components/responses/Error" } }, "security" : [ { "app_cookie" : [ "custom-object-delete" ] }, { "hapikey" : [ ] }, { "internal_cookie" : [ "custom-object-delete" ] }, { "oauth2" : [ "custom-object-delete" ] }, { "shhkey" : [ ] } ], "x-hubspot-auth-scoping-type" : "ALL" } } }, "components" : { "schemas" : { "ObjectTypeDefinitionPatch" : { "type" : "object", "properties" : { "allowsSensitiveProperties" : { "type" : "boolean", "description" : "Determines if the object type can include properties that are marked as sensitive.", "example" : null }, "clearDescription" : { "type" : "boolean", "description" : "Indicates whether the description of the object type should be cleared.", "example" : null }, "description" : { "type" : "string", "description" : "A brief explanation of the object type.", "example" : null }, "labels" : { "$ref" : "#/components/schemas/ObjectTypeDefinitionLabels" }, "primaryDisplayProperty" : { "type" : "string", "description" : "The name of the primary property for this object. This will be displayed as primary on the HubSpot record page for this object type.", "example" : null }, "requiredProperties" : { "type" : "array", "description" : "The names of properties that should be **required** when creating an object of this type.", "example" : null, "items" : { "type" : "string", "example" : null } }, "restorable" : { "type" : "boolean", "description" : "Specifies if the object type can be restored after being deleted.", "example" : null }, "searchableProperties" : { "type" : "array", "description" : "Names of properties that will be indexed for this object type in by HubSpot's product search.", "example" : null, "items" : { "type" : "string", "example" : null } }, "secondaryDisplayProperties" : { "type" : "array", "description" : "The names of secondary properties for this object. These will be displayed as secondary on the HubSpot record page for this object type.", "example" : null, "items" : { "type" : "string", "example" : null } } }, "description" : "Defines attributes to update on an object type.", "example" : { "primaryDisplayProperty" : "my_object_property", "requiredProperties" : [ "my_object_property" ], "searchableProperties" : [ "my_object_property" ] } }, "CollectionResponseObjectSchemaNoPaging" : { "required" : [ "results" ], "type" : "object", "properties" : { "results" : { "type" : "array", "example" : null, "items" : { "$ref" : "#/components/schemas/ObjectSchema" } } }, "example" : null }, "ObjectTypeDefinition" : { "required" : [ "id", "labels", "name", "requiredProperties" ], "type" : "object", "properties" : { "allowsSensitiveProperties" : { "type" : "boolean", "description" : "Indicates whether the object type allows properties that contain sensitive data.", "example" : null }, "archived" : { "type" : "boolean", "description" : "Indicates whether the object type is archived.", "example" : null }, "createdAt" : { "type" : "string", "description" : "When the object type was created.", "format" : "date-time", "example" : null }, "description" : { "type" : "string", "description" : "A description of the object type.", "example" : null }, "fullyQualifiedName" : { "type" : "string", "description" : "An assigned unique ID for the object, including portal ID and object name.", "example" : null }, "id" : { "type" : "string", "description" : "A unique ID for this object type. Will be defined as {meta-type}-{unique ID}.", "example" : null }, "labels" : { "$ref" : "#/components/schemas/ObjectTypeDefinitionLabels" }, "name" : { "type" : "string", "description" : "A unique name for this object. For internal use only.", "example" : null }, "objectTypeId" : { "type" : "string", "description" : "A unique identifier for the object type.", "example" : null }, "portalId" : { "type" : "integer", "description" : "The ID of the account that this object type is specific to.", "format" : "int32", "example" : null }, "primaryDisplayProperty" : { "type" : "string", "description" : "The name of the primary property for this object. This will be displayed as primary on the HubSpot record page for this object type.", "example" : null }, "requiredProperties" : { "type" : "array", "description" : "The names of properties that should be **required** when creating an object of this type.", "example" : null, "items" : { "type" : "string", "example" : null } }, "searchableProperties" : { "type" : "array", "description" : "Names of properties that will be indexed for this object type in by HubSpot's product search.", "example" : null, "items" : { "type" : "string", "example" : null } }, "secondaryDisplayProperties" : { "type" : "array", "description" : "The names of secondary properties for this object. These will be displayed as secondary on the HubSpot record page for this object type.", "example" : null, "items" : { "type" : "string", "example" : null } }, "updatedAt" : { "type" : "string", "description" : "When the object type was last updated.", "format" : "date-time", "example" : null } }, "description" : "Defines an object type.", "example" : { "createdAt" : "2020-02-20T18:07:11.390Z", "id" : "123456", "labels" : { "plural" : "My objects", "singular" : "My object" }, "metaType" : "PORTAL_SPECIFIC", "name" : "my_object", "portalId" : 12345678, "primaryDisplayProperty" : "my_object_property", "requiredProperties" : [ "my_object_property" ], "searchableProperties" : [ "my_object_property" ], "updatedAt" : "2020-02-21T14:13:28.818002Z" } }, "OptionInput" : { "required" : [ "displayOrder", "hidden", "label", "value" ], "type" : "object", "properties" : { "description" : { "type" : "string", "description" : "A description of the option.", "example" : null }, "displayOrder" : { "type" : "integer", "description" : "Options are shown in order starting with the lowest positive integer value. Values of -1 will cause the option to be displayed after any positive values.", "format" : "int32", "example" : null }, "hidden" : { "type" : "boolean", "description" : "Hidden options won't be shown in HubSpot.", "example" : null }, "label" : { "type" : "string", "description" : "A human-readable option label that will be shown in HubSpot.", "example" : null }, "value" : { "type" : "string", "description" : "The internal value of the option, which must be used when setting the property value through the API.", "example" : null } }, "description" : "Defines a enumeration property option", "example" : { "description" : "Choice number one", "displayOrder" : 1, "hidden" : false, "label" : "Option A", "value" : "A" } }, "ObjectSchemaBatchReadRequest" : { "required" : [ "includeAssociationDefinitions", "includeAuditMetadata", "includePropertyDefinitions", "inputs" ], "type" : "object", "properties" : { "includeAssociationDefinitions" : { "type" : "boolean", "description" : "Indicates whether to include association definitions in the response.", "example" : null }, "includeAuditMetadata" : { "type" : "boolean", "description" : "Indicates whether to include audit metadata in the response.", "example" : null }, "includePropertyDefinitions" : { "type" : "boolean", "description" : "Indicates whether to include property definitions in the response.", "example" : null }, "inputs" : { "type" : "array", "example" : null, "items" : { "type" : "string", "example" : null } } }, "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 }, "ObjectTypePropertyCreate" : { "required" : [ "fieldType", "label", "name", "type" ], "type" : "object", "properties" : { "description" : { "type" : "string", "description" : "A description of the property that will be shown as help text in HubSpot.", "example" : null }, "displayOrder" : { "type" : "integer", "description" : "The order that this property should be displayed in the HubSpot UI relative to other properties for this object type. Properties are displayed in order starting with the lowest positive integer value. A value of -1 will cause the property to be displayed **after** any positive values.", "format" : "int32", "example" : null }, "externalOptionsReferenceType" : { "type" : "string", "description" : "Specifies the reference type for external options associated with the property.", "example" : null }, "fieldType" : { "type" : "string", "description" : "Controls how the property appears in HubSpot.", "example" : null }, "formField" : { "type" : "boolean", "description" : "Whether the property can be used in a HubSpot form.", "example" : null }, "groupName" : { "type" : "string", "description" : "The name of the group this property belongs to.", "example" : null }, "hasUniqueValue" : { "type" : "boolean", "description" : "Whether or not the property's value must be unique. Once set, this can't be changed.", "example" : null }, "hidden" : { "type" : "boolean", "description" : "Hidden options won't be shown in HubSpot.", "example" : null }, "label" : { "type" : "string", "description" : "A human-readable property label that will be shown in HubSpot.", "example" : null }, "name" : { "type" : "string", "description" : "The internal property name, which must be used when referencing the property from the API.", "example" : null }, "numberDisplayHint" : { "type" : "string", "description" : "Controls how numeric properties are formatted in the HubSpot UI", "example" : null, "enum" : [ "currency", "duration", "formatted", "percentage", "probability", "unformatted" ] }, "optionSortStrategy" : { "type" : "string", "description" : "Controls how the property options will be sorted in the HubSpot UI.", "example" : null, "enum" : [ "ALPHABETICAL", "DISPLAY_ORDER" ] }, "options" : { "type" : "array", "description" : "A list of available options for the property. This field is only required for enumerated properties.", "example" : null, "items" : { "$ref" : "#/components/schemas/OptionInput" } }, "referencedObjectType" : { "type" : "string", "description" : "Defines the options this property will return, e.g. OWNER would return name of users on the portal.", "example" : null }, "searchableInGlobalSearch" : { "type" : "boolean", "description" : "Allow users to search for information entered to this field (limited to 3 properties)", "example" : null }, "showCurrencySymbol" : { "type" : "boolean", "description" : "Whether the property will display the currency symbol in the HubSpot UI.", "example" : null }, "textDisplayHint" : { "type" : "string", "description" : "Controls how text properties are formatted in the HubSpot UI", "example" : null, "enum" : [ "domain_name", "email", "ip_address", "multi_line", "phone_number", "physical_address", "postal_code", "unformatted_single_line" ] }, "type" : { "type" : "string", "description" : "The data type of the property.", "example" : null, "enum" : [ "bool", "date", "datetime", "enumeration", "number", "phone_number", "string" ] } }, "description" : "Defines a property to create.", "example" : { "displayOrder" : 2, "fieldType" : "select", "groupName" : "my_object_information", "hasUniqueValue" : false, "label" : "My object property", "options" : [ { "description" : "Choice number one", "displayOrder" : 1, "label" : "Option A", "value" : "A" }, { "description" : "Choice number two", "displayOrder" : 2, "label" : "Option B", "value" : "B" } ], "type" : "enumeration" } }, "PropertyModificationMetadata" : { "required" : [ "archivable", "readOnlyDefinition", "readOnlyValue" ], "type" : "object", "properties" : { "archivable" : { "type" : "boolean", "description" : "Indicates whether the property can be archived.", "example" : null }, "readOnlyDefinition" : { "type" : "boolean", "description" : "Indicates whether the property's definition is read-only.", "example" : null }, "readOnlyOptions" : { "type" : "boolean", "description" : "Indicates whether the property's options are read-only.", "example" : null }, "readOnlyValue" : { "type" : "boolean", "description" : "Indicates whether the property's value is read-only.", "example" : null } }, "example" : null }, "AssociationDefinitionEgg" : { "required" : [ "fromObjectTypeId", "toObjectTypeId" ], "type" : "object", "properties" : { "fromObjectTypeId" : { "type" : "string", "description" : "ID of the primary object type to link from.", "example" : null }, "name" : { "type" : "string", "description" : "A unique name for this association.", "example" : null }, "toObjectTypeId" : { "type" : "string", "description" : "ID of the target object type ID to link to.", "example" : null } }, "description" : "Defines an association between two object types.", "example" : { "fromObjectTypeId" : "2-123456", "name" : "my_object_to_contact", "toObjectTypeId" : "contact" } }, "AssociationDefinition" : { "required" : [ "fromObjectTypeId", "id", "toObjectTypeId" ], "type" : "object", "properties" : { "createdAt" : { "type" : "string", "description" : "When the association was defined.", "format" : "date-time", "example" : null }, "fromObjectTypeId" : { "type" : "string", "description" : "ID of the primary object type to link from.", "example" : null }, "id" : { "type" : "string", "description" : "A unique ID for this association.", "example" : null }, "name" : { "type" : "string", "description" : "A unique name for this association.", "example" : null }, "toObjectTypeId" : { "type" : "string", "description" : "ID of the target object type ID to link to.", "example" : null }, "updatedAt" : { "type" : "string", "description" : "When the association was last updated.", "format" : "date-time", "example" : null } }, "description" : "The definition of an association", "example" : { "fromObjectTypeId" : "2-123456", "id" : "105", "name" : "my_object_to_contact", "toObjectTypeId" : "0-1" } }, "ObjectSchema" : { "required" : [ "associations", "id", "labels", "name", "properties", "requiredProperties" ], "type" : "object", "properties" : { "allowsSensitiveProperties" : { "type" : "boolean", "example" : null }, "archived" : { "type" : "boolean", "example" : null }, "associations" : { "type" : "array", "description" : "Associations defined for a given object type.", "example" : null, "items" : { "$ref" : "#/components/schemas/AssociationDefinition" } }, "createdAt" : { "type" : "string", "description" : "When the object schema was created.", "format" : "date-time", "example" : null }, "createdByUserId" : { "type" : "integer", "format" : "int32", "example" : null }, "description" : { "type" : "string", "example" : null }, "fullyQualifiedName" : { "type" : "string", "description" : "An assigned unique ID for the object, including portal ID and object name.", "example" : null }, "id" : { "type" : "string", "description" : "A unique ID for this schema's object type. Will be defined as {meta-type}-{unique ID}.", "example" : null }, "labels" : { "$ref" : "#/components/schemas/ObjectTypeDefinitionLabels" }, "name" : { "type" : "string", "description" : "A unique name for the schema's object type.", "example" : null }, "objectTypeId" : { "type" : "string", "example" : null }, "primaryDisplayProperty" : { "type" : "string", "description" : "The name of the primary property for this object. This will be displayed as primary on the HubSpot record page for this object type.", "example" : null }, "properties" : { "type" : "array", "description" : "Properties defined for this object type.", "example" : null, "items" : { "$ref" : "#/components/schemas/Property" } }, "requiredProperties" : { "type" : "array", "description" : "The names of properties that should be **required** when creating an object of this type.", "example" : null, "items" : { "type" : "string", "example" : null } }, "searchableProperties" : { "type" : "array", "description" : "Names of properties that will be indexed for this object type in by HubSpot's product search.", "example" : null, "items" : { "type" : "string", "example" : null } }, "secondaryDisplayProperties" : { "type" : "array", "description" : "The names of secondary properties for this object. These will be displayed as secondary on the HubSpot record page for this object type.", "example" : null, "items" : { "type" : "string", "example" : null } }, "updatedAt" : { "type" : "string", "description" : "When the object schema was last updated.", "format" : "date-time", "example" : null }, "updatedByUserId" : { "type" : "integer", "format" : "int32", "example" : null } }, "description" : "Defines an object schema, including its properties and associations.", "example" : { "associations" : [ { "fromObjectTypeId" : "2-123456", "id" : "123", "name" : "my_object_to_contact", "toObjectTypeId" : "0-1" } ], "createdAt" : "2020-02-20T18:07:11.390Z", "fullyQualifiedName" : "p7878787_my_object\"", "id" : "123456", "labels" : { "plural" : "My objects", "singular" : "My object" }, "metaType" : "PORTAL_SPECIFIC", "name" : "my_object", "primaryDisplayProperty" : "my_object_property", "properties" : [ { "archived" : false, "calculated" : false, "createdAt" : "2020-02-20T18:07:11.802Z", "displayOrder" : -1, "externalOptions" : false, "fieldType" : "text", "groupName" : "my_object_information", "hasUniqueValue" : false, "label" : "My object property", "name" : "my_object_property", "type" : "string", "updatedAt" : "2020-02-20T18:07:11.802Z" } ], "requiredProperties" : [ "my_object_property" ], "searchableProperties" : [ "my_object_property" ], "updatedAt" : "2020-02-20T18:09:07.555Z" } }, "ObjectSchemaEgg" : { "required" : [ "associatedObjects", "labels", "name", "properties", "requiredProperties" ], "type" : "object", "properties" : { "allowsSensitiveProperties" : { "type" : "boolean", "description" : "Determines if the object type can include properties that are marked as sensitive.", "example" : null }, "associatedObjects" : { "type" : "array", "description" : "Associations defined for this object type.", "example" : null, "items" : { "type" : "string", "example" : null } }, "description" : { "type" : "string", "description" : "A brief explanation of the object type.", "example" : null }, "labels" : { "$ref" : "#/components/schemas/ObjectTypeDefinitionLabels" }, "name" : { "type" : "string", "description" : "A unique name for this object. For internal use only.", "example" : null }, "primaryDisplayProperty" : { "type" : "string", "description" : "The name of the primary property for this object. This will be displayed as primary on the HubSpot record page for this object type.", "example" : null }, "properties" : { "type" : "array", "description" : "Properties defined for this object type.", "example" : null, "items" : { "$ref" : "#/components/schemas/ObjectTypePropertyCreate" } }, "requiredProperties" : { "type" : "array", "description" : "The names of properties that should be **required** when creating an object of this type.", "example" : null, "items" : { "type" : "string", "example" : null } }, "searchableProperties" : { "type" : "array", "description" : "Names of properties that will be indexed for this object type in by HubSpot's product search.", "example" : null, "items" : { "type" : "string", "example" : null } }, "secondaryDisplayProperties" : { "type" : "array", "description" : "The names of secondary properties for this object. These will be displayed as secondary on the HubSpot record page for this object type.", "example" : null, "items" : { "type" : "string", "example" : null } } }, "description" : "Defines a new object type, its properties, and associations.", "example" : { "associatedObjects" : [ "CONTACT" ], "labels" : { "plural" : "My objects", "singular" : "My object" }, "metaType" : "PORTAL_SPECIFIC", "name" : "my_object", "primaryDisplayProperty" : "my_object_property", "properties" : [ { "isPrimaryDisplayLabel" : true, "label" : "My object property", "name" : "my_object_property" } ], "requiredProperties" : [ "my_object_property" ] } }, "ObjectTypeDefinitionLabels" : { "type" : "object", "properties" : { "plural" : { "type" : "string", "description" : "The word for multiple objects. (There’s no way to change this later.)", "example" : null }, "singular" : { "type" : "string", "description" : "The word for one object. (There’s no way to change this later.)", "example" : null } }, "description" : "Singular and plural labels for the object. Used in CRM display.", "example" : { "plural" : "My objects", "singular" : "My object" } }, "Option" : { "required" : [ "hidden", "label", "value" ], "type" : "object", "properties" : { "description" : { "type" : "string", "description" : "A description of the option.", "example" : null }, "displayOrder" : { "type" : "integer", "description" : "Options are displayed in order starting with the lowest positive integer value. Values of -1 will cause the option to be displayed after any positive values.", "format" : "int32", "example" : null }, "hidden" : { "type" : "boolean", "description" : "Hidden options will not be displayed in HubSpot.", "example" : null }, "label" : { "type" : "string", "description" : "A human-readable option label that will be shown in HubSpot.", "example" : null }, "value" : { "type" : "string", "description" : "The internal value of the option, which must be used when setting the property value through the API.", "example" : null } }, "description" : "A HubSpot property option", "example" : { "description" : "Choice number one", "displayOrder" : 1, "hidden" : false, "label" : "Option A", "value" : "A" } }, "Property" : { "required" : [ "description", "fieldType", "groupName", "label", "name", "options", "type" ], "type" : "object", "properties" : { "archived" : { "type" : "boolean", "description" : "Whether or not the property is archived.", "example" : null }, "archivedAt" : { "type" : "string", "description" : "When the property was archived.", "format" : "date-time", "example" : null }, "calculated" : { "type" : "boolean", "description" : "For default properties, true indicates that the property is calculated by a HubSpot process. It has no effect for custom properties.", "example" : null }, "calculationFormula" : { "type" : "string", "description" : "The formula used for calculated properties.", "example" : null }, "createdAt" : { "type" : "string", "description" : "When the property was created", "format" : "date-time", "example" : null }, "createdUserId" : { "type" : "string", "description" : "The internal ID of the user who created the property in HubSpot. This field may not exist if the property was created outside of HubSpot.", "example" : null }, "currencyPropertyName" : { "type" : "string", "description" : "The name of the related currency property.", "example" : null }, "dataSensitivity" : { "type" : "string", "description" : "Indicates the sensitivity level of the property, such as \"non_sensitive\", \"sensitive\", or \"highly_sensitive\".", "example" : null, "enum" : [ "highly_sensitive", "non_sensitive", "sensitive" ] }, "dateDisplayHint" : { "type" : "string", "description" : "Controls how date properties are displayed in the HubSpot UI, with options such as 'absolute', 'absolute_with_relative', 'time_since', and 'time_until'.", "example" : null, "enum" : [ "absolute", "absolute_with_relative", "time_since", "time_until" ] }, "description" : { "type" : "string", "description" : "A description of the property that will be shown as help text in HubSpot.", "example" : null }, "displayOrder" : { "type" : "integer", "description" : "The order that this property should be displayed in the HubSpot UI relative to other properties for this object type. Properties are displayed in order starting with the lowest positive integer value. A value of -1 will cause the property to be displayed **after** any positive values.", "format" : "int32", "example" : null }, "externalOptions" : { "type" : "boolean", "description" : "For default properties, true indicates that the options are stored externally to the property settings.", "example" : null }, "fieldType" : { "type" : "string", "description" : "Controls how the property appears in HubSpot.", "example" : null }, "formField" : { "type" : "boolean", "description" : "Whether or not the property can be used in a HubSpot form.", "example" : null }, "groupName" : { "type" : "string", "description" : "The name of the property group the property belongs to.", "example" : null }, "hasUniqueValue" : { "type" : "boolean", "description" : "Whether or not the property's value must be unique. Once set, this can't be changed.", "example" : null }, "hidden" : { "type" : "boolean", "description" : "Hidden options won't be shown in HubSpot.", "example" : false }, "hubspotDefined" : { "type" : "boolean", "description" : "This will be true for default object properties built into HubSpot.", "example" : null }, "label" : { "type" : "string", "description" : "A human-readable property label that will be shown in HubSpot.", "example" : null }, "modificationMetadata" : { "$ref" : "#/components/schemas/PropertyModificationMetadata" }, "name" : { "type" : "string", "description" : "The internal property name, which must be used when referencing the property via the API.", "example" : null }, "numberDisplayHint" : { "type" : "string", "description" : "Hint for how a number property is displayed and validated in HubSpot's UI. Can be: \"unformatted\", \"formatted\", \"currency\", \"percentage\", \"duration\", or \"probability\".", "example" : null, "enum" : [ "currency", "duration", "formatted", "percentage", "probability", "unformatted" ] }, "options" : { "type" : "array", "description" : "A list of valid options for the property. This field is required for enumerated properties, but will be empty for other property types.", "example" : null, "items" : { "$ref" : "#/components/schemas/Option" } }, "referencedObjectType" : { "type" : "string", "description" : "If this property is related to other object(s), they'll be listed here.", "example" : null }, "sensitiveDataCategories" : { "type" : "array", "description" : "When sensitiveData is true, lists the type of sensitive data contained in the property (e.g., \"HIPAA\").", "example" : null, "items" : { "type" : "string", "example" : null } }, "showCurrencySymbol" : { "type" : "boolean", "description" : "Whether the property will display the currency symbol set in the account settings.", "example" : null }, "type" : { "type" : "string", "description" : "The property data type.", "example" : null }, "updatedAt" : { "type" : "string", "description" : "When the object type was last updated.", "format" : "date-time", "example" : null }, "updatedUserId" : { "type" : "string", "description" : "The internal user ID of the user who updated the property in HubSpot. This field may not exist if the property was updated outside of HubSpot.", "example" : null } }, "description" : "A HubSpot property", "example" : { "displayOrder" : 2, "fieldType" : "select", "groupName" : "my_object_information", "hasUniqueValue" : false, "label" : "My object property", "modificationMetadata" : { "archivable" : true, "readOnlyDefinition" : false, "readOnlyOptions" : false, "readOnlyValue" : false }, "name" : "my_object_property", "options" : [ { "description" : "Choice number one", "displayOrder" : 1, "hidden" : false, "label" : "Option A", "value" : "A" }, { "description" : "Choice number two", "displayOrder" : 2, "hidden" : false, "label" : "Option B", "value" : "B" } ], "type" : "enumeration" } } }, "responses" : { "Error" : { "description" : "An error occurred.", "content" : { "*/*" : { "schema" : { "$ref" : "#/components/schemas/Error" }, "example" : null } } } }, "securitySchemes" : { "hapikey" : { "type" : "apiKey", "name" : "hapikey", "in" : "query" }, "developer_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" : { "custom-object-access" : "", "custom-object-delete" : "", "custom-object-read" : "", "custom-object-write" : "", "oauth-access" : "", "tax-rate-group-read" : "" } } } }, "private_apps_legacy" : { "type" : "apiKey", "name" : "private-app-legacy", "in" : "header" }, "private_apps" : { "type" : "apiKey", "name" : "private-app", "in" : "header" } } }, "x-hubspot-available-client-libraries" : [ "Node", "Python", "Ruby", "PHP" ], "x-hubspot-product-tier-requirements" : { "marketing" : "ENTERPRISE", "sales" : "ENTERPRISE", "service" : "ENTERPRISE", "cms" : "ENTERPRISE", "commerce" : "ENTERPRISE", "crmHub" : "ENTERPRISE", "dataHub" : "ENTERPRISE" } }