Lists
A list belongs to your organization. Make it once and use it in filters with in_list, for example to
leave out companies you already work with, or to look only at some records. Scope search.
| Call | What it does |
|---|---|
POST /v1/lists {name, kind, values[]} |
A new list; kind is ids, domains, postal or emails_hashed |
POST /v1/lists/upload (form: name, kind, file) |
A new list from a file: UTF-8 text with one value per line, or a CSV whose first column holds the values (a header line is skipped). More than 10,000 values at once; all or nothing |
GET /v1/lists, GET /v1/lists/{id} |
Your lists, with value_count and filterable |
GET /v1/lists/{id}/values?cursor=&limit= |
The values, in order |
POST /v1/lists/{id}/values {values[]} |
Add values (ones already there are ignored) |
POST /v1/lists/{id}/values/remove {values[]} |
Remove values |
DELETE /v1/lists/{id} |
Delete the list |
Values are tidied before they are stored: domains in lower case without https:// or www., ZIP
codes to five digits, hashed emails as lower-case SHA-256. A value that doesn’t fit the list’s kind
refuses the whole call (422, values.invalid). Up to 10,000 values per call and
api.lists.max_values (1,000,000) per list.
In filters
Section titled “In filters”ID lists work on ID fields (id, company.id, job.company_id), domain lists on domain fields
(company.domain, domains):
{ "not": { "field": "company.domain", "in_list": "lst_01JD3K8ZQ4V6W9XG2M5N7P0R1S" } }A list only narrows a search: IDs outside your product never come back. Another organization’s list,
or a deleted one, is 422 filter.list_not_found; a list of the wrong kind
for the field is filter.list_kind; a list above 65,536 values can’t be used in a filter yet
(filter.list_too_large).
"""Make a list of record IDs, then count only the records in it: POST /v1/lists and `in_list`.
Filters need the search engine: count answers 503 `unavailable` until search is live in production."""
import jsonimport osimport urllib.request
BASE = os.environ.get("ZEMO_API_BASE", "https://api.zemodata.com")HEADERS = {"Authorization": f"Bearer {os.environ['ZEMO_API_KEY']}", "Content-Type": "application/json"}
def post(path: str, body: dict) -> dict: request = urllib.request.Request( f"{BASE}{path}", data=json.dumps(body).encode(), headers=HEADERS, method="POST" ) with urllib.request.urlopen(request, timeout=30) as response: return json.load(response)["data"]
created = post("/v1/lists", {"name": "My records", "kind": "ids", "values": [os.environ["ZEMO_RECORD_ID"]]})counted = post( "/v1/count", { "entity": "person", "product": os.environ.get("ZEMO_PRODUCT", "demo-people"), "filter": {"field": "id", "in_list": created["id"]}, },)print(f"{created['id']}: {counted['count']} of {created['value_count']} in the list")// Make a list of record IDs, then count only the records in it: POST /v1/lists and `in_list`.// Filters need the search engine: count answers 503 `unavailable` until search is live in production.
const BASE = process.env.ZEMO_API_BASE ?? "https://api.zemodata.com";const headers = { Authorization: `Bearer ${process.env.ZEMO_API_KEY}`, "Content-Type": "application/json" };
async function post(path, body) { const response = await fetch(`${BASE}${path}`, { method: "POST", headers, body: JSON.stringify(body) }); if (!response.ok) throw new Error(`${response.status}: ${await response.text()}`); return (await response.json()).data;}
const created = await post("/v1/lists", { name: "My records", kind: "ids", values: [process.env.ZEMO_RECORD_ID] });const counted = await post("/v1/count", { entity: "person", product: process.env.ZEMO_PRODUCT ?? "demo-people", filter: { field: "id", in_list: created.id },});console.log(`${created.id}: ${counted.count} of ${created.value_count} in the list`);# Make a list of record IDs, then count only the records in it: POST /v1/lists and `in_list`.# Filters need the search engine: count answers 503 `unavailable` until search is live in production.set -euo pipefailBASE="${ZEMO_API_BASE:-https://api.zemodata.com}"PRODUCT="${ZEMO_PRODUCT:-demo-people}"
created="$(curl --silent --show-error --fail-with-body \ -H "Authorization: Bearer $ZEMO_API_KEY" -H "Content-Type: application/json" \ -d "{\"name\": \"My records\", \"kind\": \"ids\", \"values\": [\"$ZEMO_RECORD_ID\"]}" \ "$BASE/v1/lists")"list_id="$(printf '%s' "$created" | sed -n 's/.*"id": *"\(lst_[A-Z0-9]*\)".*/\1/p')"
curl --silent --show-error --fail-with-body \ -H "Authorization: Bearer $ZEMO_API_KEY" -H "Content-Type: application/json" \ -d "{\"entity\": \"person\", \"product\": \"$PRODUCT\", \"filter\": {\"field\": \"id\", \"in_list\": \"$list_id\"}}" \ "$BASE/v1/count"echoecho "$list_id: in the list"