Skip to content
Scalekit Docs
Talk to an Engineer Dashboard

Connect AI agents to Mixpanel Ingestion

Scalekit connector
Open markdown

The Mixpanel Ingestion connector lets your AI agent work with Mixpanel Ingestion. You connect it once with a service account, and Scalekit authenticates every call, so your agent never handles credentials. It comes with 25 tools.

Tools
25
What they doRead · write · destructive
3 · 19 · 33 read19 write3 destructive
Users sign in with

Setup

  1. Install the SDK

    Terminal window
    npm install @scalekit-sdk/node dotenv
  2. Set your credentials

    Add your Scalekit credentials to your .env file. Find values in app.scalekit.com > Developers > API Credentials.

    .env
    SCALEKIT_ENVIRONMENT_URL=<your-environment-url>
    SCALEKIT_CLIENT_ID=<your-client-id>
    SCALEKIT_CLIENT_SECRET=<your-client-secret>
  3. Create the Mixpanel Ingestion connection

    In AgentKit > Connections, create a Mixpanel Ingestion connection. The name you give it is the connection_name your code passes. See Configure connections.

    Console steps with screenshots

    Register your Mixpanel Service Account username and secret with Scalekit so it can authenticate and proxy requests on behalf of your users. Mixpanel uses HTTP Basic Auth — the Service Account username is the username and the secret is the password. There is no redirect URI or OAuth flow.

    1. Find your Mixpanel data residency region

      Mixpanel hosts projects in three separate data residency regions. Before generating a Service Account, confirm which region your project lives in:

      RegionAPI host
      United States (default)mixpanel.com/api
      European Unioneu.mixpanel.com/api
      Indiain.mixpanel.com/api
    2. Create a Service Account

      • Sign in to Mixpanel and go to Settings → Project → Service Accounts.

      • Click Add Service Account, give it a name (for example, Agent Auth), and choose a role.

      • Copy the generated Username and Secret immediately — Mixpanel shows the secret only once.

        Mixpanel Add Service Account modal showing the generated Username and Secret fields

    3. Create a connection in Scalekit

      • In the Scalekit dashboard, go to AgentKit → Connections → Create Connection.
      • Search for Mixpanel Ingestion and click Create.
      • Note the Connection name — use this as connection_name in your code (e.g., mixpanelingestion).
    4. Add a connected account

      Connected accounts link a specific user identifier in your system to a Mixpanel Service Account and region. Add one in the dashboard to test. In production, each user adds their own through the authorization link: they enter their credentials on the page it opens.

      In the dashboard, to test

      • Open the connection and click the Connected Accounts tab → Add account.
      • Fill in Your User’s ID, the Username, Secret, and select the matching Data Residency.
      • Click Save.

      From your backend, if your app already has the credentials

      For example, when users enter them on a settings page in your app:

      import { ConnectorStatus } from '@scalekit-sdk/node'
      // Upsert the account, then make sure it is ACTIVE before the first tool call.
      async function connectUser(connectionName, identifier, details) {
      const authorizationDetails = { details: { case: 'staticAuth', value: { details } } }
      let { connectedAccount } = await scalekit.actions.upsertConnectedAccount({
      connectionName,
      identifier,
      authorizationDetails,
      })
      if (connectedAccount?.status !== ConnectorStatus.ACTIVE) {
      ;({ connectedAccount } = await scalekit.actions.upsertConnectedAccount({
      connectionName,
      identifier,
      authorizationDetails,
      }))
      }
      return connectedAccount
      }
      // US region (default) — omit `domain` or set it to 'mixpanel.com/api'
      await connectUser('mixpanelingestion', 'user_123', {
      username: 'your-service-account-username',
      password: 'your-service-account-secret',
      domain: 'mixpanel.com/api',
      })
      // EU region
      await connectUser('mixpanelingestion', 'user_123', {
      username: 'your-eu-service-account-username',
      password: 'your-eu-service-account-secret',
      domain: 'eu.mixpanel.com/api',
      })

Tools

