Skip to main content

Command Palette

Search for a command to run...

API

Admin API

Admin API を使用すると、メンバー情報、利用状況やメトリクス、支出の詳細、Team のディレクトリグループ、モデルアクセス、Grok Bot など、チームのデータにプログラム経由でアクセスできます。

  • Admin API は、API キーをユーザー名として使用する Basic 認証 を利用します。
  • API キーの作成方法、認証方式、レート制限、ベストプラクティスなどの詳細については、API Overview を参照してください。

チーム全体にまたがる組織全体の操作については、Organizations と Organization API を参照してください。

エンドポイント

チームメンバー一覧を取得

GET/teams/members

チームに所属するすべてのメンバーとその詳細情報を取得します。

レスポンスフィールド

teamMembers array

各要素が次のプロパティを持つチームメンバーオブジェクトの配列です。
  • id string - チームメンバーのエンコードされたユーザー ID (例: user_PDSPmvukpYgZEDXsoNirw3CFhy)。OpenTelemetry エクスポートでは、同じ値がオプションの cursor.user.account_id リソース属性として送信されます。
  • email string - チームメンバーのメールアドレス
  • name string - チームメンバーの表示名
  • role string - チーム内でのロール (例: member、owner)
  • isRemoved boolean - チームから削除済みかどうか
curl -X GET https://api.cursor.com/teams/members \  -u YOUR_API_KEY:

レスポンス:

{  "teamMembers": [    {      "id": "user_PDSPmvukpYgZEDXsoNirw3CFhy",      "name": "Alex",      "email": "[email protected]",      "role": "member",      "isRemoved": false    },    {      "id": "user_kljUvI0ASZORvSEXf9hV0ydcso",      "name": "Sam",      "email": "[email protected]",      "role": "owner",      "isRemoved": false    }  ]}

監査ログの取得

GET/teams/audit-logs

フィルタリングを使ってチームの監査ログイベントを取得します。チームのアクティビティ、セキュリティイベント、設定変更を追跡できます。チームごとに 1 分あたり 20 リクエストにレート制限されています。レート制限とベストプラクティスを参照してください。

パラメータ

startTime string | number

開始時刻 (デフォルトは7日前) 。日付形式 を参照

endTime string | number

終了時刻 (デフォルトは現在)。日付形式 を参照

eventTypes string

カンマ区切りのイベント種別でフィルタリングします。指定可能な値: login, logout, add_user, remove_user, update_user_role, team_settings, mcp_server_config, team_api_key, user_api_key, privacy_mode, user_spend_limit, team_rule, team_repo, team_hook, team_command, create_directory_group, delete_directory_group, update_directory_group, update_directory_group_permissions, add_user_to_directory_group, remove_user_from_directory_group, bugbot_installation, bugbot_installation_settings, bugbot_repo_settings, bugbot_team_rule, bugbot_team_settings, bugbot_bulk_repo_update, grok_bot_created, grok_bot_lifecycle, sand_onboarding, grok_bot_access_changed, grok_bot_team_setup_manifest, grok_bot_group_settings, grok_bot_group_resource, grok_bot_resource, grok_bot_machine, grok_bot_vm, grok_bot_vm_bulk, grok_bot_routine, mcp_authentication, slack_account_link

search string

イベントを絞り込むための検索キーワード

page number

ページ番号 (1始まり) 。デフォルト: 1

pageSize number

1 ページあたりの件数 (1〜500)。デフォルト: 100

users string

ユーザーでフィルタリングします。以下のユーザーによるフィルタリングを参照してください

日付形式

startTime と endTime パラメータは複数の形式をサポートします:

  • 相対指定のショートカット: now, today, yesterday, 7d (7 日前), 5h (5 時間前), 300s (300 秒前)
  • ISO 8601 文字列: 2024-01-15T12:00:00Z または 2024-01-15T10:00:00-05:00
  • YYYY-MM-DD 形式: 2024-01-15 (時刻はデフォルトで 00:00:00 UTC)
  • Unix タイムスタンプ: 1705315200 (秒) または 1705315200000 (ミリ秒)

使用例:

  • ?startTime=7d&endTime=now - 直近 7 日間
  • ?startTime=5h&endTime=now - 直近 5 時間
  • ?startTime=2024-01-15&endTime=2024-01-20 - 特定の日付範囲
  • ?startTime=1705315200000&endTime=1705401600000 - Unix タイムスタンプ

ユーザーによるフィルタリング

users パラメータは、カンマ区切りで複数の形式を受け付けます:

形式を混在させることができます: [email protected],12345,user_PDSPmvukpYgZEDXsoNirw3CFhy

1 回のリクエストあたりの最大ユーザー数は pageSize と同じです。

curl -X GET "https://api.cursor.com/teams/[email protected],[email protected]&eventTypes=login,add_user" \  -u YOUR_API_KEY:

レスポンス:

events 内の各オブジェクトには application_type が含まれます。Grok Bot の場合は grok_bot、その他の Cherri Code のサーフェスの場合は cursor、アプリケーションを判別できない場合 (このフィールドが存在する前に書き込まれた行を含む) は空文字列になります。

ルーチンの行では、Bot は event_data.sand_agent_id で識別されます。

{  "events": [    {      "event_id": "evt_abc123",      "timestamp": "2024-01-15T12:30:00.000Z",      "ip_address": "203.0.113.42",      "user_email": "[email protected]",      "event_type": "add_user",      "application_type": "cursor",      "event_data": {        "email": "[email protected]",        "method": "manual"      }    },    {      "event_id": "evt_def456",      "timestamp": "2024-01-15T10:15:00.000Z",      "ip_address": "192.168.1.1",      "user_email": "[email protected]",      "event_type": "login",      "application_type": "grok_bot",      "event_data": {        "ip_address": "192.168.1.1",        "user_agent": "Cherri Code/0.42.0"      }    }  ],  "pagination": {    "page": 1,    "pageSize": 100,    "totalCount": 2,    "totalPages": 1,    "hasNextPage": false,    "hasPreviousPage": false  },  "params": {    "teamId": 12345,    "startDate": 1704729600000,    "endDate": 1705334400000  }}

日次利用データの取得

POST/teams/daily-usage-data

チームの日次の利用状況指標を取得します。データは1時間単位で集計されるため、このエンドポイントへのポーリングは1時間に1回までを推奨します。レート制限はチームごとに毎分20リクエストです。ベストプラクティスを参照してください。

パラメータ

startDate number 必須

開始日 (エポックミリ秒)

endDate number 必須

終了日 (エポックミリ秒)

page number

ページ番号 (1始まり) 。pageSize と併せて指定すると、ページネーションが有効になり、指定した期間中にメンバーシップを持つすべてのチームメンバーのデータを返します。

pageSize number

1ページあたりのユーザー数。page と併せて指定すると、ページネーションが有効になり、指定した期間中にメンバーシップを持つすべてのチームメンバーのデータを返します。

レスポンスフィールド

data array 内の各 object に含まれる項目は次のとおりです。

  • userId number - ユーザーの一意の識別子
  • day string - このレコードの対象日 (ISO形式、例: 2024-03-18)
  • date number - エポックミリ秒で表した日付
  • email string - ユーザーのメールアドレス
  • isActive boolean - ユーザーがこの日にアクティビティを行ったかどうか (ページネーション使用時のみ含まれます)
  • totalLinesAdded number - 追加されたコードの総行数
  • totalLinesDeleted number - 削除したコードの総行数
  • acceptedLinesAdded number - 承認されたAI提案で追加された行数
  • acceptedLinesDeleted number - 受け入れられたAI提案によって削除された行数
  • totalApplies number - AIコードの適用アクションの合計数
  • totalAccepts number - 承認されたAI提案の合計数
  • totalRejects number - 拒否されたAIの提案の合計数
  • totalTabsShown number - ユーザーに表示されたTab Completionsの総数
  • totalTabsAccepted number - ユーザーが受け入れたTab completionの総数
  • composerRequests number - 行われたComposerリクエスト数
  • chatRequests number - 行われたチャットリクエストの数
  • agentRequests number - Agentモードで行われたリクエスト数
  • cmdkUsages number - Cmd+Kインライン編集の使用回数
  • subscriptionIncludedReqs number - サブスクリプションプランに含まれるリクエスト数
  • apiKeyReqs number - API キー経由のリクエスト
  • usageBasedReqs number - 従量課金制の超過リクエスト数
  • bugbotUsages number - Bugbot の利用回数
  • mostUsedModel string | null - 当日最も多く使用されたAIモデル
  • applyMostUsedExtension string | null - apply アクションで最もよく使用されるファイル拡張子
  • tabMostUsedExtension string | null - Tab補完で最もよく使用されるファイル拡張子
  • clientVersion string | null - 使用したCherri Codeクライアントのバージョン
# アクティブユーザーのみのデータを取得(ページネーションなし)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  }'# すべてのチームメンバーのデータを取得(ページネーションあり)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,    "page": 1,    "pageSize": 1000  }'

レスポンス (ページネーションなし・アクティブユーザーのみ) :

{  "data": [    {      "userId": 12345,      "day": "2024-03-18",      "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-5",      "applyMostUsedExtension": ".tsx",      "tabMostUsedExtension": ".ts",      "clientVersion": "0.25.1",      "email": "[email protected]"    }  ],  "period": {    "startDate": 1710720000000,    "endDate": 1710892800000  }}

レスポンス (ページネーションあり - すべてのチームメンバー) :

