Skip to content

hubspot: 0-18, 0-72 and 0-64 are read as communications, deal_splits and quote_templates - #746

Merged
nuriyoo merged 3 commits into
brekkylab:mainfrom
WynandVStaden:hubspot-type-ids-0-18-0-72-0-64
Oct 16, 2026
Merged

nuriyoo merged 3 commits into
brekkylab:mainfrom
WynandVStaden:hubspot-type-ids-0-18-0-72-0-64

Conversation

@WynandVStaden

Copy link
Copy Markdown
Contributor

Closes #551.

What changed

The objectTypeIds 0-18, 0-72 and 0-64 now resolve to communications, deal_splits and quote_templates, the three entries added to _TYPE_IDS in backlot/routers/hubspot.py. Each id serves what its name serves on the listing, a record, search and batch/read, and archived=true on each is the 400 its name already gets from _NO_ARCHIVED_PAGING, naming the same id. Before this, all three were the 400 Invalid object or event type id: <id>.

The comment above _TYPE_IDS keeps its rule that an id is mapped only when it is verified, and says these three are verified by real's own answers rather than by the published list. The other names in _STANDARD_OBJECT_TYPES with no id stay unmapped: their pairings are unmeasured.

Why this is what the real API does

The measurement is the one in #551, against api.hubapi.com on 2026-10-09 by the issue's author: GET /crm/v3/objects/0-18, /0-72 and /0-64 answered 200 with the same records as the names, 0-64 served a record, search and batch/read as quote_templates does, and archived=true on each id answered the message its name gets. I have no HubSpot key and did not call the real API.

Not in this PR: the issue notes real's record url names 0-64; Backlot's records carry no url, so there is nothing here to change.

Verification

  • Tests — pytest on a .[dev] install, Ubuntu 24.04 (WSL), Python 3.12.3: 6070 passed, 37 skipped. test_hubspot_0_18_0_72_0_64_are_their_types fails with backlot/ from main and passes with this change; it checks the listing, search and the archived refusal for each id, and a record and batch/read on 0-64, over a corpus holding one quote template. The issue's reproduction prints the 400 for each id on main and 200 {'results': []} here, as communications answers.

  • Optional surfaces that ran rather than skipped — none. This was a .[dev] install only, so tests/test_sdk.py, tests/test_s3.py, tests/test_mcp.py, tests/test_llamaindex.py and the reader, Google and mirage tests in tests/test_integrations.py sat out. The change touches backlot/routers/hubspot.py and tests/test_hubspot.py only.

  • Lint — ruff check . && ruff format --check .: clean. python scripts/prose_check.py upstream/main: no findings.

  • A test fails without this change

  • A new endpoint serving corpus content is ACL-scoped, proved for both an admin and a scoped token

  • Comments state what was measured, not the history of the fix

The second box is not ticked because no endpoint is added.

@nuriyoo nuriyoo added the fidelity The vendor API defines the right answer; closing this needs a measurement against it label Oct 15, 2026

@nuriyoo nuriyoo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The three pairings are real's. On 2026-10-15 0-18, 0-72 and 0-64 listed the same records by id as communications, deal_splits and quote_templates (none, none, and the portal's three templates); 0-64 served a template as the name does, its url aside, its search totalled 3 and its batch/read returned the id asked for; and archived=true was the same 400 on the id, the plural and the singular, naming the id each time.

Mapping them in _TYPE_IDS also opens the v4 associations route to them, on either side, since list_associations resolves both types through _resolve_type. Real answers 0-64/{id}/associations/contacts, contacts/{id}/associations/0-64, …/0-18, …/0-72 and 0-64/{id}/associations/0-18 with 200 and no results, as it does for the names, and this branch does the same. The suggestions name that route in the comment, pin two of those answers in the test, and point the test's docstring at the comment it repeats. Nothing else to change.

The record url the body mentions is in the open issue on record properties, which is #377.

At f430c3b (Python 3.12, .[dev]):
  3 mutations (an id paired with a type real answers otherwise:   3 caught
    0-64 quotes, 0-18 calls, 0-72 deals)
With the suggestions:
  pytest (the whole suite)                                        6070 passed, 37 skipped
  ruff check, ruff format --check                                 clean

Comment thread backlot/routers/hubspot.py Outdated
Comment thread tests/test_hubspot.py Outdated
Comment thread tests/test_hubspot.py
Measured against api.hubapi.com on 2026-10-15: each id on either side answers what its name does; the comment above _TYPE_IDS records it and the test pins it.

@nuriyoo nuriyoo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this. I applied the review's suggestion as written, as a maintainer commit, a6009d5: the comment above _TYPE_IDS adds the v4 associations route, which reads each of the three ids on either side as it reads the name, on real and here alike, and the test pins that for 0-64 against contacts and against 0-18.

At c3090f1 (main at 7a551d0 merged in; the tree matches a local merge of the two):
  pytest (the whole suite, Python 3.13, .[all,dev])    9340 passed, 2 skipped
  ruff check, ruff format --check                      clean

@nuriyoo
nuriyoo merged commit 584079c into brekkylab:main Oct 16, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fidelity The vendor API defines the right answer; closing this needs a measurement against it

Projects

None yet

Development

Successfully merging this pull request may close these issues.

hubspot: the objectTypeIds 0-18, 0-72 and 0-64 are a 400, where real reads them as communications, deal_splits and quote_templates

2 participants