Repository navigation
Add OAuth v3 client - #502
Merged
Merged
Conversation
Exposes the OAuth v3 token endpoints (get, introspect, revoke) as HubSpot().oauth.v3.advanced_api so Python users can move off the v1 token API, matching the Node client added in hubspot-api-nodejs#702. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The spec now declares revoke_token as returning no body, so the client no longer tries to deserialize the empty 200 response as an Error. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Merged
camden11
marked this pull request as ready for review
October 27, 2026 18:14
joe-yeager
self-requested a review
October 27, 2026 18:46
joe-yeager
approved these changes
Oct 27, 2026
ksvirkou-hubspot
approved these changes
Oct 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The Python SDK has no client for the OAuth v3 token endpoints, so Python users can't move off the v1 token API. This adds
HubSpot().oauth.v3.advanced_apiwithget_token,introspect_token, andrevoke_token. It matches the Node client in HubSpot/hubspot-api-nodejs#702.The second commit regenerates the client from an updated spec. The spec now declares no response body for
revoke_token, so its return type changes fromErrortoNone. In Python only the docstring:rtypechanges; behavior is the same.Notes for reviewers
python-legacy6.5.0 and formatted withblack24.10.0-l 200. Use that exact black version: black 26 changes docstring style.python-legacymerges eachoneOfunion into one class, which keeps only the last member's enum and required fields. Withclient_side_validation=True, every response raisesValueErrorontoken_use. Client-side validation is off by default, as in the rest of the SDK.client_credentialsis untested: the test app getsBAD_SCOPES.Testing
tests/spec/oauth/v3/test_v3.pycovers discovery, plus deserialization forget_tokenandintrospect_token. All oftests/specpasses (105/105).get_tokenwithauthorization_codeand withrefresh_tokenApiException400revoke_tokenreturningNone, after which introspection reportsactive: false🤖 Generated with Claude Code