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

# Mixpanel API reference

> API reference for the Mixpanel plugin in Corsair: every `mixpanel.api.*` operation with its input and output types, taken from the plugin's Zod schemas.

> [!NOTE]
>
> **New to Corsair?** See [API access](https://docs.corsair.dev/concepts/api.md), [authentication](https://docs.corsair.dev/concepts/auth.md), and [error handling](https://docs.corsair.dev/concepts/error-handling).

## Annotations

### create

`annotations.create`

Create a chart annotation marking an event on a date

**Risk:** `write`

```ts theme={null}
await corsair.mixpanel.api.annotations.create({ date: '2026-04-01 09:00:00', description: 'Pricing page launched' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `date` | `string` | Yes | When, as "YYYY-MM-DD HH:mm:ss" in the project timezone. |
| `description` | `string` | Yes | — |
| `tags` | `number[]` | No | Annotation tag ids. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `status` | `string \| null` | No | — |
| `results` | `object \| null` | No | — |

> [accordion] results full type
>
> ```ts theme={null}
> {
>   id?: number | null,
>   date?: string | null,
>   description?: string | null,
>   user?: {
>     id?: number | null,
>     first_name?: string | null,
>     last_name?: string | null
>   } | null,
>   tags?: {
>     id?: number | null,
>     name?: string | null
>   }[] | null
> } | null
> ```

***

### createTag

`annotations.createTag`

Create an annotation tag

**Risk:** `write`

```ts theme={null}
await corsair.mixpanel.api.annotations.createTag({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `name` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `number \| null` | No | — |
| `name` | `string \| null` | No | — |
| `project_id` | `number \| null` | No | — |
| `has_annotations` | `boolean \| null` | No | — |

***

### delete

`annotations.delete`

Delete an annotation

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.mixpanel.api.annotations.delete({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `annotation_id` | `number` | Yes | The annotation id. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `status` | `string \| null` | No | — |
| `results` | `object \| null` | No | — |

> [accordion] results full type
>
> ```ts theme={null}
> {
>   id?: number | null
> } | null
> ```

***

### get

`annotations.get`

Get one annotation by id

**Risk:** `read`

```ts theme={null}
await corsair.mixpanel.api.annotations.get({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `annotation_id` | `number` | Yes | The annotation id. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `status` | `string \| null` | No | — |
| `results` | `object \| null` | No | — |

> [accordion] results full type
>
> ```ts theme={null}
> {
>   id?: number | null,
>   date?: string | null,
>   description?: string | null,
>   user?: {
>     id?: number | null,
>     first_name?: string | null,
>     last_name?: string | null
>   } | null,
>   tags?: {
>     id?: number | null,
>     name?: string | null
>   }[] | null
> } | null
> ```

***

### list

`annotations.list`

List the chart annotations in the project, optionally by date range

**Risk:** `read`

```ts theme={null}
await corsair.mixpanel.api.annotations.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `fromDate` | `string` | No | Only annotations on or after this date. |
| `toDate` | `string` | No | Only annotations on or before this date. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `status` | `string \| null` | No | — |
| `results` | `object[] \| null` | No | — |

> [accordion] results full type
>
> ```ts theme={null}
> {
>   id?: number | null,
>   date?: string | null,
>   description?: string | null,
>   user?: {
>     id?: number | null,
>     first_name?: string | null,
>     last_name?: string | null
>   } | null,
>   tags?: {
>     id?: number | null,
>     name?: string | null
>   }[] | null
> }[] | null
> ```

***

### listTags

`annotations.listTags`

List the annotation tags in the project

**Risk:** `read`

```ts theme={null}
await corsair.mixpanel.api.annotations.listTags({});
```

**Input:** *empty object*

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `tags` | `object[]` | Yes | — |

> [accordion] tags full type
>
> ```ts theme={null}
> {
>   id?: number | null,
>   name?: string | null,
>   project_id?: number | null,
>   has_annotations?: boolean | null
> }[]
> ```

***

### update

`annotations.update`

Change an annotation's description or tags

**Risk:** `write`

```ts theme={null}
await corsair.mixpanel.api.annotations.update({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `annotation_id` | `number` | Yes | The annotation id. |
| `description` | `string` | No | — |
| `tags` | `number[]` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `status` | `string \| null` | No | — |
| `results` | `object \| null` | No | — |

> [accordion] results full type
>
> ```ts theme={null}
> {
>   id?: number | null,
>   date?: string | null,
>   description?: string | null,
>   user?: {
>     id?: number | null,
>     first_name?: string | null,
>     last_name?: string | null
>   } | null,
>   tags?: {
>     id?: number | null,
>     name?: string | null
>   }[] | null
> } | null
> ```

***

## Audit Logs

### query

`auditLogs.query`

Query the organization's audit log (who changed what, when), filtered by user, type, service and date

**Risk:** `read`

```ts theme={null}
await corsair.mixpanel.api.auditLogs.query({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `organization_id` | `number` | Yes | The organization id (Organization Settings, Overview). |
| `page_size` | `number` | No | — |
| `cursor` | `string` | No | next\_cursor from the previous page. |
| `order` | `asc \| desc` | No | — |
| `user_ids` | `string[]` | No | — |
| `user_emails` | `string[]` | No | — |
| `exclude_user_ids` | `string[]` | No | — |
| `exclude_user_emails` | `string[]` | No | — |
| `types` | `string[]` | No | Audit event types. |
| `services` | `string[]` | No | — |
| `project_ids` | `string[]` | No | — |
| `created_after` | `string` | No | ISO 8601. |
| `created_before` | `string` | No | ISO 8601. |
| `user_email_search` | `string` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `results` | `object[]` | Yes | — |
| `pagination` | `object \| null` | No | — |

> [accordion] results full type
>
> ```ts theme={null}
> {
> }[]
> ```

> [accordion] pagination full type
>
> ```ts theme={null}
> {
>   previous_cursor?: string | null,
>   next_cursor?: string | null
> } | null
> ```

***

## Cohorts

### list

`cohorts.list`

List every saved cohort with its id, member count, visibility and description

**Risk:** `read`

```ts theme={null}
await corsair.mixpanel.api.cohorts.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `workspace_id` | `number` | No | The workspace (data view) to run in; omit for the project default. |

`POST /cohorts/list` on the query host; Mixpanel answers a bare array,
returned as `{ cohorts }`. 402 on the free plan.

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `cohorts` | `object[]` | Yes | — |

> [accordion] cohorts full type
>
> ```ts theme={null}
> {
>   count?: number | null,
>   is_visible?: number | null,
>   description?: string | null,
>   created?: string | null,
>   project_id?: number | null,
>   id?: number | null,
>   name?: string | null
> }[]
> ```

***

## Data Definitions

### create

`dataDefinitions.create`

Create a Lexicon data definition (event, property, custom event, metric, behavior or cohort)

**Risk:** `write`

```ts theme={null}
await corsair.mixpanel.api.dataDefinitions.create({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `workspace_id` | `number` | No | Use the workspace-scoped route for this workspace instead of the project. |
| `type` | `event \| custom_event \| event_property \| custom_property \| metric \| behavior \| cohort` | Yes | — |
| `name` | `string` | Yes | — |
| `description` | `string \| null` | No | — |
| `display_name` | `string \| null` | No | — |
| `tags` | `string[]` | No | — |
| `owners` | `object[]` | No | — |
| `event_name` | `string \| null` | No | For event properties. |
| `definition` | `object` | No | For custom events, custom properties, metrics, behaviors and cohorts. |

> [accordion] owners full type
>
> ```ts theme={null}
> {
>   type: string,
>   id: string
> }[]
> ```

> [accordion] definition full type
>
> ```ts theme={null}
> {
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `name` | `string \| null` | No | — |
| `type` | `string \| null` | No | — |
| `description` | `string \| null` | No | — |
| `display_name` | `string \| null` | No | — |
| `tags` | `string[] \| null` | No | — |
| `owners` | `object[] \| null` | No | — |
| `hidden` | `boolean \| null` | No | — |
| `blocked` | `boolean \| null` | No | — |
| `verified` | `boolean \| null` | No | — |
| `created_at` | `string \| null` | No | — |
| `updated_at` | `string \| null` | No | — |

> [accordion] owners full type
>
> ```ts theme={null}
> {
> }[] | null
> ```

***

### delete

`dataDefinitions.delete`

Delete a data definition

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.mixpanel.api.dataDefinitions.delete({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `workspace_id` | `number` | No | Use the workspace-scoped route for this workspace instead of the project. |
| `definition_id` | `string` | Yes | The data definition id. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `entity` | `object \| null` | No | — |
| `deleted_at` | `string \| null` | No | — |

> [accordion] entity full type
>
> ```ts theme={null}
> {
> } | null
> ```

***

### get

`dataDefinitions.get`

Get one Lexicon data definition

**Risk:** `read`

```ts theme={null}
await corsair.mixpanel.api.dataDefinitions.get({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `workspace_id` | `number` | No | Use the workspace-scoped route for this workspace instead of the project. |
| `definition_id` | `string` | Yes | The data definition id. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `name` | `string \| null` | No | — |
| `type` | `string \| null` | No | — |
| `description` | `string \| null` | No | — |
| `display_name` | `string \| null` | No | — |
| `tags` | `string[] \| null` | No | — |
| `owners` | `object[] \| null` | No | — |
| `hidden` | `boolean \| null` | No | — |
| `blocked` | `boolean \| null` | No | — |
| `verified` | `boolean \| null` | No | — |
| `created_at` | `string \| null` | No | — |
| `updated_at` | `string \| null` | No | — |

> [accordion] owners full type
>
> ```ts theme={null}
> {
> }[] | null
> ```

***

### list

`dataDefinitions.list`

List Lexicon data definitions (events, properties, metrics, cohorts) with filters, paged by cursor

**Risk:** `read`

```ts theme={null}
await corsair.mixpanel.api.dataDefinitions.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `workspace_id` | `number` | No | Use the workspace-scoped route for this workspace instead of the project. |
| `page_size` | `number` | No | — |
| `cursor` | `string` | No | next\_cursor from the previous page. |
| `order` | `asc \| desc` | No | — |
| `name` | `string` | No | — |
| `type` | `(event \| custom_event \| event_property \| custom_property \| metric \| behavior \| cohort)[]` | No | — |
| `event_name` | `string` | No | — |
| `hidden` | `boolean` | No | — |
| `blocked` | `boolean` | No | — |
| `verified` | `boolean` | No | — |
| `has_description` | `boolean` | No | — |
| `has_owner` | `boolean` | No | — |
| `tag` | `string[]` | No | — |

Platform API (`platform-<region>.mixpanel.com/v1`). Pass `workspace_id`
for the workspace-scoped routes; otherwise the project's. Pages by
`cursor` (`pagination.next_cursor`).

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `results` | `object[]` | Yes | — |
| `pagination` | `object \| null` | No | — |

> [accordion] results full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null,
>   type?: string | null,
>   description?: string | null,
>   display_name?: string | null,
>   tags?: string[] | null,
>   owners?: {
>   }[] | null,
>   hidden?: boolean | null,
>   blocked?: boolean | null,
>   verified?: boolean | null,
>   created_at?: string | null,
>   updated_at?: string | null
> }[]
> ```

> [accordion] pagination full type
>
> ```ts theme={null}
> {
>   previous_cursor?: string | null,
>   next_cursor?: string | null
> } | null
> ```

***

### merge

`dataDefinitions.merge`

Merge event or property definitions into one canonical definition

**Risk:** `write`

```ts theme={null}
await corsair.mixpanel.api.dataDefinitions.merge({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `workspace_id` | `number` | No | Use the workspace-scoped route for this workspace instead of the project. |
| `type` | `event \| event_property` | Yes | — |
| `canonical` | `string` | Yes | The definition the others merge into. |
| `sources` | `string[]` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `canonical` | `object \| null` | No | — |
| `sources` | `object[] \| null` | No | — |

> [accordion] canonical full type
>
> ```ts theme={null}
> {
> } | null
> ```

> [accordion] sources full type
>
> ```ts theme={null}
> {
> }[] | null
> ```

***

### unmerge

`dataDefinitions.unmerge`

Undo a merge of data definitions

**Risk:** `write`

```ts theme={null}
await corsair.mixpanel.api.dataDefinitions.unmerge({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `workspace_id` | `number` | No | Use the workspace-scoped route for this workspace instead of the project. |
| `type` | `event \| event_property` | Yes | — |
| `canonical` | `string` | Yes | — |
| `sources` | `string[]` | No | Omit to unmerge every source. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `canonical` | `object \| null` | No | — |
| `sources` | `object[] \| null` | No | — |

> [accordion] canonical full type
>
> ```ts theme={null}
> {
> } | null
> ```

> [accordion] sources full type
>
> ```ts theme={null}
> {
> }[] | null
> ```

***

### update

`dataDefinitions.update`

Update a data definition's description, display name, tags, owners or hidden/blocked/verified flags; blocked: true drops its data at ingestion

**Risk:** `destructive`

```ts theme={null}
await corsair.mixpanel.api.dataDefinitions.update({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `workspace_id` | `number` | No | Use the workspace-scoped route for this workspace instead of the project. |
| `definition_id` | `string` | Yes | The data definition id. |
| `name` | `string` | No | — |
| `description` | `string \| null` | No | — |
| `display_name` | `string \| null` | No | — |
| `tags` | `object` | No | — |
| `owners` | `object` | No | — |
| `hidden` | `boolean` | No | — |
| `blocked` | `boolean` | No | True drops the data at ingestion. |
| `verified` | `boolean` | No | — |

> [accordion] tags full type
>
> ```ts theme={null}
> {
>   operation: add | set | remove,
>   values: string[]
> }
> ```

> [accordion] owners full type
>
> ```ts theme={null}
> {
>   operation: add | set | remove,
>   values: {
>     type: string,
>     id: string
>   }[]
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `name` | `string \| null` | No | — |
| `type` | `string \| null` | No | — |
| `description` | `string \| null` | No | — |
| `display_name` | `string \| null` | No | — |
| `tags` | `string[] \| null` | No | — |
| `owners` | `object[] \| null` | No | — |
| `hidden` | `boolean \| null` | No | — |
| `blocked` | `boolean \| null` | No | — |
| `verified` | `boolean \| null` | No | — |
| `created_at` | `string \| null` | No | — |
| `updated_at` | `string \| null` | No | — |

> [accordion] owners full type
>
> ```ts theme={null}
> {
> }[] | null
> ```

***

## Data Definition Tags

### create

`dataDefinitionTags.create`

Create a data definition tag

**Risk:** `write`

```ts theme={null}
await corsair.mixpanel.api.dataDefinitionTags.create({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `workspace_id` | `number` | No | Use the workspace-scoped route for this workspace instead of the project. |
| `name` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `name` | `string \| null` | No | — |
| `entity_count` | `number \| null` | No | — |

***

### delete

`dataDefinitionTags.delete`

Delete a data definition tag (it is removed from every definition)

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.mixpanel.api.dataDefinitionTags.delete({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `workspace_id` | `number` | No | Use the workspace-scoped route for this workspace instead of the project. |
| `tag_id` | `string` | Yes | The tag id. |

**Output:** *empty object*

***

### get

`dataDefinitionTags.get`

Get one data definition tag

**Risk:** `read`

```ts theme={null}
await corsair.mixpanel.api.dataDefinitionTags.get({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `workspace_id` | `number` | No | Use the workspace-scoped route for this workspace instead of the project. |
| `tag_id` | `string` | Yes | The tag id. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `name` | `string \| null` | No | — |
| `entity_count` | `number \| null` | No | — |

***

### list

`dataDefinitionTags.list`

List data definition tags with their usage counts

**Risk:** `read`

```ts theme={null}
await corsair.mixpanel.api.dataDefinitionTags.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `workspace_id` | `number` | No | Use the workspace-scoped route for this workspace instead of the project. |
| `page_size` | `number` | No | — |
| `cursor` | `string` | No | next\_cursor from the previous page. |
| `order` | `asc \| desc` | No | — |
| `sort` | `name \| entity_count` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `results` | `object[]` | Yes | — |
| `pagination` | `object \| null` | No | — |

> [accordion] results full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null,
>   entity_count?: number | null
> }[]
> ```

> [accordion] pagination full type
>
> ```ts theme={null}
> {
>   previous_cursor?: string | null,
>   next_cursor?: string | null
> } | null
> ```

***

### rename

`dataDefinitionTags.rename`

Rename a data definition tag

**Risk:** `write`

```ts theme={null}
await corsair.mixpanel.api.dataDefinitionTags.rename({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `workspace_id` | `number` | No | Use the workspace-scoped route for this workspace instead of the project. |
| `tag_id` | `string` | Yes | The tag id. |
| `name` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `name` | `string \| null` | No | — |
| `entity_count` | `number \| null` | No | — |

***

## Events

### counts

`events.counts`

Aggregate counts of one or more events over time

**Risk:** `read`

```ts theme={null}
await corsair.mixpanel.api.events.counts({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `events` | `string[]` | Yes | Event names. |
| `type` | `general \| unique \| average` | Yes | general counts every event, unique counts users, average is per user. |
| `unit` | `minute \| hour \| day \| week \| month` | Yes | — |
| `interval` | `number` | No | — |
| `from_date` | `string` | Yes | — |
| `to_date` | `string` | Yes | — |
| `workspace_id` | `number` | No | The workspace (data view) to run in; omit for the project default. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object \| null` | No | — |
| `legend_size` | `number \| null` | No | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   series?: string[] | null,
>   values?: Record<string, any> | null
> } | null
> ```

***

### import

`events.import`

Import up to 2000 server-side events (service account auth, any age), validated per event unless strict is 0

**Risk:** `write`

```ts theme={null}
await corsair.mixpanel.api.events.import({ events: [{ event: 'Signed up', properties: { time: 1618716477000, distinct_id: '91304156-cafc-4673-a237-623d1129c801', $insert_id: '29fc2962-6d9c-455d-95ad-95b84f09b9e4' } }] });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `strict` | `0 \| 1` | No | Defaults to '1': Mixpanel validates the batch and rejects it with per-event errors instead of ingesting silently. |
| `events` | `object[]` | Yes | Up to 2000 events and 10 MB uncompressed per request. Mixpanel deduplicates on (event, time, distinct\_id, \$insert\_id). |

`POST /import` on the ingestion host with the service account and
`project_id`. Every event needs `time`, `distinct_id` and `$insert_id`;
Mixpanel deduplicates on those plus the event name, so a retried batch
cannot double-count. With the default `strict: '1'` a 400 lists the
rejected events in `failed_records`; the error quotes the first message.

> [accordion] events full type
>
> ```ts theme={null}
> {
>   event: string,
>   properties: {
>     time: number | string,
>     distinct_id: string,
>     $insert_id: string
>   }
> }[]
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `code` | `number \| null` | No | — |
| `num_records_imported` | `number \| null` | No | — |
| `status` | `string \| number \| null` | No | — |

***

### names

`events.names`

The most common event names over the last 31 days

**Risk:** `read`

```ts theme={null}
await corsair.mixpanel.api.events.names({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `type` | `general \| unique \| average` | Yes | general counts every event, unique counts users, average is per user. |
| `limit` | `number` | No | — |
| `workspace_id` | `number` | No | The workspace (data view) to run in; omit for the project default. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `names` | `string[]` | Yes | — |

***

### propertyCounts

`events.propertyCounts`

Aggregate counts of an event broken down by the values of one property

**Risk:** `read`

```ts theme={null}
await corsair.mixpanel.api.events.propertyCounts({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `event` | `string` | Yes | — |
| `name` | `string` | Yes | The property name. |
| `values` | `string[]` | No | Only these property values. |
| `type` | `general \| unique \| average` | Yes | general counts every event, unique counts users, average is per user. |
| `unit` | `minute \| hour \| day \| week \| month` | Yes | — |
| `interval` | `number` | No | — |
| `from_date` | `string` | Yes | — |
| `to_date` | `string` | Yes | — |
| `limit` | `number` | No | — |
| `workspace_id` | `number` | No | The workspace (data view) to run in; omit for the project default. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object \| null` | No | — |
| `legend_size` | `number \| null` | No | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   series?: string[] | null,
>   values?: Record<string, any> | null
> } | null
> ```

***

### top

`events.top`

Today's top events with counts and change against yesterday

**Risk:** `read`

```ts theme={null}
await corsair.mixpanel.api.events.top({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `type` | `general \| unique \| average` | Yes | general counts every event, unique counts users, average is per user. |
| `limit` | `number` | No | — |
| `workspace_id` | `number` | No | The workspace (data view) to run in; omit for the project default. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `events` | `object[] \| null` | No | — |
| `type` | `string \| null` | No | — |

> [accordion] events full type
>
> ```ts theme={null}
> {
>   amount?: number | null,
>   event?: string | null,
>   percent_change?: number | null
> }[] | null
> ```

***

### topProperties

`events.topProperties`

The top property names of an event with their counts

**Risk:** `read`

```ts theme={null}
await corsair.mixpanel.api.events.topProperties({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `event` | `string` | Yes | — |
| `limit` | `number` | No | — |
| `workspace_id` | `number` | No | The workspace (data view) to run in; omit for the project default. |

**Output:** `Record<string, any>`

***

### topPropertyValues

`events.topPropertyValues`

The top values of one event property

**Risk:** `read`

```ts theme={null}
await corsair.mixpanel.api.events.topPropertyValues({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `event` | `string` | Yes | — |
| `name` | `string` | Yes | The property name. |
| `limit` | `number` | No | — |
| `workspace_id` | `number` | No | The workspace (data view) to run in; omit for the project default. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `values` | `string[]` | Yes | — |

***

### track

`events.track`

Track up to 2000 recent events (last 5 days) with the project token, the client-side ingestion route

**Risk:** `write`

```ts theme={null}
await corsair.mixpanel.api.events.track({ events: [{ event: 'Viewed pricing', properties: { distinct_id: 'user-42' } }] });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `events` | `object[]` | Yes | — |
| `ip` | `boolean` | No | True to geolocate from the sender IP (the server running Corsair). |

`POST /track` with the project token added to each event. Takes events
from the last five days only; use events.import for older data.

> [accordion] events full type
>
> ```ts theme={null}
> {
>   event: string,
>   properties?: {
>     distinct_id?: string,
>     time?: number,
>     $insert_id?: string
>   }
> }[]
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `status` | `number \| string \| null` | No | — |
| `error` | `string \| null` | No | — |

***

## Experiments

### archive

`experiments.archive`

Archive an experiment

**Risk:** `write`

```ts theme={null}
await corsair.mixpanel.api.experiments.archive({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `workspace_id` | `number` | Yes | The workspace (data view) id, from the project URL (/project/\<id>/view/\<workspace>). |
| `experiment_id` | `string` | Yes | The experiment id. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `status` | `string \| null` | No | — |
| `results` | `object \| null` | No | — |

> [accordion] results full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null,
>   description?: string | null,
>   hypothesis?: string | null,
>   status?: string | null,
>   start_date?: string | null,
>   end_date?: string | null,
>   variants?: {
>   }[] | null,
>   metrics?: {
>   }[] | null,
>   tags?: string[] | null
> } | null
> ```

***

### create

`experiments.create`

Create a draft experiment

**Risk:** `write`

```ts theme={null}
await corsair.mixpanel.api.experiments.create({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `workspace_id` | `number` | Yes | The workspace (data view) id, from the project URL (/project/\<id>/view/\<workspace>). |
| `name` | `string` | Yes | — |
| `description` | `string` | No | — |
| `hypothesis` | `string` | No | — |
| `settings` | `Record<string, any>` | No | — |
| `variants` | `object[]` | No | — |
| `metrics` | `object[]` | No | — |
| `global_access_type` | `string` | No | — |

> [accordion] variants full type
>
> ```ts theme={null}
> {
> }[]
> ```

> [accordion] metrics full type
>
> ```ts theme={null}
> {
> }[]
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `status` | `string \| null` | No | — |
| `results` | `object \| null` | No | — |

> [accordion] results full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null,
>   description?: string | null,
>   hypothesis?: string | null,
>   status?: string | null,
>   start_date?: string | null,
>   end_date?: string | null,
>   variants?: {
>   }[] | null,
>   metrics?: {
>   }[] | null,
>   tags?: string[] | null
> } | null
> ```

***

### decide

`experiments.decide`

Record the decision on a concluded experiment (success and winning variant)

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.mixpanel.api.experiments.decide({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `workspace_id` | `number` | Yes | The workspace (data view) id, from the project URL (/project/\<id>/view/\<workspace>). |
| `experiment_id` | `string` | Yes | The experiment id. |
| `success` | `boolean` | Yes | Whether the experiment succeeded. |
| `variant` | `string` | No | The winning variant key. |
| `message` | `string` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `status` | `string \| null` | No | — |
| `results` | `object \| null` | No | — |

> [accordion] results full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null,
>   description?: string | null,
>   hypothesis?: string | null,
>   status?: string | null,
>   start_date?: string | null,
>   end_date?: string | null,
>   variants?: {
>   }[] | null,
>   metrics?: {
>   }[] | null,
>   tags?: string[] | null
> } | null
> ```

***

### delete

`experiments.delete`

Delete an experiment

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.mixpanel.api.experiments.delete({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `workspace_id` | `number` | Yes | The workspace (data view) id, from the project URL (/project/\<id>/view/\<workspace>). |
| `experiment_id` | `string` | Yes | The experiment id. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `status` | `string \| null` | No | — |
| `results` | `object \| null` | No | — |

> [accordion] results full type
>
> ```ts theme={null}
> {
> } | null
> ```

***

### forceConclude

`experiments.forceConclude`

Stop a running experiment now, ending exposure to its variants

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.mixpanel.api.experiments.forceConclude({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `workspace_id` | `number` | Yes | The workspace (data view) id, from the project URL (/project/\<id>/view/\<workspace>). |
| `experiment_id` | `string` | Yes | The experiment id. |
| `end_date` | `string` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `status` | `string \| null` | No | — |
| `results` | `object \| null` | No | — |

> [accordion] results full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null,
>   description?: string | null,
>   hypothesis?: string | null,
>   status?: string | null,
>   start_date?: string | null,
>   end_date?: string | null,
>   variants?: {
>   }[] | null,
>   metrics?: {
>   }[] | null,
>   tags?: string[] | null
> } | null
> ```

***

### get

`experiments.get`

Get one experiment

**Risk:** `read`

```ts theme={null}
await corsair.mixpanel.api.experiments.get({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `workspace_id` | `number` | Yes | The workspace (data view) id, from the project URL (/project/\<id>/view/\<workspace>). |
| `experiment_id` | `string` | Yes | The experiment id. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `status` | `string \| null` | No | — |
| `results` | `object \| null` | No | — |

> [accordion] results full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null,
>   description?: string | null,
>   hypothesis?: string | null,
>   status?: string | null,
>   start_date?: string | null,
>   end_date?: string | null,
>   variants?: {
>   }[] | null,
>   metrics?: {
>   }[] | null,
>   tags?: string[] | null
> } | null
> ```

***

### launch

`experiments.launch`

Launch an experiment: live users start getting its variants

**Risk:** `destructive`

```ts theme={null}
await corsair.mixpanel.api.experiments.launch({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `workspace_id` | `number` | Yes | The workspace (data view) id, from the project URL (/project/\<id>/view/\<workspace>). |
| `experiment_id` | `string` | Yes | The experiment id. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `status` | `string \| null` | No | — |
| `results` | `object \| null` | No | — |

> [accordion] results full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null,
>   description?: string | null,
>   hypothesis?: string | null,
>   status?: string | null,
>   start_date?: string | null,
>   end_date?: string | null,
>   variants?: {
>   }[] | null,
>   metrics?: {
>   }[] | null,
>   tags?: string[] | null
> } | null
> ```

***

### list

`experiments.list`

List the experiments of a workspace

**Risk:** `read`

```ts theme={null}
await corsair.mixpanel.api.experiments.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `workspace_id` | `number` | Yes | The workspace (data view) id, from the project URL (/project/\<id>/view/\<workspace>). |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `status` | `string \| null` | No | — |
| `results` | `object[] \| null` | No | — |

> [accordion] results full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null,
>   description?: string | null,
>   hypothesis?: string | null,
>   status?: string | null,
>   start_date?: string | null,
>   end_date?: string | null,
>   variants?: {
>   }[] | null,
>   metrics?: {
>   }[] | null,
>   tags?: string[] | null
> }[] | null
> ```

***

### unarchive

`experiments.unarchive`

Restore an archived experiment

**Risk:** `write`

```ts theme={null}
await corsair.mixpanel.api.experiments.unarchive({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `workspace_id` | `number` | Yes | The workspace (data view) id, from the project URL (/project/\<id>/view/\<workspace>). |
| `experiment_id` | `string` | Yes | The experiment id. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `status` | `string \| null` | No | — |
| `results` | `object \| null` | No | — |

> [accordion] results full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null,
>   description?: string | null,
>   hypothesis?: string | null,
>   status?: string | null,
>   start_date?: string | null,
>   end_date?: string | null,
>   variants?: {
>   }[] | null,
>   metrics?: {
>   }[] | null,
>   tags?: string[] | null
> } | null
> ```

***

### update

`experiments.update`

Update an experiment's fields

**Risk:** `write`

```ts theme={null}
await corsair.mixpanel.api.experiments.update({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `workspace_id` | `number` | Yes | The workspace (data view) id, from the project URL (/project/\<id>/view/\<workspace>). |
| `experiment_id` | `string` | Yes | The experiment id. |
| `name` | `string` | No | — |
| `description` | `string` | No | — |
| `hypothesis` | `string` | No | — |
| `status` | `string` | No | — |
| `settings` | `Record<string, any>` | No | — |
| `variants` | `object[]` | No | — |
| `metrics` | `object[]` | No | — |
| `start_date` | `string` | No | — |
| `end_date` | `string` | No | — |
| `tags` | `string[]` | No | — |
| `global_access_type` | `string` | No | — |

> [accordion] variants full type
>
> ```ts theme={null}
> {
> }[]
> ```

> [accordion] metrics full type
>
> ```ts theme={null}
> {
> }[]
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `status` | `string \| null` | No | — |
| `results` | `object \| null` | No | — |

> [accordion] results full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null,
>   description?: string | null,
>   hypothesis?: string | null,
>   status?: string | null,
>   start_date?: string | null,
>   end_date?: string | null,
>   variants?: {
>   }[] | null,
>   metrics?: {
>   }[] | null,
>   tags?: string[] | null
> } | null
> ```

***

## Export

### events

`export.events`

Export raw events for a date range as parsed objects, with optional event-name filter, expression filter and limit

**Risk:** `read`

```ts theme={null}
await corsair.mixpanel.api.export.events({ from_date: '2026-04-01', to_date: '2026-04-02', event_names: ['Signed up'], limit: 1000 });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `from_date` | `string` | Yes | Inclusive, in the project timezone. |
| `to_date` | `string` | Yes | Inclusive. |
| `event_names` | `string[]` | No | Only these events; omit for all of them. |
| `where` | `string` | No | An expression to filter events by. |
| `limit` | `number` | No | At most 100000. |
| `time_in_ms` | `boolean` | No | True for millisecond timestamps; default is seconds. |

`GET /export` on the data host. The body is newline-delimited JSON; the
plugin parses each line and fails, naming only the line number, on one it
cannot parse. One request covers one date range, capped by `limit`.

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `events` | `object[]` | Yes | — |

> [accordion] events full type
>
> ```ts theme={null}
> {
>   event?: string | null,
>   properties?: Record<string, any> | null
> }[]
> ```

***

## Feature Flags

### create

`featureFlags.create`

Create a feature flag with variants and rollout rules

**Risk:** `write`

```ts theme={null}
await corsair.mixpanel.api.featureFlags.create({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `name` | `string` | Yes | — |
| `key` | `string` | Yes | The key code evaluates the flag by. |
| `description` | `string \| null` | No | — |
| `tags` | `string[]` | Yes | Tags; \[] for none. |
| `status` | `enabled \| disabled \| archived` | No | — |
| `context` | `string` | Yes | The identity the flag is evaluated on, usually distinct\_id. |
| `serving_method` | `client \| server \| remote_or_local \| remote_only` | Yes | — |
| `ruleset` | `object` | Yes | — |
| `experiment_id` | `string \| null` | No | — |
| `data_group_id` | `string \| number \| null` | No | — |
| `is_experiment_active` | `boolean \| null` | No | — |
| `hash_salt` | `string \| null` | No | — |
| `reset_hash_salt` | `boolean` | No | — |
| `workspace_id` | `number` | Yes | The workspace (data view) id, from the project URL (/project/\<id>/view/\<workspace>). |

> [accordion] ruleset full type
>
> ```ts theme={null}
> {
>   variants: {
>   }[],
>   rollout: {
>   }[],
>   test?: {
>   }
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `status` | `string \| null` | No | — |
| `results` | `object \| null` | No | — |

> [accordion] results full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null,
>   key?: string | null,
>   description?: string | null,
>   status?: string | null,
>   tags?: string[] | null,
>   context?: string | null,
>   serving_method?: string | null,
>   ruleset?: {
>   } | null
> } | null
> ```

***

### definitions

`featureFlags.definitions`

Get the definitions of every flag, for local evaluation in server SDKs

**Risk:** `read`

```ts theme={null}
await corsair.mixpanel.api.featureFlags.definitions({});
```

**Input:** *empty object*

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `flags` | `object[] \| null` | No | — |
| `code` | `number \| null` | No | — |
| `status` | `string \| null` | No | — |

> [accordion] flags full type
>
> ```ts theme={null}
> {
> }[] | null
> ```

***

### delete

`featureFlags.delete`

Delete a feature flag

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.mixpanel.api.featureFlags.delete({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `workspace_id` | `number` | Yes | The workspace (data view) id, from the project URL (/project/\<id>/view/\<workspace>). |
| `flag_id` | `string` | Yes | The feature flag id. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `status` | `string \| null` | No | — |
| `results` | `object \| null` | No | — |

> [accordion] results full type
>
> ```ts theme={null}
> {
> } | null
> ```

***

### evaluate

`featureFlags.evaluate`

Evaluate every enabled feature flag for one user and return the assigned variants

**Risk:** `read`

```ts theme={null}
await corsair.mixpanel.api.featureFlags.evaluate({ distinct_id: 'user-42' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `distinct_id` | `string` | Yes | The user to evaluate flags for. |
| `device_id` | `string` | No | — |
| `custom_properties` | `Record<string, any>` | No | Properties the rollout rules can target. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `flags` | `object \| null` | No | — |
| `code` | `number \| null` | No | — |
| `status` | `string \| null` | No | — |

> [accordion] flags full type
>
> ```ts theme={null}
> Record<string, {
> }> | null
> ```

***

### get

`featureFlags.get`

Get one feature flag with its ruleset

**Risk:** `read`

```ts theme={null}
await corsair.mixpanel.api.featureFlags.get({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `workspace_id` | `number` | Yes | The workspace (data view) id, from the project URL (/project/\<id>/view/\<workspace>). |
| `flag_id` | `string` | Yes | The feature flag id. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `status` | `string \| null` | No | — |
| `results` | `object \| null` | No | — |

> [accordion] results full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null,
>   key?: string | null,
>   description?: string | null,
>   status?: string | null,
>   tags?: string[] | null,
>   context?: string | null,
>   serving_method?: string | null,
>   ruleset?: {
>   } | null
> } | null
> ```

***

### list

`featureFlags.list`

List the feature flags of a workspace

**Risk:** `read`

```ts theme={null}
await corsair.mixpanel.api.featureFlags.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `workspace_id` | `number` | Yes | The workspace (data view) id, from the project URL (/project/\<id>/view/\<workspace>). |
| `include_archived` | `boolean` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `status` | `string \| null` | No | — |
| `results` | `object[] \| null` | No | — |

> [accordion] results full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null,
>   key?: string | null,
>   description?: string | null,
>   status?: string | null,
>   tags?: string[] | null,
>   context?: string | null,
>   serving_method?: string | null,
>   ruleset?: {
>   } | null
> }[] | null
> ```

***

### update

`featureFlags.update`

Replace a feature flag (full PUT: send every field); changes what live users are served

**Risk:** `write`

```ts theme={null}
await corsair.mixpanel.api.featureFlags.update({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `name` | `string` | Yes | — |
| `key` | `string` | Yes | The key code evaluates the flag by. |
| `description` | `string \| null` | No | — |
| `tags` | `string[]` | Yes | Tags; \[] for none. |
| `status` | `enabled \| disabled \| archived` | No | — |
| `context` | `string` | Yes | The identity the flag is evaluated on, usually distinct\_id. |
| `serving_method` | `client \| server \| remote_or_local \| remote_only` | Yes | — |
| `ruleset` | `object` | Yes | — |
| `experiment_id` | `string \| null` | No | — |
| `data_group_id` | `string \| number \| null` | No | — |
| `is_experiment_active` | `boolean \| null` | No | — |
| `hash_salt` | `string \| null` | No | — |
| `reset_hash_salt` | `boolean` | No | — |
| `workspace_id` | `number` | Yes | The workspace (data view) id, from the project URL (/project/\<id>/view/\<workspace>). |
| `flag_id` | `string` | Yes | The feature flag id. |

> [accordion] ruleset full type
>
> ```ts theme={null}
> {
>   variants: {
>   }[],
>   rollout: {
>   }[],
>   test?: {
>   }
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `status` | `string \| null` | No | — |
| `results` | `object \| null` | No | — |

> [accordion] results full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null,
>   key?: string | null,
>   description?: string | null,
>   status?: string | null,
>   tags?: string[] | null,
>   context?: string | null,
>   serving_method?: string | null,
>   ruleset?: {
>   } | null
> } | null
> ```

***

## Funnels

### list

`funnels.list`

List the saved funnels with their ids and names

**Risk:** `read`

```ts theme={null}
await corsair.mixpanel.api.funnels.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `workspace_id` | `number` | No | The workspace (data view) to run in; omit for the project default. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `funnels` | `object[]` | Yes | — |

> [accordion] funnels full type
>
> ```ts theme={null}
> {
>   funnel_id?: number | null,
>   name?: string | null
> }[]
> ```

***

### query

`funnels.query`

Query a saved funnel for a date range, with optional segmentation and conversion window

**Risk:** `read`

```ts theme={null}
await corsair.mixpanel.api.funnels.query({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `funnel_id` | `number` | Yes | The saved funnel id (funnels.list). |
| `from_date` | `string` | Yes | — |
| `to_date` | `string` | Yes | — |
| `length` | `number` | No | Conversion window length, in length\_unit. |
| `length_unit` | `day \| hour \| minute \| second` | No | — |
| `interval` | `number` | No | — |
| `unit` | `day \| week \| month` | No | — |
| `on` | `string` | No | A property expression to segment on. |
| `where` | `string` | No | — |
| `limit` | `number` | No | — |
| `workspace_id` | `number` | No | The workspace (data view) to run in; omit for the project default. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `meta` | `object \| null` | No | — |
| `data` | `Record<string, any> \| null` | No | — |

> [accordion] meta full type
>
> ```ts theme={null}
> {
>   dates?: string[] | null
> } | null
> ```

***

## Gdpr

### cancelDeletion

`gdpr.cancelDeletion`

Cancel a GDPR deletion job that has not started yet

**Risk:** `write`

```ts theme={null}
await corsair.mixpanel.api.gdpr.cancelDeletion({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `tracking_id` | `string` | Yes | The task\_id the create call returned. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `status` | `string \| null` | No | — |

***

### createDeletion

`gdpr.createDeletion`

Start a GDPR/CCPA deletion job that permanently deletes all events and profile data of the given users

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.mixpanel.api.gdpr.createDeletion({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `distinct_ids` | `string[]` | Yes | The users the request covers. |
| `compliance_type` | `GDPR \| CCPA` | No | Defaults to GDPR. |

Needs `gdpr_token` and `project_token`. Deletes every event and profile
of the users; Mixpanel runs it as a job you can cancel with
gdpr.cancelDeletion until it starts.

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `status` | `string \| null` | No | — |
| `results` | `object \| null` | No | — |

> [accordion] results full type
>
> ```ts theme={null}
> {
>   task_id?: string | null
> } | null
> ```

***

### createRetrieval

`gdpr.createRetrieval`

Start a GDPR/CCPA data retrieval job that exports everything stored about the given users

**Risk:** `write`

```ts theme={null}
await corsair.mixpanel.api.gdpr.createRetrieval({ distinct_ids: ['user-42'] });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `distinct_ids` | `string[]` | Yes | The users the request covers. |
| `compliance_type` | `GDPR \| CCPA` | No | Defaults to GDPR. |
| `disclosure_type` | `Data \| Categories \| Sources` | No | CCPA only: what to disclose. Defaults to Data. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `status` | `string \| null` | No | — |
| `results` | `object \| null` | No | — |

> [accordion] results full type
>
> ```ts theme={null}
> {
>   task_id?: string | null
> } | null
> ```

***

### getDeletion

`gdpr.getDeletion`

Check a GDPR deletion job

**Risk:** `read`

```ts theme={null}
await corsair.mixpanel.api.gdpr.getDeletion({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `tracking_id` | `string` | Yes | The task\_id the create call returned. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `status` | `string \| null` | No | — |
| `results` | `object \| null` | No | — |

> [accordion] results full type
>
> ```ts theme={null}
> {
>   tracking_id?: string | null,
>   status?: string | null,
>   requesting_user?: string | null,
>   compliance_type?: string | null,
>   project_id?: number | null,
>   date_requested?: string | null,
>   distinct_ids?: string[] | null
> } | null
> ```

***

### getRetrieval

`gdpr.getRetrieval`

Check a GDPR data retrieval job

**Risk:** `read`

```ts theme={null}
await corsair.mixpanel.api.gdpr.getRetrieval({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `tracking_id` | `string` | Yes | The task\_id the create call returned. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `status` | `string \| null` | No | — |
| `results` | `object \| null` | No | — |

> [accordion] results full type
>
> ```ts theme={null}
> {
>   status?: string | null,
>   results?: string | null,
>   distinct_ids?: string[] | null
> } | null
> ```

***

## Groups

### batchUpdate

`groups.batchUpdate`

Apply up to 200 mixed group profile updates in one request; $unset and $delete entries remove data

**Risk:** `destructive`

```ts theme={null}
await corsair.mixpanel.api.groups.batchUpdate({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `updates` | `object[]` | Yes | Up to 200 group updates, each with $group_key, $group\_id and one operation. |

> [accordion] updates full type
>
> ```ts theme={null}
> {
>   $group_key: string,
>   $group_id: string,
>   $set?: Record<string, any>,
>   $set_once?: Record<string, any>,
>   $union?: Record<string, any[]>,
>   $remove?: Record<string, any>,
>   $unset?: string[],
>   $delete?: string
> }[]
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `status` | `number \| string \| null` | No | — |
| `error` | `string \| null` | No | — |

***

### delete

`groups.delete`

Permanently delete a group profile and its properties

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.mixpanel.api.groups.delete({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `group_key` | `string` | Yes | The group key, the property groups are keyed on (e.g. company). |
| `group_id` | `string` | Yes | The id of the group to update. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `status` | `number \| string \| null` | No | — |
| `error` | `string \| null` | No | — |

***

### remove

`groups.remove`

Remove a value from list properties on a group profile

**Risk:** `write`

```ts theme={null}
await corsair.mixpanel.api.groups.remove({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `group_key` | `string` | Yes | The group key, the property groups are keyed on (e.g. company). |
| `group_id` | `string` | Yes | The id of the group to update. |
| `$remove` | `Record<string, any>` | Yes | List properties and one value each to remove. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `status` | `number \| string \| null` | No | — |
| `error` | `string \| null` | No | — |

***

### set

`groups.set`

Set properties on a group profile, creating it if needed

**Risk:** `write`

```ts theme={null}
await corsair.mixpanel.api.groups.set({ group_key: 'company', group_id: 'Acme', $set: { tier: 'enterprise' } });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `group_key` | `string` | Yes | The group key, the property groups are keyed on (e.g. company). |
| `group_id` | `string` | Yes | The id of the group to update. |
| `$set` | `Record<string, any>` | Yes | Properties to set, overwriting current values. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `status` | `number \| string \| null` | No | — |
| `error` | `string \| null` | No | — |

***

### setOnce

`groups.setOnce`

Set properties on a group profile only where they are not set yet

**Risk:** `write`

```ts theme={null}
await corsair.mixpanel.api.groups.setOnce({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `group_key` | `string` | Yes | The group key, the property groups are keyed on (e.g. company). |
| `group_id` | `string` | Yes | The id of the group to update. |
| `$set_once` | `Record<string, any>` | Yes | Properties to set only where not already set. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `status` | `number \| string \| null` | No | — |
| `error` | `string \| null` | No | — |

***

### union

`groups.union`

Merge values into list properties on a group profile, skipping duplicates

**Risk:** `write`

```ts theme={null}
await corsair.mixpanel.api.groups.union({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `group_key` | `string` | Yes | The group key, the property groups are keyed on (e.g. company). |
| `group_id` | `string` | Yes | The id of the group to update. |
| `$union` | `Record<string, any[]>` | Yes | List properties and the values to merge in. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `status` | `number \| string \| null` | No | — |
| `error` | `string \| null` | No | — |

***

### unset

`groups.unset`

Delete properties from a group profile

**Risk:** `destructive`

```ts theme={null}
await corsair.mixpanel.api.groups.unset({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `group_key` | `string` | Yes | The group key, the property groups are keyed on (e.g. company). |
| `group_id` | `string` | Yes | The id of the group to update. |
| `$unset` | `string[]` | Yes | Property names to delete. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `status` | `number \| string \| null` | No | — |
| `error` | `string \| null` | No | — |

***

## Identity

### createAlias

`identity.createAlias`

Send a \$create\_alias event so a new id resolves to an existing distinct\_id (legacy ID management)

**Risk:** `write`

```ts theme={null}
await corsair.mixpanel.api.identity.createAlias({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `distinct_id` | `string` | Yes | The existing distinct\_id. |
| `alias` | `string` | Yes | The new id that should resolve to distinct\_id. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `status` | `number \| string \| null` | No | — |
| `error` | `string \| null` | No | — |

***

### createIdentity

`identity.createIdentity`

Send an \$identify event linking an anonymous id to an identified id (original ID merge API)

**Risk:** `write`

```ts theme={null}
await corsair.mixpanel.api.identity.createIdentity({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `identified_id` | `string` | Yes | The id the user is known by after login (\$identified\_id). |
| `anon_id` | `string` | Yes | The anonymous id used before login (\$anon\_id). |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `status` | `number \| string \| null` | No | — |
| `error` | `string \| null` | No | — |

***

### merge

`identity.merge`

Merge two distinct\_ids into one user with a \$merge event (original ID merge API); cannot be undone

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.mixpanel.api.identity.merge({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `distinct_ids` | `[string, string]` | Yes | The two distinct\_ids to merge into one user. |

A `$merge` event through `/import`. Projects on Simplified ID Merge (every
project created since 2023) refuse it: 400 "identity events are not
allowed when project is using simplified identity management".
`identity.createIdentity` and `identity.createAlias` are accepted there
but have no effect.

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `code` | `number \| null` | No | — |
| `num_records_imported` | `number \| null` | No | — |
| `status` | `string \| number \| null` | No | — |

***

## Insights

### query

`insights.query`

Read the data behind one saved Insights report by its bookmark id

**Risk:** `read`

```ts theme={null}
await corsair.mixpanel.api.insights.query({ bookmark_id: 12345 });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `bookmark_id` | `number` | Yes | The id of the saved Insights report. |
| `workspace_id` | `number` | No | The workspace (data view) to run in; omit for the project default. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `computed_at` | `string \| null` | No | — |
| `date_range` | `object \| null` | No | — |
| `headers` | `string[] \| null` | No | — |
| `series` | `Record<string, any> \| null` | No | — |

> [accordion] date\_range full type
>
> ```ts theme={null}
> {
>   from_date?: string | null,
>   to_date?: string | null
> } | null
> ```

***

### run

`insights.run`

Run an ad hoc Insights query (events, funnels, retention, cohorts, formulas) without a saved report

**Risk:** `read`

```ts theme={null}
await corsair.mixpanel.api.insights.run({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `metrics` | `object[]` | Yes | What to measure; each has `type`: event, funnel, retention, cohort or formula (see Mixpanel Insights query reference). |
| `time` | `object` | Yes | start/end as YYYY-MM-DD, YYYY-MM-DDTHH:mm or a relative date object; unit such as day or week. |
| `filters` | `object[]` | No | — |
| `breakdowns` | `object[]` | No | — |
| `time_comparison` | `object` | No | — |
| `lift_comparison` | `object` | No | — |
| `workspace_id` | `number` | No | The workspace (data view) to run in; omit for the project default. |

`POST /insights/query`: an ad hoc report from metrics, time, filters and
breakdowns, in Mixpanel's Insights query format.

> [accordion] metrics full type
>
> ```ts theme={null}
> {
>   type: string
> }[]
> ```

> [accordion] time full type
>
> ```ts theme={null}
> {
>   start: string | {
>   },
>   end?: string | {
>   },
>   unit?: string
> }
> ```

> [accordion] filters full type
>
> ```ts theme={null}
> {
>   type: string
> }[]
> ```

> [accordion] breakdowns full type
>
> ```ts theme={null}
> {
>   type: string
> }[]
> ```

> [accordion] time\_comparison full type
>
> ```ts theme={null}
> {
> }
> ```

> [accordion] lift\_comparison full type
>
> ```ts theme={null}
> {
> }
> ```

**Output:** *empty object*

***

## Jql

### run

`jql.run`

Run a JQL script (custom JavaScript query) over events and profiles; JQL is in maintenance mode at Mixpanel

**Risk:** `read`

```ts theme={null}
await corsair.mixpanel.api.jql.run({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `script` | `string` | Yes | The JQL script, a JavaScript main() function. |
| `params` | `Record<string, any>` | No | Values the script reads as `params`. |
| `workspace_id` | `number` | No | The workspace (data view) to run in; omit for the project default. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `results` | `any[]` | Yes | — |

***

## Lexicon

### delete

`lexicon.delete`

Delete the Lexicon schema of one event or profile type

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.mixpanel.api.lexicon.delete({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `entity_type` | `event \| profile` | Yes | event for event schemas, profile for user profile schemas. |
| `name` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `status` | `string \| null` | No | — |
| `results` | `object \| null` | No | — |

> [accordion] results full type
>
> ```ts theme={null}
> {
>   delete_count?: number | null
> } | null
> ```

***

### deleteAll

`lexicon.deleteAll`

Delete every Lexicon schema in the project

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.mixpanel.api.lexicon.deleteAll({});
```

**Input:** *empty object*

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `status` | `string \| null` | No | — |
| `results` | `object \| null` | No | — |

> [accordion] results full type
>
> ```ts theme={null}
> {
>   delete_count?: number | null
> } | null
> ```

***

### deleteForEntity

`lexicon.deleteForEntity`

Delete every Lexicon schema for events or for profiles

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.mixpanel.api.lexicon.deleteForEntity({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `entity_type` | `event \| profile` | Yes | event for event schemas, profile for user profile schemas. |
| `entity_name` | `string` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `status` | `string \| null` | No | — |
| `results` | `object \| null` | No | — |

> [accordion] results full type
>
> ```ts theme={null}
> {
>   delete_count?: number | null
> } | null
> ```

***

### get

`lexicon.get`

Get the Lexicon schema of one event or profile type

**Risk:** `read`

```ts theme={null}
await corsair.mixpanel.api.lexicon.get({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `entity_type` | `event \| profile` | Yes | event for event schemas, profile for user profile schemas. |
| `name` | `string` | Yes | The event name, or \$user for user profiles. |

**Output:** *empty object*

***

### list

`lexicon.list`

List every Lexicon schema in the project

**Risk:** `read`

```ts theme={null}
await corsair.mixpanel.api.lexicon.list({});
```

**Input:** *empty object*

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `status` | `string \| null` | No | — |
| `results` | `object[] \| null` | No | — |

> [accordion] results full type
>
> ```ts theme={null}
> {
>   entityType?: string | null,
>   name?: string | null,
>   schemaJson?: Record<string, any> | null
> }[] | null
> ```

***

### listForEntity

`lexicon.listForEntity`

List the Lexicon schemas for events or for profiles

**Risk:** `read`

```ts theme={null}
await corsair.mixpanel.api.lexicon.listForEntity({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `entity_type` | `event \| profile` | Yes | event for event schemas, profile for user profile schemas. |
| `entity_name` | `string` | No | Only the schema of this event or profile. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `status` | `string \| null` | No | — |
| `results` | `object[] \| object \| null` | No | — |

> [accordion] results full type
>
> ```ts theme={null}
> {
>   entityType?: string | null,
>   name?: string | null,
>   schemaJson?: Record<string, any> | null
> }[] | {
> } | null
> ```

***

### upsert

`lexicon.upsert`

Create or replace the Lexicon schema of one event or profile type; metadata dropped: true makes Mixpanel drop that event at ingestion

**Risk:** `destructive`

```ts theme={null}
await corsair.mixpanel.api.lexicon.upsert({ entity_type: 'event', name: 'Signed up', schema: { description: 'A new account', properties: { plan: { type: 'string' } } } });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `entity_type` | `event \| profile` | Yes | event for event schemas, profile for user profile schemas. |
| `name` | `string` | Yes | — |
| `schema` | `object` | Yes | The JSON Schema to store, replacing any existing one. |

> [accordion] schema full type
>
> ```ts theme={null}
> {
>   description?: string,
>   properties?: Record<string, any>,
>   metadata?: Record<string, any>
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `status` | `string \| null` | No | — |
| `results` | `object \| null` | No | — |

> [accordion] results full type
>
> ```ts theme={null}
> {
> } | null
> ```

***

### upsertMany

`lexicon.upsertMany`

Create or replace many Lexicon schemas at once; truncate deletes every schema not uploaded

**Risk:** `destructive`

```ts theme={null}
await corsair.mixpanel.api.lexicon.upsertMany({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `entries` | `object[]` | Yes | — |
| `truncate` | `boolean` | No | True deletes every schema not in this upload. Defaults to false. |

> [accordion] entries full type
>
> ```ts theme={null}
> {
>   entityType: event | profile,
>   name: string,
>   schemaJson: {
>     description?: string,
>     properties?: Record<string, any>,
>     metadata?: Record<string, any>
>   }
> }[]
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `status` | `string \| null` | No | — |
| `results` | `object \| null` | No | — |

> [accordion] results full type
>
> ```ts theme={null}
> {
>   added?: number | null,
>   deleted?: number | null
> } | null
> ```

***

## Lookup Tables

### list

`lookupTables.list`

List the lookup tables in the project with their ids

**Risk:** `read`

```ts theme={null}
await corsair.mixpanel.api.lookupTables.list({});
```

**Input:** *empty object*

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `code` | `number \| null` | No | — |
| `status` | `string \| null` | No | — |
| `results` | `object[] \| null` | No | — |

> [accordion] results full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null
> }[] | null
> ```

***

### replace

`lookupTables.replace`

Replace every row of a lookup table with new CSV content (max 100 MB); the old rows are gone

**Risk:** `destructive`

```ts theme={null}
await corsair.mixpanel.api.lookupTables.replace({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | The lookup table id from lookupTables.list. |
| `csv` | `string` | Yes | The whole table as CSV, header row first; the first column is the join key. Replaces every row. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `code` | `number \| null` | No | — |
| `status` | `string \| null` | No | — |

***

## Pipelines

### create

`pipelines.create`

Create a data pipeline that exports project data to a bucket or warehouse (a paid add-on that bills while it runs)

**Risk:** `destructive`

```ts theme={null}
await corsair.mixpanel.api.pipelines.create({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `type` | `gcs-raw \| s3-raw \| azure-raw \| bigquery \| snowflake \| aws \| azure-blob \| gcs-schema` | Yes | Where to export: raw to a bucket, or schematized to a warehouse. |
| `from_date` | `string` | No | Start of the export window (at most six months back); required unless trial is true. |
| `to_date` | `string` | No | End of the window; omit to keep exporting. |
| `trial` | `boolean` | No | A free 30-day trial pipeline. |
| `data_source` | `events \| people` | No | — |
| `frequency` | `daily \| hourly` | No | — |
| `events` | `string[]` | No | Only these events. |
| `where` | `string` | No | — |
| `data_format` | `string` | No | — |
| `settings` | `Record<string, string \| number \| boolean \| string[]>` | No | Destination fields for this type, e.g. gcs\_bucket and gcs\_region, s3\_bucket, s3\_region and s3\_role, bq\_region, snowflake\_*, azure\_*. |

**Output:** `object \| any[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
> } | any[]
> ```

***

### delete

`pipelines.delete`

Delete (cancel) a data pipeline

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.mixpanel.api.pipelines.delete({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `name` | `string` | Yes | The pipeline name, from pipelines.list. |

**Output:** `object \| any[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
> } | any[]
> ```

***

### edit

`pipelines.edit`

Change a pipeline's event filter or settings

**Risk:** `write`

```ts theme={null}
await corsair.mixpanel.api.pipelines.edit({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `name` | `string` | Yes | The pipeline name, from pipelines.list. |
| `events` | `string[]` | No | — |
| `where` | `string` | No | — |
| `settings` | `Record<string, string \| number \| boolean \| string[]>` | No | Other fields the pipeline type allows editing. |

**Output:** `object \| any[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
> } | any[]
> ```

***

### list

`pipelines.list`

List the data pipelines of the project

**Risk:** `read`

```ts theme={null}
await corsair.mixpanel.api.pipelines.list({});
```

**Input:** *empty object*

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `pipelines` | `object \| any[]` | Yes | — |

> [accordion] pipelines full type
>
> ```ts theme={null}
> {
> } | any[]
> ```

***

### pause

`pipelines.pause`

Pause a data pipeline

**Risk:** `write`

```ts theme={null}
await corsair.mixpanel.api.pipelines.pause({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `name` | `string` | Yes | The pipeline name, from pipelines.list. |

**Output:** `object \| any[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
> } | any[]
> ```

***

### resume

`pipelines.resume`

Resume a paused data pipeline

**Risk:** `write`

```ts theme={null}
await corsair.mixpanel.api.pipelines.resume({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `name` | `string` | Yes | The pipeline name, from pipelines.list. |

**Output:** `object \| any[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
> } | any[]
> ```

***

### status

`pipelines.status`

Get a pipeline's export jobs by status

**Risk:** `read`

```ts theme={null}
await corsair.mixpanel.api.pipelines.status({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `name` | `string` | Yes | The pipeline name, from pipelines.list. |
| `summary` | `boolean` | No | True for counts only. |
| `status` | `(pending \| running \| retried \| failed \| canceled \| timed_out \| succeeded)[]` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `canceled` | `object[] \| null` | No | — |
| `retried` | `object[] \| null` | No | — |
| `succeeded` | `object[] \| null` | No | — |

> [accordion] canceled full type
>
> ```ts theme={null}
> {
> }[] | null
> ```

> [accordion] retried full type
>
> ```ts theme={null}
> {
> }[] | null
> ```

> [accordion] succeeded full type
>
> ```ts theme={null}
> {
> }[] | null
> ```

***

### timeline

`pipelines.timeline`

List the dates a pipeline has synced

**Risk:** `read`

```ts theme={null}
await corsair.mixpanel.api.pipelines.timeline({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `name` | `string` | No | The pipeline name, from pipelines.list. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `timeline` | `object \| any[]` | Yes | — |

> [accordion] timeline full type
>
> ```ts theme={null}
> {
> } | any[]
> ```

***

## Profiles

### activity

`profiles.activity`

Return the event activity stream of one or more users' profiles for a date range

**Risk:** `read`

```ts theme={null}
await corsair.mixpanel.api.profiles.activity({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `distinct_ids` | `string[]` | Yes | The users whose event stream to return. |
| `from_date` | `string` | Yes | — |
| `to_date` | `string` | Yes | — |
| `workspace_id` | `number` | No | The workspace (data view) to run in; omit for the project default. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `status` | `string \| null` | No | — |
| `results` | `object \| null` | No | — |

> [accordion] results full type
>
> ```ts theme={null}
> {
>   events?: {
>     event?: string | null,
>     properties?: Record<string, any> | null
>   }[] | null
> } | null
> ```

***

### append

`profiles.append`

Append a value to list properties on a user profile

**Risk:** `write`

```ts theme={null}
await corsair.mixpanel.api.profiles.append({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `distinct_id` | `string` | Yes | The profile to update. |
| `$append` | `Record<string, any>` | Yes | List properties and one value each to append. |
| `$ip` | `string` | No | An IP to geolocate the profile from; omit to skip it. |
| `$ignore_time` | `boolean` | No | True to leave \$last\_seen unchanged. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `status` | `number \| string \| null` | No | — |
| `error` | `string \| null` | No | — |

***

### batchUpdate

`profiles.batchUpdate`

Apply up to 2000 mixed profile updates in one request; $unset and $delete entries remove data

**Risk:** `destructive`

```ts theme={null}
await corsair.mixpanel.api.profiles.batchUpdate({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `updates` | `object[]` | Yes | Up to 2000 profile updates, each with $distinct_id and one operation ($set, $set_once, $add, $union, $append, $remove, $unset or \$delete). |

> [accordion] updates full type
>
> ```ts theme={null}
> {
>   $distinct_id: string,
>   $set?: Record<string, any>,
>   $set_once?: Record<string, any>,
>   $add?: Record<string, number>,
>   $union?: Record<string, any[]>,
>   $append?: Record<string, any>,
>   $remove?: Record<string, any>,
>   $unset?: string[],
>   $delete?: string,
>   $ip?: string,
>   $ignore_time?: boolean
> }[]
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `status` | `number \| string \| null` | No | — |
| `error` | `string \| null` | No | — |

***

### delete

`profiles.delete`

Permanently delete a user profile and its properties (events stay)

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.mixpanel.api.profiles.delete({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `distinct_id` | `string` | Yes | The profile to update. |
| `ignore_alias` | `boolean` | No | True to delete only this id, not profiles aliased to it. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `status` | `number \| string \| null` | No | — |
| `error` | `string \| null` | No | — |

***

### increment

`profiles.increment`

Add to (or subtract from) numeric properties on a user profile

**Risk:** `write`

```ts theme={null}
await corsair.mixpanel.api.profiles.increment({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `distinct_id` | `string` | Yes | The profile to update. |
| `$add` | `Record<string, number>` | Yes | Numeric properties and the amount to add (negative to subtract). |
| `$ip` | `string` | No | An IP to geolocate the profile from; omit to skip it. |
| `$ignore_time` | `boolean` | No | True to leave \$last\_seen unchanged. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `status` | `number \| string \| null` | No | — |
| `error` | `string \| null` | No | — |

***

### query

`profiles.query`

Query user or group profiles with an expression, a cohort filter or exact distinct\_ids, paged via session\_id and next\_page

**Risk:** `read`

```ts theme={null}
await corsair.mixpanel.api.profiles.query({ where: 'properties["plan"] == "pro"', output_properties: ['$email', 'plan'] });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `where` | `string` | No | An expression to filter profiles by, such as properties\["\$email"] == "...". |
| `distinct_id` | `string` | No | Retrieve exactly this profile. |
| `distinct_ids` | `string[]` | No | Retrieve exactly these profiles. |
| `data_group_id` | `string` | No | The ID of the group key, to query group profiles instead of user profiles. |
| `output_properties` | `string[]` | No | Only return these properties, which speeds the query up considerably. |
| `session_id` | `string` | No | The session\_id from the previous response, to keep paging through one query. |
| `page` | `number` | No | Set to the previous response's next\_page; pages after 0 need its session\_id. |
| `behaviors` | `number` | No | Needed when filtering with an event selector expression. |
| `as_of_timestamp` | `number` | No | Required with `behaviors` when exporting more than 1000 profiles. |
| `filter_by_cohort` | `number` | No | Only profiles in this cohort id. |
| `include_all_users` | `boolean` | No | With `filter_by_cohort`: false keeps only distinct\_ids that have a profile. Defaults to true. |
| `workspace_id` | `number` | No | The workspace (data view) to run in; omit for the project default. |

`POST /engage` on the query host. To page, pass the response's
`next_page` as `page` with the same `session_id` and the same filters;
stop when `next_page` is null.

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `page` | `number \| null` | No | — |
| `page_size` | `number \| null` | No | — |
| `results` | `object[]` | Yes | — |
| `session_id` | `string \| null` | No | — |
| `status` | `string \| null` | No | — |
| `total` | `number \| null` | No | — |
| `next_page` | `number \| null` | Yes | Derived: the page to request next while this one came back full, otherwise null. Pass it as `page` with the same session\_id. |

> [accordion] results full type
>
> ```ts theme={null}
> {
>   $distinct_id?: string | number | null,
>   $properties?: Record<string, any> | null
> }[]
> ```

***

### remove

`profiles.remove`

Remove a value from list properties on a user profile

**Risk:** `write`

```ts theme={null}
await corsair.mixpanel.api.profiles.remove({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `distinct_id` | `string` | Yes | The profile to update. |
| `$remove` | `Record<string, any>` | Yes | List properties and one value each to remove. |
| `$ip` | `string` | No | An IP to geolocate the profile from; omit to skip it. |
| `$ignore_time` | `boolean` | No | True to leave \$last\_seen unchanged. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `status` | `number \| string \| null` | No | — |
| `error` | `string \| null` | No | — |

***

### set

`profiles.set`

Set properties on a user profile, creating the profile if needed

**Risk:** `write`

```ts theme={null}
await corsair.mixpanel.api.profiles.set({ distinct_id: 'user-42', $set: { plan: 'pro', seats: 5 } });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `distinct_id` | `string` | Yes | The profile to update. |
| `$set` | `Record<string, any>` | Yes | Properties to set, overwriting current values. |
| `$ip` | `string` | No | An IP to geolocate the profile from; omit to skip it. |
| `$ignore_time` | `boolean` | No | True to leave \$last\_seen unchanged. |

`POST /engage` with the project token. Every profile operation takes
`distinct_id` and its Mixpanel operator field (`$set`, `$set_once`,
`$add`, `$union`, `$append`, `$remove`, `$unset`). Mixpanel answers
status 1 even for a wrong token, so check the project with
profiles.query.

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `status` | `number \| string \| null` | No | — |
| `error` | `string \| null` | No | — |

***

### setOnce

`profiles.setOnce`

Set properties on a user profile only where they are not set yet

**Risk:** `write`

```ts theme={null}
await corsair.mixpanel.api.profiles.setOnce({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `distinct_id` | `string` | Yes | The profile to update. |
| `$set_once` | `Record<string, any>` | Yes | Properties to set only where not already set. |
| `$ip` | `string` | No | An IP to geolocate the profile from; omit to skip it. |
| `$ignore_time` | `boolean` | No | True to leave \$last\_seen unchanged. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `status` | `number \| string \| null` | No | — |
| `error` | `string \| null` | No | — |

***

### union

`profiles.union`

Merge values into list properties on a user profile, skipping values already present

**Risk:** `write`

```ts theme={null}
await corsair.mixpanel.api.profiles.union({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `distinct_id` | `string` | Yes | The profile to update. |
| `$union` | `Record<string, any[]>` | Yes | List properties and the values to merge in without duplicates. |
| `$ip` | `string` | No | An IP to geolocate the profile from; omit to skip it. |
| `$ignore_time` | `boolean` | No | True to leave \$last\_seen unchanged. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `status` | `number \| string \| null` | No | — |
| `error` | `string \| null` | No | — |

***

### unset

`profiles.unset`

Delete properties from a user profile

**Risk:** `destructive`

```ts theme={null}
await corsair.mixpanel.api.profiles.unset({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `distinct_id` | `string` | Yes | The profile to update. |
| `$unset` | `string[]` | Yes | Property names to delete. |
| `$ip` | `string` | No | An IP to geolocate the profile from; omit to skip it. |
| `$ignore_time` | `boolean` | No | True to leave \$last\_seen unchanged. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `status` | `number \| string \| null` | No | — |
| `error` | `string \| null` | No | — |

***

## Retention

### frequency

`retention.frequency`

Frequency (addiction) report: how many users did an event on how many hours or days of each period

**Risk:** `read`

```ts theme={null}
await corsair.mixpanel.api.retention.frequency({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `from_date` | `string` | Yes | — |
| `to_date` | `string` | Yes | — |
| `unit` | `day \| week \| month` | Yes | The overall time period to bucket users by. |
| `addiction_unit` | `hour \| day` | Yes | The granularity to count how often users did the event. |
| `event` | `string` | No | — |
| `where` | `string` | No | — |
| `on` | `string` | No | — |
| `limit` | `number` | No | — |
| `workspace_id` | `number` | No | The workspace (data view) to run in; omit for the project default. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `Record<string, any> \| null` | No | — |

***

### query

`retention.query`

Run a birth or compounded retention query for a date range, per day, week or month

**Risk:** `read`

```ts theme={null}
await corsair.mixpanel.api.retention.query({ from_date: '2026-04-01', to_date: '2026-04-07', born_event: 'Signed up', event: 'Viewed report', unit: 'week' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `from_date` | `string` | Yes | — |
| `to_date` | `string` | Yes | — |
| `retention_type` | `birth \| compounded` | No | Defaults to 'birth' (first time). 'compounded' is recurring retention. |
| `born_event` | `string` | No | The first event, required when retention\_type is 'birth'. |
| `event` | `string` | No | The returning event. Omit to look across all events. |
| `born_where` | `string` | No | — |
| `where` | `string` | No | — |
| `interval` | `number` | No | Defaults to 1. At most 90 when unit is day. |
| `interval_count` | `number` | No | — |
| `unit` | `day \| week \| month` | No | — |
| `unbounded_retention` | `boolean` | No | — |
| `on` | `string` | No | — |
| `limit` | `number` | No | — |
| `workspace_id` | `number` | No | The workspace (data view) to run in; omit for the project default. |

**Output:** `Record<string, any>`

***

## Segmentation

### average

`segmentation.average`

Average a numeric property of an event per time unit

**Risk:** `read`

```ts theme={null}
await corsair.mixpanel.api.segmentation.average({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `event` | `string` | Yes | The event to segment. |
| `from_date` | `string` | Yes | — |
| `to_date` | `string` | Yes | — |
| `where` | `string` | No | — |
| `workspace_id` | `number` | No | The workspace (data view) to run in; omit for the project default. |
| `on` | `string` | Yes | A numeric property expression to average. |
| `unit` | `hour \| day` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `status` | `string \| null` | No | — |
| `computed_at` | `string \| null` | No | — |
| `results` | `Record<string, any> \| null` | No | — |

***

### numeric

`segmentation.numeric`

Segment an event by numeric ranges of a property

**Risk:** `read`

```ts theme={null}
await corsair.mixpanel.api.segmentation.numeric({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `event` | `string` | Yes | The event to segment. |
| `from_date` | `string` | Yes | — |
| `to_date` | `string` | Yes | — |
| `where` | `string` | No | — |
| `workspace_id` | `number` | No | The workspace (data view) to run in; omit for the project default. |
| `on` | `string` | Yes | A numeric property expression to bucket. |
| `unit` | `hour \| day` | No | — |
| `type` | `general \| unique \| average` | No | general counts every event, unique counts users, average is per user. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object \| null` | No | — |
| `legend_size` | `number \| null` | No | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   series?: string[] | null,
>   values?: Record<string, any> | null
> } | null
> ```

***

### query

`segmentation.query`

Count an event over time, optionally segmented by a property (Segmentation report)

**Risk:** `read`

```ts theme={null}
await corsair.mixpanel.api.segmentation.query({ event: 'Signed up', from_date: '2026-04-01', to_date: '2026-04-07', on: 'properties["utm_source"]' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `event` | `string` | Yes | The event to segment. |
| `from_date` | `string` | Yes | — |
| `to_date` | `string` | Yes | — |
| `where` | `string` | No | — |
| `workspace_id` | `number` | No | The workspace (data view) to run in; omit for the project default. |
| `on` | `string` | No | A property expression to segment on. |
| `unit` | `minute \| hour \| day \| month` | No | — |
| `interval` | `number` | No | — |
| `limit` | `number` | No | — |
| `type` | `general \| unique \| average` | No | general counts every event, unique counts users, average is per user. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object \| null` | No | — |
| `legend_size` | `number \| null` | No | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   series?: string[] | null,
>   values?: Record<string, any> | null
> } | null
> ```

***

### sum

`segmentation.sum`

Sum a numeric property of an event per time unit

**Risk:** `read`

```ts theme={null}
await corsair.mixpanel.api.segmentation.sum({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `event` | `string` | Yes | The event to segment. |
| `from_date` | `string` | Yes | — |
| `to_date` | `string` | Yes | — |
| `where` | `string` | No | — |
| `workspace_id` | `number` | No | The workspace (data view) to run in; omit for the project default. |
| `on` | `string` | Yes | A numeric property expression to sum. |
| `unit` | `hour \| day` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `status` | `string \| null` | No | — |
| `computed_at` | `string \| null` | No | — |
| `results` | `Record<string, any> \| null` | No | — |

***

## Service Accounts

### addToProjects

`serviceAccounts.addToProjects`

Grant service accounts access to projects with a role

**Risk:** `write`

```ts theme={null}
await corsair.mixpanel.api.serviceAccounts.addToProjects({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `organization_id` | `number` | Yes | The organization id (Organization Settings, Overview). |
| `service_account_ids` | `number[]` | Yes | — |
| `projects` | `object[]` | Yes | — |

> [accordion] projects full type
>
> ```ts theme={null}
> {
>   id: number,
>   role: owner | admin | analyst | consumer
> }[]
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `status` | `string \| null` | No | — |

***

### create

`serviceAccounts.create`

Create a service account and return its secret once; this mints a new credential with the given role

**Risk:** `destructive`

```ts theme={null}
await corsair.mixpanel.api.serviceAccounts.create({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `organization_id` | `number` | Yes | The organization id (Organization Settings, Overview). |
| `username` | `string` | Yes | A name for the service account. |
| `role` | `owner \| admin \| analyst \| consumer` | No | Organization role; defaults to Mixpanel default. |
| `expires` | `string` | No | ISO 8601 expiry; omit for no expiry. |
| `projects` | `object[]` | No | Projects to grant, each with a role. |

Returns the new account's secret once, in `results.token`. Organization
calls need an organization admin or owner service account.

> [accordion] projects full type
>
> ```ts theme={null}
> {
>   id: number,
>   role: owner | admin | analyst | consumer
> }[]
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `status` | `string \| null` | No | — |
| `results` | `object \| null` | No | — |

> [accordion] results full type
>
> ```ts theme={null}
> {
>   id?: number | null,
>   username?: string | null,
>   last_used?: string | null,
>   expires?: string | null,
>   creator?: number | null,
>   creator_name?: string | null,
>   created?: string | null,
>   user?: number | null,
>   role?: string | null,
>   token?: string | null
> } | null
> ```

***

### delete

`serviceAccounts.delete`

Delete a service account; anything using its secret stops working (including this connection, if it is this one)

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.mixpanel.api.serviceAccounts.delete({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `organization_id` | `number` | Yes | The organization id (Organization Settings, Overview). |
| `service_account_id` | `number` | Yes | — |

**Output:** *empty object*

***

### get

`serviceAccounts.get`

Get one service account of the organization

**Risk:** `read`

```ts theme={null}
await corsair.mixpanel.api.serviceAccounts.get({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `organization_id` | `number` | Yes | The organization id (Organization Settings, Overview). |
| `service_account_id` | `number` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `number \| null` | No | — |
| `username` | `string \| null` | No | — |
| `last_used` | `string \| null` | No | — |
| `expires` | `string \| null` | No | — |
| `creator` | `number \| null` | No | — |
| `creator_name` | `string \| null` | No | — |
| `created` | `string \| null` | No | — |
| `user` | `number \| null` | No | — |
| `role` | `string \| null` | No | — |

***

### list

`serviceAccounts.list`

List the organization's service accounts

**Risk:** `read`

```ts theme={null}
await corsair.mixpanel.api.serviceAccounts.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `organization_id` | `number` | Yes | The organization id (Organization Settings, Overview). |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `status` | `string \| null` | No | — |
| `results` | `object[] \| null` | No | — |

> [accordion] results full type
>
> ```ts theme={null}
> {
>   id?: number | null,
>   username?: string | null,
>   last_used?: string | null,
>   expires?: string | null,
>   creator?: number | null,
>   creator_name?: string | null,
>   created?: string | null,
>   user?: number | null,
>   role?: string | null
> }[] | null
> ```

***

### listForProject

`serviceAccounts.listForProject`

List the service accounts that can reach this project, with their roles

**Risk:** `read`

```ts theme={null}
await corsair.mixpanel.api.serviceAccounts.listForProject({});
```

**Input:** *empty object*

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `status` | `string \| null` | No | — |
| `results` | `object[] \| null` | No | — |

> [accordion] results full type
>
> ```ts theme={null}
> {
>   id?: number | null,
>   username?: string | null,
>   last_used?: string | null,
>   expires?: string | null,
>   creator?: number | null,
>   creator_name?: string | null,
>   created?: string | null,
>   user?: number | null,
>   role?: string | null
> }[] | null
> ```

***

### removeFromProjects

`serviceAccounts.removeFromProjects`

Remove service accounts from projects; they lose access at once

**Risk:** `destructive`

```ts theme={null}
await corsair.mixpanel.api.serviceAccounts.removeFromProjects({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `organization_id` | `number` | Yes | The organization id (Organization Settings, Overview). |
| `projects` | `object[]` | Yes | — |

> [accordion] projects full type
>
> ```ts theme={null}
> {
>   id: number,
>   service_account_ids: number[]
> }[]
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `status` | `string \| null` | No | — |

***

## Warehouse Imports

### createEventStream

`warehouseImports.createEventStream`

Create an import that loads events from a warehouse table

**Risk:** `write`

```ts theme={null}
await corsair.mixpanel.api.warehouseImports.createEventStream({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `warehouse_source_id` | `number` | Yes | The connected warehouse source. |
| `table_params` | `Record<string, any>` | Yes | Where the table is, per warehouse (e.g. dataset\_name and table\_name for BigQuery). |
| `run_every` | `0 \| 3600000000000 \| 86400000000000 \| 604800000000000` | No | Sync interval in nanoseconds: 0 (manual), hourly, daily or weekly. |
| `json_properties_column_name` | `string` | No | — |
| `property_mappings` | `Record<string, string>` | No | — |
| `databricks_params` | `object` | No | — |
| `time_column_name` | `string` | Yes | — |
| `sync_mode` | `time_based \| mirror_mode \| full_sync \| one_time` | Yes | — |
| `event_name` | `string` | No | One event name for every row. |
| `event_column_name` | `string` | No | Or a column holding the event name. |
| `user_column_name` | `string` | No | — |
| `company_column_name` | `string` | No | — |
| `device_column_name` | `string` | No | — |
| `insert_id_column_name` | `string` | No | — |
| `insert_time_column_name` | `string` | No | — |

> [accordion] databricks\_params full type
>
> ```ts theme={null}
> {
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `status` | `string \| null` | No | — |
| `results` | `object \| null` | No | — |

> [accordion] results full type
>
> ```ts theme={null}
> {
>   id?: number | null,
>   import_type?: string | null,
>   warehouse_source_id?: number | null,
>   paused?: boolean | null,
>   run_every?: number | null,
>   sync_mode?: string | null
> } | null
> ```

***

### createGroups

`warehouseImports.createGroups`

Create an import that loads group profiles from a warehouse table

**Risk:** `write`

```ts theme={null}
await corsair.mixpanel.api.warehouseImports.createGroups({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `warehouse_source_id` | `number` | Yes | The connected warehouse source. |
| `table_params` | `Record<string, any>` | Yes | Where the table is, per warehouse (e.g. dataset\_name and table\_name for BigQuery). |
| `run_every` | `0 \| 3600000000000 \| 86400000000000 \| 604800000000000` | No | Sync interval in nanoseconds: 0 (manual), hourly, daily or weekly. |
| `json_properties_column_name` | `string` | No | — |
| `property_mappings` | `Record<string, string>` | No | — |
| `databricks_params` | `object` | No | — |
| `group_key` | `string` | Yes | — |
| `group_id_column` | `string` | Yes | — |
| `sync_mode` | `time_based \| mirror_mode \| full_sync \| one_time` | Yes | — |
| `insert_time_column_name` | `string` | No | — |

> [accordion] databricks\_params full type
>
> ```ts theme={null}
> {
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `status` | `string \| null` | No | — |
| `results` | `object \| null` | No | — |

> [accordion] results full type
>
> ```ts theme={null}
> {
>   id?: number | null,
>   import_type?: string | null,
>   warehouse_source_id?: number | null,
>   paused?: boolean | null,
>   run_every?: number | null,
>   sync_mode?: string | null
> } | null
> ```

***

### createLookupTable

`warehouseImports.createLookupTable`

Create an import that loads a lookup table from a warehouse table

**Risk:** `write`

```ts theme={null}
await corsair.mixpanel.api.warehouseImports.createLookupTable({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `warehouse_source_id` | `number` | Yes | The connected warehouse source. |
| `table_params` | `Record<string, any>` | Yes | Where the table is, per warehouse (e.g. dataset\_name and table\_name for BigQuery). |
| `run_every` | `0 \| 3600000000000 \| 86400000000000 \| 604800000000000` | No | Sync interval in nanoseconds: 0 (manual), hourly, daily or weekly. |
| `databricks_params` | `object` | No | — |
| `mixpanel_property` | `object` | Yes | The Mixpanel property the table joins on. |
| `property_key_column_name` | `string` | Yes | — |
| `sync_mode` | `full_sync \| one_time` | Yes | — |

> [accordion] databricks\_params full type
>
> ```ts theme={null}
> {
> }
> ```

> [accordion] mixpanel\_property full type
>
> ```ts theme={null}
> {
>   value: string,
>   resourceType: string,
>   customPropertyId?: number
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `status` | `string \| null` | No | — |
| `results` | `object \| null` | No | — |

> [accordion] results full type
>
> ```ts theme={null}
> {
>   id?: number | null,
>   import_type?: string | null,
>   warehouse_source_id?: number | null,
>   paused?: boolean | null,
>   run_every?: number | null,
>   sync_mode?: string | null
> } | null
> ```

***

### createPeople

`warehouseImports.createPeople`

Create an import that loads user profiles from a warehouse table

**Risk:** `write`

```ts theme={null}
await corsair.mixpanel.api.warehouseImports.createPeople({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `warehouse_source_id` | `number` | Yes | The connected warehouse source. |
| `table_params` | `Record<string, any>` | Yes | Where the table is, per warehouse (e.g. dataset\_name and table\_name for BigQuery). |
| `run_every` | `0 \| 3600000000000 \| 86400000000000 \| 604800000000000` | No | Sync interval in nanoseconds: 0 (manual), hourly, daily or weekly. |
| `json_properties_column_name` | `string` | No | — |
| `property_mappings` | `Record<string, string>` | No | — |
| `databricks_params` | `object` | No | — |
| `user_column_name` | `string` | Yes | — |
| `sync_mode` | `time_based \| mirror_mode \| full_sync \| one_time` | Yes | — |
| `insert_time_column_name` | `string` | No | — |

> [accordion] databricks\_params full type
>
> ```ts theme={null}
> {
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `status` | `string \| null` | No | — |
| `results` | `object \| null` | No | — |

> [accordion] results full type
>
> ```ts theme={null}
> {
>   id?: number | null,
>   import_type?: string | null,
>   warehouse_source_id?: number | null,
>   paused?: boolean | null,
>   run_every?: number | null,
>   sync_mode?: string | null
> } | null
> ```

***

### delete

`warehouseImports.delete`

Delete a warehouse import, and with delete\_data the data it imported

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.mixpanel.api.warehouseImports.delete({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `import_id` | `number` | Yes | The warehouse import id. |
| `delete_data` | `boolean` | No | True also deletes the data this import brought into Mixpanel. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `status` | `string \| null` | No | — |

***

### get

`warehouseImports.get`

Get one warehouse import with its settings

**Risk:** `read`

```ts theme={null}
await corsair.mixpanel.api.warehouseImports.get({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `import_id` | `number` | Yes | The warehouse import id. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `status` | `string \| null` | No | — |
| `results` | `object \| null` | No | — |

> [accordion] results full type
>
> ```ts theme={null}
> {
>   id?: number | null,
>   import_type?: string | null,
>   warehouse_source_id?: number | null,
>   paused?: boolean | null,
>   run_every?: number | null,
>   sync_mode?: string | null
> } | null
> ```

***

### history

`warehouseImports.history`

List the past sync runs of a warehouse import

**Risk:** `read`

```ts theme={null}
await corsair.mixpanel.api.warehouseImports.history({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `import_id` | `number` | Yes | The warehouse import id. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `status` | `string \| null` | No | — |
| `results` | `object \| null` | No | — |

> [accordion] results full type
>
> ```ts theme={null}
> {
>   runs?: {
>   }[] | null
> } | null
> ```

***

### list

`warehouseImports.list`

List the warehouse imports of the project

**Risk:** `read`

```ts theme={null}
await corsair.mixpanel.api.warehouseImports.list({});
```

**Input:** *empty object*

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `status` | `string \| null` | No | — |
| `results` | `object[] \| null` | No | — |

> [accordion] results full type
>
> ```ts theme={null}
> {
>   id?: number | null,
>   import_type?: string | null,
>   warehouse_source_id?: number | null,
>   paused?: boolean | null,
>   run_every?: number | null,
>   sync_mode?: string | null
> }[] | null
> ```

***

### run

`warehouseImports.run`

Start a sync of a warehouse import now

**Risk:** `write`

```ts theme={null}
await corsair.mixpanel.api.warehouseImports.run({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `import_id` | `number` | Yes | The warehouse import id. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `status` | `string \| null` | No | — |
| `results` | `object \| null` | No | — |

> [accordion] results full type
>
> ```ts theme={null}
> {
>   run_id?: string | null
> } | null
> ```

***

### update

`warehouseImports.update`

Pause, resume or reschedule a warehouse import

**Risk:** `write`

```ts theme={null}
await corsair.mixpanel.api.warehouseImports.update({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `import_id` | `number` | Yes | The warehouse import id. |
| `paused` | `boolean` | Yes | — |
| `run_every` | `0 \| 3600000000000 \| 86400000000000 \| 604800000000000` | Yes | Sync interval in nanoseconds: 0 (manual), hourly, daily or weekly. |
| `databricks_params` | `object` | No | — |

> [accordion] databricks\_params full type
>
> ```ts theme={null}
> {
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `status` | `string \| null` | No | — |
| `results` | `object \| null` | No | — |

> [accordion] results full type
>
> ```ts theme={null}
> {
>   id?: number | null,
>   import_type?: string | null,
>   warehouse_source_id?: number | null,
>   paused?: boolean | null,
>   run_every?: number | null,
>   sync_mode?: string | null
> } | null
> ```

***


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