HubSpot Custom Objects (via hubspot CLI)
Custom objects are portal-specific object types beyond the built-in ones. Always discover the schema before operating on records.
Auth
Set HUBSPOT_ACCESS_TOKEN. Optional --profile <name>.
Discovery first
# List every custom object type in the portal
hubspot crm custom-objects list-types
# List properties on a type (replace <type>)
hubspot discover properties <type>
Type names look like p12345_cars or a fully-qualified 2-12345 object-type id. Use whatever list-types returns.
Canonical commands
| Intent | Command |
|---|---|
| List schemas | hubspot crm custom-objects list-types |
| List records | hubspot crm custom-objects list <type> --limit 20 |
| Get | hubspot crm custom-objects get <type> <id> |
| Create | hubspot crm custom-objects create <type> --properties '{"name":"X","vin":"ABC"}' |
| Update | hubspot crm custom-objects update <type> <id> --properties '{"name":"Y"}' |
| Delete | hubspot crm custom-objects delete <type> <id> --yes |
Associations
Custom-object records can associate to any standard object:
hubspot crm associations create <type> <id> contacts 67890
hubspot crm associations list <type> <id> deals
Output / errors
Envelope matches other CRM objects. Extra error code to handle: SCHEMA_NOT_FOUND (exit 6) — the <type> argument is wrong; run list-types.
Scopes
- Read:
crm.schemas.custom.read,crm.objects.custom.read - Write:
crm.schemas.custom.write,crm.objects.custom.write
Tips
- Custom object type names are portal-specific. Never hard-code a type in a reusable script — discover first.
- Required properties on create vary per schema. If a create returns
VALIDATION_ERROR, runhubspot discover properties <type>and look for"required": true.