Workspace API
Filtering with where
One condition format for workspace search, View records, saved Views and the table links. Rules of field, operator and value, grouped with and or or.
Workspace search (POST /workspace/{accounts,projects,contacts}/search), View records search, saved Views and the web tables all filter with one condition, where. The same JSON works in every one of them.
Shape
{ "combinator": "and", "rules": [ { "field": "type", "operator": "in", "value": ["developer"] }, { "field": "project.city", "operator": "in", "value": ["Boston", "Cambridge"] }, { "field": "project.use", "operator": "in", "value": ["multifamily"] }, { "combinator": "or", "rules": [ { "field": "contact.title", "operator": "contains", "value": "development" }, { "field": "tags", "operator": "in", "value": ["Known client"] } ] } ]}- A group is
{ "combinator": "and" | "or", "not"?: true, "rules": [...] }.rulesholds rules and groups. - A rule is
{ "field", "operator", "value" }.valueis left out fornullandnotNull. fieldis a key from the dataset’s field list. Each dataset page lists them, andPOST /data/fields/searchwith{"dataset": "workspace_accounts"}(orworkspace_projects,workspace_contacts) returns them as data, with their operators and values.- Text matching ignores case.
"is"with several values means any of them:"value": ["Boston", "Cambridge"]is Boston or Cambridge.
Operators
| Operator | Reads as | Value | Fields |
|---|---|---|---|
in | is | a list, 1 to 100 values | text, choice |
notIn | is not | a list, 1 to 100 values | text, choice |
null | is empty | none | all but yes / no |
notNull | is not empty | none | all but yes / no |
contains | contains | text | text |
doesNotContain | doesn’t contain | text | text |
= | is | one number, or true / false | number, yes / no |
!= | is not | one number | number |
> | greater than | one number | number, score |
< | less than | one number | number, score |
between | between | [low, high], both inclusive | number, score, date (["YYYY-MM-DD", "YYYY-MM-DD"]) |
withinLast | less than N ago | { "amount": 3, "unit": "days" or "months" } | date |
notWithinLast | more than N ago | { "amount": 3, "unit": "days" or "months" } | date |
notIn and doesNotContain also match records where the value is empty. A comparison (>, <, between) never matches an empty value. The field “In a saved View” (view) takes in and notIn with View ids.
Linked records
Fields with a dot are about linked records: project.city on accounts is “works on a project in this city”, firm.type on projects is “a firm on it of this type”, contact.title, signal.type and so on.
Rules in one group on the same prefix describe the same linked record. project.city is Boston and project.use is multifamily, in one group, means one Boston multifamily project. Put them in two separate groups to mean any Boston project and any multifamily project.
A group with "not": true turns into “has no linked record where”: { "combinator": "and", "not": true, "rules": [{ "field": "project.city", "operator": "in", "value": ["Boston"] }] } is a firm with no Boston project. A single notIn rule, project.city is not Boston, means a firm with some project outside Boston.
Scores
score is the record’s own score in your workspace (ICP Score on accounts, Atlas Score on projects, Prospect Score on contacts), and firm.score is the linked firm’s ICP Score. A score runs 0 to 100. The tier names are ranges: Tier 1 is between [75, 100], then 50 to 74, 25 to 49 and 0 to 24. An unscored record is empty.
Limits
Groups nest 3 deep, a condition holds at most 40 rules, a rule at most 100 values, a text value at most 200 characters, and the whole condition at most 12,000 characters of URL-encoded JSON.
Errors
A field the dataset does not have, an operator the field does not take, or a value of the wrong shape returns 400 with the code invalid_where, a message that names the field and its operators, and the path of the rule:
{ "error": { "code": "invalid_where", "message": "units takes between, =, !=, >, <, null, notNull; got \"contains\".", "path": "rules.0.operator" }}A saved View named in view that lists another kind of record answers view_dataset, one that leads back to itself answers view_cycle, and one stored in a form the app can no longer read answers view_invalid.