Add Global Profile API support - #121
Open
tholovina-sift wants to merge 2 commits into
Open
Conversation
Co-Authored-By: Claude <noreply@anthropic.com>
- Strip whitespace from email/phone before empty check in get_global_profile_by_attributes so whitespace-only strings are correctly rejected and not forwarded to the API (P2) - Add error_cls=ValueError to _assert_non_empty_str call in get_global_profile for consistency with peer methods (P3) - Extract shared global_profile_response_json() module-level helper in tests to eliminate duplicate inline JSON fixtures (P3) Co-Authored-By: Claude <noreply@anthropic.com>
tholovina-sift
marked this pull request as ready for review
August 20, 2026 16:24
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.
Purpose:
GET /v3/accounts/{accountId}/global_profile/users/{userId}(lookup by Sift user ID) andPOST /v3/accounts/{accountId}/global_profile/lookup(lookup by email and/or phone)Technical overview:
get_global_profile(user_id, global_only=False, include_own_data=True, timeout=None)— GET endpoint; optional boolean params always sent on the wire to make default behavior explicitget_global_profile_by_attributes(email=None, phone=None, timeout=None)— POST endpoint with JSON body; raisesValueErrorif neitheremailnorphoneis provided; strips whitespace before validation so blank strings are rejectedsift.client.Responsewrapper around raw parsed JSON; no new typed model classes, consistent with the rest of the SDK_global_profile_urland_global_profile_lookup_urlfollow the existing_v3_api()/_q()percent-encoding patternTesting plan:
This PR contains all required labels and reviewers as per our Change Management Procedure
Live tested against the Sift API with a real account: both GET and POST returned
ok=Truewithidentity_found=True,link_count=31, and fully populated location entriesDeployment plan:
Related documentation is updated
README.md: new usage examples for both methods in the Usage sectionCHANGES.md: new6.1.0entrysift/version.py: version bumped to6.1.0Merge when Global Profile API is publicly available
Merge before https://github.com/SiftScience/sift-docs/pull/92
Rollback plan:
Customer Impact Assessment: