> ## Documentation Index
> Fetch the complete documentation index at: https://docs.open.cx/llms.txt
> Use this file to discover all available pages before exploring further.

> Find companies by the teammate who owns them, by attribute conditions such as a plan or a subscription date, or by name, sorted and paged.

# Search

Every filter you send must hold, so each one narrows the result. Leave `filters` out to page through every company.

```json theme={"dark"}
{
  "filters": {
    "owner_ids": [12],
    "custom_data": [
      { "key": "plan", "op": "eq", "value": "enterprise" },
      { "key": "subscriptionStart", "op": "after", "value": "2025-03-01" }
    ]
  },
  "search": "acme",
  "ordering": { "field": "contacts_count", "direction": "desc" },
  "page": 1,
  "limit": 50
}
```

## Owner

`owner_ids` matches companies owned by any of the listed teammates. `unowned: true` matches companies nobody owns. Send both to get "these teammates' companies, plus the unowned ones".

## Attribute conditions

| `op`                    | Matches when the attribute…            | `value`      |
| ----------------------- | -------------------------------------- | ------------ |
| `exists` / `not_exists` | is set / is not set                    | —            |
| `eq` / `neq`            | equals / does not equal the value      | text         |
| `contains`              | contains the value, ignoring case      | text         |
| `before` / `after`      | is a date earlier / later than the day | `YYYY-MM-DD` |

`eq` also matches numbers and booleans, so `"value": "40"` finds a `seats` attribute stored as `40`.

`before` and `after` read the attribute as a date when it holds a whole ISO 8601 date or timestamp (`"2025-03-14"`, `"2025-03-14T09:30:00Z"`, `"2025-03-14T09:30:00+03:00"`) or a Unix timestamp. Dates are compared by UTC day: a timestamp with an offset counts on its UTC day, and one without an offset is read as UTC. The day you send matches neither side, so `after 2025-03-01` starts on March 2.

A number above 100,000,000,000 is read as milliseconds, anything smaller as seconds. An attribute in any other format, such as `"14/03/2025"` or `"2025-03-14 approx"`, never matches a date condition.

## Scopes

Needs `companies:read`.