Pass the exact name to execute_tool
Try in PlaygroundRequest a tool
  • mixpanelingestion_feature_flags_definitionsGet the full definitions of every feature flag/experiment configured in a Mixpanel project, including each flag's variants, rollout rules, and linked experiment.Read-only

    Get Feature Flag Definitions

    Get the full definitions of every feature flag/experiment configured in a Mixpanel project, including each flag's variants, rollout rules, and linked experiment. Provide either 'project_token' or 'project_id' to authenticate (project_id uses your Service Account credentials).

    Inputs

    project_idstring
    Your numeric Mixpanel Project ID, used if authenticating with a Service Account. Provide this or 'project_token'.
    project_tokenstring
    Your Mixpanel Project Token, used if authenticating without a Service Account. Provide this or 'project_id'.
  • mixpanelingestion_feature_flags_evaluateEvaluate all enabled Mixpanel feature flags and experiments for a given user, returning the variant each flag assigns them.Read-only

    Evaluate Feature Flags

    Evaluate all enabled Mixpanel feature flags and experiments for a given user, returning the variant each flag assigns them. Provide either 'project_token' or 'project_id' to authenticate (project_id uses your Service Account credentials).

    Inputs

    contextobjectrequired
    JSON object describing the user to evaluate flags for. Must include 'distinct_id'; may include 'device_id' and 'custom_properties' (used for targeting rules). Example: {"distinct_id": "user_00123", "custom_properties": {"plan": "pro"}}.
    project_idstring
    Your numeric Mixpanel Project ID, used if authenticating with a Service Account. Provide this or 'project_token'.
    project_tokenstring
    Your Mixpanel Project Token, used if authenticating without a Service Account. Provide this or 'project_id'.
  • mixpanelingestion_lookup_tables_listList the Lookup Tables defined in a Mixpanel project.Read-only

    List Lookup Tables

    List the Lookup Tables defined in a Mixpanel project. Returns each table's id and name. Use the id with 'mixpanelingestion_lookup_table_replace' to update a table's contents, or find it in Lexicon under the lookup table's details.

    Inputs

    project_idstringrequired
    Your numeric Mixpanel Project ID, required to authenticate Service Account requests. Find it in Mixpanel under Project Settings > Overview.
  • mixpanelingestion_group_batch_updateSend a batch of mixed group-profile updates to Mixpanel in a single call, analogous to 'mixpanelingestion_profile_batch_update' for user profiles.Write

    Batch Update Groups

    Send a batch of mixed group-profile updates to Mixpanel in a single call, analogous to 'mixpanelingestion_profile_batch_update' for user profiles. Each item in 'updates' is a fully-formed update object with its own "$token", "$group_key", "$group_id", and one operation key ($set, $set_once, $add, $union, $remove, $unset, or $delete). Example: [{"$token": "...", "$group_key": "Company", "$group_id": "Acme", "$set": {"Plan": "Enterprise"}}].

    Inputs

    updatesarrayrequired
    Array of fully-formed group update objects, each with $token, $group_key, $group_id, and one operation key ($set/$set_once/$add/$union/$remove/$unset/$delete).
  • mixpanelingestion_group_removeRemove a specific value from a list-valued property on a Mixpanel group profile, analogous to 'mixpanelingestion_profile_remove' for user profiles.Write

    Remove from Group List Property

    Remove a specific value from a list-valued property on a Mixpanel group profile, analogous to 'mixpanelingestion_profile_remove' for user profiles. If the value is not present, no change is made.

    Inputs

    group_idstringrequired
    The value identifying this specific group, e.g. the company name or account ID.
    group_keystringrequired
    The name of the group key as configured in Mixpanel, e.g. "Company" or "Account ID".
    project_tokenstringrequired
    Your Mixpanel Project Token (Project Settings > Overview). Embedded in the payload to authenticate the request.
    removalsobjectrequired
    JSON object mapping list-property names to the single value to remove from each. Example: {"Enabled Features": "beta-search"}.
    ipinteger
    Set to 1 to let Mixpanel geolocate the group profile from the request IP. Recommended to leave at 0 for server-side calls.one of 01default 0
    strictinteger
    Set to 1 to have Mixpanel validate the record and return per-record error messages if validation fails.one of 01
    verboseinteger
    Set to 1 to receive a JSON object describing success/failure instead of a bare "1"/"0".one of 01
  • mixpanelingestion_group_setSet (overwrite) properties on a Mixpanel group profile (e.g.Write

    Set Group Properties

    Set (overwrite) properties on a Mixpanel group profile (e.g. a company or team account), analogous to 'mixpanelingestion_profile_set' for user profiles. Creates the group profile if it does not already exist. Requires Group Analytics to be enabled on your Mixpanel project.

    • Idempotent

    Inputs

    group_idstringrequired
    The value identifying this specific group, e.g. the company name or account ID.
    group_keystringrequired
    The name of the group key as configured in Mixpanel, e.g. "Company" or "Account ID".
    project_tokenstringrequired
    Your Mixpanel Project Token (Project Settings > Overview). Embedded in the payload to authenticate the request.
    propertiesobjectrequired
    JSON object of property names and values to set on the group profile, overwriting any existing values. Example: {"Plan": "Enterprise", "Seats": 50}.
    ipinteger
    Set to 1 to let Mixpanel geolocate the group profile from the request IP. Recommended to leave at 0 for server-side calls.one of 01default 0
    strictinteger
    Set to 1 to have Mixpanel validate the record and return per-record error messages if validation fails.one of 01
    verboseinteger
    Set to 1 to receive a JSON object describing success/failure instead of a bare "1"/"0".one of 01
  • mixpanelingestion_group_set_onceSet properties on a Mixpanel group profile only if they are not already set — existing values are never overwritten, analogous to 'mixpanelingestion_profile_set_once' for user profiles.Write

    Set Group Properties Once

    Set properties on a Mixpanel group profile only if they are not already set — existing values are never overwritten, analogous to 'mixpanelingestion_profile_set_once' for user profiles. Creates the group profile if it does not already exist.

    • Idempotent

    Inputs

    group_idstringrequired
    The value identifying this specific group, e.g. the company name or account ID.
    group_keystringrequired
    The name of the group key as configured in Mixpanel, e.g. "Company" or "Account ID".
    project_tokenstringrequired
    Your Mixpanel Project Token (Project Settings > Overview). Embedded in the payload to authenticate the request.
    propertiesobjectrequired
    JSON object of property names and values to set only if not already present on the group profile. Example: {"First Seen": "2026-01-01"}.
    ipinteger
    Set to 1 to let Mixpanel geolocate the group profile from the request IP. Recommended to leave at 0 for server-side calls.one of 01default 0
    strictinteger
    Set to 1 to have Mixpanel validate the record and return per-record error messages if validation fails.one of 01
    verboseinteger
    Set to 1 to receive a JSON object describing success/failure instead of a bare "1"/"0".one of 01
  • mixpanelingestion_group_unionAdd values to a list-valued property on a Mixpanel group profile, ensuring each value only appears once, analogous to 'mixpanelingestion_profile_union' for user profiles.Write

    Union Group List Property

    Add values to a list-valued property on a Mixpanel group profile, ensuring each value only appears once, analogous to 'mixpanelingestion_profile_union' for user profiles. Creates the group profile if it does not already exist.

    • Idempotent

    Inputs

    group_idstringrequired
    The value identifying this specific group, e.g. the company name or account ID.
    group_keystringrequired
    The name of the group key as configured in Mixpanel, e.g. "Company" or "Account ID".
    project_tokenstringrequired
    Your Mixpanel Project Token (Project Settings > Overview). Embedded in the payload to authenticate the request.
    unionsobjectrequired
    JSON object mapping list-property names to arrays of values to add (duplicates are not re-added). Example: {"Enabled Features": ["beta-search", "dark-mode"]}.
    ipinteger
    Set to 1 to let Mixpanel geolocate the group profile from the request IP. Recommended to leave at 0 for server-side calls.one of 01default 0
    strictinteger
    Set to 1 to have Mixpanel validate the record and return per-record error messages if validation fails.one of 01
    verboseinteger
    Set to 1 to receive a JSON object describing success/failure instead of a bare "1"/"0".one of 01