Skip to content
Scalekit Docs
Talk to an Engineer Dashboard

Connect AI agents to Mixpanel Compliance

Scalekit connector
Open markdown

The Mixpanel Compliance connector lets your AI agent act in each user's Mixpanel Compliance account. Each user connects their own Mixpanel Compliance access token once, and Scalekit sends it with every call, so your agent never handles credentials. It comes with 5 tools.

Tools
5
What they doRead · write · destructive
2 · 2 · 12 read2 write1 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 Compliance connection

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

    Console steps with screenshots

    Register your Mixpanel GDPR/CCPA compliance token with Scalekit so it can authenticate and proxy data deletion and retrieval requests on behalf of your users. This connector uses a Bearer token.

    1. Find your Mixpanel data residency region

      Mixpanel hosts projects in three separate data residency regions. Before generating a token, 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. Get your GDPR compliance token

      • Sign in to Mixpanel and go to Settings → Profile → Data & Privacy.

      • Under GDPR API, copy the OAuth Token for GDPR APIs. If none exists yet, click Reset to generate one.

        Mixpanel Data & Privacy settings page showing the GDPR API OAuth Token field

    3. Create a connection in Scalekit

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

      Connected accounts link a specific user identifier in your system to a GDPR compliance token 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 GDPR Token, 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('mixpanelcompliance', 'user_123', {
      token: 'your-gdpr-compliance-token',
      domain: 'mixpanel.com/api',
      })
      // EU region
      await connectUser('mixpanelcompliance', 'user_123', {
      token: 'your-eu-gdpr-compliance-token',
      domain: 'eu.mixpanel.com/api',
      })
  4. Authorize a user and make your first call

    quickstart.mts
    import { ScalekitClient } from '@scalekit-sdk/node'
    import 'dotenv/config'
    import { createInterface } from 'node:readline/promises'
    const scalekit = new ScalekitClient(
    process.env.SCALEKIT_ENVIRONMENT_URL,
    process.env.SCALEKIT_CLIENT_ID,
    process.env.SCALEKIT_CLIENT_SECRET,
    )
    const actions = scalekit.actions
    const connector = 'mixpanelcompliance'
    const identifier = 'user_123'
    // Generate an authorization link for the user
    const { link } = await actions.getAuthorizationLink({ connectionName: connector, identifier })
    console.log('Authorize Mixpanel Compliance:', link)
    const rl = createInterface({ input: process.stdin, output: process.stdout })
    await rl.question('Press Enter after authorizing...')
    rl.close()
    // Make your first call
    const result = await actions.executeTool({
    connector,
    identifier,
    toolName: 'mixpanelcompliance_gdpr_deletion_status',
    toolInput: { tracking_id: 'YOUR_TRACKING_ID', project_token: 'YOUR_PROJECT_TOKEN' },
    })
    console.log(result)
    Terminal window
    npx tsx quickstart.mts

    Each user opens the link once and enters their Mixpanel credentials there. If your app already has a user's credentials, add the account from your backend instead, as the console steps above show. See Authorize a user for the full flow and statuses.

Tools

