> ## 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

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

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

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

## Contacts

Path: `clicksend.db.contacts.search`

```ts theme={null}
const rows = await corsair.clicksend.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 |
| `contact_id` | `string` | equals, contains, startsWith, endsWith, in |
| `list_id` | `string` | equals, contains, startsWith, endsWith, in |
| `first_name` | `string` | equals, contains, startsWith, endsWith, in |
| `last_name` | `string` | equals, contains, startsWith, endsWith, in |
| `phone_number` | `string` | equals, contains, startsWith, endsWith, in |
| `email` | `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: `clicksend.db.messages.search`

```ts theme={null}
const rows = await corsair.clicksend.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 |
| `message_id` | `string` | equals, contains, startsWith, endsWith, in |
| `to` | `string` | equals, contains, startsWith, endsWith, in |
| `from` | `string` | equals, contains, startsWith, endsWith, in |
| `body` | `string` | equals, contains, startsWith, endsWith, in |
| `status` | `string` | equals, contains, startsWith, endsWith, in |
| `direction` | `string` | equals, contains, startsWith, endsWith, in |
| `date_sent` | `string` | equals, contains, startsWith, endsWith, in |
| `price` | `string` | equals, contains, startsWith, endsWith, in |
| `currency` | `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).*

***


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.