Manage programmatic access to Mixpanel
curl --request GET \
--url https://mixpanel.com/api/app/organizations/{organizationId}/service-accounts \
--header 'Content-Type: application/json' \
--data '
{
"username": "<string>",
"role": "<string>",
"expires": "<string>",
"projects": [
{
"id": 123,
"service_account_ids": [
{}
]
}
],
"service_account_ids": [
{}
]
}
'Documentation Index
Fetch the complete documentation index at: https://mintlify.com/mixpanel/docs/llms.txt
Use this file to discover all available pages before exploring further.
https://mixpanel.com/api/app
curl "https://mixpanel.com/api/app/organizations/123/service-accounts" \
-u SERVICE_ACCOUNT_USERNAME:SERVICE_ACCOUNT_SECRET
{
"status": "ok",
"results": [
{
"id": 12345,
"username": "api-bot",
"last_used": "2024-01-15T10:30:00Z",
"expires": "2025-01-15T10:30:00Z",
"creator": 789,
"created": "2024-01-01T09:00:00Z",
"user": 12345
}
]
}
owner, admin, analyst, consumer2025-12-31T23:59:59Zcurl "https://mixpanel.com/api/app/organizations/123/service-accounts" \
-X POST \
-u SERVICE_ACCOUNT_USERNAME:SERVICE_ACCOUNT_SECRET \
-H "Content-Type: application/json" \
-d '{
"username": "data-pipeline-bot",
"role": "admin",
"expires": "2025-12-31T23:59:59Z",
"projects": [
{"id": 456, "role": "admin"},
{"id": 789, "role": "analyst"}
]
}'
{
"status": "ok",
"results": {
"id": 12345,
"username": "data-pipeline-bot",
"token": "SECRET_TOKEN_SAVE_THIS",
"last_used": null,
"expires": "2025-12-31T23:59:59Z",
"creator": 789,
"created": "2024-01-15T10:30:00Z",
"user": 12345
}
}
token (secret) is only returned once during creation. Store it securely - it cannot be retrieved later.curl "https://mixpanel.com/api/app/organizations/123/service-accounts/12345" \
-u SERVICE_ACCOUNT_USERNAME:SERVICE_ACCOUNT_SECRET
curl "https://mixpanel.com/api/app/organizations/123/service-accounts/12345" \
-X DELETE \
-u SERVICE_ACCOUNT_USERNAME:SERVICE_ACCOUNT_SECRET
curl "https://mixpanel.com/api/app/organizations/123/service-accounts/add-to-project" \
-X POST \
-u SERVICE_ACCOUNT_USERNAME:SERVICE_ACCOUNT_SECRET \
-H "Content-Type: application/json" \
-d '{
"projects": [
{"id": 456, "role": "admin"},
{"id": 789, "role": "analyst"}
],
"service_account_ids": [12345, 67890]
}'
curl "https://mixpanel.com/api/app/organizations/123/service-accounts/remove-from-project" \
-X POST \
-u SERVICE_ACCOUNT_USERNAME:SERVICE_ACCOUNT_SECRET \
-H "Content-Type: application/json" \
-d '{
"projects": [
{"id": 456, "service_account_ids": [12345]},
{"id": 789, "service_account_ids": [12345, 67890]}
]
}'
Create service accounts for specific purposes
data-pipeline-bot: For data exportsci-cd-bot: For CI/CD integrationsanalytics-dashboard: For custom dashboardsUse least privilege
# Good: Specific role for specific purpose
{
"username": "readonly-reporter",
"projects": [{"id": 123, "role": "consumer"}]
}
Set expiration dates
{
"expires": "2025-12-31T23:59:59Z"
}
Rotate credentials regularly
# 1. Create new service account
# 2. Update applications to use new credentials
# 3. Delete old service account
curl --request GET \
--url https://mixpanel.com/api/app/organizations/{organizationId}/service-accounts \
--header 'Content-Type: application/json' \
--data '
{
"username": "<string>",
"role": "<string>",
"expires": "<string>",
"projects": [
{
"id": 123,
"service_account_ids": [
{}
]
}
],
"service_account_ids": [
{}
]
}
'