Query People
query_peopleColumns: id, display_name, title, headline, company, location,
summary, linkedin_url, linkedin_provider_id, email, mail_host, connections_count, follower_count,
is_open_profile, is_premium, work_experience (JSONB), education (JSONB), linkedin_looked_up_at,
company_profile_id, owner_email, data (JSONB), created_at, updated_at. company_profile_id is
the person's canonical employer FK (NULL when unresolved). Sliq's CRM is deals and tasks: to
see whether someone has a deal or a task, use query_deals (status='all') / query_crm_tasks
with person_id.
mail_host is the email provider hosting this person's address (Google Workspace,
Microsoft 365, …), read from their domain's MX record: google, microsoft, gateway,
other, unknown (no mail record, or the domain's DNS is broken), or '' with no email or
no successful lookup yet.
gateway means a security gateway (Mimecast,
Proofpoint) receives the mail first, which hides the provider behind it.
connections_count / follower_count are NULL when never fetched (not 0); is_open_profile /
is_premium are NULL likewise. JSONB queries: data->>'some_key' ILIKE '%...%'.
work_experience and education are the person's full LinkedIn employment and education
history — the same arrays enrich_linkedin_profiles returns, already stored on the person from
the last profile lookup, so reading them here costs nothing (answer "where did they go to
school", "are they an LSU alum", "how long in seat" from these instead of a fresh enrich).
Each is a list, in LinkedIn display order (NOT sorted by date). linkedin_looked_up_at is when
the person's full LinkedIn profile was first looked up: NULL means it never was, and a time
with empty lists means LinkedIn had no history to give. These arrays are large for senior
people — a broad limit=200 read that returns them can exceed the 50KB direct-return cap and
truncate; for a wide pull, either narrow the where_clause or call this from run_code
(nothing truncates there) and print only the fields you need.
To list the outreach prospects tracking a person, take an id from here and call
query_prospects with where_clause="person_id = <id>".
Each row also carries segments: the person's segment tags across every segment group they're
classified into — [{group_id, group_name, tag}], tag 'No match' where the classifier couldn't
place them (empty when no group has classified them). Segments are the LLM-defined
people dimensions from the Explore Segments surface (e.g. Seniority -> VP); manage them with the
segment tools (list_segment_groups etc.).
Pass group_by for per-bucket counts over ALL your people instead of a row list — a whole-set
aggregate, never capped at the 200-row limit, so it answers "how many people per "
without paging. outreach_stage buckets each person by their most-advanced lead-funnel stage
across every campaign; segment buckets each person by their tag in one segment group (pass
that group's id as segment_group_id). Both ignore where_clause.
In row mode (group_by omitted) — a dict with count, truncated, and items array (each row
{id, display_name, title, headline, company, location, summary, linkedin_url,
linkedin_provider_id, email, mail_host, connections_count, follower_count, is_open_profile,
is_premium, work_experience, education, linkedin_looked_up_at, company_profile_id,
owner_email, segments: [{group_id, group_name, tag}], data, created_at, updated_at}).
In aggregate mode (group_by set) — a dict {group_by, groups} where groups is a list of
{key, count} ordered by count descending; for "segment" the keys are tag names, 'No match'
for people the classifier couldn't place, and '' for people the group hasn't classified.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Max results (default 50, capped at 200). | |
| offset | No | Rows to skip for paging (default 0). When the result is truncated, re-call with offset += limit for the next page. | |
| group_by | No | Aggregate mode, returned instead of the row list — whole-set per-bucket counts over all your people (not capped by `limit`). "title" / "company" / "location" bucket by that column's value; "outreach_stage" by the person's collapsed lead-funnel bucket; "segment" by the person's tag in the `segment_group_id` group. Omit for the row list. | |
| order_by | No | SQL ORDER BY (default: created_at DESC). | created_at DESC |
| on_behalf_of | No | An agency client's email, from list_agency_clients, to run this call in that client's account: their agents, settings, connected accounts, and credits. Omit it to act on your own account. | |
| where_clause | No | SQL WHERE condition (default: all your people). Examples: "display_name ILIKE '%chen%'", "title ILIKE '%VP%'", "company_profile_id = 42", "linkedin_url = 'some-slug'". | 1=1 |
| segment_group_id | No | Required with group_by="segment" — the segment group (from list_segment_groups) to bucket by. Ignored otherwise. |