Skip to content
Scalekit Docs

Connect AI agents to Mixpanel Compliance

scalekit5 toolsBearer TokenAnalytics

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.

  1. Terminal window
    npm install @scalekit-sdk/node dotenv

    Full SDK reference: Node.js | Python

  2. 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. Register your Mixpanel Compliance credentials with Scalekit so it can authenticate requests on your behalf. You do this once per environment.

    Dashboard setup steps

    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 — 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 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 them via the dashboard for testing, or via the Scalekit API in production.

      Via dashboard (for testing)

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

      Via API (for production)

      // US region (default) — omit `domain` or set it to 'mixpanel.com/api'
      await scalekit.connect.upsertConnectedAccount({
      connectionName: 'mixpanelcompliance',
      identifier: 'user@example.com',
      credentials: {
      token: 'your-gdpr-compliance-token',
      domain: 'mixpanel.com/api',
      },
      })
      // EU region
      await scalekit.connect.upsertConnectedAccount({
      connectionName: 'mixpanelcompliance',
      identifier: 'eu-user@example.com',
      credentials: {
      token: 'your-eu-gdpr-compliance-token',
      domain: 'eu.mixpanel.com/api',
      },
      })
  4. quickstart.mts
    import { ScalekitClient } from '@scalekit-sdk/node'
    import 'dotenv/config'
    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'
    // 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

Connect this agent connector to let your agent:

  • Status gdpr retrieval, gdpr deletion — Check the status of a GDPR/CCPA data retrieval (Subject Access Request) previously created with ‘mixpanelcompliance_gdpr_retrieval_create’
  • Create gdpr retrieval, gdpr deletion — Create a GDPR or CCPA Subject Access Request (SAR) for one or more Mixpanel distinct_ids
  • Cancel gdpr deletion — Cancel a pending GDPR/CCPA data deletion request before Mixpanel begins permanently erasing the data

Use the exact tool names from the Tool list below when you call execute_tool. If you’re not sure which name to use, list the tools available for the current user first.

mixpanelcompliance_gdpr_deletion_cancel#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.2 params

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.

NameTypeRequiredDescription
project_tokenstringrequiredYour 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_idstringrequiredThe tracking ID returned by 'mixpanelcompliance_gdpr_deletion_create' when the deletion request was created.
mixpanelcompliance_gdpr_deletion_create#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.3 params

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.

NameTypeRequiredDescription
distinct_idsarrayrequiredThe 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_tokenstringrequiredYour 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_typestringoptionalThe privacy regulation this request is being made under. Defaults to 'GDPR' when omitted.
mixpanelcompliance_gdpr_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'.2 params

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

NameTypeRequiredDescription
project_tokenstringrequiredYour 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_idstringrequiredThe tracking ID returned by 'mixpanelcompliance_gdpr_deletion_create' when the deletion request was created.
mixpanelcompliance_gdpr_retrieval_create#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.4 params

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.

NameTypeRequiredDescription
distinct_idsarrayrequiredThe 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_tokenstringrequiredYour 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_typestringoptionalThe privacy regulation this request is being made under. Defaults to 'GDPR' when omitted.
disclosure_typestringoptionalThe category of data to disclose. Required by Mixpanel when compliance_type is CCPA; ignored for GDPR requests.
mixpanelcompliance_gdpr_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.2 params

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.

NameTypeRequiredDescription
project_tokenstringrequiredYour 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_idstringrequiredThe tracking ID returned by 'mixpanelcompliance_gdpr_retrieval_create' when the retrieval request was created.