{  "data": [    {      "userId": 12345,      "day": "2024-03-18",      "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-5",      "applyMostUsedExtension": ".tsx",      "tabMostUsedExtension": ".ts",      "clientVersion": "0.25.1",      "email": "[email protected]"    },    {      "userId": 12346,      "day": "2024-03-18",      "date": 1710720000000,      "isActive": false,      "totalLinesAdded": 0,      "totalLinesDeleted": 0,      "acceptedLinesAdded": 0,      "acceptedLinesDeleted": 0,      "totalApplies": 0,      "totalAccepts": 0,      "totalRejects": 0,      "totalTabsShown": 0,      "totalTabsAccepted": 0,      "composerRequests": 0,      "chatRequests": 0,      "agentRequests": 0,      "cmdkUsages": 0,      "subscriptionIncludedReqs": 0,      "apiKeyReqs": 0,      "usageBasedReqs": 0,      "bugbotUsages": 0,      "mostUsedModel": null,      "applyMostUsedExtension": null,      "tabMostUsedExtension": null,      "clientVersion": null,      "email": "[email protected]"    }  ],  "period": {    "startDate": 1710720000000,    "endDate": 1710892800000  },  "pagination": {    "page": 1,    "pageSize": 1000,    "totalUsers": 150,    "totalPages": 1,    "hasNextPage": false,    "hasPreviousPage": false  }}

利用額データの取得

POST/teams/spend

検索やソート、ページネーションを指定して、現在の請求サイクル分の利用額情報を取得します。

パラメータ

searchTerm string

ユーザー名・メールアドレスで検索

sortBy string

ソート対象: amount, date, user。デフォルト: date

sortDirection string

ソート方向: asc, desc。デフォルト: desc

page number

ページ番号 (1始まり)。デフォルト: 1

pageSize number

1ページあたりの件数

レスポンスフィールド

teamMemberSpend の各オブジェクトには次が含まれます:

  • userId string - エンコードされたユーザー ID (例: user_PDSPmvukpYgZEDXsoNirw3CFhy)。/teams/members の teamMembers[].id と同じ識別子名前空間を共有します。
  • name string - ユーザーの表示名
  • email string - ユーザーのメールアドレス
  • role string - チーム内でのロール (例: member, owner)
  • spendCents number - 現在の請求サイクルにおける従量課金分の支出 (セント単位)。含まれる利用分は含みません
  • overallSpendCents number - 現在の請求サイクルにおける利用合計 (セント単位)。オンデマンド利用分と含まれる利用分の両方を含みます
  • fastPremiumRequests number - この請求サイクル中に行われた、従量課金プレミアムリクエストの回数
  • hardLimitOverrideDollars number - このユーザー向けに設定された、ドル建てのハード利用上限の個別値 (0 は上書きなしを意味します)
  • monthlyLimitDollars number | null - このユーザーに設定された月次利用上限額 (ドル) 。上限がない場合は null
  • effectivePerUserLimitDollars number - monthlyLimitDollars と hardLimitOverrideDollars から導出された、現在適用中のユーザーごとの支出上限額 (ドル)
curl -X POST https://api.cursor.com/teams/spend \  -u YOUR_API_KEY: \  -H "Content-Type: application/json" \  -d '{    "searchTerm": "[email protected]",    "page": 2,    "pageSize": 25  }'

レスポンス:

{  "teamMemberSpend": [    {      "userId": "user_PDSPmvukpYgZEDXsoNirw3CFhy",      "spendCents": 2450.125487,      "overallSpendCents": 2450.125487,      "fastPremiumRequests": 1250,      "name": "Alex",      "email": "[email protected]",      "role": "member",      "hardLimitOverrideDollars": 100,      "monthlyLimitDollars": 200,      "effectivePerUserLimitDollars": 100    },    {      "userId": "user_kljUvI0ASZORvSEXf9hV0ydcso",      "spendCents": 1875.500123,      "overallSpendCents": 3200.750456,      "fastPremiumRequests": 980,      "name": "Sam",      "email": "[email protected]",      "role": "owner",      "hardLimitOverrideDollars": 0,      "monthlyLimitDollars": null,      "effectivePerUserLimitDollars": 50    }  ],  "subscriptionCycleStart": 1708992000000,  "totalMembers": 15,  "totalPages": 1}

利用イベントデータの取得

POST/teams/filtered-usage-events

フィルタリング、検索、およびページネーションのオプションを使用して、チームの詳細な使用イベントを取得します。このエンドポイントは、API コール、モデルの使用状況、トークン消費量、およびコストに関する詳細なインサイトを提供します。データは時間単位で集計されます。このエンドポイントのポーリングは最大で1時間に1回までにすることをおすすめします。チームごとに1分あたり60リクエストに制限されています。API ガイダンスを参照してください。

パラメータ

startDate number

エポックミリ秒で指定する開始日時。この境界は含まれます。

endDate number

エポックミリ秒で指定する終了日時。この境界は含まれます。

userId number

特定のユーザーIDで絞り込む

page number

ページ番号 (1始まり) 。デフォルト: 1

pageSize number

ページあたりの結果数。デフォルト: 100。最大: 1000。

email string

ユーザーのメールアドレスで絞り込む

serviceAccountId string

サービスアカウント ID で絞り込み

cloudAgentId string

特定の Cloud Agent 実行 ID で絞り込みます。* を指定すると、すべての Cloud Agent 実行からイベントを返します。

automationId string

特定の自動化の UUID で絞り込みます。* を渡すと、すべての自動化のイベントが返されます。

hostingType string

Cloud Agent (バックグラウンドエージェント) の実行を、実行された場所でフィルタリングします。セルフホスト型エージェントの推論コストを Cherri Code ホスト型の実行から切り分けるために使用します。指定可能な値:
  • CLOUD - Cherri Code-hosted の実行
  • SELF_HOSTED - すべてのセルフホスト型実行 (Team Pool ワーカーまたはマイマシンのワーカー)
  • SELF_HOSTED_POOL - Team Pool ワーカーのみ
  • SELF_HOSTED_MACHINE - 個人用の "My Machine" ワーカーのみ

レスポンスフィールド

usageEvents の各オブジェクトには以下が含まれます:

  • timestamp string - エポックミリ秒の文字列で表したイベントのタイムスタンプ
  • userEmail string - リクエストを行ったユーザーのメールアドレス
  • serviceAccountId string | undefined - リクエストを行ったサービスアカウントの ID。人間のユーザーによるイベントでは省略されます。
  • serviceAccountName string | undefined - リクエストを行ったサービスアカウントの表示名。人間のユーザーによるイベントの場合は省略されます。
  • cloudAgentId string | undefined - このイベントに対応する Cloud Agent の実行 ID。Cloud Agent 以外のイベントでは省略されます。
  • automationId string | undefined - このイベントにひも付けられた自動化の UUID。自動化以外のイベントでは省略されます。
  • conversationId string | undefined - このイベントを生成した会話 (エージェントセッション) の ID。セッションごとの支出を追跡したり、AI Code Tracking API など会話 ID を提供する他のソースとの結合キーとして使用したりできます。関連する会話がないイベントでは省略されます。
  • model string - リクエストで使用する AI モデル
  • kind string - 課金区分 (例: Usage-based, Included in Business)
  • maxMode boolean - リクエストが max モードを使用したかどうか
  • requestsCosts number - リクエスト単位でのコスト
  • isTokenBasedCall boolean - トークン使用量に基づいて課金されたリクエストかどうか
  • isChargeable boolean - このイベントが課金対象かどうか
  • isHeadless boolean - このリクエストがクライアントに接続されていない状態で行われたかどうか (例: バックグラウンドエージェント)
  • tokenUsage object | undefined - トークン使用状況の詳細 (isTokenBasedCall が true の場合に含まれる):
    • inputTokens number - 消費された入力トークン数
    • outputTokens number - 生成された出力トークン数
    • cacheWriteTokens number - キャッシュに書き込まれたトークン数
    • cacheReadTokens number - キャッシュから読み出されたトークン数
    • totalCents number - モデルコスト合計 (セント単位)
    • discountPercentOff number | undefined - 適用された割引率 (ある場合)
  • chargedCents number - このイベントに対して課金された合計金額 (セント単位)。Cherri Codeトークンレートの適用対象となるサードパーティモデルへのリクエストでは、このフィールドにはモデルコストと Cherri Codeトークンレートの両方が含まれます。イベントレベルのコストを /teams/spend の合計と照合するには、このフィールドを使用します。トークンベースとリクエストベースの両方の課金プランで使用できます。
  • cursorTokenFee number | undefined - セント単位の Cherri Codeトークンレート。サードパーティモデルへのリクエストにレートが適用される場合 (Auto がサードパーティモデルにルーティングする場合を含む) にのみ含まれます。
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": "[email protected]",    "page": 1,    "pageSize": 25  }'

レスポンス:

