Mixpanel

Learn how to use Mixpanel with Composio

Overview

SLUG: MIXPANEL

Description

Mixpanel is a product analytics platform tracking user interactions and engagement, providing cohort analysis, funnels, and A/B testing to improve user experiences

Authentication Details

username
stringRequired
password
stringRequired
region
string

Connecting to Mixpanel

Create an auth config

Use the dashboard to create an auth config for the Mixpanel toolkit. This allows you to connect multiple Mixpanel accounts to Composio for agents to use.

1

Select App

Navigate to Mixpanel.

2

Configure Auth Config Settings

Select among the supported auth schemes of and configure them here.

3

Create and Get auth config ID

Click “Create Mixpanel Auth Config”. After creation, copy the displayed ID starting with ac_. This is your auth config ID. This is not a sensitive ID — you can save it in environment variables or a database. This ID will be used to create connections to the toolkit for a given user.

Connect Your Account

Using Basic Auth

1from composio import Composio
2from composio.types import auth_scheme
3
4# Replace these with your actual values
5mixpanel_auth_config_id = "ac_YOUR_MIXPANEL_CONFIG_ID"
6user_id = "user@example.com"
7username = "your_mixpanel_username"
8password = "your_mixpanel_password"
9
10composio = Composio()
11
12# Create a new connected account for Mixpanel using Basic Auth
13connection_request = composio.connected_accounts.initiate(
14 user_id=user_id,
15 auth_config_id=mixpanel_auth_config_id,
16 config=auth_scheme.basic_auth(
17 username=username,
18 password=password
19 )
20)
21
22# Basic authentication is immediate - no redirect needed
23print(f"Successfully connected Mixpanel for user {user_id}")
24
25# You can verify the connection using:
26# connected_account = composio.connected_accounts.get(user_id=user_id, app_id="MIXPANEL")

Tools

Executing tools

To prototype you can execute some tools to see the responses and working on the Mixpanel toolkit’s playground

For code examples, see the Tool calling guide and Provider examples.

Tool List

Tool Name: Get Aggregated Event Property Values

Description

Get unique, total, or average data for a single event and property over days, weeks, or months. The Query API has a rate limit of 60 queries per hour and a maximum of 5 concurrent queries.

Action Parameters

event
stringRequired
format
Defaults to json
from_date
interval
limit
Defaults to 255
name
stringRequired
project_id
integerRequired
to_date
type
stringRequired
unit
stringRequired
values
workspace_id

Action Response

data
objectRequired
error
legend_size
integerRequired
successful
booleanRequired

Tool Name: Aggregate Event Counts

Description

Tool to get unique, total, or average data for events over N days, weeks, or months. Use when analyzing event trends and patterns over time with different aggregation methods.

Action Parameters

event
stringRequired
format
from_date
interval
project_id
stringRequired
to_date
type
stringRequired
unit
stringRequired
workspace_id

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Get Aggregate Events

Description

Get aggregate event counts over time. Supports different types of aggregation: general, unique, average, sum.

Action Parameters

event
events
from_date
stringRequired
interval
limit
project_id
integerRequired
to_date
stringRequired
type
stringDefaults to general
unit
stringDefaults to day
where
workspace_id

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: List Saved Cohorts

Description

Tool to list all saved cohorts in a Mixpanel project. Use when you need to retrieve cohort metadata including name, id, count, description, creation date, and visibility. The Query API has a rate limit of 60 queries per hour and a maximum of 5 concurrent queries.

Action Parameters

project_id
integerRequired
workspace_id

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Create Annotation Tag

Description

Tool to create a new annotation tag in Mixpanel using the provided name. Use when you need to create tags for organizing and categorizing annotations. Requires a role of at least Analyst.

Action Parameters

name
stringRequired
project_id
stringRequired

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Create Service Account

Description

Tool to create a new service account for your organization and optionally add it to projects. Use when you need to generate API credentials for programmatic access. The response includes a token (secret) that cannot be recovered after creation. Requires service account with admin or owner role.

Action Parameters

expires
organization_id
stringRequired
projects
role
username
stringRequired

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Delete Group

Description

Tool to permanently delete a group profile from Mixpanel Group Analytics. Use when you need to completely remove a group profile and all of its properties. The deletion is permanent and cannot be undone. Note that group properties on historical events remain intact even after group deletion.

Action Parameters

group_id
stringRequired
group_key
stringRequired
time
token
stringRequired

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Delete Profile

