Skip to content

Cursor

Build workflows with Cursor AI Agents and track usage

To get your API keys, visit the Cursor Dashboard. You may need separate keys for Agents and Admin features.

The Get Daily Usage Data component fetches team usage metrics from Cursor’s Admin API.

  • Usage reporting: Track team productivity and AI usage patterns
  • Cost tracking: Monitor usage-based requests and subscription consumption
  • Analytics dashboards: Build custom dashboards with Cursor usage data
  1. Fetches usage data for the specified date range from Cursor’s Admin API
  2. Returns detailed metrics per user including lines added/deleted, requests, and model usage
  • Start Date: Start of the date range (YYYY-MM-DD format, defaults to 7 days ago)
  • End Date: End of the date range (YYYY-MM-DD format, defaults to today)

The output includes per-user daily metrics:

  • Lines added/deleted (total and accepted)
  • Tab completions shown/accepted
  • Composer, chat, and agent requests
  • Subscription vs usage-based request counts
  • Most used model and file extensions
  • Requires a valid Cursor Admin API key configured in the integration
  • Only returns data for active users
{
"data": [
{
"acceptedLinesAdded": 1102,
"acceptedLinesDeleted": 645,
"agentRequests": 12,
"chatRequests": 128,
"composerRequests": 45,
"date": 1710720000000,
"email": "developer@company.com",
"isActive": true,
"mostUsedModel": "gpt-4",
"subscriptionIncludedReqs": 180,
"totalAccepts": 73,
"totalApplies": 87,
"totalLinesAdded": 1543,
"totalLinesDeleted": 892,
"totalRejects": 14,
"totalTabsAccepted": 289,
"totalTabsShown": 342,
"usageBasedReqs": 5
}
],
"period": {
"endDate": 1710892800000,
"startDate": 1710720000000
}
}

The Get Last Message component retrieves the last message from a Cursor Cloud Agent’s conversation history.

  • Message tracking: Get the latest response or prompt from an agent conversation
  • Workflow automation: Use the last message as input for downstream components
  • Status monitoring: Check what the agent last communicated
  1. Fetches the conversation history for the specified agent ID
  2. Extracts the last message from the conversation
  3. Returns the message details including ID, type (user_message or assistant_message), and text
  • Agent ID: The unique identifier for the cloud agent (e.g., bc_abc123)

The output includes:

  • Agent ID: The identifier of the agent
  • Message: The last message object containing:
    • ID: Unique message identifier
    • Type: Either “user_message” or “assistant_message”
    • Text: The message content
  • Requires a valid Cursor Cloud Agent API key configured in the integration
  • If the agent has been deleted, the conversation cannot be accessed
  • Returns nil if the conversation has no messages
{
"agentId": "bc_abc123",
"message": {
"id": "msg_005",
"text": "I've added a troubleshooting section to the README.",
"type": "assistant_message"
}
}

The Launch Cloud Agent component triggers a Cursor AI coding agent and waits for it to complete.

  • Automated code generation: Generate code from natural language prompts
  • PR fixes: Automatically fix issues on existing pull requests
  • Code refactoring: Refactor code based on instructions
  • Feature implementation: Implement new features from specifications
  1. Launches a Cursor Cloud Agent with the specified prompt and configuration
  2. Waits for the agent to complete (monitored via webhook and polling)
  3. Emits output with the agent result (success or failure)
{
"agentId": "agent_12345",
"branchName": "cursor/agent-550e8400",
"prUrl": "https://github.com/org/repo/pull/42",
"status": "done",
"summary": "Refactored login logic."
}