Cursor
By integrating Cursor with DX, you can import data on Cursor usage and link this data to the rest of your DX data to analyze impact. Please refer to the API documentation below and our schema explorer to see what data DX imports—note that DX does not read or access your source code.
Prerequisites
To connect Cursor to DX, you need:
- a Cursor workspace/plan with access to the Teams Admin API (this is the API DX uses, including
/teams/*endpoints). - an API key created by a team admin.
- (optional) privacy mode must be disabled if code change files need to be tracked.
Setup instructions
Follow the steps below to connect Cursor to DX.
Step 1
Create a Cursor API key:
- Go to cursor.com/dashboard.
- Click the Team Settings tab.
- Scroll to the Advanced section.
- In the API Keys card, click New API Key.
- Change Scope from Admin to Read-only.
- Give the key a name, such as DX Integration, create the key, and copy it. Cursor API keys start with
crsr_and are only shown once.
Note: Enterprise is not a separate DX integration API. DX uses Cursor’s Teams Admin API, so the key should be created by a team admin in a workspace that has access to that API.
Step 2
- Navigate to the connections page in DX and select + Connection in the top right.
- Enter the API key you copied in the previous step. Refer to the information below for errors and troubleshooting.
API reference
The table below lists the specific API endpoints that are used by DX.
| Endpoint | Documentation |
|---|---|
| POST /teams/daily-usage-data | Link |
| POST /teams/spend | Link |
| GET /analytics/ai-code/commits | Link |
| GET /analytics/ai-code/changes | Link |
Errors
The table below lists potential error codes when adding a connection in DX.
| Error | Description |
|---|---|
invalid_credentials |
Your API credentials entered are not valid. |
no_resources |
DX cannot access any projects or repositories. |
Data Cloud API
Once the initial connection is created successfully, Cursor credentials can be managed via the Data Cloud API.
Credential fields
| Field | Type | Description |
|---|---|---|
secrets.api_token |
String |
A Cursor API key with read-only scope. |
{
"id": 456,
"secrets": {
"api_token": "crsr_your_cursor_api_key"
}
}