Repository navigation
feat(api): add customer lookups - #152
Open
talon-github-manager[bot] wants to merge 1 commit into
Open
talon-github-manager[bot] wants to merge 1 commit into
talon-github-manager[bot] wants to merge 1 commit into
Conversation
talon-github-manager
Bot
force-pushed
the
spec-sync/python-customers
branch
from
December 2, 2026 23:09
03b242a to
f94be07
Compare
This was referenced Dec 2, 2026
talon-github-manager
Bot
force-pushed
the
spec-sync/python-customers
branch
from
December 4, 2026 14:19
f94be07 to
277e6de
Compare
talon-github-manager
Bot
force-pushed
the
spec-sync/python-customers
branch
from
December 4, 2026 15:48
277e6de to
fff89aa
Compare
talon-github-manager
Bot
changed the base branch from
spec-sync/python-broadcasts-writes
to
main
December 4, 2026 17:09
Add the ten App API customer reads to APIClient: look people up by email or by filter, read attributes for one person or a list, and a person's activities, messages, relationships, segments, subscription preferences and opt-outs. Additions only.
talon-github-manager
Bot
force-pushed
the
spec-sync/python-customers
branch
from
December 4, 2026 17:09
fff89aa to
1d45454
Compare
sydneycollins-cio
approved these changes
Dec 4, 2026
sydneycollins-cio
left a comment
Contributor
There was a problem hiding this comment.
Checked each new customer method against the services customer handlers: paths, methods, the id_type, start, limit, type, name, start_ts, end_ts and language params, the filter and ids bodies, and the response keys all match. Optouts correctly leaves out id_type since that handler ignores it, and nothing existing changed.
sydneycollins-cio
approved these changes
Dec 4, 2026
sydneycollins-cio
left a comment
Contributor
There was a problem hiding this comment.
Approving again so it counts for the team. Same commit I reviewed.
This branch has not been deployed
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.
MBL-2972
Summary
Adds the ten customer read endpoints from the public App API reference to
APIClient: look people up by email or by filter, read attributes for one person or up to 100, and read a person's activities, messages, relationships, segments, subscription preferences and opt-outs. Additions only: no existing method, class, argument or default changes.Autonomous change by Moby.
Added
APIClientmethodGET /v1/customers?email=get_customers_by_email(email)POST /v1/customers(search by filter)search_customers(filter, start=None, limit=None)POST /v1/customers/attributesget_customers_attributes(ids, id_type=None)GET /v1/customers/{customer_id}/attributesget_customer_attributes(customer_id, id_type=None)GET /v1/customers/{customer_id}/activitiesget_customer_activities(customer_id, id_type=None, start=None, limit=None, type=None, name=None)GET /v1/customers/{customer_id}/messagesget_customer_messages(customer_id, id_type=None, start=None, limit=None, start_ts=None, end_ts=None)GET /v1/customers/{customer_id}/relationshipsget_customer_relationships(customer_id, id_type=None, start=None, limit=None)GET /v1/customers/{customer_id}/segmentsget_customer_segments(customer_id, id_type=None)GET /v1/customers/{customer_id}/subscription_preferencesget_customer_subscription_preferences(customer_id, id_type=None, language=None)GET /v1/customers/{customer_id}/optoutsget_customer_optouts(customer_id)README: a new "Look up customers" section with an example.
Design choices
getCustomersByEmail,searchCustomers,getCustomersAttributes,getAttributes,getCustomerActivities, ...) in snake_case; node'sgetAttributesbecomesget_customer_attributesso it reads as a customer call next to the otherAPIClientmethods.None, through the existing_query_string, as in the transactional and broadcast reads. Each one is read by the API.id_typeis a plain string ("id","email","phone"or"cio_id") passed through, and is sent only when given, so the API's default applies otherwise (it reads the value as anid, or acio_id). The SDK doesn't validate it: which kinds work depends on the workspace's identifier settings, and the API answers 400 for the rest.get_customers_attributesturns the ids into strings with the existing_stringify_list, because the API reads them as strings and rejects numbers. A non-list, an empty list or a non-string, non-int id raisesCustomerIOExceptionbefore any request.search_customerstakes the filter as a dict and sends it as{"filter": ...}; a missing or empty filter raises, since the API answers 400 without one.get_customers_by_emailURL-encodes the email, so a+is sent as%2B; an empty or non-string email raises.Noneor empty id raises, through a private_customer_url, the way_broadcast_urlserves the broadcast calls.APIClientcalls; the SDK has no response classes.Clientwrapper is unchanged; the calls are oncio.api_client.Not changed
id_typeonGET /v1/customers/{customer_id}/optouts: the reference lists it, but the API ignores it and reads the path value as anidorcio_id, soget_customer_optoutshas noid_type.Accept-Languageheader on subscription preferences: the API reads it, but sending a header would need a change to the sharedsend_request;languagecovers the same need and takes precedence.PUT /v1/customers/{customer_id}/optoutsis a write and comes in a later customer-writes PR.identify,delete,merge_customersand the rest) already exist and are unchanged.Related Issues
https://linear.app/customerio/issue/MBL-2972
Testing
python -m unittest discover -v(129 tests on this branch, feat(api): add transactional message endpoints and send request fields #149's, feat(api): add broadcast read endpoints #150's and feat(api): add broadcast action updates #151's included, OK),python -m ruff check .,python -m ruff format --check .,python -m doctest ./customerio/__init__.py, on Python 3.11POSTcalls only read. Top-level keys matched the reference for each (results;identifiers,ids,next;customers;customer;activities,next;messages;cio_relationships,next;segments;customer;optouts), andid_type,limit,typeandlanguagewere sent on the calls that take them. Item keys were checked for every list but opt-outs: no person in the workspace sample had an opt-out, soget_customer_optoutsreturned an empty list and its item shape is covered only by the reference and the fake-server test.Deployment
feat: minor release via release-please. Additive, safe to revert.Submitted by Moby, autonomous triage agent for Squad Mobile
Talon-Agent: Moby (4d2873ab)