Skip to content

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

where
{
"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": [...] }. rules holds rules and groups.
  • A rule is { "field", "operator", "value" }. value is left out for null and notNull.
  • field is a key from the dataset’s field list. Each dataset page lists them, and POST /data/fields/search with {"dataset": "workspace_accounts"} (or workspace_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

OperatorReads asValueFields
inisa list, 1 to 100 valuestext, choice
notInis nota list, 1 to 100 valuestext, choice
nullis emptynoneall but yes / no
notNullis not emptynoneall but yes / no
containscontainstexttext
doesNotContaindoesn’t containtexttext
=isone number, or true / falsenumber, yes / no
!=is notone numbernumber
>greater thanone numbernumber, score
<less thanone numbernumber, score
betweenbetween[low, high], both inclusivenumber, score, date (["YYYY-MM-DD", "YYYY-MM-DD"])
withinLastless than N ago{ "amount": 3, "unit": "days" or "months" }date
notWithinLastmore 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.

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:

400 response
{
"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.