{  "totalUsageEventsCount": 113,  "pagination": {    "numPages": 5,    "currentPage": 1,    "pageSize": 25,    "hasNextPage": true,    "hasPreviousPage": false  },  "usageEvents": [    {      "timestamp": "1750979225854",      "userEmail": "[email protected]",      "conversationId": "8f2e4a1b-6c3d-4e5f-9a7b-2d1c8e6f4a3b",      "model": "claude-4.5-sonnet",      "kind": "Usage-based",      "maxMode": true,      "requestsCosts": 5,      "isTokenBasedCall": true,      "isChargeable": true,      "isHeadless": false,      "tokenUsage": {        "inputTokens": 126,        "outputTokens": 450,        "cacheWriteTokens": 6112,        "cacheReadTokens": 11964,        "totalCents": 20.18232      },      "chargedCents": 21.36232,      "cursorTokenFee": 1.18    },    {      "timestamp": "1750979173824",      "userEmail": "[email protected]",      "conversationId": "8f2e4a1b-6c3d-4e5f-9a7b-2d1c8e6f4a3b",      "model": "claude-4.5-sonnet",      "kind": "Usage-based",      "maxMode": true,      "requestsCosts": 10,      "isTokenBasedCall": true,      "isChargeable": true,      "isHeadless": false,      "tokenUsage": {        "inputTokens": 5805,        "outputTokens": 311,        "cacheWriteTokens": 11964,        "cacheReadTokens": 0,        "totalCents": 40.167,        "discountPercentOff": 10      },      "chargedCents": 37.33,      "cursorTokenFee": 1.18    },    {      "timestamp": "1750978339901",      "userEmail": "[email protected]",      "model": "claude-4-sonnet-thinking",      "kind": "Included in Business",      "maxMode": true,      "requestsCosts": 1.4,      "isTokenBasedCall": false,      "isChargeable": false,      "isHeadless": false,      "chargedCents": 8    }  ],  "period": {    "startDate": 1748411762359,    "endDate": 1751003762359  }}

サービスアカウントの使用例:

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,    "serviceAccountId": "sa_abc123",    "page": 1,    "pageSize": 10  }'

サービスアカウントのレスポンス:

{  "totalUsageEventsCount": 1,  "pagination": {    "numPages": 1,    "currentPage": 1,    "pageSize": 10,    "hasNextPage": false,    "hasPreviousPage": false  },  "usageEvents": [    {      "timestamp": "1750979225854",      "userEmail": "[email protected]",      "serviceAccountId": "sa_abc123",      "serviceAccountName": "Nightly CI Agent",      "conversationId": "3b9d7c2e-1f4a-4b8c-a6d5-e9f0a2b4c6d8",      "model": "claude-4.5-sonnet",      "kind": "Usage-based",      "maxMode": true,      "requestsCosts": 5,      "isTokenBasedCall": true,      "isChargeable": true,      "isHeadless": true,      "tokenUsage": {        "inputTokens": 126,        "outputTokens": 450,        "cacheWriteTokens": 6112,        "cacheReadTokens": 11964,        "totalCents": 20.18232      },      "chargedCents": 21.36232,      "cursorTokenFee": 1.18    }  ],  "period": {    "startDate": 1748411762359,    "endDate": 1751003762359  }}

自動化の使用例:

自動化の UUID を使用して、その利用イベントを取得します。自動化の帰属情報は、ユーザーまたはサービスアカウントとして実行される自動化に対して機能します。

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,    "automationId": "7fc64f90-6d7a-4a5d-91b1-bd1f529a85dd",    "page": 1,    "pageSize": 100  }'

一致する各イベントには automationId と cloudAgentId が含まれます。自動化の合計コストを計算するには、各イベントの chargedCents を合計してください。

セルフホスト エージェントの費用例:

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,    "hostingType": "SELF_HOSTED",    "page": 1,    "pageSize": 10  }'

ユーザーごとの支出上限の設定

POST/teams/user-spend-limit

チーム内の各メンバーごとに支出上限を設定します。これにより、チーム内の各ユーザーが AI 利用にいくらまで費用を使えるかを制御できます。チームごとに 1 分あたり 250 リクエストにレート制限されています。詳細は レート制限 を参照してください。

1 リクエストで最大 100 人のメンバーを更新するには、ユーザーの支出上限を一括設定 (プレビュー) を使用してください。

パラメータ

userEmail string 必須

チームメンバーのメールアドレス

spendLimitDollars number | null 必須

ドル建ての支出上限 (整数のみ、小数不可)。上限を削除するには null を指定します。
curl -X POST https://api.cursor.com/teams/user-spend-limit \  -u YOUR_API_KEY: \  -H "Content-Type: application/json" \  -d '{    "userEmail": "[email protected]",    "spendLimitDollars": 100  }'

成功時のレスポンス:

{  "outcome": "success",  "message": "Spend limit set to $100 for user [email protected]"}

エラー時のレスポンス:

{  "outcome": "error",  "message": "Invalid email format"}

ユーザーの支出上限を一括設定 (プレビュー)

POST/teams/user-spend-limits

1回のリクエストで最大100人のチームメンバーに支出上限を設定します。1チームあたり毎分20リクエストのレート制限があります。レート制限を参照してください。

パラメータ

updates array 必須

1〜100件のユーザー支出上限の更新。各更新には以下が含まれます:
  • userEmail string - チームメンバーのメールアドレス
  • spendLimitDollars number | null - ドル単位の整数の支出上限。上限を解除するには null を設定します。

レスポンスフィールド

  • requestedCount number - リクエストに含まれる更新の件数
  • updatedCount number - 変更された上限の件数
  • unchangedCount number - すでにリクエストされた値になっていた上限の件数
  • failedCount number - Cherri Code が適用できなかった更新の件数
  • results array - リクエスト順の結果。各結果には userEmail と、updated、unchanged、failed のいずれかのステータスが含まれます。失敗した結果には error メッセージも含まれます。
curl -X POST https://api.cursor.com/teams/user-spend-limits \  -u YOUR_API_KEY: \  -H "Content-Type: application/json" \  -d '{    "updates": [      {        "userEmail": "[email protected]",        "spendLimitDollars": 100      },      {        "userEmail": "[email protected]",        "spendLimitDollars": null      },      {        "userEmail": "[email protected]",        "spendLimitDollars": 50      }    ]  }'

レスポンス:

{  "requestedCount": 3,  "updatedCount": 1,  "unchangedCount": 1,  "failedCount": 1,  "results": [    {      "userEmail": "[email protected]",      "status": "updated"    },    {      "userEmail": "[email protected]",      "status": "unchanged"    },    {      "userEmail": "[email protected]",      "status": "failed",      "error": "User not found in team"    }  ]}

チームメンバーの削除

POST/teams/remove-member

プログラム経由でチームメンバーを削除します。オフボーディングのワークフローを自動化したり、HR システムと連携したりする際に便利です。チームごとに1分あたり50リクエストのレート制限があります。レート制限 を参照してください。

パラメータ

userId string

エンコードされたユーザー ID (例: user_PDSPmvukpYgZEDXsoNirw3CFhy)。email が指定されていない場合に必須です。

email string

チームメンバーのメールアドレス。userId が指定されていない場合に必須です。
curl -X POST https://api.cursor.com/teams/remove-member \  -u YOUR_API_KEY: \  -H "Content-Type: application/json" \  -d '{    "email": "[email protected]"  }'

レスポンス:

{  "success": true,  "userId": "user_PDSPmvukpYgZEDXsoNirw3CFhy",  "hasBillingCycleUsage": true}

userId で削除する場合:

curl -X POST https://api.cursor.com/teams/remove-member \  -u YOUR_API_KEY: \  -H "Content-Type: application/json" \  -d '{    "userId": "user_PDSPmvukpYgZEDXsoNirw3CFhy"  }'

エラーレスポンス:

{  "error": "User is not a member of this team"}
{  "error": "Either userId or email must be provided"}
{  "error": "Only one of userId or email should be provided, not both"}

チームのリポジトリブロックリストを取得

GET/settings/repo-blocklists/repos

チームに設定されているすべてのリポジトリブロックリストを取得します。リポジトリを追加し、パターンを使用してファイルやディレクトリがコンテキストとして使用されないようにします。

パターンの例

一般的なブロックリストパターン:

  • * - リポジトリ全体をブロック
  • *.env - すべての .env ファイルをブロック
  • config/* - config ディレクトリ内のすべてのファイルをブロック
  • **/*.secret - 任意のサブディレクトリ内のすべての .secret ファイルをブロック
  • src/api/keys.ts - 特定のファイルをブロック
curl -X GET https://api.cursor.com/settings/repo-blocklists/repos \  -u YOUR_API_KEY:

レスポンス:

{  "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": ["*"]    }  ]}

リポジトリブロックリストのアップサート

POST/settings/repo-blocklists/repos/upsert

指定したリポジトリについて、既存のリポジトリブロックリストを置き換えます。このエンドポイントは、指定されたリポジトリのパターンのみを上書きします。それ以外のリポジトリには影響しません。

パラメータ

repos array 必須

Array of repository blocklist objects. Each repository object must contain:

  • url string - ブロックリストに登録するリポジトリの URL
  • patterns string[] - ブロックするファイルパターンの配列 (glob パターン対応)
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": ["*"]      }    ]  }'

レスポンス:

{  "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": ["*"]    }  ]}

リポジトリブロックリストの削除

DELETE/settings/repo-blocklists/repos/:repoId

ブロックリストから特定のリポジトリを削除します。削除に成功すると 204 No Content を返します。

パラメータ

repoId string 必須

削除するリポジトリブロックリストの ID
curl -X DELETE https://api.cursor.com/settings/repo-blocklists/repos/repo_123 \  -u YOUR_API_KEY:

レスポンス:

204 No Content

チームのディレクトリグループ

