The Admin API lets you programmatically access your team’s data, including member information, usage metrics, and spending details. Build custom dashboards, monitoring tools, or integrate with existing workflows.
The API is in its first release. We’re expanding capabilities based on feedback - let us know what endpoints you need!

Authentication

All API requests require authentication using an API key. Only team administrators can create and manage API keys. API keys are are tied to the organization, viewable by all admins, and are unaffected by the original creator’s account status.

Creating an API Key

  1. Navigate to cursor.com/dashboardSettings tab → Cursor Admin API Keys
  2. Click Create New API Key
  3. Give your key a descriptive name (e.g., “Usage Dashboard Integration”)
  4. Copy the generated key immediately - you won’t see it again
Format: key_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Using Your API Key

Use your API key as the username in basic authentication: Using curl with basic auth:
curl https://api.cursor.com/{route} -u API_KEY:
Or set the Authorization header directly:
Authorization: Basic {base64_encode('API_KEY:')}

Base URL

All API endpoints use:
https://api.cursor.com

Endpoints

Get Team Members

Retrieve all team members and their details.
GET /teams/members

Response

Returns an array of team member objects:
{
  teamMembers: {
    name: string;
    email: string;
    role: 'owner' | 'member' | 'free-owner';
  }[];
}

Example Response

{
  "teamMembers": [
    {
      "name": "Alex",
      "email": "developer@company.com",
      "role": "member"
    },
    {
      "name": "Sam",
      "email": "admin@company.com",
      "role": "owner"
    }
  ]
}

Example Request

curl -X GET https://api.cursor.com/teams/members \
  -u YOUR_API_KEY:

Get Daily Usage Data

Retrieve detailed daily usage metrics for your team within a date range. Provides insights into code edits, AI assistance usage, and acceptance rates.
POST /teams/daily-usage-data

Request Body

ParameterTypeRequiredDescription
startDatenumberYesStart date in epoch milliseconds
endDatenumberYesEnd date in epoch milliseconds
Date range cannot exceed 90 days. Make multiple requests for longer periods.

Response

{
  data: {
    date: number;
    isActive: boolean;
    totalLinesAdded: number;
    totalLinesDeleted: number;
    acceptedLinesAdded: number;
    acceptedLinesDeleted: number;
    totalApplies: number;
    totalAccepts: number;
    totalRejects: number;
    totalTabsShown: number;
    totalTabsAccepted: number;
    composerRequests: number;
    chatRequests: number;
    agentRequests: number;
    cmdkUsages: number;
    subscriptionIncludedReqs: number;
    apiKeyReqs: number;
    usageBasedReqs: number;
    bugbotUsages: number;
    mostUsedModel: string;
    applyMostUsedExtension?: string;
    tabMostUsedExtension?: string;
    clientVersion?: string;
    email?: string;
  }[];
  period: {
    startDate: number;
    endDate: number;
  };
}

Response Fields

FieldDescription
dateDate in epoch milliseconds
isActiveUser active on this day
totalLinesAddedLines of code added
totalLinesDeletedLines of code deleted
acceptedLinesAddedLines added from accepted AI suggestions
acceptedLinesDeletedLines deleted from accepted AI suggestions
totalAppliesApply operations
totalAcceptsAccepted suggestions
totalRejectsRejected suggestions
totalTabsShownTab completions shown
totalTabsAcceptedTab completions accepted
composerRequestsComposer requests
chatRequestsChat requests
agentRequestsAgent requests
cmdkUsagesCommand palette (Cmd+K) uses
subscriptionIncludedReqsSubscription requests
apiKeyReqsAPI key requests
usageBasedReqsPay-per-use requests
bugbotUsagesBug detection uses
mostUsedModelMost frequent AI model
applyMostUsedExtensionMost used file extension for applies
tabMostUsedExtensionMost used file extension for tabs
clientVersionCursor version
emailUser email

Example Response

{
  "data": [
    {
      "date": 1710720000000,
      "isActive": true,
      "totalLinesAdded": 1543,
      "totalLinesDeleted": 892,
      "acceptedLinesAdded": 1102,
      "acceptedLinesDeleted": 645,
      "totalApplies": 87,
      "totalAccepts": 73,
      "totalRejects": 14,
      "totalTabsShown": 342,
      "totalTabsAccepted": 289,
      "composerRequests": 45,
      "chatRequests": 128,
      "agentRequests": 12,
      "cmdkUsages": 67,
      "subscriptionIncludedReqs": 180,
      "apiKeyReqs": 0,
      "usageBasedReqs": 5,
      "bugbotUsages": 3,
      "mostUsedModel": "gpt-4",
      "applyMostUsedExtension": ".tsx",
      "tabMostUsedExtension": ".ts",
      "clientVersion": "0.25.1",
      "email": "developer@company.com"
    },
    {
      "date": 1710806400000,
      "isActive": true,
      "totalLinesAdded": 2104,
      "totalLinesDeleted": 1203,
      "acceptedLinesAdded": 1876,
      "acceptedLinesDeleted": 987,
      "totalApplies": 102,
      "totalAccepts": 91,
      "totalRejects": 11,
      "totalTabsShown": 456,
      "totalTabsAccepted": 398,
      "composerRequests": 67,
      "chatRequests": 156,
      "agentRequests": 23,
      "cmdkUsages": 89,
      "subscriptionIncludedReqs": 320,
      "apiKeyReqs": 15,
      "usageBasedReqs": 0,
      "bugbotUsages": 5,
      "mostUsedModel": "claude-3-opus",
      "applyMostUsedExtension": ".py",
      "tabMostUsedExtension": ".py",
      "clientVersion": "0.25.1",
      "email": "developer@company.com"
    }
  ],
  "period": {
    "startDate": 1710720000000,
    "endDate": 1710892800000
  }
}

Example Request

curl -X POST https://api.cursor.com/teams/daily-usage-data \
  -u YOUR_API_KEY: \
  -H "Content-Type: application/json" \
  -d '{
    "startDate": 1710720000000,
    "endDate": 1710892800000
  }'

Get Spending Data

Retrieve spending information for the current calendar month with search, sorting, and pagination.
POST /teams/spend

Request Body

ParameterTypeRequiredDescription
searchTermstringNoSearch in user names and emails
sortBystringNoSort by: amount, date, user. Default: date
sortDirectionstringNoSort direction: asc, desc. Default: desc
pagenumberNoPage number (1-indexed). Default: 1
pageSizenumberNoResults per page

Response

{
  teamMemberSpend: {
    spendCents: number;
    fastPremiumRequests: number;
    name: string;
    email: string;
    role: 'owner' | 'member' | 'free-owner';
    hardLimitOverrideDollars: number;
  }[];
  subscriptionCycleStart: number;
  totalMembers: number;
  totalPages: number;
}

Response Fields

FieldDescription
spendCentsTotal spend in cents
fastPremiumRequestsFast premium model requests
nameMember’s name
emailMember’s email
roleTeam role
hardLimitOverrideDollarsCustom spending limit override
subscriptionCycleStartSubscription cycle start (epoch milliseconds)
totalMembersTotal team members
totalPagesTotal pages

Example Response

{
  "teamMemberSpend": [
    {
      "spendCents": 2450,
      "fastPremiumRequests": 1250,
      "name": "Alex",
      "email": "developer@company.com",
      "role": "member",
      "hardLimitOverrideDollars": 100
    },
    {
      "spendCents": 1875,
      "fastPremiumRequests": 980,
      "name": "Sam",
      "email": "admin@company.com",
      "role": "owner",
      "hardLimitOverrideDollars": 0
    },
  ],
  "subscriptionCycleStart": 1708992000000,
  "totalMembers": 15,
  "totalPages": 1
}

Example Requests

Basic spending data:
curl -X POST https://api.cursor.com/teams/spend \
  -u YOUR_API_KEY: \
  -H "Content-Type: application/json" \
  -d '{}'
Search specific user with pagination:
curl -X POST https://api.cursor.com/teams/spend \
  -u YOUR_API_KEY: \
  -H "Content-Type: application/json" \
  -d '{
    "searchTerm": "alex@company.com",
    "page": 2,
    "pageSize": 25
  }'

Get Usage Events Data

Retrieve detailed usage events for your team with comprehensive filtering, search, and pagination options. This endpoint provides granular insights into individual API calls, model usage, token consumption, and costs.
POST /teams/filtered-usage-events

Request Body

ParameterTypeRequiredDescription
startDatenumberNoStart date in epoch milliseconds
endDatenumberNoEnd date in epoch milliseconds
userIdnumberNoFilter by specific user ID
pagenumberNoPage number (1-indexed). Default: 1
pageSizenumberNoNumber of results per page. Default: 10
emailstringNoFilter by user email address

Response

{
  totalUsageEventsCount: number;
  pagination: {
    numPages: number;
    currentPage: number;
    pageSize: number;
    hasNextPage: boolean;
    hasPreviousPage: boolean;
  };
  usageEvents: {
    timestamp: string;
    model: string;
    kindLabel: string;
    maxMode: boolean;
    requestsCosts: number;
    isTokenBasedCall: boolean;
    tokenUsage?: {
      inputTokens: number;
      outputTokens: number;
      cacheWriteTokens: number;
      cacheReadTokens: number;
      totalCents: number;
    };
    isFreeBugbot: boolean;
    userEmail: string;
  }[];
  period: {
    startDate: number;
    endDate: number;
  };
}

Response Fields Explained

FieldDescription
totalUsageEventsCountTotal number of usage events matching the query
paginationPagination metadata for navigating results
timestampEvent timestamp in epoch milliseconds
modelAI model used for the request
kindLabelUsage category (e.g., “Usage-based”, “Included in Business”)
maxModeWhether max mode was enabled
requestsCostsCost in request units
isTokenBasedCallTrue when the event is charged as a usage-based event
tokenUsageDetailed token consumption (available when isTokenBasedCall is true)
isFreeBugbotWhether this was a free bugbot usage
userEmailEmail of the user who made the request
periodDate range of the queried data

Example Response

