Skip to content

fix: migrate people search to /mixed_people/api_search (unbreak people search) - #19

Merged
jschfflr merged 2 commits into
mainfrom
fix/people-api-search
Jul 10, 2026
Merged

fix: migrate people search to /mixed_people/api_search (unbreak people search)#19
jschfflr merged 2 commits into
mainfrom
fix/people-api-search

Conversation

@jschfflr

Copy link
Copy Markdown
Contributor

The bug

search_people (and the 3-tier LinkedIn fallback in find_contact_by_linkedin_url) POST to /mixed_people/search, which Apollo now rejects for API callers:

422 — "This endpoint is deprecated for API callers. Please use the new mixed_people/api_search endpoint."

So people search — and the CLI people search — fail entirely.

Fix

Both call sites now use /mixed_people/api_search. Live-verified with q_keywords, person_titles, person_seniorities, and q_organization_domains_list (all return 200 + results).

⚠️ Behavior change to be aware of

The new endpoint returns teaser data only: first_name, last_name_obfuscated, title, organizationno full name, email, or linkedin_url (those now require a separate enrichment/reveal step that consumes credits). That's Apollo's deliberate API restriction, not something we can work around here. The search_people docstring documents this.

A follow-up CLI change will adapt the people formatter to the new shape (build a display name from first_name + last_name_obfuscated, read total_entries).

Testing

  • Updated test_search_people for the new endpoint + response shape.
  • Live-verified against the real API.
  • ruff ✅ · pyright ✅ · 186 tests ✅

No version bump (left for a release PR).

🤖 Generated with Claude Code

Apollo deprecated /mixed_people/search for API callers (422: 'use the new
mixed_people/api_search endpoint'), breaking search_people and the 3-tier
linkedin fallback. Both now hit /mixed_people/api_search.

Note: the new endpoint returns teaser data only (first_name,
last_name_obfuscated, title, organization; no full name/email/linkedin_url),
which is Apollo's intended API behavior. Live-verified with q_keywords,
person_titles, person_seniorities, and q_organization_domains_list.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

@peqy peqy Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Improvement: search_people() docstring references a non-existent/unused PEOPLE_SEARCH_FILTERS “validated set” — either implement validation + constant, or remove the claim.

Question: find_contact_by_linkedin_url() Step 3 now hits /mixed_people/api_search, but the same file documents this endpoint as teaser-only (no linkedin_url). If that’s accurate, Step 3 can’t match/create contacts as written; please confirm real response fields and align logic/tests/docs.

Found 2 issues (0 critical, 1 improvement, 0 nits, 1 question).

Comment thread src/qodev_apollo_api/client.py Outdated
if create_if_missing and person_name:
people_result = await self._post(
"/mixed_people/search",
"/mixed_people/api_search",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Question: search_people()’s docstring below says /mixed_people/api_search returns teaser data only (no linkedin_url). If that’s true, this Step 3 fallback will never match (person.get("linkedin_url")) and create_if_missing effectively can’t work.

Fix: either confirm api_search still returns linkedin_url (and update the docstring accordingly), or adjust this logic/docs to reflect that auto-creation via people search is no longer feasible without a credit-consuming reveal/enrichment step.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Good call — fixed in 3559fdd. Step 3 auto-creation has been removed and create_if_missing now logs a warning since api_search doesn’t return linkedin_url/enough data to create a contact.

Comment thread src/qodev_apollo_api/client.py Outdated
Args:
**filters: Search filters (q_keywords, person_titles, person_locations, etc.)
**filters: Search filters (q_keywords, person_titles, person_seniorities,
person_locations, q_organization_domains_list, etc.). See

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Improvement: The docstring claims “See PEOPLE_SEARCH_FILTERS for the validated set”, but search_people() doesn’t validate anything (it just forwards **filters), and there doesn’t appear to be a PEOPLE_SEARCH_FILTERS constant.

Fix: either implement an allowlist validation (like search_accounts() does) and define/export PEOPLE_SEARCH_FILTERS, or remove that sentence to avoid misleading callers.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Addressed: the docstring no longer claims filters are validated / references PEOPLE_SEARCH_FILTERS.

peqy: /mixed_people/api_search returns teaser data with no linkedin_url, so
find_contact_by_linkedin_url Step 3 (people-DB match + auto-create) can never
succeed. Removed it; the lookup is now 2-tier over existing contacts, and
create_if_missing is a documented no-op that warns. Also dropped the stale
PEOPLE_SEARCH_FILTERS reference from the search_people docstring.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

@peqy peqy Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Fix looks correct: all people-search calls now use /mixed_people/api_search, tests updated for the new response shape, and the dead auto-creation path in find_contact_by_linkedin_url is now explicitly deprecated with a warning.

One thing to double-check: uv.lock now records the editable qodev-apollo-api as 0.4.0 (was 0.3.2). If this isn’t intended as part of this fix, it may be worth regenerating/reverting the lockfile or updating the MR description (it currently says “No version bump”).

@jschfflr
jschfflr merged commit c856745 into main Jul 10, 2026
4 checks passed
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