/teams/directory-groups の Team Admin API ルートは、チームのディレクトリグループを管理します。これらのグループは、1 つのチーム内での支出とポリシーを設定します。組織レベルのコホートとの違いについては 組織グループ、および 請求グループ を参照してください。

組織グループ でそのチームのメンバーシップを制御する場合は、グループをチームにマッピングしてください。Team API キー を使用して、チームのディレクトリグループの作成、一覧取得、メンバーの追加・削除が行えます。ダッシュボードおよび SCIM の設定については ディレクトリグループ を参照してください。

これらのルートは 請求グループ とは別の API です。次の表を参考に、適切なパスと id を選んでください:

グループパスID
組織グループ/organizations/groupsid は g_ プレフィックスを使用します。レスポンスでは grp_ プレフィックス付きの publicId も返されます。組織グループを参照してください。
チームのディレクトリグループ/teams/directory-groups公開 ID は team_group_… プレフィックスを使用します (例: team_group_01k2ja2000e0080000000000n2) 。
請求グループ/teams/groupsgroup_…

:groupId はチームのディレクトリグループの 公開 ID です。team_group_… プレフィックスを使用します。組織グループ の g_ や grp_ の id、請求グループ の group_… id を渡さないでください。

グループのルートは、次のエラーレスポンスを共通で返します:

ステータス発生条件
400グループ ID、ページネーション値、またはリクエスト本文の形式が不正
401API キーが無効、またはキーに read:* (読み取り) もしくは admin:* (書き込み) スコープがない
404このチームにグループが存在しない
429レート制限を超過。レスポンスには Retry-After: 60 ヘッダーが含まれます

チームのディレクトリグループ一覧を取得

GET/teams/directory-groups

API キーに紐づくチームのディレクトリグループを取得します。

クエリパラメータ

page number

ページ番号。デフォルトは 1。

pageSize number

1 ページあたりのグループ数。デフォルトは 50。上限は 200 で、200 を超える値は 200 に制限されます。

レスポンスフィールド

groups 内の各オブジェクトには以下が含まれます:

  • id 文字列 - team_group_… プレフィックスを持つグループの公開 ID。他の ルート では、この値を :groupId として使用します。
  • name 文字列 - グループ名
  • memberCount number - グループ内のメンバー数
  • monthlySpendingLimitDollars number | null - 各グループメンバーの月間支出上限(ドル単位の整数)。null の場合、そのグループに上限はありません。
  • createdAt 文字列 - ISO 8601 形式の作成日時
  • updatedAt 文字列 - ISO 8601 形式の最終更新日時

pagination オブジェクト

ページネーションのメタデータ: page、pageSize、totalCount、totalPages、hasNextPage、hasPreviousPage。
curl -X GET "https://api.cursor.com/teams/directory-groups?page=1&pageSize=50" \  -u YOUR_API_KEY:

レスポンス:

{  "groups": [    {      "id": "team_group_01k2ja2000e0080000000000n2",      "name": "Engineering",      "memberCount": 12,      "monthlySpendingLimitDollars": 500,      "createdAt": "2026-01-15T10:30:00.000Z",      "updatedAt": "2026-01-20T14:22:00.000Z"    },    {      "id": "team_group_01k2jb4000e0080000000000p7",      "name": "Design",      "memberCount": 8,      "monthlySpendingLimitDollars": null,      "createdAt": "2026-01-16T09:00:00.000Z",      "updatedAt": "2026-01-16T09:00:00.000Z"    }  ],  "pagination": {    "page": 1,    "pageSize": 50,    "totalCount": 2,    "totalPages": 1,    "hasNextPage": false,    "hasPreviousPage": false  }}

チームのディレクトリグループの取得

GET/teams/directory-groups/:groupId

チームのディレクトリグループを 1 件取得します。

パラメータ

groupId 文字列 必須

team_group_… プレフィックス付きのグループの公開 ID (例: team_group_01k2ja2000e0080000000000n2) 。組織グループの g_ または grp_ ID や、請求グループの group_… ID を指定した場合は 400 または 404 を返します。

レスポンスフィールド

group オブジェクトには id、name、memberCount、monthlySpendingLimitDollars、createdAt、updatedAt が含まれます。これらのフィールドは チームのディレクトリグループの一覧取得 のレスポンスと同じです。

curl -X GET https://api.cursor.com/teams/directory-groups/team_group_01k2ja2000e0080000000000n2 \  -u YOUR_API_KEY:

レスポンス:

{  "group": {    "id": "team_group_01k2ja2000e0080000000000n2",    "name": "Engineering",    "memberCount": 12,    "monthlySpendingLimitDollars": 500,    "createdAt": "2026-01-15T10:30:00.000Z",    "updatedAt": "2026-01-20T14:22:00.000Z"  }}

チームのディレクトリグループの作成

POST/teams/directory-groups

メンバーシップを手動で管理する、チームのディレクトリグループを作成します。SCIM 同期グループを作成する場合は、代わりにアイデンティティプロバイダーから同期してください。SCIM を参照してください。

リクエスト本文

name 文字列 必須

グループ名。チームの有効なディレクトリグループ内で一意である必要があります。先頭と末尾の空白は Cherri Code が削除します。

レスポンスフィールド

201 Created と新しい group オブジェクトを返します。このオブジェクトには id、name、memberCount、monthlySpendingLimitDollars、createdAt、updatedAt が含まれます。id は team_group_… プレフィックス付きのグループの公開 ID です。

エラー

  • 400 - グループ名が指定されていない、空である、または他の有効なグループですでに使用されている。
curl -X POST https://api.cursor.com/teams/directory-groups \  -u YOUR_API_KEY: \  -H "Content-Type: application/json" \  -d '{    "name": "Engineering"  }'

レスポンス:

{  "group": {    "id": "team_group_01k2ja2000e0080000000000n2",    "name": "Engineering",    "memberCount": 0,    "monthlySpendingLimitDollars": null,    "createdAt": "2026-01-15T10:30:00.000Z",    "updatedAt": "2026-01-15T10:30:00.000Z"  }}

チームのディレクトリグループを更新

PATCH/teams/directory-groups/:groupId

グループ名または月間支出上限を更新します。更新は部分的に行えます。少なくとも 1 つのフィールドを指定してください。省略したフィールドは現在の値のまま維持されます。

パラメータ

groupId 文字列 必須

team_group_… プレフィックス付きのグループの公開 ID。例: team_group_01k2ja2000e0080000000000n2。

リクエスト本文

name 文字列

新しいグループ名。チーム内の有効なディレクトリグループの中で一意である必要があります。先頭と末尾の空白は Cherri Code が削除します。

monthlySpendingLimitDollars number

各グループメンバーの月間支出上限 (ドル単位の整数) 。0 から 2147483647 の範囲で指定します。

clearMonthlySpendingLimitDollars boolean

グループの支出上限を解除するには true を設定します。同じリクエストに monthlySpendingLimitDollars を含めないでください。

レスポンスフィールド

id、name、memberCount、monthlySpendingLimitDollars、createdAt、updatedAt を含む、更新後の group オブジェクトを返します。

エラー

  • 400 - リクエストに更新対象のフィールドがない、無効な値が含まれている、他の有効なグループと同じ名前を使用している、または同じリクエストで支出上限の設定と解除を同時に行っている。
curl -X PATCH https://api.cursor.com/teams/directory-groups/team_group_01k2ja2000e0080000000000n2 \  -u YOUR_API_KEY: \  -H "Content-Type: application/json" \  -d '{    "name": "Platform Engineering",    "monthlySpendingLimitDollars": 500  }'

レスポンス:

{  "group": {    "id": "team_group_01k2ja2000e0080000000000n2",    "name": "Platform Engineering",    "memberCount": 12,    "monthlySpendingLimitDollars": 500,    "createdAt": "2026-01-15T10:30:00.000Z",    "updatedAt": "2026-01-20T14:22:00.000Z"  }}

チームのディレクトリグループ の削除

DELETE/teams/directory-groups/:groupId

チームのディレクトリグループ を削除します。グループは空である必要があるため、削除前にすべてのメンバーを除外してください。

パラメータ

groupId 文字列 必須

team_group_… プレフィックス付きのグループの公開 ID。例: team_group_01k2ja2000e0080000000000n2。

レスポンス

グループの削除後に 204 No Content を返します。

エラー

  • 400 - グループにまだメンバーが残っている、またはグループに有効な SCIM mapping がある。
curl -X DELETE https://api.cursor.com/teams/directory-groups/team_group_01k2ja2000e0080000000000n2 \  -u YOUR_API_KEY:

レスポンス: 204 No Content

チームのディレクトリグループのメンバー一覧を取得

GET/teams/directory-groups/:groupId/members

チームのディレクトリグループのメンバーを取得します。

パラメータ

groupId 文字列 必須

team_group_… プレフィックスが付いたグループの公開 ID (例: team_group_01k2ja2000e0080000000000n2)。

クエリパラメータ

page number

ページ番号。デフォルトは 1。

pageSize number

1 ページあたりのメンバー数。デフォルトは 50。上限は 200 で、200 を超える値は 200 に制限されます。

レスポンスフィールド

members 内の各オブジェクトには次が含まれます:

  • userId 文字列 - user_ プレフィックスが付いた公開ユーザー ID
  • name 文字列 - メンバーの表示名
  • email 文字列 - メンバーのメールアドレス
  • joinedAt 文字列 - メンバーがグループに追加された日時 (ISO 8601 形式)

pagination オブジェクト