{
  "totalUsageEventsCount": 113,
  "pagination": {
    "numPages": 12,
    "currentPage": 1,
    "pageSize": 10,
    "hasNextPage": true,
    "hasPreviousPage": false
  },
  "usageEvents": [
    {
      "timestamp": "1750979225854",
      "model": "claude-4-opus",
      "kindLabel": "Usage-based",
      "maxMode": true,
      "requestsCosts": 5,
      "isTokenBasedCall": true,
      "tokenUsage": {
        "inputTokens": 126,
        "outputTokens": 450,
        "cacheWriteTokens": 6112,
        "cacheReadTokens": 11964,
        "totalCents": 20.18232
      },
      "isFreeBugbot": false,
      "userEmail": "developer@company.com"
    },
    {
      "timestamp": "1750979173824",
      "model": "claude-4-opus",
      "kindLabel": "Usage-based",
      "maxMode": true,
      "requestsCosts": 10,
      "isTokenBasedCall": true,
      "tokenUsage": {
        "inputTokens": 5805,
        "outputTokens": 311,
        "cacheWriteTokens": 11964,
        "cacheReadTokens": 0,
        "totalCents": 40.16699999999999
      },
      "isFreeBugbot": false,
      "userEmail": "developer@company.com"
    },
    {
      "timestamp": "1750978339901",
      "model": "claude-4-sonnet-thinking",
      "kindLabel": "Included in Business",
      "maxMode": true,
      "requestsCosts": 1.4,
      "isTokenBasedCall": false,
      "isFreeBugbot": false,
      "userEmail": "admin@company.com"
    }
  ],
  "period": {
    "startDate": 1748411762359,
    "endDate": 1751003762359
  }
}

Example Requests

Get all usage events with default pagination:
curl -X POST https://api.cursor.com/teams/filtered-usage-events \
  -u YOUR_API_KEY: \
  -H "Content-Type: application/json" \
  -d '{}'
Filter by date range and specific user:
curl -X POST https://api.cursor.com/teams/filtered-usage-events \
  -u YOUR_API_KEY: \
  -H "Content-Type: application/json" \
  -d '{
    "startDate": 1748411762359,
    "endDate": 1751003762359,
    "email": "developer@company.com",
    "page": 1,
    "pageSize": 25
  }'
Get usage events for a specific user with custom pagination:
curl -X POST https://api.cursor.com/teams/filtered-usage-events \
  -u YOUR_API_KEY: \
  -H "Content-Type: application/json" \
  -d '{
    "userId": 12345,
    "page": 2,
    "pageSize": 50
  }'

Repo Blocklists API

Add repositories and use patterns to prevent files or directories from being indexed or used as context for your team.

Get Team Repo Blocklists

Retrieve all repository blocklists configured for your team.
GET /settings/repo-blocklists/repos
Response
Returns an array of repository blocklist objects:
{
  repos: {
    id: string;
    url: string;
    patterns: string[];
  }[];
}
Example Response
{
  "repos": [
    {
      "id": "repo_123",
      "url": "https://github.com/company/sensitive-repo",
      "patterns": ["*.env", "config/*", "secrets/**"]
    },
    {
      "id": "repo_456",
      "url": "https://github.com/company/internal-tools",
      "patterns": ["*"]
    }
  ]
}
Example Request
curl -X GET https://api.cursor.com/settings/repo-blocklists/repos \
  -u YOUR_API_KEY:

Upsert Repo Blocklists

Replace existing repository blocklists for the provided repos. Note: This endpoint will only overwrite the patterns for the repositories provided. All other repos will be unaffected.
POST /settings/repo-blocklists/repos/upsert
Request Body
ParameterTypeRequiredDescription
reposarrayYesArray of repository blocklist objects
Each repository object must contain:
FieldTypeRequiredDescription
urlstringYesRepository URL to blocklist
patternsstring[]YesArray of file patterns to block (glob patterns supported)
Response
Returns the updated list of repository blocklists:
{
  repos: {
    id: string;
    url: string;
    patterns: string[];
  }[];
}
Example Request
curl -X POST https://api.cursor.com/settings/repo-blocklists/repos/upsert \
  -u YOUR_API_KEY: \
  -H "Content-Type: application/json" \
  -d '{
    "repos": [
      {
        "url": "https://github.com/company/sensitive-repo",
        "patterns": ["*.env", "config/*", "secrets/**"]
      },
      {
        "url": "https://github.com/company/internal-tools", 
        "patterns": ["*"]
      }
    ]
  }'

Delete Repo Blocklist

Remove a specific repository from the blocklist.
DELETE /settings/repo-blocklists/repos/:repoId
Parameters
ParameterTypeRequiredDescription
repoIdstringYesID of the repository blocklist to delete
Response
Returns 204 No Content on successful deletion.
Example Request
curl -X DELETE https://api.cursor.com/settings/repo-blocklists/repos/repo_123 \
  -u YOUR_API_KEY:

Pattern Examples

Common blocklist patterns:
  • * - Block entire repository
  • *.env - Block all .env files
  • config/* - Block all files in config directory
  • **/*.secret - Block all .secret files in any subdirectory
  • src/api/keys.ts - Block specific file