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

# Database

> Campayn local sync: searchable entities, `.search()` filters, and operators.

The Campayn plugin syncs data locally. Use `corsair.campayn.db.<entity>.search({ data, limit?, offset? })` with the filters listed per entity.

<Info>
  **New to Corsair?** See [database operations](/concepts/database), [data synchronization](/concepts/integrations), and [multi-tenancy](/concepts/multi-tenancy).
</Info>

## Contacts

Path: `campayn.db.contacts.search`

```ts theme={null}
const rows = await corsair.campayn.db.contacts.search({
    data: { /* filters below */ },
    limit: 100,
    offset: 0,
});
```

### Searchable filters

| Field        | Type     | Operators                                  |
| ------------ | -------- | ------------------------------------------ |
| `entity_id`  | `string` | equals, contains, startsWith, endsWith, in |
| `id`         | `string` | equals, contains, startsWith, endsWith, in |
| `email`      | `string` | equals, contains, startsWith, endsWith, in |
| `first_name` | `string` | equals, contains, startsWith, endsWith, in |
| `last_name`  | `string` | equals, contains, startsWith, endsWith, in |
| `title`      | `string` | equals, contains, startsWith, endsWith, in |
| `company`    | `string` | equals, contains, startsWith, endsWith, in |
| `address`    | `string` | equals, contains, startsWith, endsWith, in |
| `country_id` | `string` | equals, contains, startsWith, endsWith, in |
| `country`    | `string` | equals, contains, startsWith, endsWith, in |
| `city`       | `string` | equals, contains, startsWith, endsWith, in |
| `state`      | `string` | equals, contains, startsWith, endsWith, in |
| `zip`        | `string` | equals, contains, startsWith, endsWith, in |
| `birthday`   | `string` | equals, contains, startsWith, endsWith, in |
| `tags`       | `string` | equals, contains, startsWith, endsWith, in |
| `image_url`  | `string` | equals, contains, startsWith, endsWith, in |

*Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).*

***

## Lists

Path: `campayn.db.lists.search`

```ts theme={null}
const rows = await corsair.campayn.db.lists.search({
    data: { /* filters below */ },
    limit: 100,
    offset: 0,
});
```

### Searchable filters

| Field       | Type     | Operators                                  |
| ----------- | -------- | ------------------------------------------ |
| `entity_id` | `string` | equals, contains, startsWith, endsWith, in |
| `id`        | `string` | equals, contains, startsWith, endsWith, in |
| `list_name` | `string` | equals, contains, startsWith, endsWith, in |
| `tags`      | `string` | equals, contains, startsWith, endsWith, in |

*Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).*

***

## Messages

Path: `campayn.db.messages.search`

```ts theme={null}
const rows = await corsair.campayn.db.messages.search({
    data: { /* filters below */ },
    limit: 100,
    offset: 0,
});
```

### Searchable filters

| Field            | Type     | Operators                                  |
| ---------------- | -------- | ------------------------------------------ |
| `entity_id`      | `string` | equals, contains, startsWith, endsWith, in |
| `id`             | `string` | equals, contains, startsWith, endsWith, in |
| `name`           | `string` | equals, contains, startsWith, endsWith, in |
| `scheduled_date` | `string` | equals, contains, startsWith, endsWith, in |
| `campaign_title` | `string` | equals, contains, startsWith, endsWith, in |
| `status`         | `string` | equals, contains, startsWith, endsWith, in |
| `preview_url`    | `string` | equals, contains, startsWith, endsWith, in |
| `preview_thumb`  | `string` | equals, contains, startsWith, endsWith, in |

*Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).*

***

## Reports

Path: `campayn.db.reports.search`

```ts theme={null}
const rows = await corsair.campayn.db.reports.search({
    data: { /* filters below */ },
    limit: 100,
    offset: 0,
});
```

### Searchable filters

| Field            | Type     | Operators                                  |
| ---------------- | -------- | ------------------------------------------ |
| `entity_id`      | `string` | equals, contains, startsWith, endsWith, in |
| `id`             | `string` | equals, contains, startsWith, endsWith, in |
| `name`           | `string` | equals, contains, startsWith, endsWith, in |
| `scheduled_date` | `string` | equals, contains, startsWith, endsWith, in |
| `status`         | `string` | equals, contains, startsWith, endsWith, in |
| `preview_url`    | `string` | equals, contains, startsWith, endsWith, in |
| `report_url`     | `string` | equals, contains, startsWith, endsWith, in |

*Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).*

***

## Webforms

Path: `campayn.db.webforms.search`

```ts theme={null}
const rows = await corsair.campayn.db.webforms.search({
    data: { /* filters below */ },
    limit: 100,
    offset: 0,
});
```

### Searchable filters

| Field             | Type     | Operators                                  |
| ----------------- | -------- | ------------------------------------------ |
| `entity_id`       | `string` | equals, contains, startsWith, endsWith, in |
| `id`              | `string` | equals, contains, startsWith, endsWith, in |
| `contact_list_id` | `string` | equals, contains, startsWith, endsWith, in |
| `form_title`      | `string` | equals, contains, startsWith, endsWith, in |
| `form_type`       | `string` | equals, contains, startsWith, endsWith, in |
| `form_html`       | `string` | equals, contains, startsWith, endsWith, in |

*Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](/concepts/database).*

***