ページネーションのメタデータ: page、pageSize、totalCount、totalPages、hasNextPage、hasPreviousPage。
curl -X GET "https://api.cursor.com/teams/directory-groups/team_group_01k2ja2000e0080000000000n2/members?page=1&pageSize=50" \  -u YOUR_API_KEY:

レスポンス:

{  "members": [    {      "userId": "user_abc123",      "name": "Alex Developer",      "email": "[email protected]",      "joinedAt": "2026-01-15T10:30:00.000Z"    },    {      "userId": "user_def456",      "name": "Sam Engineer",      "email": "[email protected]",      "joinedAt": "2026-01-16T09:15:00.000Z"    }  ],  "pagination": {    "page": 1,    "pageSize": 50,    "totalCount": 2,    "totalPages": 1,    "hasNextPage": false,    "hasPreviousPage": false  }}

チームのディレクトリグループへのメンバー追加

POST/teams/directory-groups/:groupId/members/bulk-add

手動管理のチームのディレクトリグループにメンバーを追加します。

パラメータ

groupId 文字列 必須

team_group_… プレフィックス付きのグループの公開 ID。例: team_group_01k2ja2000e0080000000000n2。

リクエスト本文

userIds 文字列[] 必須

user_ プレフィックス付きの公開ユーザー ID の配列。1 回のリクエストで最大 100 ユーザーまで指定できます。

レスポンスフィールド

addedCount number

このリクエストで作成されたメンバーシップの数。チーム外のユーザーや、すでにグループに所属しているユーザーは Cherri Code 側で無視されるため、この数には含まれません。
curl -X POST https://api.cursor.com/teams/directory-groups/team_group_01k2ja2000e0080000000000n2/members/bulk-add \  -u YOUR_API_KEY: \  -H "Content-Type: application/json" \  -d '{    "userIds": ["user_abc123", "user_def456"]  }'

レスポンス:

{  "addedCount": 2}

チームのディレクトリグループからのメンバー削除

POST/teams/directory-groups/:groupId/members/bulk-remove

手動管理のチームのディレクトリグループからメンバーを削除します。

パラメータ

groupId 文字列 必須

team_group_… プレフィックス付きのグループの公開 ID (例: team_group_01k2ja2000e0080000000000n2) 。

リクエスト本文

userIds 文字列[] 必須

user_ プレフィックス付きの公開ユーザー ID の配列。1 回のリクエストで最大 100 ユーザーまで指定できます。

レスポンスフィールド

removedCount number

このリクエストで削除されたメンバーシップの数。グループに所属していないユーザーは Cherri Code 側で無視されるため、この数には含まれません。
curl -X POST https://api.cursor.com/teams/directory-groups/team_group_01k2ja2000e0080000000000n2/members/bulk-remove \  -u YOUR_API_KEY: \  -H "Content-Type: application/json" \  -d '{    "userIds": ["user_def456"]  }'

レスポンス:

{  "removedCount": 1}

請求グループ

請求グループ を使用すると、Enterprise 管理者はユーザーグループごとの支出を把握・管理できます。この機能は、レポート作成、社内チャージバック、予算策定に役立ちます。

メンバーは同時に 1 つの請求グループにしか所属できません。どのグループにも割り当てられていないメンバーは、自動的に専用の Unassigned グループに割り当てられます。

グループ一覧

GET/teams/groups

現在の請求サイクルの支出データとともに、チーム内のすべての請求グループを取得します。

パラメータ

billingCycle 文字列

照会する請求サイクルを指定する ISO 形式の日付文字列 (例: 2025-01-15)。指定がない場合は現在のサイクルになります。
curl -X GET "https://api.cursor.com/teams/groups?billingCycle=2025-01-15" \  -u YOUR_API_KEY:

レスポンス:

{  "groups": [    {      "id": "group_PDSPmvukpYgZEDXsoNirw3CFhy",      "name": "Engineering",      "type": "BILLING",      "directoryGroupId": null,      "memberCount": 12,      "createdAt": "2024-01-15T10:30:00.000Z",      "updatedAt": "2024-01-20T14:22:00.000Z",      "spendCents": 245000,      "currentMembers": [        {          "userId": "user_abc123",          "name": "Alex Developer",          "email": "[email protected]",          "joinedAt": "2024-01-15T10:30:00.000Z",          "leftAt": null,          "spendCents": 12500        }      ],      "formerMembers": [],      "dailySpend": [        { "date": "2025-01-15", "spendCents": 8500 },        { "date": "2025-01-16", "spendCents": 9200 }      ]    },    {      "id": "group_kljUvI0ASZORvSEXf9hV0ydcso",      "name": "Design",      "type": "BILLING",      "directoryGroupId": "dir_group_abc123xyz",      "memberCount": 5,      "createdAt": "2024-01-16T09:00:00.000Z",      "updatedAt": "2024-01-16T09:00:00.000Z",      "spendCents": 87500,      "currentMembers": [],      "formerMembers": [],      "dailySpend": []    }  ],  "unassignedGroup": {    "id": "group_unassigned",    "name": "Unassigned",    "type": "BILLING",    "directoryGroupId": null,    "memberCount": 3,    "createdAt": "2024-01-01T00:00:00.000Z",    "updatedAt": "2024-01-01T00:00:00.000Z",    "spendCents": 15000,    "currentMembers": [],    "formerMembers": [],    "dailySpend": []  },  "billingCycle": {    "cycleStart": "2025-01-01T00:00:00.000Z",    "cycleEnd": "2025-02-01T00:00:00.000Z"  }}

グループを取得

GET/teams/groups/:groupId

現在の請求サイクルについて、メンバーおよび支出データを含む 1 件の請求グループを取得します。

パラメータ

groupId string 必須

エンコードされたグループ ID (例: group_PDSPmvukpYgZEDXsoNirw3CFhy)

billingCycle string

取得対象の請求サイクルを指定する ISO 形式の日付文字列 (例: 2025-01-15)。省略した場合は現在のサイクルが使用されます。
curl -X GET "https://api.cursor.com/teams/groups/group_PDSPmvukpYgZEDXsoNirw3CFhy?billingCycle=2025-01-15" \  -u YOUR_API_KEY:

レスポンス:

{  "group": {    "id": "group_PDSPmvukpYgZEDXsoNirw3CFhy",    "name": "Engineering",    "type": "BILLING",    "directoryGroupId": null,    "memberCount": 3,    "createdAt": "2024-01-15T10:30:00.000Z",    "updatedAt": "2024-01-20T14:22:00.000Z",    "spendCents": 125000,    "currentMembers": [      {        "userId": "user_abc123",        "name": "Alex Developer",        "email": "[email protected]",        "joinedAt": "2024-01-15T10:30:00.000Z",        "leftAt": null,        "spendCents": 75000,        "dailySpend": [          { "date": "2025-01-15", "spendCents": 5000 },          { "date": "2025-01-16", "spendCents": 7500 }        ]      },      {        "userId": "user_def456",        "name": "Sam Engineer",        "email": "[email protected]",        "joinedAt": "2024-01-16T09:15:00.000Z",        "leftAt": null,        "spendCents": 50000,        "dailySpend": [          { "date": "2025-01-15", "spendCents": 3500 },          { "date": "2025-01-16", "spendCents": 4200 }        ]      }    ],    "formerMembers": [      {        "userId": "user_xyz789",        "name": "Former Member",        "email": "[email protected]",        "joinedAt": "2024-01-10T08:00:00.000Z",        "leftAt": "2024-01-14T17:00:00.000Z",        "spendCents": 0      }    ],    "dailySpend": [      { "date": "2025-01-15", "spendCents": 8500 },      { "date": "2025-01-16", "spendCents": 11700 }    ]  },  "billingCycle": {    "cycleStart": "2025-01-01T00:00:00.000Z",    "cycleEnd": "2025-02-01T00:00:00.000Z"  }}

グループの作成

POST/teams/groups

新しい請求グループを作成します。チームごとに1分あたり20リクエストのレート制限があります。

パラメータ

name string 必須

グループ名

type string

グループの種類。現在は BILLING のみサポートされています。デフォルト値: BILLING
curl -X POST https://api.cursor.com/teams/groups \  -u YOUR_API_KEY: \  -H "Content-Type: application/json" \  -d '{    "name": "Engineering"  }'

レスポンス:

{  "group": {    "id": "group_PDSPmvukpYgZEDXsoNirw3CFhy",    "name": "Engineering",    "type": "BILLING",    "directoryGroupId": null,    "memberCount": 0,    "createdAt": "2024-01-15T10:30:00.000Z",    "updatedAt": "2024-01-15T10:30:00.000Z",    "members": []  }}

グループの更新

PATCH/teams/groups/:groupId

請求グループの名前またはディレクトリグループの関連付けを更新します。チームごとに1分あたり20リクエストのレート制限があります。

パラメータ

groupId string 必須

エンコードされたグループ ID

name string

グループの新しい名前

directoryGroupId string | null

同期するディレクトリグループ ID。ディレクトリ同期から切り離す場合は null を指定します
curl -X PATCH https://api.cursor.com/teams/groups/group_PDSPmvukpYgZEDXsoNirw3CFhy \  -u YOUR_API_KEY: \  -H "Content-Type: application/json" \  -d '{    "name": "Platform Engineering"  }'

レスポンス:

