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

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

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

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

## Calls

Path: `retellai.db.calls.search`

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

### Searchable filters

| Field | Type | Operators |
| - | - | - |
| `entity_id` | `string` | equals, contains, startsWith, endsWith, in |
| `call_id` | `string` | equals, contains, startsWith, endsWith, in |
| `call_type` | `string` | equals, contains, startsWith, endsWith, in |
| `agent_id` | `string` | equals, contains, startsWith, endsWith, in |
| `call_status` | `string` | equals, contains, startsWith, endsWith, in |
| `start_timestamp` | `number` | equals, gt, gte, lt, lte, in |
| `end_timestamp` | `number` | equals, gt, gte, lt, lte, in |
| `transcript` | `string` | equals, contains, startsWith, endsWith, in |
| `recording_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](https://docs.corsair.dev/concepts/database.md).*

***

## Chats

Path: `retellai.db.chats.search`

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

### Searchable filters

| Field | Type | Operators |
| - | - | - |
| `entity_id` | `string` | equals, contains, startsWith, endsWith, in |
| `chat_id` | `string` | equals, contains, startsWith, endsWith, in |
| `agent_id` | `string` | equals, contains, startsWith, endsWith, in |
| `chat_status` | `string` | equals, contains, startsWith, endsWith, in |
| `start_timestamp` | `number` | equals, gt, gte, lt, lte, in |
| `end_timestamp` | `number` | equals, gt, gte, lt, lte, in |
| `transcript` | `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](https://docs.corsair.dev/concepts/database.md).*

***


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