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

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

The Zendesk plugin syncs data locally. Use `corsair.zendesk.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>

## Comments

Path: `zendesk.db.comments.search`

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

### Searchable filters

| Field       | Type      | Operators                                  |
| ----------- | --------- | ------------------------------------------ |
| `entity_id` | `string`  | equals, contains, startsWith, endsWith, in |
| `id`        | `number`  | equals, gt, gte, lt, lte, in               |
| `ticketId`  | `number`  | equals, gt, gte, lt, lte, in               |
| `body`      | `string`  | equals, contains, startsWith, endsWith, in |
| `authorId`  | `number`  | equals, gt, gte, lt, lte, in               |
| `public`    | `boolean` | equals                                     |
| `createdAt` | `date`    | equals, before, after, between             |

*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).*

***

## Tickets

Path: `zendesk.db.tickets.search`

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

### Searchable filters

| Field            | Type     | Operators                                  |
| ---------------- | -------- | ------------------------------------------ |
| `entity_id`      | `string` | equals, contains, startsWith, endsWith, in |
| `id`             | `number` | equals, gt, gte, lt, lte, in               |
| `subject`        | `string` | equals, contains, startsWith, endsWith, in |
| `description`    | `string` | equals, contains, startsWith, endsWith, in |
| `status`         | `string` | equals, contains, startsWith, endsWith, in |
| `priority`       | `string` | equals, contains, startsWith, endsWith, in |
| `requesterId`    | `number` | equals, gt, gte, lt, lte, in               |
| `assigneeId`     | `number` | equals, gt, gte, lt, lte, in               |
| `organizationId` | `number` | equals, gt, gte, lt, lte, in               |
| `groupId`        | `number` | equals, gt, gte, lt, lte, in               |
| `createdAt`      | `date`   | equals, before, after, between             |
| `updatedAt`      | `date`   | equals, before, after, between             |

*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).*

***

## Users

Path: `zendesk.db.users.search`

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

### Searchable filters

| Field       | Type      | Operators                                  |
| ----------- | --------- | ------------------------------------------ |
| `entity_id` | `string`  | equals, contains, startsWith, endsWith, in |
| `id`        | `number`  | equals, gt, gte, lt, lte, in               |
| `name`      | `string`  | equals, contains, startsWith, endsWith, in |
| `email`     | `string`  | equals, contains, startsWith, endsWith, in |
| `role`      | `string`  | equals, contains, startsWith, endsWith, in |
| `active`    | `boolean` | equals                                     |
| `timeZone`  | `string`  | equals, contains, startsWith, endsWith, in |
| `locale`    | `string`  | equals, contains, startsWith, endsWith, in |
| `createdAt` | `date`    | equals, before, after, between             |
| `updatedAt` | `date`    | equals, before, after, between             |

*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).*

***
