Skip to content

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.

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).

python/lists.py
"""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 json
import os
import 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")