cursor-docs/latest/content · Jun 26, 20:20 UTC
pages/account/teams/analytics-api.txt
TXT32.2 KB286 lines
route: /docs/account/teams/analytics-api title: Analytics API description: Comprehensive insights into your team's Cursor usage, including AI-assisted coding metrics, active users, model usage, and more. Analytics API The Analytics API provides comprehensive insights into your team's Cursor usage, including AI-assisted coding metrics, active users, model usage, and more. The Analytics API uses Basic Authentication. You must generate an admin-scoped API key (with admin:* scope) from Cursor Dashboard → API Keys. For details on authentication, rate limits, and best practices, see the API Overview. Availability: Only for enterprise teams Available Endpoints Agent Edits GET/analytics/team/agent-edits Get metrics on AI-suggested code edits accepted by your team with Cursor. Parameters startDate string Start date for analytics period (default: 7 days ago). See Date Formats endDate string End date for analytics period (default: today). See Date Formats users string Filter data to specific users (comma-separated emails or user IDs, e.g., [email protected],user_abc123) curl -X GET "https://api.cursor.com/analytics/team/agent-edits" \ -u YOUR_API_KEY: Response: $9e Tab Usage GET/analytics/team/tabs Get metrics on Tab autocomplete usage across your team. Parameters startDate string Start date for analytics period (default: 7 days ago). See Date Formats endDate string End date for analytics period (default: today). See Date Formats users string Filter data to specific users (comma-separated emails or user IDs, e.g., [email protected],user_abc123) curl -X GET "https://api.cursor.com/analytics/team/tabs" \ -u YOUR_API_KEY: Response: $a0 Daily Active Users (DAU) GET/analytics/team/dau Get daily active user counts for your team. DAU is the number of unique users who have used Cursor in a given day. An active user is a user who has used at least one AI feature in Cursor. Response includes DAU breakdown metrics for the Cursor CLI, Cloud Agents, and BugBot. Parameters startDate string Start date for analytics period (default: 7 days ago). See Date Formats endDate string End date for analytics period (default: today). See Date Formats users string Filter data to specific users (comma-separated emails or user IDs, e.g., [email protected],user_abc123) curl -X GET "https://api.cursor.com/analytics/team/dau?startDate=14d&endDate=today" \ -u YOUR_API_KEY: Response: { "data": [ { "date": "2025-01-15", "dau": 42, "cli_dau": 5, "cloud_agent_dau": 37, "bugbot_dau": 10 }, { "date": "2025-01-16", "dau": 38, "cli_dau": 4, "cloud_agent_dau": 34, "bugbot_dau": 12 } ], "params": { "metric": "dau", "teamId": 12345, "startDate": "2025-01-01", "endDate": "2025-01-31" } Client Versions GET/analytics/team/client-versions Get distribution of Cursor client versions used by your team (defaults to last 7 days). We report the latest version for each user per day (if a user has installed multiple versions, we report the latest). Parameters startDate string Start date for analytics period (default: 7 days ago). See Date Formats endDate string End date for analytics period (default: today). See Date Formats users string Filter data to specific users (comma-separated emails or user IDs, e.g., [email protected],user_abc123) curl -X GET "https://api.cursor.com/analytics/team/client-versions" \ -u YOUR_API_KEY: Response: { "data": [ { "event_date": "2025-01-01", "client_version": "0.42.3", "user_count": 35, "percentage": 0.833 }, { "event_date": "2025-01-01", "client_version": "0.42.2", "user_count": 7, "percentage": 0.167 } ], "params": { "metric": "client-versions", "teamId": 12345, "startDate": "2025-01-01", "endDate": "2025-01-31" } Model Usage GET/analytics/team/models Get metrics on AI model usage across your team. Parameters startDate string Start date for analytics period (default: 7 days ago). See Date Formats endDate string End date for analytics period (default: today). See Date Formats users string Filter data to specific users (comma-separated emails or user IDs, e.g., [email protected],user_abc123) curl -X GET "https://api.cursor.com/analytics/team/models" \ -u YOUR_API_KEY: Response: { "data": [ { "date": "2025-01-15", "model_breakdown": { "claude-sonnet-4.5": { "messages": 1250, "users": 28 }, "gpt-4o": { "messages": 450, "users": 15 }, "claude-opus-4.5": { "messages": 320, "users": 12 } }, { "date": "2025-01-16", "model_breakdown": { "claude-sonnet-4.5": { "messages": 1180, "users": 26 }, "gpt-4o": { "messages": 420, "users": 14 } ], "params": { "metric": "models", "teamId": 12345, "startDate": "2025-01-01", "endDate": "2025-01-31" } Top File Extensions GET/analytics/team/top-file-extensions Get the most frequently edited files across your team in Cursor. Returns the top 5 file extensions per day by suggestion volume. Parameters startDate string Start date for analytics period (default: 7 days ago). See Date Formats endDate string End date for analytics period (default: today). See Date Formats users string Filter data to specific users (comma-separated emails or user IDs, e.g., [email protected],user_abc123) curl -X GET "https://api.cursor.com/analytics/team/top-file-extensions?startDate=30d&endDate=today" \ -u YOUR_API_KEY: Response: { "data": [ { "event_date": "2025-01-15", "file_extension": "tsx", "total_files": 156, "total_accepts": 98, "total_rejects": 45, "total_lines_suggested": 3230, "total_lines_accepted": 2340, "total_lines_rejected": 890 }, { "event_date": "2025-01-15", "file_extension": "ts", "total_files": 142, "total_accepts": 89, "total_rejects": 38, "total_lines_suggested": 2850, "total_lines_accepted": 2100, "total_lines_rejected": 750 } ], "params": { "metric": "top-files", "teamId": 12345, "startDate": "2025-01-01", "endDate": "2025-01-31" } MCP Adoption GET/analytics/team/mcp Get metrics on MCP (Model Context Protocol) tool adoption across your team. Returns daily adoption counts broken down by tool name and MCP server name. Parameters startDate string Start date for analytics period (default: 7 days ago). See Date Formats endDate string End date for analytics period (default: today). See Date Formats users string Filter data to specific users (comma-separated emails or user IDs, e.g., [email protected],user_abc123) curl -X GET "https://api.cursor.com/analytics/team/mcp" \ -u YOUR_API_KEY: Response: { "data": [ { "event_date": "2025-01-15", "tool_name": "read_file", "mcp_server_name": "filesystem", "usage": 245 }, { "event_date": "2025-01-15", "tool_name": "search_web", "mcp_server_name": "brave-search", "usage": 128 }, { "event_date": "2025-01-16", "tool_name": "read_file", "mcp_server_name": "filesystem", "usage": 231 } ], "params": { "metric": "mcp", "teamId": 12345, "startDate": "2025-01-01", "endDate": "2025-01-31" } Commands Adoption GET/analytics/team/commands Get metrics on Cursor command adoption across your team. Returns daily adoption counts broken down by command name. Parameters startDate string Start date for analytics period (default: 7 days ago). See Date Formats endDate string End date for analytics period (default: today). See Date Formats users string Filter data to specific users (comma-separated emails or user IDs, e.g., [email protected],user_abc123) curl -X GET "https://api.cursor.com/analytics/team/commands" \ -u YOUR_API_KEY: Response: { "data": [ { "event_date": "2025-01-15", "command_name": "explain", "usage": 89 }, { "event_date": "2025-01-15", "command_name": "refactor", "usage": 45 }, { "event_date": "2025-01-16", "command_name": "explain", "usage": 92 } ], "params": { "metric": "commands", "teamId": 12345, "startDate": "2025-01-01", "endDate": "2025-01-31" } Plans Adoption GET/analytics/team/plans Get metrics on Plan mode adoption across your team. Returns daily adoption counts broken down by AI model used for plan generation. The API returns default as the model name when a user has the Auto model selection enabled. This corresponds to what users see as "Auto" in the Cursor UI. Parameters startDate string Start date for analytics …