Summary
Add a --label-ids (or equivalent) option to contacts search and accounts search so that users can filter results by Apollo label/list membership directly through the CLI.
Motivation
The underlying Apollo API endpoint POST /api/v1/contacts/search already accepts a label_ids parameter, but the CLI doesn't expose it. The current CLI surface for contacts search is:
--query / -q Search keyword
--stage-id Filter by stage ID
--linkedin-url Filter by LinkedIn URL
Without a label filter we end up dropping back to raw curl against the API every time we want to operate on a list — for example, "give me all contacts in my 'LinkedIn connections' list", or "everyone in the 'Dynafair Referenten' list at company X". The CLI is otherwise the right tool for these workflows; this gap forces a context switch to manual HTTP calls.
Proposed behavior
# Single label
qodev-apollo-cli contacts search --label-ids LABEL_ID --json
# Multiple (comma-separated, AND or OR semantics matching API)
qodev-apollo-cli contacts search --label-ids LABEL_ID_1,LABEL_ID_2 --json
# Combined with existing filters
qodev-apollo-cli contacts search --label-ids LABEL_ID -q "Müller" --json
Same option should also be available on accounts search (the API supports label filtering for accounts as well).
Bonus (optional)
Two related conveniences that would round out the workflow but are not strictly required for this issue:
- A
labels list command that returns label IDs + names + counts, so users don't have to look up the label ID manually.
- Accept either a label ID or a label name in
--label-ids, resolving names to IDs internally.
Acceptance criteria
contacts search --label-ids <id> returns only contacts in that label
accounts search --label-ids <id> returns only accounts in that label
- Multiple IDs via comma-separated input work as the underlying API expects
--help reflects the new option
Summary
Add a
--label-ids(or equivalent) option tocontacts searchandaccounts searchso that users can filter results by Apollo label/list membership directly through the CLI.Motivation
The underlying Apollo API endpoint
POST /api/v1/contacts/searchalready accepts alabel_idsparameter, but the CLI doesn't expose it. The current CLI surface forcontacts searchis:Without a label filter we end up dropping back to raw
curlagainst the API every time we want to operate on a list — for example, "give me all contacts in my 'LinkedIn connections' list", or "everyone in the 'Dynafair Referenten' list at company X". The CLI is otherwise the right tool for these workflows; this gap forces a context switch to manual HTTP calls.Proposed behavior
Same option should also be available on
accounts search(the API supports label filtering for accounts as well).Bonus (optional)
Two related conveniences that would round out the workflow but are not strictly required for this issue:
labels listcommand that returns label IDs + names + counts, so users don't have to look up the label ID manually.--label-ids, resolving names to IDs internally.Acceptance criteria
contacts search --label-ids <id>returns only contacts in that labelaccounts search --label-ids <id>returns only accounts in that label--helpreflects the new option