Pass the exact name to execute_tool
Try in PlaygroundRequest a tool
  • mixpanelcompliance_gdpr_deletion_statusCheck the status of a GDPR/CCPA data deletion request previously created with 'mixpanelcompliance_gdpr_deletion_create'.Read-only

    Get Data Deletion Status

    Check the status of a GDPR/CCPA data deletion request previously created with 'mixpanelcompliance_gdpr_deletion_create'. The response's status field is one of: PENDING, STAGING, STARTED, SUCCESS, FAILURE, REVOKED, NOT_FOUND, or UNKNOWN. Deletions can take up to 30 days to reach SUCCESS. While a request is still PENDING or STAGING it may still be cancellable via 'mixpanelcompliance_gdpr_deletion_cancel'.

    Inputs

    project_tokenstringrequired
    Your Mixpanel Project Token (Project Settings > Overview), identifying which project to check this request against. Sent as the 'token' query parameter. This is distinct from the GDPR Compliance Token used to authenticate this connection.
    tracking_idstringrequired
    The tracking ID returned by 'mixpanelcompliance_gdpr_deletion_create' when the deletion request was created.
  • mixpanelcompliance_gdpr_retrieval_statusCheck the status of a GDPR/CCPA data retrieval (Subject Access Request) previously created with 'mixpanelcompliance_gdpr_retrieval_create'.Read-only

    Get Data Retrieval Status

    Check the status of a GDPR/CCPA data retrieval (Subject Access Request) previously created with 'mixpanelcompliance_gdpr_retrieval_create'. The response's status field is one of: PENDING, STAGING, STARTED, SUCCESS, FAILURE, REVOKED, NOT_FOUND, or UNKNOWN. Poll this until the status reaches SUCCESS (the export is ready), FAILURE, or REVOKED.

    Inputs

    project_tokenstringrequired
    Your Mixpanel Project Token (Project Settings > Overview), identifying which project to check this request against. Sent as the 'token' query parameter. This is distinct from the GDPR Compliance Token used to authenticate this connection.
    tracking_idstringrequired
    The tracking ID returned by 'mixpanelcompliance_gdpr_retrieval_create' when the retrieval request was created.
  • mixpanelcompliance_gdpr_deletion_cancelCancel a pending GDPR/CCPA data deletion request before Mixpanel begins permanently erasing the data.Write

    Cancel Data Deletion Request

    Cancel a pending GDPR/CCPA data deletion request before Mixpanel begins permanently erasing the data. Returns no content on success. Cancellation can fail once the deletion has already progressed too far to stop — check 'mixpanelcompliance_gdpr_deletion_status' first if you're unsure, and be prepared for this call to be rejected once a deletion is underway.

    • Idempotent

    Inputs

    project_tokenstringrequired
    Your Mixpanel Project Token (Project Settings > Overview), identifying which project this request applies to. Sent as the 'token' query parameter. This is distinct from the GDPR Compliance Token used to authenticate this connection.
    tracking_idstringrequired
    The tracking ID returned by 'mixpanelcompliance_gdpr_deletion_create' when the deletion request was created.
  • mixpanelcompliance_gdpr_retrieval_createCreate a GDPR or CCPA Subject Access Request (SAR) for one or more Mixpanel distinct_ids.Write

    Create Data Retrieval Request

    Create a GDPR or CCPA Subject Access Request (SAR) for one or more Mixpanel distinct_ids. Mixpanel asynchronously compiles an export of every event and profile property it holds for the given distinct_ids so you can fulfill a data subject's access request. This call only queues the export — use 'mixpanelcompliance_gdpr_retrieval_status' with the returned tracking_id to poll for completion and get the download details.

    Inputs

    distinct_idsarrayrequired
    The Mixpanel distinct_ids to retrieve all held data for. Mixpanel accepts at most 2000 distinct_ids per retrieval request — split larger batches into multiple calls.
    project_tokenstringrequired
    Your Mixpanel Project Token (Project Settings > Overview), identifying which project to run this request against. Sent as the 'token' query parameter. This is distinct from the GDPR Compliance Token used to authenticate this connection.
    compliance_typestring
    The privacy regulation this request is being made under. Defaults to 'GDPR' when omitted.one of GDPRCCPAdefault GDPR
    disclosure_typestring
    The category of data to disclose. Required by Mixpanel when compliance_type is CCPA; ignored for GDPR requests.one of DataCategoriesSources
  • mixpanelcompliance_gdpr_deletion_createPermanently delete ALL data Mixpanel holds for the given distinct_ids — every event and profile property, across all time.Destructive

    Create Data Deletion Request

    Permanently delete ALL data Mixpanel holds for the given distinct_ids — every event and profile property, across all time. This is irreversible once processing completes, and per Mixpanel's GDPR/CCPA documentation it can take up to 30 days to fully propagate through Mixpanel's systems. Only call this to fulfill a genuine right-to-erasure request — never speculatively or for testing. Use 'mixpanelcompliance_gdpr_deletion_status' with the returned tracking_id to monitor progress, and 'mixpanelcompliance_gdpr_deletion_cancel' to attempt to stop it before processing starts.

    Inputs

    distinct_idsarrayrequired
    The Mixpanel distinct_ids whose data will be PERMANENTLY deleted. This cannot be undone. Mixpanel accepts at most 1999 distinct_ids per deletion request — split larger batches into multiple calls.
    project_tokenstringrequired
    Your Mixpanel Project Token (Project Settings > Overview), identifying which project to run this request against. Sent as the 'token' query parameter. This is distinct from the GDPR Compliance Token used to authenticate this connection.
    compliance_typestring
    The privacy regulation this request is being made under. Defaults to 'GDPR' when omitted.one of GDPRCCPAdefault GDPR