custom-object-management
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseSource of truth
事实来源
hubspot schemas --helplistgetcreateupdatedeletecrm.schemas.custom.writebulk-operations/SKILL.mdschemas deletehubspot schemas --helplistgetcreateupdatedeletecrm.schemas.custom.writebulk-operations/SKILL.mdschemas deleteDiscover existing schemas
发现现有模式
bash
hubspot schemas list # JSONL: name, label, singular, objectTypeId, source
hubspot schemas list | jq 'select(.source=="custom")' # custom only
hubspot objects types | jq -c 'select(.source=="custom")' # same set, also shown to confirm `--type` resolvesnameobjectTypeId2-12345678PLATFORM_FLOWbash
hubspot schemas list # JSONL格式:name、label、singular、objectTypeId、source
hubspot schemas list | jq 'select(.source=="custom")' # 仅显示自定义模式
hubspot objects types | jq -c 'select(.source=="custom")' # 同一数据集,也可用于确认`--type`参数是否解析正确nameobjectTypeId2-12345678PLATFORM_FLOWInspect one schema
查看单个模式
bash
hubspot schemas get petsReturns the full definition — properties, associations, labels, , , . Reshape with as needed (see ).
requiredPropertiesprimaryDisplayPropertyfullyQualifiedNamejqbulk-operations/resources/json-patterns.mdbash
hubspot schemas get pets返回完整定义——包括属性、关联关系、标签、、、。可根据需要使用调整格式(请参阅)。
requiredPropertiesprimaryDisplayPropertyfullyQualifiedNamejqbulk-operations/resources/json-patterns.mdCreate a schema
创建模式
Build a JSON body and pipe it (or pass ). Minimal valid body:
--filejson
{
"name": "equipment",
"labels": {"singular": "Equipment", "plural": "Equipment"},
"primaryDisplayProperty": "equipment_name",
"requiredProperties": ["equipment_name"],
"properties": [
{"name": "equipment_name", "label": "Name", "type": "string", "fieldType": "text"}
],
"associatedObjects": ["contacts"]
}bash
cat equipment-schema.json | hubspot schemas create --dry-run # preview
hubspot schemas create --file equipment-schema.json # executeAdd more properties later with .
hubspot properties create --type <name> ...构建JSON主体并通过管道传递(或使用参数)。最小有效主体如下:
--filejson
{
"name": "equipment",
"labels": {"singular": "Equipment", "plural": "Equipment"},
"primaryDisplayProperty": "equipment_name",
"requiredProperties": ["equipment_name"],
"properties": [
{"name": "equipment_name", "label": "Name", "type": "string", "fieldType": "text"}
],
"associatedObjects": ["contacts"]
}bash
cat equipment-schema.json | hubspot schemas create --dry-run # 预览操作
hubspot schemas create --file equipment-schema.json # 执行操作后续可使用添加更多属性。
hubspot properties create --type <name> ...Update schema metadata
更新模式元数据
updatehubspot propertiesbash
echo '{"labels":{"singular":"Device","plural":"Devices"}}' | hubspot schemas update equipmentupdate--dry-run--digest --confirm <name>bulk-operations/SKILL.mdupdatehubspot propertiesbash
echo '{"labels":{"singular":"Device","plural":"Devices"}}' | hubspot schemas update equipmentupdate--dry-run--digest --confirm <name>bulk-operations/SKILL.mdDelete a schema (destructive)
删除模式(破坏性操作)
Schema delete is destructive and irreversible — it permanently removes the schema and every record of that type. It is gated as : every delete requires first, then re-run with within 5 minutes.
MetadataDestroy--dry-run--digest <hash> --confirm <name>Follow the three-step flow documented in ("Safe destructive workflow"). For schemas, the confirm value is the schema name:
bulk-operations/SKILL.mdbash
hubspot schemas delete equipment --dry-run删除模式是破坏性且不可逆的操作——它会永久删除模式以及该类型的所有记录。此操作属于权限范畴:每次删除都必须先执行,然后在5分钟内使用重新运行。
MetadataDestroy--dry-run--digest <hash> --confirm <name>请遵循中记录的三步流程(“安全破坏性工作流”)。对于模式,确认值为模式名称:
bulk-operations/SKILL.mdbash
hubspot schemas delete equipment --dry-run→ digest=blast-... ; apply_command_hint shows: --digest <hash> --confirm 'equipment'
→ digest=blast-... ; apply_command_hint显示:--digest <hash> --confirm 'equipment'
hubspot schemas delete equipment --digest <hash> --confirm equipment
Check `hubspot history --since 24h --kind MetadataDestroy` to audit recent schema deletes.hubspot schemas delete equipment --digest <hash> --confirm equipment
可查看`hubspot history --since 24h --kind MetadataDestroy`来审计最近的模式删除操作。Using the schema after creation
创建模式后的使用
Once a schema exists, all commands accept its as (e.g. ). Record CRUD, search, association, bulk upsert — all identical to standard objects. Don't re-implement those flows here; see and .
hubspot objects ...name--type--type petsbulk-operations/SKILL.mdcrm-lookup模式创建完成后,所有命令都可接受其作为参数(例如)。记录CRUD、搜索、关联、批量更新插入——所有操作均与标准对象相同。无需在此处重新实现这些流程;请参阅和。
hubspot objects ...name--type--type petsbulk-operations/SKILL.mdcrm-lookup