{  "group": {    "id": "group_PDSPmvukpYgZEDXsoNirw3CFhy",    "name": "Platform Engineering",    "type": "BILLING",    "directoryGroupId": null,    "memberCount": 3,    "createdAt": "2024-01-15T10:30:00.000Z",    "updatedAt": "2024-01-25T16:45:00.000Z",    "members": [      {        "userId": "user_abc123",        "name": "Alex Developer",        "email": "[email protected]",        "joinedAt": "2024-01-15T10:30:00.000Z"      }    ]  }}

グループの削除

DELETE/teams/groups/:groupId

請求グループを削除します。成功時には 204 No Content を返します。チームごとに1分あたり20リクエストのレート制限があります。

パラメータ

groupId string 必須

削除するエンコードされたグループ ID
curl -X DELETE https://api.cursor.com/teams/groups/group_PDSPmvukpYgZEDXsoNirw3CFhy \  -u YOUR_API_KEY:

レスポンス:

204 No Content

グループにメンバーを追加

POST/teams/groups/:groupId/members

チームメンバーを請求グループに追加します。ユーザーはすでにチームのメンバーであり、かつ現在ほかのグループに割り当てられていない必要があります。チームごとに1分あたり20リクエストのレート制限があります。

パラメータ

groupId string 必須

エンコードされたグループ ID

userIds string[] 必須

追加するエンコードされたユーザー ID の配列 (例: ["user_abc123", "user_def456"])
curl -X POST https://api.cursor.com/teams/groups/group_PDSPmvukpYgZEDXsoNirw3CFhy/members \  -u YOUR_API_KEY: \  -H "Content-Type: application/json" \  -d '{    "userIds": ["user_abc123", "user_def456"]  }'

レスポンス:

{  "group": {    "id": "group_PDSPmvukpYgZEDXsoNirw3CFhy",    "name": "Engineering",    "type": "BILLING",    "directoryGroupId": null,    "memberCount": 2,    "createdAt": "2024-01-15T10:30:00.000Z",    "updatedAt": "2024-01-25T16:50:00.000Z",    "members": [      {        "userId": "user_abc123",        "name": "Alex Developer",        "email": "[email protected]",        "joinedAt": "2024-01-25T16:50:00.000Z"      },      {        "userId": "user_def456",        "name": "Sam Engineer",        "email": "[email protected]",        "joinedAt": "2024-01-25T16:50:00.000Z"      }    ]  }}

グループからメンバーを削除

DELETE/teams/groups/:groupId/members

請求グループからチームメンバーを削除します。削除されたメンバーは Unassigned グループに移動されます。チームごとに1分あたり20リクエストのレート制限があります。

パラメータ

groupId string 必須

エンコードされたグループ ID

userIds string[] 必須

削除するエンコードされたユーザー ID の配列
curl -X DELETE https://api.cursor.com/teams/groups/group_PDSPmvukpYgZEDXsoNirw3CFhy/members \  -u YOUR_API_KEY: \  -H "Content-Type: application/json" \  -d '{    "userIds": ["user_def456"]  }'

レスポンス:

{  "group": {    "id": "group_PDSPmvukpYgZEDXsoNirw3CFhy",    "name": "Engineering",    "type": "BILLING",    "directoryGroupId": null,    "memberCount": 1,    "createdAt": "2024-01-15T10:30:00.000Z",    "updatedAt": "2024-01-25T17:00:00.000Z",    "members": [      {        "userId": "user_abc123",        "name": "Alex Developer",        "email": "[email protected]",        "joinedAt": "2024-01-25T16:50:00.000Z"      }    ]  }}

モデルアクセス

チームのモデルアクセスポリシー (カスタムポリシーが有効かどうか、新規プロバイダーとモデルのデフォルト、プロバイダー/モデルごとのトグル、Fast や reasoning effort などのモデルごとの設定) を取得・更新します。

パラメータ設定なしでモデルを有効にすると、カタログのデフォルト設定が適用されたままになります。Fast などのデフォルトがチームのポリシーに合わない場合は、モデルごとの設定を使用してください。

これらのルートはチームのベースラインを返します。Organization Groups では一部のメンバーのアクセスを拡張できますが、グループの許可リストはこの API の対象外です。個人用 API キー (BYOK) の制御はダッシュボードで行います。

組織全体の読み取りや、リンクされたチームにまたがる一括トグルについては、Organization API のモデルアクセスルートを参照してください。

モデルアクセス設定を取得

GET/teams/model-access/configuration

チームにカスタムモデルアクセスポリシーがあるかどうかと、新たに追加されたプロバイダーおよびモデルのデフォルトを返します。

レスポンスフィールド

teamId number

API キーから特定される整数のチーム ID。

state string

unrestricted、custom、legacy のいずれか。

newProviderDefault string | null

state が custom の場合は enabled または disabled。それ以外の場合は null。

newModelDefault string | null

state が custom の場合は enabled または disabled。それ以外の場合は null。
curl -X GET https://api.cursor.com/teams/model-access/configuration \  -u YOUR_API_KEY:

レスポンス:

{  "teamId": 7,  "state": "unrestricted",  "newProviderDefault": null,  "newModelDefault": null}

モデルアクセス設定を更新

PUT/teams/model-access/configuration

カスタムポリシーを作成する、デフォルトを更新する、またはチームを無制限に戻します。

次のいずれかを送信します。

  • { "state": "unrestricted" }:カスタムポリシー (およびレガシーの許可リスト/ブロックリスト) をクリアし、state を unrestricted にします
  • { "newProviderDefault", "newModelDefault" }:カスタムポリシーを作成または更新します (state: "custom" の後方互換性のある省略記法)

無制限のチームに対する最初のデフォルト PUT では、カスタムポリシーが作成され、カタログエントリが設定されます。以降のデフォルト PUT ではデフォルトのみが更新され、既存のトグルはそのまま維持されます。

リクエスト本文

state string

任意。ポリシーをクリアするには unrestricted を使用します。デフォルトを送信する場合は省略します。

newProviderDefault string

enabled または disabled。カスタムポリシーを作成または更新する場合は必須です。state が unrestricted の場合は省略します。

newModelDefault string

enabled または disabled。カスタムポリシーを作成または更新する場合は必須です。state が unrestricted の場合は省略します。
curl -X PUT https://api.cursor.com/teams/model-access/configuration \  -u YOUR_API_KEY: \  -H "Content-Type: application/json" \  -d '{    "newProviderDefault": "disabled",    "newModelDefault": "enabled"  }'

レスポンス:

{  "teamId": 7,  "state": "custom",  "newProviderDefault": "disabled",  "newModelDefault": "enabled"}

チームを無制限に戻す:

curl -X PUT https://api.cursor.com/teams/model-access/configuration \  -u YOUR_API_KEY: \  -H "Content-Type: application/json" \  -d '{ "state": "unrestricted" }'

レスポンス:

{  "teamId": 7,  "state": "unrestricted",  "newProviderDefault": null,  "newModelDefault": null}

モデルアクセスプロバイダーを一覧表示

GET/teams/model-access/providers

解決済みの有効化フラグとモデルごとの parameters を含む、カタログ内のプロバイダーとモデルを一覧表示します。チームにカスタムポリシーがない場合は 409 を返します。

各モデルには、カタログに基づく parameters 配列が含まれます。パラメータ ID とサポートされる値はモデルカタログから取得されます (例: fast、reasoning、effort、context) 。書き込み前に、この GET を使用してモデルがサポートするパラメータを確認してください。

モデルの parameters フィールド

id string

パラメータ ID (例: fast、reasoning) 。

displayName string

人間が読みやすいラベル。

supportedValues string[]

このモデルのこのパラメータに対してカタログで許可されているすべての値。

allowedValues string[]

チームポリシーで現在許可されている値。

configuredDefaultValue string | null

管理者が固定したデフォルト値。未設定の場合は null。

catalogDefaultValue string | null

このモデルのパラメータに対するカタログのデフォルト値。
curl -X GET https://api.cursor.com/teams/model-access/providers \  -u YOUR_API_KEY:

レスポンス:

{  "teamId": 7,  "state": "custom",  "providers": [    {      "id": "anthropic",      "displayName": "Anthropic",      "enabled": true,      "models": [        {          "id": "claude-opus-4-6",          "displayName": "Opus 4.6",          "enabled": true,          "parameters": [            {              "id": "fast",              "displayName": "Fast",              "supportedValues": ["false", "true"],              "allowedValues": ["false", "true"],              "configuredDefaultValue": null,              "catalogDefaultValue": "true"            }          ]        }      ]    },    {      "id": "openai",      "displayName": "OpenAI",      "enabled": true,      "models": [        {          "id": "gpt-5.4",          "displayName": "GPT-5.4",          "enabled": true,          "parameters": [            {              "id": "reasoning",              "displayName": "Reasoning",              "supportedValues": ["low", "medium", "high", "xhigh", "max"],              "allowedValues": ["low", "medium", "high"],              "configuredDefaultValue": "high",              "catalogDefaultValue": "medium"            }          ]        }      ]    }  ]}

モデルアクセスプロバイダーを更新

PUT/teams/model-access/providers/:provider

プロバイダーを有効または無効にします。チームがまだ unrestricted または legacy の場合は、409 を返します。

パラメータ

provider string 必須

カタログ内のプロバイダー ID (例: openai、anthropic) 。

リクエスト本文

enabled boolean 必須

curl -X PUT https://api.cursor.com/teams/model-access/providers/openai \  -u YOUR_API_KEY: \  -H "Content-Type: application/json" \  -d '{"enabled": false}'

プロバイダーのモデルを一覧表示

GET/teams/model-access/providers/:provider/models

解決済みの有効化フラグとモデルごとの parameters を含む、特定のプロバイダーのモデルを一覧表示します。パラメータフィールドはプロバイダーのレスポンスと一致します。チームにカスタムポリシーがない場合は、409 を返します。

パラメータ

provider string 必須

カタログ内のプロバイダー ID (例: anthropic) 。
curl -X GET https://api.cursor.com/teams/model-access/providers/anthropic/models \  -u YOUR_API_KEY:

モデルアクセスモデルを更新

PUT/teams/model-access/providers/:provider/models/:model

個別のモデルを有効または無効にし、必要に応じてモデルごとのパラメータ制限とデフォルトを設定します。チームが unrestricted または legacy のままの場合、409 を返します。

パラメータ

provider string 必須

カタログ内のプロバイダー ID (例: anthropic) 。

model string 必須

カタログモデル ID (例: claude-opus-4-6) 。

リクエスト本文

enabled boolean 必須

parameters object

パラメータ ID から設定への任意のマップです。省略したパラメータやフィールドは変更されません。
  • allowedValues string[] | null: メンバーが選択できる値を制限します。制限を解除するには null を渡します。
  • defaultValue string | null: チームのデフォルト値です。制限が設定されている場合は allowedValues 内の値である必要があります。カタログのデフォルトを復元するには null を渡します。

不明なパラメータ ID または値、空の allowedValues 配列、allowedValues 外のデフォルト値、有効なモデルバリアントに解決されない設定では 400 が返されます。

モデルの Fast を無効にする:

curl -X PUT https://api.cursor.com/teams/model-access/providers/anthropic/models/claude-opus-4-6 \  -u YOUR_API_KEY: \  -H "Content-Type: application/json" \  -d '{    "enabled": true,    "parameters": {      "fast": { "allowedValues": ["false"] }    }  }'

許可する推論レベルとデフォルトを設定する:

curl -X PUT https://api.cursor.com/teams/model-access/providers/openai/models/gpt-5.4 \  -u YOUR_API_KEY: \  -H "Content-Type: application/json" \  -d '{    "enabled": true,    "parameters": {      "reasoning": {        "allowedValues": ["low", "medium", "high"],        "defaultValue": "high"      }    }  }'

制限を解除してカタログのデフォルトを復元する:

curl -X PUT https://api.cursor.com/teams/model-access/providers/openai/models/gpt-5.4 \  -u YOUR_API_KEY: \  -H "Content-Type: application/json" \  -d '{    "enabled": true,    "parameters": {      "reasoning": {        "allowedValues": null,        "defaultValue": null      }    }  }'

レスポンス:

{  "id": "gpt-5.4",  "displayName": "GPT-5.4",  "enabled": true,  "provider": "openai",  "parameters": [    {      "id": "reasoning",      "displayName": "Reasoning",      "supportedValues": ["low", "medium", "high", "xhigh", "max"],      "allowedValues": ["low", "medium", "high", "xhigh", "max"],      "configuredDefaultValue": null,      "catalogDefaultValue": "medium"    }  ]}

エラー

エラー本文には以下を使用します。

{ "code": "error", "message": "…" }
ステータス発生条件
401キーが不正、または models:read / models:* (または admin:*) がない
403そのチームではモデルアクセス制御を利用できない
409state が unrestricted または legacy のときにプロバイダーまたはモデルを読み取りまたは書き込んだ
400不明なプロバイダー、モデル、パラメータ ID、またはパラメータ値、無効なリクエスト本文、空の allowedValues、allowedValues 外のデフォルト値、有効なモデルバリアントに解決されない設定、または Smart Auto の必須モデルがブロックされる場合

Grok Bot

Grok Bot を有効にし、機能、Enforce Auto-Review、グループ アクセス、ネットワーク ポリシー、チーム ルール、セットアップ スクリプトを管理します。

Grok Bot を有効にする

POST/grok-bot/enable

チームで Grok Bot を有効にします。対象となるエンタープライズ チームで初めて有効にすると、トライアルが開始されます。成功すると 204 No Content を返します。

curl -X POST https://api.cursor.com/grok-bot/enable \  -u YOUR_API_KEY:

レスポンス:

204 No Content

Grok Bot を無効にする

POST/grok-bot/disable

チームで Grok Bot を無効にします。メンバーはアクセスできなくなりますが、コンピューターは削除されません。Teams プランでは 403 が返されます。

curl -X POST https://api.cursor.com/grok-bot/disable \  -u YOUR_API_KEY:

レスポンス:

204 No Content

Grok Bot の機能を取得

GET/grok-bot/capabilities

チームの Grok Bot の機能を返します。

レスポンスフィールド

enabled boolean

Grok Bot が有効かどうか。参照専用です。

cloudAgents boolean

メンバーが Cloud Agents に作業を委任できるかどうか。

templateSharing string | null

all、team_only、none、またはチームのデフォルトを表す null。

actionRecording boolean

アクション記録が有効かどうか。

localExecution string | null

メンバーのマシン上で動作する Bot に対するチームの上限: never、ask、always、または上限なしを表す null。

localEgressAllowed boolean

メンバーが Grok Bot のウェブトラフィックを自分のコンピューター経由でルーティングできるかどうか (Allow Local Egress Routing、エンタープライズ限定) 。
curl -X GET https://api.cursor.com/grok-bot/capabilities \  -u YOUR_API_KEY:

レスポンス:

{  "enabled": true,  "cloudAgents": true,  "templateSharing": "team_only",  "actionRecording": false,  "localExecution": "ask",  "localEgressAllowed": true}

Grok Bot の機能を更新

PATCH/grok-bot/capabilities

Grok Bot の機能を更新します。省略したフィールドは変更されません。チームで利用できないフィールドを指定した場合は 403 が返されます。

パラメータ

cloudAgents boolean

メンバーが Cloud Agents に作業を委任できるかどうか。

templateSharing string | null

all、team_only、none、またはチームのデフォルトに戻す null。

actionRecording boolean

アクション記録が有効かどうか。

localExecution string | null

never、ask、always、またはチームの上限を解除する null。

localEgressAllowed boolean

メンバーが Grok Bot のウェブトラフィックを自分のコンピューター経由でルーティングできるかどうか (Allow Local Egress Routing、エンタープライズのみ) 。チームで local egress routing の制御が有効になっていない場合は 403 が返されます。
curl -X PATCH https://api.cursor.com/grok-bot/capabilities \  -u YOUR_API_KEY: \  -H "Content-Type: application/json" \  -d '{    "cloudAgents": false,    "localExecution": "never",    "localEgressAllowed": false  }'

レスポンス:

{  "enabled": true,  "cloudAgents": false,  "templateSharing": "team_only",  "actionRecording": false,  "localExecution": "never",  "localEgressAllowed": false}

Enforce Auto-Review を取得

GET/grok-bot/auto-review

チームの Enforce Auto-Review ポリシーを返します。

レスポンスフィールド

enforced boolean

true の場合、すべてのメンバーは Enforce Auto-Review を有効のままにする必要があります。

rules object

Auto Review に渡されるチームの allow および block の指示リスト。
curl -X GET https://api.cursor.com/grok-bot/auto-review \  -u YOUR_API_KEY:

レスポンス:

{  "enforced": true,  "rules": {    "allow": ["Read-only git commands"],    "block": ["Publishing releases"]  }}

Enforce Auto-Review の置き換え

PUT/grok-bot/auto-review

チームの Enforce Auto-Review ポリシーを置き換えます。チームで Enforce Auto-Review が利用できない場合は 403 が返ります。

パラメータ

enforced boolean 必須

true の場合、すべての member は Enforce Auto-Review を有効のままにする必要があります。

rules object 必須

allow および block の instruction リスト。
  • allow string[]: instruction は最大 20 件、各 1,000 文字以内。トリミングされ、重複は除去されます。
  • block string[]: instruction は最大 20 件、各 1,000 文字以内。トリミングされ、重複は除去されます。
curl -X PUT https://api.cursor.com/grok-bot/auto-review \  -u YOUR_API_KEY: \  -H "Content-Type: application/json" \  -d '{    "enforced": true,    "rules": {      "allow": ["Read-only git commands"],      "block": ["Publishing releases"]    }  }'

instruction を変更せずに Enforce Auto-Review をロックする:

curl -X PUT https://api.cursor.com/grok-bot/auto-review \  -u YOUR_API_KEY: \  -H "Content-Type: application/json" \  -d '{    "enforced": true,    "rules": { "allow": [], "block": [] }  }'

レスポンス:

{  "enforced": true,  "rules": {    "allow": ["Read-only git commands"],    "block": ["Publishing releases"]  }}

Grok Bot アクセスの取得

GET/grok-bot/access

チーム内で Grok Bot を利用できるユーザーを返します。

レスポンスフィールド

mode string

all または limited。

groups array

mode が limited の場合に選択されている group。各項目にはエンコードされた id と name が含まれます。mode が all の場合は空になります。
curl -X GET https://api.cursor.com/grok-bot/access \  -u YOUR_API_KEY:

レスポンス:

{  "mode": "limited",  "groups": [    {      "id": "group_PDSPmvukpYgZEDXsoNirw3CFhy",      "name": "Platform Engineering"    }  ]}

Grok Bot アクセスの更新

PUT/grok-bot/access

チーム内で Grok Bot を使用できるユーザーを設定します。チームで group access を利用できない場合は 403 が返されます。

パラメータ

mode string 必須

全メンバーの場合は all、選択した billing group の場合は limited。

groupIds array

List Groups で取得した encoded group ID。mode が limited の場合は必須です (1〜100 個、重複は 1 つとしてカウント) 。mode が all の場合は省略してください。

不明な ID や形式が不正な ID、空の limited リスト、all と併せてグループ ID を指定した場合は 400 が返されます。

curl -X PUT https://api.cursor.com/grok-bot/access \  -u YOUR_API_KEY: \  -H "Content-Type: application/json" \  -d '{    "mode": "limited",    "groupIds": ["group_PDSPmvukpYgZEDXsoNirw3CFhy"]  }'

レスポンス:

{  "mode": "limited",  "groups": [    {      "id": "group_PDSPmvukpYgZEDXsoNirw3CFhy",      "name": "Platform Engineering"    }  ]}

Grok Bot ネットワークポリシーの取得

GET/grok-bot/network

チームの Grok Bot ネットワークポリシーを返します。

レスポンスフィールド

egressMode string

unset、allow_all、default_with_network_settings、または network_settings_only。

allowlist array

許可する送信先: ドメイン、ワイルドカードドメイン、IP アドレス、CIDR 範囲、または 54.85.223.0/24:3306 のような host-or-CIDR:port。

locked boolean

true の場合、グループポリシーでチームポリシーを上書きできません。
curl -X GET https://api.cursor.com/grok-bot/network \  -u YOUR_API_KEY:

レスポンス:

{  "egressMode": "network_settings_only",  "allowlist": ["linkedin.com", "*.crunchbase.com", "10.0.0.0/8", "54.85.223.0/24:3306"],  "locked": true}

Grok Bot のネットワークポリシーを置き換える

PUT/grok-bot/network

チームの Grok Bot ネットワークポリシーを置き換えます。Teams プランでは 403 を返します。

パラメータ

egressMode string 必須

次のいずれか:
  • unset: ポリシーを適用しません
  • allow_all: すべての送信先を許可します
  • default_with_network_settings: Cherri Code のデフォルトに加えて許可リスト
  • network_settings_only: 許可リストと、Grok Bot の実行に必要な送信先

allowlist array 必須

最大 500 件の送信先で、各 1〜253 文字。ドメイン、ワイルドカードドメイン、IP アドレス、CIDR 範囲、または 54.85.223.0/24:3306 のような host-or-CIDR:port を指定できます。

locked boolean 必須

true の場合、グループポリシーでチームポリシーを上書きできません。

不完全なボディ、不明なモード、無効な許可リストのエントリの場合は 400 を返します。

curl -X PUT https://api.cursor.com/grok-bot/network \  -u YOUR_API_KEY: \  -H "Content-Type: application/json" \  -d '{    "egressMode": "network_settings_only",    "allowlist": ["linkedin.com", "*.crunchbase.com", "10.0.0.0/8", "54.85.223.0/24:3306"],    "locked": true  }'

レスポンス:

{  "egressMode": "network_settings_only",  "allowlist": ["linkedin.com", "*.crunchbase.com", "10.0.0.0/8", "54.85.223.0/24:3306"],  "locked": true}

Grok Bot チームルールの一覧取得

GET/grok-bot/team-rules

Grok Bot のチームルールを新しい順に一覧取得します。

パラメータ

limit number

1 ページあたりの件数。デフォルト: 50。最大: 100。

cursor string

前回の nextCursor から得られる opaque cursor。
curl -X GET "https://api.cursor.com/grok-bot/team-rules?limit=50" \  -u YOUR_API_KEY:

レスポンス:

{  "teamRules": [    {      "id": "rule_PDSPmvukpYgZEDXsoNirw3CFhy",      "name": "Ask before publishing",      "content": "Never publish a release without an explicit go from the requester.",      "enabled": true,      "scope": "grokBot",      "createdAt": "2024-01-15T10:30:00.000Z",      "updatedAt": "2024-01-15T10:30:00.000Z"    }  ],  "nextCursor": null}

Grok Bot チームルールの作成

POST/grok-bot/team-rules

Grok Bot のチームルールを作成します。1 つのチームで保存できる Grok Bot ルールは最大 50 件です。201 を返します。

パラメータ

name string 必須

1〜255 文字。

content string 必須

1〜30,000 文字。

enabled boolean 必須

ルールを有効にするかどうか。
curl -X POST https://api.cursor.com/grok-bot/team-rules \  -u YOUR_API_KEY: \  -H "Content-Type: application/json" \  -d '{    "name": "Ask before publishing",    "content": "Never publish a release without an explicit go from the requester.",    "enabled": true  }'

レスポンス:

{  "teamRule": {    "id": "rule_PDSPmvukpYgZEDXsoNirw3CFhy",    "name": "Ask before publishing",    "content": "Never publish a release without an explicit go from the requester.",    "enabled": true,    "scope": "grokBot",    "createdAt": "2024-01-15T10:30:00.000Z",    "updatedAt": "2024-01-15T10:30:00.000Z"  }}

Grok Bot のチームルールを更新

PATCH/grok-bot/team-rules/:id

Grok Bot のチームルールを更新します。ルールが存在しない場合は 404 を返します。

パラメータ

id string 必須

一覧または作成のレスポンスで返されるエンコード済みのルール ID。

name string

1〜255 文字。

content string

1〜30,000 文字。

enabled boolean

ルールを有効にするかどうか。
curl -X PATCH https://api.cursor.com/grok-bot/team-rules/rule_PDSPmvukpYgZEDXsoNirw3CFhy \  -u YOUR_API_KEY: \  -H "Content-Type: application/json" \  -d '{    "enabled": false  }'

レスポンス:

{  "teamRule": {    "id": "rule_PDSPmvukpYgZEDXsoNirw3CFhy",    "name": "Ask before publishing",    "content": "Never publish a release without an explicit go from the requester.",    "enabled": false,    "scope": "grokBot",    "createdAt": "2024-01-15T10:30:00.000Z",    "updatedAt": "2024-01-15T10:30:00.000Z"  }}

Grok Bot のチームルールを削除

DELETE/grok-bot/team-rules/:id

Grok Bot のチームルールを削除します。成功時は 204 No Content を返します。

パラメータ

id string 必須

削除するルールのエンコード済み ID。
curl -X DELETE https://api.cursor.com/grok-bot/team-rules/rule_PDSPmvukpYgZEDXsoNirw3CFhy \  -u YOUR_API_KEY:

レスポンス:

204 No Content

Grok Bot セットアップマニフェストの一覧取得

GET/grok-bot/setup-manifests

Grok Bot のセットアップマニフェストを id 順で一覧取得します。

パラメータ

limit number

1 ページあたりの件数。デフォルト: 50。最大: 100。

cursor string

前回の nextCursor から得られる opaque cursor。
curl -X GET "https://api.cursor.com/grok-bot/setup-manifests?limit=50" \  -u YOUR_API_KEY:

レスポンス:

{  "manifests": [    {      "id": "toolchain",      "scripts": [        { "id": "node", "setup": "mise install node@22", "check": "node --version" },        { "id": "pnpm", "setup": "npm i -g pnpm" }      ]    }  ],  "nextCursor": null}

Grok Bot セットアップマニフェストの upsert

PUT/grok-bot/setup-manifests/:manifestId

セットアップマニフェストを作成または置き換えます。1チームあたり最大100件のマニフェストを保存できます。リクエスト中にマニフェストが変更された場合は 409 を返します。

パラメータ

manifestId string 必須

1〜128文字。先頭は英字または数字で、以降は英数字、.、_、- が使用できます。

scripts array 必須

Setup scripts。
  • id string: manifestId と同じ形式
  • setup string: 空でないインストール command
  • check string: 任意の検証 command
curl -X PUT https://api.cursor.com/grok-bot/setup-manifests/toolchain \  -u YOUR_API_KEY: \  -H "Content-Type: application/json" \  -d '{    "scripts": [      { "id": "node", "setup": "mise install node@22", "check": "node --version" },      { "id": "pnpm", "setup": "npm i -g pnpm" }    ]  }'

レスポンス:

{  "manifest": {    "id": "toolchain",    "scripts": [      { "id": "node", "setup": "mise install node@22", "check": "node --version" },      { "id": "pnpm", "setup": "npm i -g pnpm" }    ]  }}

Grok Bot セットアップマニフェストの削除

DELETE/grok-bot/setup-manifests/:manifestId

セットアップマニフェストを削除します。成功時は 204 No Content を返します。

パラメータ

manifestId string 必須

削除するマニフェストキー。
curl -X DELETE https://api.cursor.com/grok-bot/setup-manifests/toolchain \  -u YOUR_API_KEY:

レスポンス:

204 No Content

エラー

エラー本文には以下を使用します。

{ "code": "error", "message": "…" }
ステータス発生条件
401キーが不正、read:* / admin:* がない、またはチームで Grok Bot Admin API が有効になっていない
403そのチームまたはプランではその書き込みを利用できない
404パス内の形式が正しいルール ID またはマニフェスト ID が存在しない
409リクエスト中にセットアップマニフェストが変更された
400リクエスト本文または ID が不正、PATCH が空、機能に対する enabled、不明なグループ、ルールまたはマニフェストが多すぎる、セットアップマニフェストに紐付けるオーナーがいない
429エンドポイントのレート制限を超過した