Description

Tool to permanently delete a user profile from Mixpanel, along with all of its properties. Use when you need to completely remove a profile. The deletion is permanent and cannot be undone. Note that this only deletes the profile, not the associated events. For duplicate profiles, use $ignore_alias: true to avoid deleting the original profile.

Action Parameters

distinct_id
stringRequired
ignore_alias
ignore_time
ip
token
stringRequired

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Get All Projects

Description

Get all projects associated with the authenticated Mixpanel account. Returns project details including name, permissions, role, domain, and other configuration details.

Action Parameters

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Get Annotation Tags

Description

Tool to get all annotation tags from a Mixpanel project. Use when you need to retrieve tags that have been added to annotations. Requires a role of at least Analyst.

Action Parameters

project_id
stringRequired

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Batch Update Group Profiles

Description

Tool to send a batch of group profile updates to Mixpanel. Use when you need to update multiple group profiles in a single request. Supports operations like $set, $set_once, $add, $union, $remove, $unset, and $delete.

Action Parameters

data
arrayRequired
response_format

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Delete Group Properties

Description

Tool to delete specific properties from a Mixpanel group profile. Use when you need to permanently remove unwanted properties from a group (company, organization, team, etc.). The operation uses the $unset operation to permanently remove the specified properties.

Action Parameters

group_id
stringRequired
group_key
stringRequired
properties
arrayRequired
token
stringRequired

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Set Group Properties (Batch)

Description

Tool to send batch group profile updates to Mixpanel. Use when you need to update properties for one or more groups (companies, organizations, teams, etc.). Supports multiple operations: $set (update/add), $set_once (set if not exists), $unset (delete), $remove (remove from list), $union (add to list uniquely).

Action Parameters

groups
arrayRequired

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Create Identity Alias

Description

Tool to create an alias mapping between two distinct IDs in Mixpanel. Use when you need to link a new identifier with an existing one. This is only available for projects using the Original ID Merge system and Legacy ID Management System; it has no effect in the Simplified ID Merge system. Typically called once during user signup to connect anonymous pre-signup events with post-signup activity. Each alias can only map to one distinct_id.

Action Parameters

alias
stringRequired
distinct_id
stringRequired
token
stringRequired

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Execute JQL Query

Description

Execute a custom JQL (JavaScript Query Language) query against Mixpanel's Query API. Key Constraints: - 60 queries/hour, max 5 concurrent queries. - 2-minute execution timeout. - 5 GB data processing limit, 2 GB output limit. - No remote network requests (XMLHttpRequest) are allowed inside the JQL script.

Action Parameters

params
project_id
integerRequired
script
stringRequired
workspace_id

Action Response

data
Required
error
successful
booleanRequired

Tool Name: List Saved Cohorts

Description

Get list of all cohorts in a Mixpanel project. Returns cohort details including name, id, count, description, creation date, and visibility. The Query API has a rate limit of 60 queries per hour and a maximum of 5 concurrent queries.

Action Parameters

project_id
integerRequired
workspace_id

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: List Saved Funnels

Description

Get the names and funnel_ids of your funnels. The Query API has a rate limit of 60 queries per hour and a maximum of 5 concurrent queries.

Action Parameters

project_id
integerRequired
workspace_id

Action Response

data
arrayRequired
error
successful
booleanRequired

Tool Name: List Saved Cohorts

Description

Tool to list all saved cohorts in a Mixpanel project. Use when you need to retrieve cohort metadata including name, id, count, description, creation date, and visibility for every cohort in the project.

Action Parameters

project_id
integerRequired

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: List Service Accounts

Description

Tool to list all service accounts for an organization. Use when you need to retrieve service accounts, check when they were last used, or see when they expire. Requires service account with admin or owner role.

Action Parameters

organization_id
stringRequired

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Append to Profile List Property

Description

Tool to append values to list properties on user profiles in Mixpanel. Use when you need to add items to list-type properties. Unlike $union, $append allows duplicate values. If the property doesn't exist, it creates a new list with the value as the first element.

Action Parameters

data
arrayRequired
verbose

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Update Multiple Profiles (Batch)

Description

Tool to update multiple user profiles in Mixpanel in a single batch request. Use when you need to update properties for multiple users efficiently. Supports operations: $set (update/add), $set_once (set if not exists), $add (increment), $union (add to list uniquely), $append (append to list), $remove (remove from list), $unset (delete property), $delete (delete profile). Maximum 50 updates per request. Always check the response status and failed_records for individual update failures.

