Skip to content

Add Global Profile API support - #121

Open
tholovina-sift wants to merge 2 commits into
masterfrom
atlas-382-global-profile-api
Open

Add Global Profile API support#121
tholovina-sift wants to merge 2 commits into
masterfrom
atlas-382-global-profile-api

Conversation

@tholovina-sift

@tholovina-sift tholovina-sift commented Aug 18, 2026

Copy link
Copy Markdown

Purpose:

  • Add client support for the new Global Profile API, which returns cross-tenant identity, decision, chargeback, order, transaction, and location signals for a user
  • Expose two new endpoints: GET /v3/accounts/{accountId}/global_profile/users/{userId} (lookup by Sift user ID) and POST /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 explicit
  • get_global_profile_by_attributes(email=None, phone=None, timeout=None) — POST endpoint with JSON body; raises ValueError if neither email nor phone is provided; strips whitespace before validation so blank strings are rejected
  • Both methods use HTTP Basic auth (API key as username, empty password) and return the existing sift.client.Response wrapper around raw parsed JSON; no new typed model classes, consistent with the rest of the SDK
  • URL builders _global_profile_url and _global_profile_lookup_url follow the existing _v3_api() / _q() percent-encoding pattern

Testing 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=True with identity_found=True, link_count=31, and fully populated location entries

Deployment plan:

  • Related documentation is updated

    • README.md: new usage examples for both methods in the Usage section
    • CHANGES.md: new 6.1.0 entry
    • sift/version.py: version bumped to 6.1.0
  • Merge when Global Profile API is publicly available

  • Merge before https://github.com/SiftScience/sift-docs/pull/92

Rollback plan:

  • Revert this PR; no schema changes, no breaking changes to existing methods, fully additive

Customer Impact Assessment:

tholovina-sift and others added 2 commits August 18, 2026 21:34
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
tholovina-sift marked this pull request as ready for review August 20, 2026 16:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant