跳转到内容
EN

Create property

Code Mode: praxis.crm.properties.create

HTTP: POST /crm/v1/properties/{objectType}

Define a property before setting its values on records. Choose objectType from schemas.list and groupName from properties.groups.list; provide an immutable internal name, display label, type and fieldType. Enumeration properties require their valid options. Writes return refs (ResourceRef[]) for entity cards and optional property changes in conversations.

签名

praxis.crm.properties.create(args:{path:{objectType:string};body:{/** Represents a formula that is used to compute a calculated property. */ calculationFormula?:string;/** A string representing the name of the currency property. */ currencyPropertyName?:string;/** Indicates the sensitivity level of the property, with options: highly_sensitive, non_sensitive, or sensitive. e.g. "highly_sensitive" */ dataSensitivity?:"highly_sensitive"|"non_sensitive"|"sensitive";/** A description of the property that will be shown as help text in CRM. */ description?:string;/** Properties are displayed in order starting with the lowest positive integer value. e.g. 0 */ displayOrder?:number;/** Applicable only for 'enumeration' type properties. */ externalOptions?:boolean;/** Controls how the property appears in CRM. e.g. "booleancheckbox" */ fieldType:"booleancheckbox"|"calculation_equation"|"checkbox"|"date"|"file"|"html"|"number"|"phonenumber"|"radio"|"select"|"text"|"textarea";/** Whether or not the property can be used in a CRM form. */ formField?:boolean;/** The name of the property group the property belongs to. */ groupName:string;/** Whether or not the property's value must be unique. */ hasUniqueValue?:boolean;/** If true, the property won't be visible and can't be used in CRM. */ hidden?:boolean;/** A human-readable property label that will be shown in CRM. */ label:string;/** The internal property name, which must be used when referencing the property via the API. */ name:string;/** A string providing a hint on how to display numbers. e.g. "currency" */ numberDisplayHint?:"currency"|"duration"|"formatted"|"percentage"|"probability"|"unformatted";/** A list of valid options for the property. */ options?:Array<{/** A description of the option. */ description?:string;/** Options are shown in order starting with the lowest positive integer value. e.g. 0 */ displayOrder:number;/** Hidden options won't be shown in CRM. */ hidden:boolean;/** A human-readable option label that will be shown in CRM. */ label:string;/** The internal value of the option, which must be used when setting the property value through the API. */ value:string}>;/** Should be set to 'OWNER' when 'externalOptions' is true, which causes the property to dynamically pull option values from the current CRM users. */ referencedObjectType?:string;/** A boolean indicating whether to show the currency symbol for currency fields. */ showCurrencySymbol?:boolean;/** A string providing a hint on how to display text. e.g. "domain_name" */ textDisplayHint?:"domain_name"|"email"|"ip_address"|"multi_line"|"phone_number"|"physical_address"|"postal_code"|"unformatted_single_line";/** The data type of the property. e.g. "bool" */ type:"bool"|"date"|"datetime"|"enumeration"|"number"|"phone_number"|"string"}}):Promise<({/** Whether or not the property is archived. */ archived?:boolean;/** When the property was archived. e.g. "2026-10-29T12:00:00Z" */ archivedAt?:string;/** For default properties, true indicates that the property is calculated by a CRM process. */ calculated?:boolean;/** Represents a formula that is used to compute a calculated property. */ calculationFormula?:string;/** The timestamp when the property was created, in ISO 8601 format. e.g. "2026-10-29T12:00:00Z" */ createdAt?:string;/** The internal user ID of the user who created the property in CRM. */ createdUserId?:string;/** The name of the currency property associated with this property, if applicable. */ currencyPropertyName?:string;/** The sensitivity level of the data. e.g. "highly_sensitive" */ dataSensitivity?:"highly_sensitive"|"non_sensitive"|"sensitive";/** Indicates how date values should be displayed, with options such as 'absolute', 'absolute_with_relative', 'time_since', or 'time_until'. e.g. "absolute" */ dateDisplayHint?:"absolute"|"absolute_with_relative"|"time_since"|"time_until";/** A description of the property that will be shown as help text in CRM. */ description:string;/** Properties are shown in order, starting with the lowest positive integer value. e.g. 0 */ displayOrder?:number;/** For default properties, true indicates that the options are stored externally to the property settings. */ externalOptions?:boolean;/** Controls how the property appears in CRM. */ fieldType:string;/** Whether or not the property can be used in a CRM form. */ formField?:boolean;/** The name of the property group the property belongs to. */ groupName:string;/** Whether or not the property's value must be unique. */ hasUniqueValue?:boolean;/** Whether or not the property will be hidden from the CRM UI. e.g. false */ hidden?:boolean;/** This will be true for default object properties built into CRM. */ hubspotDefined?:boolean;/** A human-readable property label that will be shown in CRM. */ label:string;/** Restrictions on archiving and editing this property definition, options or record values. */ modificationMetadata?:{/** Specifies whether the property can be archived. */ archivable:boolean;/** Indicates whether the property's definition is read-only and cannot be modified. */ readOnlyDefinition:boolean;/** Indicates whether the property's options are read-only and cannot be modified. */ readOnlyOptions?:boolean;/** Indicates whether the property's value is read-only and cannot be modified. */ readOnlyValue:boolean};/** The internal property name, which must be used when referencing the property via the API. */ name:string;/** A hint for displaying number properties. e.g. "currency" */ numberDisplayHint?:"currency"|"duration"|"formatted"|"percentage"|"probability"|"unformatted";/** A list of valid options for the property. */ options:Array<{/** A description of the option. */ description?:string;/** Options are displayed in order starting with the lowest positive integer value. e.g. 0 */ displayOrder?:number;/** Hidden options will not be displayed in CRM. */ hidden:boolean;/** A human-readable option label that will be shown in CRM. */ label:string;/** The internal value of the option, which must be used when setting the property value through the API. */ value:string}>;/** If this property is related to other object(s), they'll be listed here. */ referencedObjectType?:string;/** An array of categories indicating the sensitivity of the data contained in the property. */ sensitiveDataCategories?:Array<string>;/** Whether or not the property will display the currency symbol set in the account settings. */ showCurrencySymbol?:boolean;/** A hint for displaying text properties. e.g. "domain_name" */ textDisplayHint?:"domain_name"|"email"|"ip_address"|"multi_line"|"phone_number"|"physical_address"|"postal_code"|"unformatted_single_line";/** The property data type. */ type:string;/** The timestamp when the property was last updated, in ISO 8601 format. e.g. "2026-10-29T12:00:00Z" */ updatedAt?:string;/** The internal user ID of the user who updated the property in CRM. */ updatedUserId?:string})&({/** Affected record references for rendering entity cards in conversations; may be empty for definition-only writes. */ refs:Array<{/** Object type containing the referenced record; use with objects.retrieve. e.g. "deals" */ object:string;/** Record identifier to retrieve with object; obtained from the write result. e.g. "rec_example" */ id:string;/** Console URL for opening the entity card in a conversation or viewing the record. e.g. "https://console.deepraxis.com/crm/deals/rec_example" */ viewer_url:string;/** Optional property changes to render alongside the entity card. */ changes?:Array<{/** Internal name of the property changed by this request. */ property:string;/** Value before the change; null means the property was empty. */ before:string|null;/** Value committed by the change; null means the property was cleared. */ after:string|null}>}>})>;

参数

名称位置类型必填说明
objectTypepathstring是Object type name from schemas.list, such as contacts, companies, deals or a custom p_<name>.

请求体

必填内容类型说明
是application/jsonValues for create property; use internal property names and resource ids from the corresponding list operations.

响应

状态码内容类型说明
201application/jsonCreate property succeeded; inspect the returned resource or result collection.
400application/jsonVALIDATION_ERROR rejects invalid properties or stage rules; supply errors[0].context.properties when requirements are missing, or choose an allowed stage. BAD_REQUEST rejects malformed input; correct the request before retrying.
401application/jsonThe bearer credential is missing or invalid; provide a valid platform API key before retrying.
404application/jsonOBJECT_NOT_FOUND means an object type, record or definition is unavailable in your organization; select an accessible identifier from its list operation.
409application/jsonCONFLICT means a unique value is already used or a change-set reversal would overwrite a later value; read the current records and resolve the conflicting values before retrying.