Action Parameters

profiles
arrayRequired

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Delete Profile Property

Description

Tool to permanently delete properties from a user profile in Mixpanel. Use when you need to remove specific properties and their values from a profile. This operation uses $unset and permanently removes properties that cannot be recovered. Useful when cleaning up properties or approaching Mixpanel's limit of 2000 properties per profile.

Action Parameters

distinct_id
stringRequired
ignore_alias
ignore_time
ip
time
token
stringRequired
unset
arrayRequired

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Get Profile Event Activity

Description

Get event activity feed for specified users from Mixpanel Query API. The Query API has a rate limit of 60 queries per hour and a maximum of 5 concurrent queries.

Action Parameters

distinct_ids
arrayRequired
from_date
stringRequired
project_id
integerRequired
to_date
stringRequired
workspace_id

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Increment Profile Numerical Property

Description

Tool to increment or decrement numerical properties on user profiles in Mixpanel. Use when you need to add values to existing numerical properties (e.g., login counts, points, credits). Properties are incremented by the specified amount. If a property doesn't exist, the value is added to zero. Use negative values to decrement properties.

Action Parameters

$add
objectRequired
$distinct_id
stringRequired
$ignore_time
$ip
$time
$token
stringRequired
verbose

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Remove from Profile List Property

Description

Tool to remove values from list properties on user profiles in Mixpanel. Use when you need to remove specific items from list-type properties. If the value doesn't exist in the list, no updates are made. If the property doesn't exist or is not list-valued, the operation is ignored.

Action Parameters

data
arrayRequired
verbose

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Set Profile Properties

Description

Tool to set user profile properties in Mixpanel using the $set operation. Use when you need to create or update properties on a user profile. Properties specified will be created if they don't exist, or overwritten if they do. If the profile doesn't exist, it will be created with these properties.

Action Parameters

distinct_id
stringRequired
ignore_time
ip
set_properties
objectRequired
time
token
stringRequired

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Query Activity Stream

Description

Tool to retrieve the activity feed/event stream for specified users from Mixpanel. Use when you need to view the chronological sequence of events performed by one or more users within a specific date range. The Query API enforces a rate limit of 60 queries per hour and a maximum of 5 concurrent queries.

Action Parameters

distinct_ids
arrayRequired
from_date
stringRequired
project_id
integerRequired
to_date
stringRequired
workspace_id

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Query Frequency Report

Description

Get data about how frequently users are performing events. The Query API has a rate limit of 60 queries per hour and a maximum of 5 concurrent queries. Example response with unit="day" and addiction_unit="hour": { "2012-01-01": [305, 107, 60, 41, ...], # Users who did event in 1+ hours, 2+ hours, etc. "2012-01-02": [495, 204, 117, 77, ...], "2012-01-03": [671, 324, 176, 122, ...] }

Action Parameters

addiction_unit
stringRequired
event
from_date
stringRequired
limit
on
project_id
integerRequired
to_date
stringRequired
unit
stringRequired
where
workspace_id

Action Response

computed_at
stringRequired
data
objectRequired
error
metadata
objectRequired
successful
booleanRequired

Tool Name: Query Saved Funnel

Description

Get data for a funnel. The Query API has a rate limit of 60 queries per hour and a maximum of 5 concurrent queries.

Action Parameters

from_date
stringRequired
funnel_id
integerRequired
interval
Defaults to 1
length
length_unit
limit
Defaults to 255
on
project_id
integerRequired
to_date
stringRequired
unit
where
workspace_id

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Query Saved Insight

Description

Get data from your Insights reports. The Query API has a rate limit of 60 queries per hour and a maximum of 5 concurrent queries.

Action Parameters

bookmark_id
integerRequired
project_id
integerRequired
workspace_id

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Get Top Event Names (Last 31 Days)

Description

Get a list of the most common event names over the last 31 days. The Query API has a rate limit of 60 queries per hour and a maximum of 5 concurrent queries. Use when you need to discover what events are being tracked most frequently in your project.

Action Parameters

limit
Defaults to 255
project_id
integerRequired
type
stringRequired
workspace_id

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Query Numeric Average Report

Description

Averages an expression for events per unit time. The Query API has a rate limit of 60 queries per hour and a maximum of 5 concurrent queries. Example response: { "status": "ok", "results": { "2024-01-01": 25.5, "2024-01-02": 32.75, "2024-01-03": 28.25 } }

Action Parameters

event
stringRequired
from_date
stringRequired
on
stringRequired
project_id
integerRequired
to_date
stringRequired
unit
Defaults to day
where
workspace_id

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Query Numeric Segmentation Report

Description

Get data for an event, segmented and filtered by properties, with values placed into numeric buckets. The Query API has a rate limit of 60 queries per hour and a maximum of 5 concurrent queries.

Action Parameters

event
stringRequired
from_date
stringRequired
on
stringRequired
project_id
integerRequired
to_date
stringRequired
type
Defaults to day
unit
Defaults to day
where
workspace_id

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Query Numeric Sum Report

Description

Sums an expression for events per unit time. The Query API has a rate limit of 60 queries per hour and a maximum of 5 concurrent queries. Example response: { "status": "ok", "computed_at": "2024-01-20T12:00:00", "results": { "2024-01-01": 150.5, "2024-01-02": 245.75, "2024-01-03": 198.25 } }

Action Parameters

event
stringRequired
from_date
stringRequired
on
stringRequired
project_id
integerRequired
to_date
stringRequired
unit
Defaults to day
where
workspace_id

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Query Profiles

Description

Query user or group profile data from Mixpanel. Returns list of profiles that match specified parameters. The Query API has a rate limit of 60 queries per hour and a maximum of 5 concurrent queries.

Action Parameters

as_of_timestamp
behaviors
data_group_id
distinct_id
distinct_ids
filter_by_cohort
include_all_users
Defaults to True
output_properties
page
project_id
integerRequired
session_id
where
workspace_id

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Query Retention Report

Description

Get cohort analysis data. The Query API has a rate limit of 60 queries per hour and a maximum of 5 concurrent queries.

Action Parameters

born_event
born_where
event
from_date
stringRequired
interval
Defaults to 1
interval_count
Defaults to 1
limit
on
project_id
integerRequired
retention_type
stringDefaults to birth
to_date
stringRequired
unbounded_retention
unit
Defaults to day
where
workspace_id

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Query Segmentation Report

Description

Get data for an event, segmented and filtered by properties. The Query API has a rate limit of 60 queries per hour and a maximum of 5 concurrent queries.

Action Parameters

event
stringRequired
from_date
stringRequired
interval
limit
Defaults to 60
on
project_id
integerRequired
to_date
stringRequired
type
Defaults to general
unit
Defaults to day
where
workspace_id

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Query Top Events

Description

Get the top events for today, with their counts and the normalized percent change from yesterday. Use when you need to analyze today's event performance compared to yesterday.

Action Parameters

limit
Defaults to 100
project_id
integerRequired
type
stringRequired
workspace_id

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Numeric Bucket Segmentation Query

Description

Tool to get event data numerically bucketed by property values. Use when you need to analyze distributions of numeric properties like revenue, session duration, or counts with automatic bucketing.

Action Parameters

bucket_size
event
stringRequired
from_date
stringRequired
on
stringRequired
project_id
integerRequired
to_date
stringRequired
type
Defaults to general
unit
where
workspace_id

Action Response

data
objectRequired
error
legend_size
successful
booleanRequired

Tool Name: Get Today’s Top Events

Description

Get the top events for today, with their counts and the normalized percent change from yesterday. The Query API has a rate limit of 60 queries per hour and a maximum of 5 concurrent queries.

Action Parameters

limit
Defaults to 100
project_id
integerRequired
type
stringRequired
workspace_id

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Get Top Event Properties

Description

Get the top property names for an event. The Query API has a rate limit of 60 queries per hour and a maximum of 5 concurrent queries.

Action Parameters

event
stringRequired
limit
Defaults to 10
project_id
integerRequired
workspace_id

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Get Top Event Property Values

Description

Tool to get the top values for a property ordered by frequency. Use when you need to understand the most common values for a specific property on an event. The Query API has a rate limit of 60 queries per hour and a maximum of 5 concurrent queries.

Action Parameters

event
stringRequired
limit
Defaults to 255
name
stringRequired
project_id
integerRequired
workspace_id

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Get Top Events

Description

Get a list of the most common events over the last 31 days. The Query API has a rate limit of 60 queries per hour and a maximum of 5 concurrent queries.

Action Parameters

limit
Defaults to 255
project_id
integerRequired
type
stringRequired
workspace_id

Action Response

data
arrayRequired
error
successful
booleanRequired