Origin API
Origin は Early Beta 段階であり、変更される可能性があります。連携を更新する際は、OpenAPI 仕様を確認してください。
Origin は Cursor のコードフォージです。公開 REST API を使用すると、アプリやツールで Origin のリポジトリ、コミット、チェック、Pull Requests、アプリのインストールを操作できます。
- Origin Apps は、アプリ JWT とインストールアクセストークンで認証します。認証を参照してください。
- 詳細なスキーマと例については、OpenAPI 仕様の完全版を参照してください。
- エージェントは、llms.txt インデックスまたは llms-full.txt の Markdown 形式の完全なリファレンスを読み込めます。
概要
Origin Apps は、OAuth 形式のインストール同意と GitHub App 形式の認証モデルを採用しています。
- アプリは、Ed25519 秘密鍵を使用して短期有効の EdDSA JWT に署名します。
- アプリは、その JWT とインストール ID を短期有効のインストールアクセストークン (
oit_…) と交換します。 - インストールトークンは、インストールで承認されたリポジトリとスコープ内でリポジトリ API を呼び出し、HTTPS 経由の Git 認証に使用します。
- Origin は、アプリに登録された webhook URL に署名付き webhook 配信を送信します。
ベース URL
https://api.cursor.com/v1/originリファレンスのエンドポイントパスには、/v1/originプレフィックス全体が含まれます。
プロトコルの規約
リクエストとレスポンスには application/json を使用します。JSON フィールド名には camelCase を使用します。タイムスタンプは RFC 3339 形式の文字列です。プルリクエスト番号やバージョン番号を含む Protobuf の 64 ビット整数は、JSON 文字列として表現します。
レスポンスは、デフォルト値のフィールドを省略せずに含めます。そのため、false の boolean、0 の number、空文字列、空の配列はいずれもボディに含まれます。キーが存在しないことをデフォルト値とみなすのではなく、値そのものを読み取ってください。存在しない、または省略されると記載されているフィールドはコントラクト上 optional であり、未設定の場合はボディに含まれません。
はじめに
Origin へのアクセス
- cursor.com/codebase で Origin をブラウズします。
- cursor.com/codebase/settings/apps でアプリの設定を管理します。
- アプリの署名キーを生成し、公開キーのみを登録します。
Origin CLI
Origin CLI をインストールしてサインインします。
curl -fsSL https://downloads.cursor.com/origin/install.sh | shorigin auth login既存のリポジトリをクローンする:
origin repo clone '{ownerSlug}/{repoName}'# または git を直接使用するgit clone 'https://origin.cursor.com/{ownerSlug}/{repoName}.git'Apps は、ユーザーログインではなく、インストールアクセストークンによる Git HTTPS 認証を使用してクローンします。
インストール
顧客の Workspace 管理者に以下を送信してください:
https://cursor.com/codebase/apps/install ?client_id=APP_ID &scope=SPACE_SEPARATED_SCOPES &redirect_uri=REGISTERED_CALLBACK &state=RANDOM_ANTI_FORGERY_VALUE &summary=SHORT_REASON_FOR_ACCESS &include_granted_scopes=true| パラメータ | 必須 | 説明 |
|---|---|---|
client_id | 対応 | Origin Apps ID。 |
scope | 対応 | スペース区切りのスコープ。repository:metadata:read は自動的に追加されます。 |
redirect_uri | パートナー主導のインストールでは対応 | 登録済みのコールバック URI と完全に一致する URI。 |
state | 強く推奨 | インストールレシートの state クレームとしてエコーされる偽造防止用のランダムな値。リダイレクト前に生成し、コールバック時にクレームを確認してください。 |
summary | 非対応 | 同意画面に表示される簡単な説明。 |
include_granted_scopes | 非対応 | true の場合、既存の付与を維持し、追加分のみをリクエストします。 |
Workspace 管理者は、ターゲットの所有者、承認するスコープ、すべてのリポジトリまたは選択したリポジトリを選択します。リポジトリへのアクセスを制御するのはアプリではなく顧客です。
承認後、Origin は登録済みのコールバック URI にリダイレクトします。
https://ci.example.com/origin/callback?installation_receipt=RECEIPT_JWTインストールレシートを確認してから、その sub クレームからインストール ID を保存します。インストールアクセストークンを発行するたびに必要になります。
インストールでは、次の 2 つのリポジトリ選択モードのいずれかを使用します。
all: インストールは、選択したターゲットが所有するすべてのリポジトリにアクセスできます。selected: インストールは、Workspace 管理者が選択したリポジトリにのみアクセスできます。
どちらのモードも、ネイティブの Origin リポジトリとミラーリポジトリの両方に対応しているため、ミラーは GET /installation/repos に表示され、選択できます。ミラーは安定したアウトバウンドミラーになるまで参照専用です。ミラーリポジトリを参照してください。
インストール トークンを使用して GET /installation/repos を呼び出すと、そのインストールで利用可能なリポジトリを確認できます。App JWT エンドポイントでは、アプリのインストールを一覧表示、確認、削除できます。インストールを削除すると、新しいトークンを発行できなくなります。
インストールレシート
installation_receipt は、Origin が署名した短期有効なコンパクト JWT です。インストールの承認が偽造されたリダイレクトによるものではなく、Origin からのものであることを証明し、コールバックに必要な情報をすべて含みます。Cursor はこれがない場合はリダイレクトを拒否するため、外部コールバックには常に含まれます。
JOSE ヘッダー:
{ "alg": "EdDSA", "kid": "origin-key-id", "typ": "origin-installation-receipt+jwt"}クレーム:
{ "iss": "https://api.cursor.com/v1/origin", "aud": "app_01...", "sub": "i_01...", "namespace_id": "ns_01...", "iat": 1786465200, "exp": 1786465500, "jti": "RECEIPT_UUID", "installedBy": { "id": "user_01...", "email": "installer@example.com", "displayName": "Jane Doe" }, "state": "ORIGINAL_VALUE"}audはアプリ ID、subはインストールアクセストークンを発行する際に使用するインストール ID です。namespace_idは、アプリがインストールされた namespace の安定した ID です。installedByは、このインストールまたは再同意を実行したユーザーを識別します。現在のアクションを示すため、再同意時には Get App Installation の永続的なinstalledByと異なる場合があります。アカウントに名前がある場合はdisplayNameを含みますが、handleは含みません。handle は REST レスポンスまたは webhook のペイロードから取得してください。- レシートは発行から 5 分で期限切れになります。
jtiはレシートごとに一意です。 stateは、インストール URL に空でないstateが含まれる場合にのみ存在し、その値をそのまま返します。リダイレクト前に生成した偽造防止用の値と照合してください。
コールバックを信頼する前にレシートを確認してください。kid ヘッダーを基に JWKS から署名キーを取得し、alg が EdDSA、typ が origin-installation-receipt+jwt であることを確認したうえで、署名、iss、aud、exp を検証します。検証に失敗した場合は、コールバックを拒否します。
レシートはインストールアクセストークンではありません。Bearer 認証情報として送信しないでください。代わりに、Create Installation Access Token でインストール トークンを発行してください。
認証
REST認証情報はBearerスキームで送信してください。各エンドポイントのAuthバッジに、受け入れ可能な認証情報のタイプが一覧表示されます。
curl --request GET \ --url https://api.cursor.com/v1/origin/repos/OWNER_SLUG/REPO_NAME \ --header "Authorization: Bearer $ORIGIN_BEARER_TOKEN"Cursor API キーはOriginのBearerトークンではありません。ユーザー認証されたリクエストには Origin CLI を使用してください。Origin CLIは、個人ユーザーの API キーを、Originが受け入れる短命なアクセストークンと交換します。Cursor API キーを Authorization ヘッダーに直接指定しないでください。
アプリの署名キーを生成する
Origin Apps は Ed25519 キーペアで認証します。キーペアをローカルで生成し、公開鍵のみを cursor.com/codebase/settings/apps に登録します。アプリでは有効な署名キーを最大 10 個保持できます。
秘密鍵は厳重に管理してください。アップロードしたり、アプリの設定に貼り付けたり、リポジトリにコミットしたり、共有したりしないでください。シークレットマネージャーに保存してください。Cursor に保存されるのは公開鍵のみです。
OpenSSL を使用して、PKCS#8 秘密鍵と PEM SPKI 公開鍵を作成します。
openssl genpkey -algorithm ED25519 -out origin-app-private.pemopenssl pkey -in origin-app-private.pem -pubout -out origin-app-public.pem公開鍵ファイルは -----BEGIN PUBLIC KEY----- で始まります。署名キーを追加する際に、この PEM を貼り付けます。対応する秘密鍵は、app JWT への署名にのみ使用してください。
アプリ JWT
アプリの有効な署名キーのいずれかに対応する Ed25519 秘密鍵で、短期有効の JWT に署名します。その鍵ペアは、アプリ署名キーを生成するで説明されている方法で生成します。
JOSE ヘッダー:
{ "alg": "EdDSA", "kid": "app_01...", "typ": "JWT"}クレーム:
{ "iss": "app_01...", "aud": "origin-apps", "iat": 1782928800, "exp": 1782929100}iss と kid にはアプリ ID を設定します。有効期限は約 5 分に設定します。
Authorization: Bearer APP_JWTアプリのメタデータの読み取り、インストールの管理、インストールトークンの発行、Webhook 配信の再取得などのアプリレベルの操作には、アプリ JWT を使用します。
インストールアクセストークン
アプリ JWT を使用して POST /app/installations/{installationId}/access_tokens を呼び出します。インストールトークンは oit_ で始まります。
Authorization: Bearer oit_...レスポンスには expiresAt が含まれます。トークンは必要になる直前に発行し、有効期限が切れる前に更新してください。パスワードと同様に扱い、決してログに記録しないでください。
インストールを削除するか、アプリを削除すると、expiresAt より前にそのインストールトークンは無効になります。その後、REST API と HTTPS 経由の Git はトークンを 401 で拒否します。同じトークンで再試行しないでください。有効なトークンを発行するには、アプリを再インストールする必要があります。
インストールトークンに付与できるスコープまたはリポジトリアクセスは、インストールで承認された範囲を超えることはできません。トークンは、より少ない scopes または repositoryIds に制限できます。空の配列または省略した配列には、インストールに付与されたすべての権限が継承されます。
Pull Requestsやチェック実行の書き込み、HTTPS 経由の Gitを含む、リポジトリスコープの操作にはインストールトークンを使用します。
Git HTTPS 認証
インストールアクセストークンを使用して、HTTPS 経由で Git を認証します。Git エンドポイントでは HTTP ベーシック認証を使用します。パスワードにはインストール トークン、ユーザー名には x-access-token を指定します。Bearer 認証情報は REST API で使用してください。Git HTTPS では使用できません。
Git 操作の直前に、Create Installation Access Token でトークンを発行します。トークンの有効期限は最長 15 分です。
clone、fetch、pull には repository:contents:read が必要です。プッシュには repository:contents:write が必要です。トークンの権限付与には、ターゲット リポジトリを含める必要があります。
プッシュには、Create Repo と同様に、リポジトリの所有者に Origin への書き込みが許可されていることも必要です。ユーザー所有者は、Pro、Pro Student、Pro+、Ultra、または Start プランを利用している必要があります。チーム所有者は、有効な有料チーム プランを利用しており、プライバシーモード (レガシー) を使用しておらず、チーム管理者によって Origin が無効化されていない必要があります。所有者が適格でないリポジトリへのプッシュでは 403 が返されます。clone、fetch、pull にはこの要件はありません。
Get Repo または List App Installation Repositories から cloneUrl を取得します。GitHub 形式のパス (https://origin.cursor.com/OWNER_SLUG/REPO_NAME.git) と従来の /git/ パスのどちらでも clone できます。
git clone "https://x-access-token:${INSTALLATION_TOKEN}@origin.cursor.com/OWNER_SLUG/REPO_NAME.git"トークンをURLに埋め込むと、.git/configに保存されます。クローンに成功したら、後続のコマンドで期限切れのシークレットが再利用されないよう、リモートURLを書き換えます:
git remote set-url origin "https://origin.cursor.com/OWNER_SLUG/REPO_NAME.git"トークンをリモート URL に含めないよう、Git の認証情報ヘルパーを使って指定します:
git -c credential.helper="!f() { echo username=x-access-token; echo password=${INSTALLATION_TOKEN}; }; f" \ clone "https://origin.cursor.com/OWNER_SLUG/REPO_NAME.git"Origin CLI の認証情報ヘルパーは、ユーザーログインに使用します。アプリ連携では、ここに示すようにインストールトークンを渡します。トークンはパスワードと同様に扱い、決してログに記録しないでください。ジョブで引き続き Git へのアクセスが必要な場合は、expiresAt より前に新しいトークンを発行してください。
ミラーリポジトリでは、インストールトークンで clone、fetch、pull を実行できますが、ミラーが安定したアウトバウンド ミラーになるまで、Origin は git push を 403 で拒否します。ミラーリポジトリを参照してください。
ユーザー認証による CLI リクエスト
ユーザー認証されたリクエストには origin api を使用します。対話型セッションの場合は、ブラウザからサインインします。
origin auth loginorigin api /repos/OWNER_SLUG/REPO_NAME/pulls非対話型セッションの場合は、Cursor Dashboard → API キー で取得した個人ユーザーの API キーを指定してください。
export CURSOR_API_KEY="YOUR_PERSONAL_USER_API_KEY"origin api /repos/OWNER_SLUG/REPO_NAME/pullsCLI は個人用 API キーを短期間有効なユーザーアクセストークンに交換し、そのトークンを Authorization ヘッダーに含めて送信します。API キー自体を Origin エンドポイントに送信しないでください。アプリ連携では、代わりに アプリ JWT とインストールアクセストークンを使用してください。
ディスカバリーと署名キー
Origin は、認証不要のディスカバリーメタデータと有効な署名キーを公開します。同じキーは webhook 配信とインストールレシートの署名に使用されます。
ディスカバリーメタデータには、issuer と jwks_uri が含まれます:
curl https://api.cursor.com/v1/origin/.well-known/openid-configuration{ "issuer": "https://api.cursor.com/v1/origin", "jwks_uri": "https://api.cursor.com/v1/origin/keys", "response_types_supported": ["id_token"], "subject_types_supported": ["public"], "id_token_signing_alg_values_supported": ["EdDSA"]}/keys は有効な Ed25519 JWK を返します:
curl https://api.cursor.com/v1/origin/keys{ "keys": [ { "kty": "OKP", "crv": "Ed25519", "use": "sig", "alg": "EdDSA", "kid": "origin-key-id", "x": "PUBLIC_KEY_MATERIAL" } ]}JWKS をキャッシュします。/keys は Cache-Control: public, max-age=600, stale-if-error=600 を送信するため、キャッシュされたレスポンスを 10 分間再利用した後に更新します。更新に失敗した場合は、検証を失敗とする前に、最後に取得した有効なキーを最大さらに 10 分間保持します。どのキーでも検証できない署名を受け取った場合も更新し、これにより廃止されたキー ID が除去されます。キーは毎週ローテーションされます。
Webhook 署名にはキー ID が含まれないため、検証時には有効な各 Ed25519 キーで検証を試行する必要があります。インストールレシートには JOSE ヘッダーに署名キーの kid が含まれるため、レシートの検証ではキーを直接特定できます。
スコープ
アプリに必要な最小限のスコープのみをリクエストしてください。repository:metadata:read、およびアプリまたはインストールのメタデータへのアクセスは自動的に付与されるため、インストール URL に個別に追加する必要はありません。
| スコープ | 許可される操作 |
|---|---|
repository:metadata:read | リポジトリのメタデータを読み取る。自動的に追加されます。 |
repository:contents:read | コミット、ブランチ、コンテンツ、比較ファイル、低レベルの Git オブジェクトを読み取る。ファイルのテキストを検索する。リポジトリのアーカイブをダウンロードする。Git HTTPS 経由でクローン、フェッチ、プルする。ミラーリポジトリをアップストリームソースから同期する。 |
repository:contents:write | Git HTTPS 経由でプッシュする。Pull Requests をマージする。Git data エンドポイント経由でブランチを作成し、ファイルの変更をコミットする。チェック実行を再リクエストする。 |
repository:pull_requests:read | Pull Requests、変更ファイル、Pull Requests のコミット、割り当てられたラベル、マージ可否を読み取る。 |
repository:pull_requests:write | Pull Requests を作成・更新する。Pull Requests のラベルを割り当て・削除する。 |
repository:pull_requests:reviews:read | プルリクエストコメント、コメントスレッド、送信済み確認、レビュー依頼先を読み取る。 |
repository:pull_requests:reviews:write | コメントを作成・更新し、コメントスレッドを解決・再オープンし、確認を作成・更新・却下し、レビュー担当者を依頼・削除する。 |
repository:checks:read | チェック スイート、実行、チェック実行の注釈を読み取る。 |
repository:checks:write | チェック スイートと実行を作成・更新する。チェック実行の注釈を追加する。 |
repository:labels:read | リポジトリが所有するラベル定義を読み取る。 |
repository:labels:write | リポジトリのラベル定義を作成・更新・削除する。 |
repository:rulesets:read | リポジトリのルールセットを読み取る。 |
repository:rulesets:write | リポジトリのルールセットを作成・更新・削除する。 |
repository:settings:read | リポジトリに直接付与されている権限付与を読み取る。 |
repository:settings:write | リポジトリの設定を更新する: デフォルトブランチ、可視性、マージ方法、自動ヘッドブランチ削除。リポジトリの権限付与を upsert・削除する。 |
namespace:settings:read | 所有者に直接付与されている権限付与を読み取る。 |
namespace:settings:write | 所有者の権限付与を upsert・削除する。 |
:write スコープをリクエストすると、対応する :read スコープも併せて付与されます。そのため repository:labels:write は repository:labels:read を含んでおり、両方を指定する必要はありません。ただし、その逆は成り立ちません。読み取りスコープが書き込みを許可することはありません。
インストールトークンでは、これらの権限付与を制限することしかできません。Workspace 管理者が承認していないスコープやリポジトリを追加することはできません。
ミラー状態の変更はこの表の対象外です。リポジトリミラーを移行、リポジトリミラーの切り替えを強制、リポジトリミラーを切断には repository:mirror:write または repository:mirror:delete が必要ですが、アプリはこれらをインストール時にリクエストできません。これらは Cursor ユーザー認証情報に付随し、呼び出し元はミラーのアップストリームソース上でもリポジトリを管理している必要があります。
アプリの管理も同じ理由で対象外です。アプリを作成には namespace:apps:create、ネームスペースのアプリ一覧を取得には namespace:apps:read、アプリを取得には app:settings:read、アプリを更新、アプリの署名キーを追加、アプリの署名キーを失効には app:settings:write が必要です。発行者はこれらを Cursor ユーザー認証情報上で保持します。アプリが自身のためにこれらをリクエストすることはできません。
この表では、アプリがインストール時にリクエストするスコープを示しています。個別の操作に必要なスコープを確認するには、OpenAPI 仕様の x-origin-scopes 拡張を参照してください。この拡張は、インストール権限ではなく認証情報自体に付随する app、installation、namespace スコープを含む、すべての操作を対象としています。必要なスコープがすべて認証情報に付随している操作には、拡張に ambient: true が付きます。この場合、リクエストすべきものは何もなく、適切な認証情報を提示するだけで十分です。
ミラーリポジトリ
インストールでは、ネイティブの Origin リポジトリと安定したアウトバウンドミラーに対して、付与されているすべてのスコープを使用できます。その他のミラー状態のリポジトリでは、次の 2 つのスコープのみが適用されます。
repository:metadata:readrepository:contents:read
Workspace 管理者が何を承認したかにかかわらず、そのリポジトリでは、それ以外のすべてのスコープで 403 が返されます。REST API では、リポジトリとコンテンツの読み取り、コミットの比較、ミラーを同期は引き続き利用できますが、Origin はPull Requests、確認、コメント、チェック、ルールセット、およびすべての書き込みを拒否します。Git HTTPS では、クローン、フェッチ、プル、LFS のダウンロードは引き続き利用できますが、Origin は push と LFS のアップロードを拒否します。
リポジトリをその状態から移行するには、インストールでは実行できないユーザー認証情報による操作が必要です。リポジトリミラーを移行ではミラーの方向を進め、リポジトリミラーの切り替えを強制では分岐したリファレンスをプッシュバックせずにアップストリームソースへ切り替え、リポジトリミラーを切断ではミラーを完全に切断します。
リポジトリの mirror オブジェクトでは、書き込みが許可されているかどうかはわかりません。移行中のミラーでは、mirror.status が outbound と表示されていても参照専用の場合があるため、mirror.status に基づいて分岐するのではなく、403 を信頼してください。
レート制限
Origin API では、プリンシパルごとに共有のポイント予算が設定されており、直近1分間のローリングウィンドウごとにリセットされます。認証済みプリンシパルの種類ごとに、それぞれ予算が設定されています。
| プリンシパル | デフォルトの予算 |
|---|---|
| インストールアクセストークン | 3,000 ポイント/分 |
| アプリ JWT | 6,000 ポイント/分 |
| Cursor ユーザーまたはサービスアカウント | 600 ポイント/分 |
各エンドポイントは、ハンドラーの実行前にこの予算から固定コストを差し引きます。認証または認可に失敗した場合、コストはかかりません。
| コスト | 操作 |
|---|---|
| 0 | レート制限の取得。ステータスの取得のみで、ポイントは消費しません。 |
| 1 | ほとんどの読み取りエンドポイント、および インストールアクセストークンを作成 |
| 5 | 通常の書き込み操作、および次の負荷の高い読み取り操作: Get Commit、List Commit Files、List Comparison Files、List Pull Request Files、Get Repo Tarball、Grep Contents |
| 10 | Create App、Create Repo、Create Commit From Files、Merge Pull Request、Get Pull Request Mergeability、リポジトリミラーを移行、リポジトリミラーの切り替えを強制 |
Cursor は、デザインパートナー向けにアプリごとの1分あたりの予算を引き上げることができます。連携により高い上限が必要な場合は、Cursor にお問い合わせください。
レスポンスヘッダー
課金対象のレスポンスおよびレート制限の取得には、以下のヘッダーが含まれます。
| ヘッダー | 説明 |
|---|---|
X-RateLimit-Limit | このプリンシパルに対する現在のウィンドウ内の利用可能ポイント数 |
X-RateLimit-Remaining | 現在のウィンドウ内の残りポイント数 |
X-RateLimit-Used | 現在のウィンドウ内で消費されたポイント数 |
X-RateLimit-Reset | ウィンドウがリセットされる Unix タイムスタンプ (UTC秒) |
X-RateLimit-Resource | 共有パブリック API の予算では常に core |
X-RateLimit-Reset は、レスポンス時点から60秒間のウィンドウを示します。カウンターのウィンドウは、暦上の分の境界ではなく、バースト内で最初に課金対象となるリクエスト時に開始されます。
上限を超えた場合
リクエストが予算を超過する場合、API は次の内容とともに HTTP 429 を返します。
Retry-After: 再試行までの待機時間 (秒) (60)X-RateLimit-Remainingが0に設定された同じX-RateLimit-*ヘッダー
{ "code": 8, "message": "Rate limit exceeded: 3000 points per minute for this installation. Retry after 60s.", "details": []}再試行する前に、Retry-After の時間が経過するか、X-RateLimit-Reset の時刻になるまで待機してください。複数の呼び出し元で1つのインストールトークンを共有する場合は、ジッターを加えたバックオフを使用してください。
残りのクォータを確認する
ポイントを消費せずに現在の予算を確認するには、レート制限の取得 を呼び出します。レスポンス本文には、共有 core リソースの X-RateLimit-* ヘッダーと同じ内容が含まれます。
共通の規約
ページネーション
ページネーション対応のエンドポイントでは、以下を受け付けます。
pageSize: デフォルトは30で、最大100です。pageToken: 前のページで返される不透明なトークンです。内容を確認したり、生成したりしないでください。
レスポンスでは、リソース固有のコレクションフィールドとnextPageTokenを使用します。次のページがない場合、nextPageTokenは空になります。公開リストのレスポンスには合計件数は含まれません。ページトークンは、元のリソースとフィルターに紐づきます。フィルターを変更した場合は、ページネーションをやり直してください。空でない無効なトークンや一致しないトークンの場合は、400が返されます。
エラー
エラーの本文には、Google RPC スタイルの形式を使用します。
{ "code": 5, "message": "resource not found", "details": []}一般的な HTTP ステータスは 400、401、403、404、429、500、503 です。一部の Git データベース操作では、リポジトリの状態競合に対して 409 も返されます。429 のヘッダーと再試行の挙動については、レート制限を参照してください。
エラーの処理を分岐するには、HTTP ステータスと code を使用します。message は開発者向けのテキストとして扱います。
404 は、存在しないリソースとアプリが到達できないリソースを区別しません。リソースが存在しない証拠ではなく、"このインストールでは利用できない"ものとして解釈してください。
details には型付きエントリが含まれます。無効な引数には google.rpc.BadRequest のフィールド違反、すべてのエラーには google.rpc.RequestInfo エントリが含まれます。Origin はいつでも詳細タイプを追加できるため、連携で認識できないエントリは無視してください。
すべてのエラーレスポンスには、リクエスト ID が 2 か所に含まれます。X-Request-ID レスポンスヘッダーと、details 内の google.rpc.RequestInfo エントリです。Origin は送信した x-request-id をエコーし、送信しなかった場合は生成します。message が不透明な内部エラーの場合でも RequestInfo エントリは存在するため、呼び出しの失敗について Cursor に問い合わせる際はリクエスト ID を伝えてください。
/v1/origin 配下で一致しないパスと、既知のパスに対して誤ったメソッドを使用するリクエストは、汎用ルーターエラーではなく同じ本文を返します。メッセージにはメソッドとパスが含まれ、クエリ文字列がエコーされることはありません。
リポジトリパス
リポジトリスコープのパスでは、所有者スラッグとリポジトリ名を {ownerSlug}/{repoName} の形式で指定します。両方のセグメントは大文字と小文字を区別せずに解決されるため、どの表記でもリポジトリを指定できます。レスポンスでは、送信した表記ではなく保存されている名前とスラッグが返され、Git HTTPS URLも同様に解決されます。リポジトリ名は大文字と小文字を区別せずに比較し、正規の表記は Get Repo から取得してください。
すべてのリポジトリスコープのパスでは、所有者スラッグとリポジトリ名の組み合わせの代わりに、リポジトリの安定 ID も使用できます。GET /v1/origin/repos/_/REPO_ID のように、所有者スラッグとして _ を、リポジトリ名として ID を送信します。ID は Get Repo の id フィールドから取得してください。センチネル _ は所有者スラッグとして使用できないため、2 つの形式が衝突することはありません。Connect または JSON リクエストでは、ownerSlug を _ に、name を ID に設定します。
ID 形式は名前変更後も有効なため、リポジトリを指定する安定した方法です。ID 自体が権限を付与することはありません。Origin が ID をリポジトリに解決した後も、アプリにはそのリポジトリに対する同じスコープが必要です。アプリがアクセスできない ID は、存在しない ID と同じ 404 本文を返すため、レスポンスからリポジトリの存在を確認することはできません。不正な形式の ID は 400 を返します。Create Repo は所有者スラッグのみを受け取り、_ を拒否します。
リソースリファレンス
リソーススナップショットには、リソースの現在のフィールドが含まれます。コンテナコンテキストでは、リソース全体を重複して保持する代わりに、簡潔なリファレンスを使用します。
RepositoryReferenceはリポジトリを識別します。PullRequestReferenceはプルリクエストを識別し、そのリポジトリリファレンスをネストします。ThreadReferenceはプルリクエストコメントを含むスレッドを識別します。OriginActorは公開actorをuser、app、またはserviceAccountのいずれかとして識別します。存在するバリアントは必ず1つです。そのバリアントからIDを読み取ってください。
現在の制限事項
- 名前空間全体でのリポジトリ一覧取得とリポジトリ作成は、パートナー API ではサポートされていません。リポジトリはインストール経由で検出してください。
- コミット比較では、埋め込みのコミット一覧ではなく、要約データが返されます。変更されたファイルには、専用のページ分割されたエンドポイント比較ファイルの一覧があります。
- スレッドは解決時にのみ指定できます。スレッドを直接一覧表示するエンドポイントはないため、含まれるコメントから読み取ってください。
- プッシュ Webhook には完全なコミット一覧は含まれません。
- プルリクエストのマージはネイティブの Origin リポジトリでのみサポートされます。ミラーリポジトリは拒否されます。
- ミラーリポジトリは、安定したアウトバウンドミラーになるまで、インストールでは参照専用です。ミラーリポジトリを参照してください。
実装チェックリスト
- Ed25519 秘密鍵はシークレットマネージャーに保存し、意図的にローテーションします。app 署名キーを生成を参照してください。
- インストールコールバックでインストールレシートを確認し、そのクレームからインストール ID と
stateを読み取ります。 - 短期間有効な app JWT を使用し、必要なタイミングでインストールトークンを発行します。
- リポジトリスコープの API、チェック実行の書き込み、Git HTTPS には、app JWT ではなくインストールトークンを使用します。
- 要求するスコープとリポジトリアクセスは最小限にします。
- ページトークンは不透明なものとして扱い、フィルターを変更した場合はページネーションを最初からやり直します。
- チェックの
key値は安定していて読みやすいものにします。再試行ごとに新しい不変のexternalIdを使用し、更新時にはより大きいexternalUpdatedAt値を使用します。 - 解析前に、生のリクエスト本文を使用して webhook 署名を確認します。
webhook-idを使用して配信を重複排除し、2xxを返した後に非同期で処理します。- 将来の互換性のため、未知の JSON フィールドは無視します。
Retry-AfterとX-RateLimit-*ヘッダーの指示に従います。ポイントを消費せずに残りのポイントを監視するには、レート制限を取得 を使用します。
エンドポイントリファレンス
すべてのコンポーネントスキーマについては、OpenAPI specification をダウンロードしてください。このドキュメントでは、サーバーとして https://api.cursor.com を宣言し、bearerAuth HTTP Bearer セキュリティスキームを定義しています。また、各操作には、その操作が返しうるレスポンスコードと、リクエストおよびレスポンスの例が記載されています。すべての操作には x-origin-scopes 拡張も付いており、scopes にはその操作が必要とするスコープ、tokenTypes には受け入れる認証情報の種類が入ります。パスパラメータには、URL で使用されるものと同じ ownerSlug と repoName という名前が付けられています。すべての操作には一意の operationId が付いており、1 つの操作が 2 つの URL 形式に対応する場合、2 番目の形式の id には OriginService_GetRepoTarball_2 のように _2 のサフィックスが付きます。
JSON スニペットには、スキーマに沿ったプレースホルダー値が示されています。レスポンスフィールドの説明は、OpenAPI スキーマと現在のプラットフォーム契約を反映しています。
アプリとインストール
レート制限を取得
/v1/origin/rate_limit認証済みプリンシパルの現在のパブリック API レート制限のステータスを返します。
このエンドポイントにアクセスしても、レート制限ポイントは消費されません。レスポンスには、このプリンシパルの他のパブリック API エンドポイントと共有される1分あたりのポイント予算が含まれます。レート制限を参照してください。
レスポンスフィールド
resources オブジェクト
resources.core オブジェクト
resources.core.limit integer
resources.core.remaining integer
resources.core.reset integer
resources.core.used integer
rate オブジェクト
resources.core の別名です。新しいクライアントでは resources.core を使用してください。curl --request GET \ --url 'https://api.cursor.com/v1/origin/rate_limit' \ --header 'Authorization: Bearer YOUR_ORIGIN_TOKEN'レスポンスの構造:
{ "resources": { "core": { "limit": 6000, "remaining": 5994, "reset": 1785682800, "used": 6 } }, "rate": { "limit": 6000, "remaining": 5994, "reset": 1785682800, "used": 6 }}認証済みアプリを取得
/v1/origin/app認証済みアプリのメタデータを返します。
レスポンスフィールド
id 文字列
displayName 文字列
webhookUrl 文字列
events 配列
createdAt 文字列
updatedAt 文字列
installationRedirectUris 配列
namespaceSlug 文字列
description 文字列
websiteUrl 文字列
defaultScopes 配列
curl --request GET \ --url 'https://api.cursor.com/v1/origin/app' \ --header 'Authorization: Bearer YOUR_ORIGIN_TOKEN'レスポンスの構造:
{ "id": "app_01k2ja2000e0080000000000a1", "displayName": "CI Status Bot", "webhookUrl": "https://ci.acme.dev/webhooks/origin", "events": [ "pull_request.created", "pull_request.merged" ], "createdAt": "2026-08-01T09:30:00Z", "updatedAt": "2026-08-02T14:45:00Z", "installationRedirectUris": [ "https://ci.acme.dev/origin/setup" ], "namespaceSlug": "acme", "description": "Posts CI status on pull requests.", "websiteUrl": "https://ci.acme.dev", "defaultScopes": [ "repository:contents:read", "repository:pull_requests:read" ]}アプリのインストール一覧
/v1/origin/app/installations認証済みアプリのインストールを一覧表示します。
クエリパラメータ
pageSize 整数
pageToken 文字列
next_page_tokenによる不透明なカーソル。最初のページでは空です。レスポンスフィールド
installations 配列
installations[].id 文字列
installations[].appId 文字列
installations[].target オブジェクト
installations[].target.slug 文字列
installations[].target.id 文字列
installations[].target.type 文字列
team、user。不明な場合は省略されます。installations[].createdAt 文字列
installations[].updatedAt 文字列
installations[].repoSelectionMode 文字列
installations[].scopes 配列
installations[].installedBy オブジェクト
installations[].installedBy.id 文字列
user_ のプレフィックスが付きます。installations[].installedBy.email 文字列
installations[].installedBy.displayName 文字列
installations[].installedBy.handle 文字列
@ プレフィックスは含みません。プロフィールが公開されている間のみ表示され、それ以外の場合は省略されます。installations[].suspendedAt 文字列
installations[].deletedAt 文字列
installation.deleted の webhook snapshot にのみ含まれます。削除されたインストールはAPIから解決できなくなるため、この endpoint がこの値を返すことはありません。nextPageToken 文字列
curl --request GET \ --url 'https://api.cursor.com/v1/origin/app/installations' \ --header 'Authorization: Bearer YOUR_ORIGIN_TOKEN'レスポンスの構造:
{ "installations": [ { "id": "inst_01k2ja2000e0080000000000b2", "appId": "app_01k2ja2000e0080000000000a1", "target": { "slug": "acme", "id": "ns_01k2ja2000e0080000000000p3", "type": "team" }, "createdAt": "2026-08-01T09:30:00Z", "updatedAt": "2026-08-02T14:45:00Z", "repoSelectionMode": "selected", "scopes": [ "repository:contents:read", "repository:pull_requests:read" ] } ]}アプリのインストールを取得
/v1/origin/app/installations/{installationId}認証済みアプリのインストールを1件取得します。
repoSelectionMode は all または selected です。
パスパラメータ
installationId 文字列 必須
レスポンスフィールド
id 文字列
appId 文字列
target オブジェクト
target.slug 文字列
target.id 文字列
target.type 文字列
team、user。不明な場合は省略されます。createdAt 文字列
updatedAt 文字列
repoSelectionMode 文字列
scopes 配列
installedBy オブジェクト
installedBy.id 文字列
user_ プレフィックスが付いたユーザーの公開識別子。installedBy.email 文字列
installedBy.displayName 文字列
installedBy.handle 文字列
@ プレフィックスを除く、ユーザーが申告したプロフィールハンドル。プロフィールが公開されている間のみ存在し、それ以外の場合は省略されます。suspendedAt 文字列
deletedAt 文字列
installation.deleted webhook の snapshot にのみ含まれます。削除済みのインストールは API 経由で解決されなくなるため、この endpoint がこの値を返すことはありません。curl --request GET \ --url 'https://api.cursor.com/v1/origin/app/installations/INSTALLATION_ID' \ --header 'Authorization: Bearer YOUR_ORIGIN_TOKEN'レスポンスの構造:
{ "id": "inst_01k2ja2000e0080000000000b2", "appId": "app_01k2ja2000e0080000000000a1", "target": { "slug": "acme", "id": "ns_01k2ja2000e0080000000000p3", "type": "team" }, "createdAt": "2026-08-01T09:30:00Z", "updatedAt": "2026-08-02T14:45:00Z", "repoSelectionMode": "selected", "scopes": [ "repository:contents:read", "repository:pull_requests:read" ]}アプリのインストールを削除
/v1/origin/app/installations/{installationId}認証済みアプリに属するインストールを削除し、新しいインストールトークンが発行されないようにします。すでに発行された短期間有効なトークンは、有効期限が切れるまで (最長 15 分間) 有効な場合があります。レスポンス本文は空です。
パスパラメータ
installationId 文字列 必須
レスポンスフィールド
成功したリクエストではレスポンス本文は返されません。
curl --request DELETE \ --url 'https://api.cursor.com/v1/origin/app/installations/INSTALLATION_ID' \ --header 'Authorization: Bearer YOUR_ORIGIN_TOKEN'レスポンス:
204 No Contentインストールアクセストークンを作成
/v1/origin/app/installations/{installationId}/access_tokens認証済みアプリ用のインストールアクセストークンを作成します。
GetAuthenticatedApp と同様に、app signing-JWT による認証が必要です。トークンは指定したインストールに限定され、そのインストールは認証済みアプリに属している必要があります。呼び出し元は、トークンをインストールで許可されているスコープとアクセス可能なリポジトリの一部に限定できます。
repositoryIds にはミラーリポジトリを指定できます。生成されるトークンにはインストールのスコープが付与され、Origin は各リクエストにミラーの上限を引き続き適用します。詳細はミラーリポジトリを参照してください。
パスパラメータ
installationId 文字列 必須
リクエスト本文
scopes 配列
repositoryIds 配列
レスポンスフィールド
token 文字列
oit_ プレフィックスを持つ有効期間の短いインストール認証情報です。expiresAt 文字列
curl --request POST \ --url 'https://api.cursor.com/v1/origin/app/installations/INSTALLATION_ID/access_tokens' \ --header 'Authorization: Bearer YOUR_ORIGIN_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "scopes": [ "repository:contents:read", "repository:pull_requests:read" ], "repositoryIds": [ "repo_01k2ja2000e0080000000000q4" ]}'レスポンスの構造:
{ "token": "oit_2v8xkq4m1c7p9t3w5y0z6r4b", "expiresAt": "2026-08-01T10:30:00Z"}アプリのインストール用リポジトリ一覧
/v1/origin/installation/repos認証済みアプリのインストールがアクセス可能なリポジトリを一覧表示します。
CreateInstallationAccessToken で発行されたインストールアクセストークン (oit_) が必要です。
パートナーはこのエンドポイントを通じてリポジトリを発見します。一覧の各項目は簡略化されたリポジトリの概要です。完全なタイムスタンプについては Get Repo を使用してください。Get Repo には出力専用の cloneUrl が含まれます。
結果にはミラーリポジトリが含まれます。ミラーは安定したアウトバウンドミラーになるまで読み取り専用です。ミラーリポジトリを参照してください。
クエリパラメータ
pageSize 整数
pageToken 文字列
next_page_tokenに由来する不透明なカーソル。最初のページでは空です。レスポンスフィールド
repositories 配列
repositories[].id 文字列
repositories[].name 文字列
repositories[].fullName 文字列
repositories[].owner オブジェクト
repositories[].owner.slug 文字列
repositories[].owner.id 文字列
repositories[].owner.type 文字列
team、user。不明な場合は省略されます。repositories[].defaultBranch 文字列
repositories[].mirror オブジェクト
repositories[].mirror.source 文字列
github。repositories[].mirror.sourceId 文字列
repositories[].mirror.status 文字列
inbound、outbound。repositories[].visibility 文字列
internal、private。repositories[].allowMergeCommit ブール値
repositories[].allowSquashMerge boolean
repositories[].deleteBranchOnMerge ブール値
nextPageToken 文字列
repoSelectionMode 文字列
curl --request GET \ --url 'https://api.cursor.com/v1/origin/installation/repos' \ --header 'Authorization: Bearer YOUR_ORIGIN_TOKEN'レスポンスの構造:
{ "repositories": [ { "id": "repo_01k2ja2000e0080000000000q4", "name": "rocket", "fullName": "acme/rocket", "owner": { "slug": "acme", "id": "ns_01k2ja2000e0080000000000p3", "type": "team" }, "defaultBranch": "main", "createdAt": "2026-08-01T09:30:00Z", "updatedAt": "2026-08-02T14:45:00Z", "pushedAt": "2026-08-02T14:45:00Z", "cloneUrl": "https://origin.cursor.com/git/acme/rocket.git" } ], "repoSelectionMode": "selected"}Webhook配信の一覧
/v1/origin/app/webhook/deliveries認証済みアプリのWebhook配信を新しい順に一覧表示します。
配信とは、1つのアプリに対して発生する単一のイベントです。ID は受信者が見る webhook-id ヘッダーの値です。delivered=false はリカバリ述語で、障害によりリトライ階段が尽きた配信を含め、2xx を一度も受け取ったことのないすべての配信を選択します。
配信は作成後7日間、かつアプリが配信の名前空間に有効なインストールを持っている間のみ一覧表示できます。installation.deleted のようなアプリを対象とするライフサイクルイベントは、それが説明するアンインストール後も表示されたままになります。
クエリ パラメータ
delivered 真偽値
delivered_atと比較します。delivered=falseはリカバリ述語で、サーバー側で評価されるため、呼び出し元が指定する時間窓のように、障害の途中で再試行の階段が尽きた配信を見逃すことはありません。eventType 文字列
pull_request.created。installationId 文字列
WebhookDelivery.installation.id) 。createdAfter 文字列
createdBefore 文字列
pageSize 整数
pageToken 文字列
next_page_tokenに由来する不透明なカーソル。最初のページでは空です。レスポンスフィールド
deliveries 配列
deliveries[].id 文字列
webhook-id の値です。冪等性キーとして使用してください。deliveries[].event オブジェクト
deliveries[].event.id 文字列
deliveries[].event.type 文字列
deliveries[].installation オブジェクト
id は対象オーナーの現在アクティブなインストールを示します。存在しない場合は未設定になります (アンインストール後のアプリ対象ライフサイクルイベントでのみ発生します) 。deliveries[].installation.id 文字列
deliveries[].installation.target オブジェクト
deliveries[].installation.target.slug 文字列
deliveries[].installation.target.id 文字列
deliveries[].installation.target.type 文字列
team、user。不明な場合は省略されます。deliveries[].createdAt 文字列
deliveries[].deliveredAt 文字列
deliveries[].lastAttempt オブジェクト
deliveries[].lastAttempt.id 文字列
deliveries[].lastAttempt.deliveryId 文字列
deliveries[].lastAttempt.trigger 文字列
automatic、manual。deliveries[].lastAttempt.responseStatusCode 整数
deliveries[].lastAttempt.latencyMs 整数
deliveries[].lastAttempt.errorMessage 文字列
deliveries[].lastAttempt.attemptedAt 文字列
nextPageToken 文字列
curl --request GET \ --url 'https://api.cursor.com/v1/origin/app/webhook/deliveries' \ --header 'Authorization: Bearer YOUR_ORIGIN_TOKEN'レスポンスの構造:
{ "deliveries": [ { "id": "whd_01k2ja2000e0080000000000j9", "event": { "id": "evt_01k2ja2000e0080000000000r5", "type": "pull_request.created" }, "installation": { "id": "inst_01k2ja2000e0080000000000b2", "target": { "slug": "acme", "id": "ns_01k2ja2000e0080000000000p3", "type": "team" } }, "createdAt": "2026-08-01T09:30:00Z", "deliveredAt": "2026-08-02T14:45:05Z", "lastAttempt": { "id": "wha_01k2ja2000e0080000000000k0", "deliveryId": "whd_01k2ja2000e0080000000000j9", "trigger": "automatic", "responseStatusCode": 200, "latencyMs": 182, "attemptedAt": "2026-08-02T14:45:05Z" } } ]}Webhook配信 を一括再配信
/v1/origin/app/webhook/deliveries:batchRedeliverOrigin に配信を再送するよう要求します。
このリクエストは「それぞれについて送信処理が進行中であることを確認する」という意味であり、「別の送信を追加する」という意味ではありません。不正なエントリがあってもバッチ全体を失敗させず、一意の入力ごとに1つの結果を返すため、期限切れの ID が1つあっても、復旧ページの残りがブロックされることはありません。202 は送信がキューに入れられたことを意味します。配信自体は非同期のため、結果は Webhook配信を一覧表示 でポーリングしてください。
リクエスト本文
deliveryIds 配列 必須
pageSize 上限に対応しています。重複は削除され、最初に出現した順序が維持されます。空のリスト、または一意のエントリが100件を超える場合は、InvalidArgument (HTTP 400) が返されます。レスポンスフィールド
results 配列
results[].deliveryId 文字列
results[].outcome 文字列
queued、送信がすでに実行中の場合は already_in_flight、それ以外の場合は not_found です。already_in_flight はエラーではなく成功です。not_found には、不明な ID、7日間の保持期間より古い ID、アプリがすでにインストールされていない名前空間が含まれます。curl --request POST \ --url 'https://api.cursor.com/v1/origin/app/webhook/deliveries:batchRedeliver' \ --header 'Authorization: Bearer YOUR_ORIGIN_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "deliveryIds": [ "whd_01k2ja2000e0080000000000j9" ]}'レスポンスの構造:
{ "results": [ { "deliveryId": "whd_01k2ja2000e0080000000000j9", "outcome": "queued" } ]}Webhook Ping
/v1/origin/app/webhook/pings認証済みアプリの webhook URL にテスト配信を送信し、受信側からの応答を返します。
実際のイベントを待たずに、アプリの設定中に受信側を確認できます。認証済みアプリを取得と同様に、app signing-JWT による認証が必要です。
受信側には本番環境と同じ形式で送信されます。ヘッダーと、署名キーで検証可能な v1ed 署名が含まれ、webhook-event-type には ping が設定され、ペイロードにはアプリ名が含まれます。ping はどのインストールにも属さないため、webhook-installation-id ヘッダーとエンベロープの installationId はどちらも含まれません。
Origin は ping を同期的に一度だけ送信し、結果をレスポンスで返します。再試行は行われず、ping はドメインイベントではありません。Webhook 配信を一覧表示には表示されず、再配信もできません。受信側が失敗した場合も、エラーではなくレスポンスで報告されます。webhook URL が設定されていないアプリでは FailedPrecondition (HTTP 400) が返されます。
リクエスト本文
リクエストにフィールドはありません。空の JSON オブジェクトを送信します。
レスポンスフィールド
deliveryId 文字列
webhook-id。受信側に送信されたヘッダーの値と一致します。eventId 文字列
event.id と同じ値です。delivered boolean
2xx ステータスで応答した場合は true。常に含まれます。responseStatusCode integer
0。常に含まれます。curl --request POST \ --url 'https://api.cursor.com/v1/origin/app/webhook/pings' \ --header 'Authorization: Bearer YOUR_ORIGIN_TOKEN' \ --header 'Content-Type: application/json' \ --data '{}'レスポンスの構造:
{ "deliveryId": "whd_01k2ja2000e0080000000000j9", "eventId": "evt_01k2ja2000e0080000000000r5", "delivered": true, "responseStatusCode": 200}アプリを取得
/v1/origin/apps/{appId}identifier を指定して単一のアプリを返します。これはアプリの publisher 向けの管理用 read です。アプリ自身の JWT credential による自己 read は 認証済みアプリを取得 を使用します。
パスパラメータ
appId string 必須
app_ のプレフィックスが付いたアプリの identifier。レスポンスフィールド
id string
app_ のプレフィックスが付いた、グローバルに一意なアプリの identifier。displayName string
webhookUrl string
events array
createdAt string
updatedAt string
installationRedirectUris array
namespaceSlug string
description string
websiteUrl string
defaultScopes array
curl --request GET \ --url 'https://api.cursor.com/v1/origin/apps/{appId}' \ --header 'Authorization: Bearer YOUR_ORIGIN_TOKEN'レスポンスの構造:
{ "id": "app_01k2ja2000e0080000000000a1", "displayName": "CI Status Bot", "webhookUrl": "https://ci.acme.dev/webhooks/origin", "events": [ "pull_request.created", "pull_request.merged" ], "createdAt": "2026-08-01T09:30:00Z", "updatedAt": "2026-08-02T14:45:00Z", "installationRedirectUris": [ "https://ci.acme.dev/origin/setup" ], "namespaceSlug": "acme", "description": "Posts CI status on pull requests.", "websiteUrl": "https://ci.acme.dev", "defaultScopes": [ "repository:contents:read", "repository:pull_requests:read" ]}アプリの更新
/v1/origin/apps/{appId}appの設定を更新します。省略したフィールドは変更されません。設定可能なフィールドを少なくとも1つ指定する必要があります。空文字列を送信してwebhookUrlをクリアすると、アウトバウンドのwebhook配信が無効になり、appの保留中の配信はキャンセルされます。再度URLを設定しても、キャンセルされた配信は復元されません。
パスパラメータ
appId string 必須
app_ のプレフィックスが付きます。リクエストボディ
displayName string
webhookUrl string
events オブジェクト
events.events 配列
description string
websiteUrl string
installationRedirectUris object
installationRedirectUris.installationRedirectUris 配列
defaultScopes オブジェクト
defaultScopes.scopes 配列
レスポンスフィールド
id string
app_ のプレフィックスが付きます。displayName string
webhookUrl string
events 配列
createdAt string
updatedAt string
installationRedirectUris 配列
namespaceSlug string
description string
websiteUrl string
defaultScopes 配列
curl --request PATCH \ --url 'https://api.cursor.com/v1/origin/apps/APP_ID' \ --header 'Authorization: Bearer YOUR_ORIGIN_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "webhookUrl": "https://ci.acme.dev/webhooks/origin-v2", "events": { "events": [ "pull_request.created", "pull_request.merged", "repository.pushed" ] }}'レスポンスの構造:
{ "id": "app_01k2ja2000e0080000000000a1", "displayName": "CI Status Bot", "webhookUrl": "https://ci.acme.dev/webhooks/origin-v2", "events": [ "pull_request.created", "pull_request.merged", "repository.pushed" ], "createdAt": "2026-08-01T09:30:00Z", "updatedAt": "2026-08-02T14:45:00Z", "installationRedirectUris": [ "https://ci.acme.dev/origin/setup" ], "namespaceSlug": "acme", "description": "Posts CI status on pull requests.", "websiteUrl": "https://ci.acme.dev", "defaultScopes": [ "repository:contents:read", "repository:pull_requests:read" ]}アプリの署名キーを追加
/v1/origin/apps/{appId}/signing_keysアプリに署名キーを追加します。アプリが保持できる有効な署名キーの数には上限があり、上限を超えてキーを追加しようとすると、別のキーが失効されるまで FailedPrecondition (HTTP 400) が返されます。すでに登録済みのキーの場合は AlreadyExists (HTTP 409 Conflict) が返されます。
パスパラメータ
appId 文字列 Required
app_ のプレフィックスが付いたアプリの識別子。リクエスト本文
publicKey 文字列 Required
レスポンスフィールド
kid 文字列
kid header や、キーの失効に使用します。createdAt 文字列
curl --request POST \ --url 'https://api.cursor.com/v1/origin/apps/APP_ID/signing_keys' \ --header 'Authorization: Bearer YOUR_ORIGIN_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "publicKey": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEAq9zTf3hL6wXe1cVj0bYs5mKR8uDnG2oAaPp4NiEkKlM=\n-----END PUBLIC KEY-----"}'レスポンスの構造:
{ "kid": "3q2xW9dK5fJm8vB1nY6cT0aZrQpLh4eGkVsN7uMxOdI", "createdAt": "2026-08-02T14:45:00Z"}アプリの署名キーを取り消す
/v1/origin/apps/{appId}/signing_keys/{kid}キー ID を指定してアプリの署名キーを取り消します。取り消されたキーで署名されたアプリ JWT は認証に使用できなくなります。最後に残った有効な署名キーは取り消せず、そのリクエストは FailedPrecondition (HTTP 400) を返します。レスポンス本文は空です。
パスパラメータ
appId 文字列 必須
app_ のプレフィックスが付いたアプリの識別子。kid 文字列 必須
レスポンスフィールド
リクエストが成功した場合、レスポンス本文は返されません。
curl --request DELETE \ --url 'https://api.cursor.com/v1/origin/apps/{appId}/signing_keys/{kid}' \ --header 'Authorization: Bearer YOUR_ORIGIN_TOKEN'レスポンス:
204 No ContentList 名前空間 Apps
/v1/origin/namespaces/{namespaceSlug}/apps名前空間 が所有する app を新しい順に一覧します。レスポンスに含まれるのは表示用の metadata のみです。個々の app の webhook 設定を読み取るには Get App を使用してください。
パスパラメータ
namespaceSlug 文字列 Required
Query Parameters
pageSize integer
pageToken 文字列
next_page_token から得られる 不透明なカーソル。最初のページでは空です。レスポンスフィールド
apps 配列
apps[].id 文字列
app_ のプレフィックスが付きます。apps[].displayName 文字列
apps[].description 文字列
nextPageToken 文字列
curl --request GET \ --url 'https://api.cursor.com/v1/origin/namespaces/{namespaceSlug}/apps' \ --header 'Authorization: Bearer YOUR_ORIGIN_TOKEN'レスポンスの構造:
{ "apps": [ { "id": "app_01k2ja2000e0080000000000a1", "displayName": "CI Status Bot", "description": "Posts CI status on pull requests." }, { "id": "app_01k2ja2000e0080000000000a2", "displayName": "Deploy Bot", "description": "" } ], "nextPageToken": ""}アプリの作成
/v1/origin/namespaces/{namespaceSlug}/appsnamespace が所有する app を作成します。app は private として作成されます。Ed25519 のキーペアはローカルで生成し、公開鍵のみを送信してください。Origin は公開鍵を保存し、app の JWT の検証に使用します。webhook URL、event type、リダイレクト URI、scope が無効な場合は InvalidArgument (HTTP 400) が返されます。
パスパラメータ
namespaceSlug string 必須
リクエストボディ
displayName string 必須
publicKey string 必須
webhookUrl string
events 配列
description string
websiteUrl string
installationRedirectUris 配列
defaultScopes 配列
repository:contents:read のようなカタログのスコープ文字列で指定します。インストール時にスコープを明示的に指定することも可能です。レスポンスフィールド
id string
app_ プレフィックスが付きます。displayName string
webhookUrl string
events 配列
createdAt string
updatedAt string
installationRedirectUris 配列
namespaceSlug string
description string
websiteUrl string
defaultScopes 配列
curl --request POST \ --url 'https://api.cursor.com/v1/origin/namespaces/NAMESPACE_SLUG/apps' \ --header 'Authorization: Bearer YOUR_ORIGIN_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "displayName": "CI Status Bot", "publicKey": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEAv7wFoV1bC9yKq3nZ8dQmXh5uJb2tR4sEwG6aP0iN8kY=\n-----END PUBLIC KEY-----", "webhookUrl": "https://ci.acme.dev/webhooks/origin", "events": [ "pull_request.created", "pull_request.merged" ], "description": "Posts CI status on pull requests.", "websiteUrl": "https://ci.acme.dev", "installationRedirectUris": [ "https://ci.acme.dev/origin/setup" ], "defaultScopes": [ "repository:contents:read", "repository:pull_requests:read" ]}'レスポンスの構造:
{ "id": "app_01k2ja2000e0080000000000a1", "displayName": "CI Status Bot", "webhookUrl": "https://ci.acme.dev/webhooks/origin", "events": [ "pull_request.created", "pull_request.merged" ], "createdAt": "2026-08-01T09:30:00Z", "updatedAt": "2026-08-01T09:30:00Z", "installationRedirectUris": [ "https://ci.acme.dev/origin/setup" ], "namespaceSlug": "acme", "description": "Posts CI status on pull requests.", "websiteUrl": "https://ci.acme.dev", "defaultScopes": [ "repository:contents:read", "repository:pull_requests:read" ]}リポジトリ
cloneUrlは出力専用のHTTPSクローンURLです。Get RepoのレスポンスにはcloneUrlが含まれます。
パートナーはアプリのインストールのリポジトリ一覧を通じてリポジトリを確認します。名前空間全体でのリポジトリの一覧表示と作成は、パートナーAPIの対象外です。
リポジトリ一覧
/v1/origin/repos/{ownerSlug}オーナーエンティティに属するリポジトリを一覧表示します。
パスパラメータ
ownerSlug 文字列 必須
クエリパラメータ
pageSize 整数
pageToken 文字列
next_page_token による不透明なカーソル。最初のページでは空です。filter 文字列
レスポンスフィールド
repositories 配列
repositories[].id 文字列
repositories[].name 文字列
repositories[].fullName 文字列
repositories[].owner オブジェクト
repositories[].owner.slug 文字列
repositories[].owner.id 文字列
repositories[].owner.type 文字列
team、user。不明な場合は省略されます。repositories[].defaultBranch 文字列
repositories[].createdAt 文字列
repositories[].updatedAt 文字列
repositories[].pushedAt 文字列
repositories[].cloneUrl 文字列
repositories[].mirror オブジェクト
repositories[].mirror.source 文字列
github。repositories[].mirror.sourceId 文字列
repositories[].mirror.status 文字列
inbound、outbound。repositories[].visibility 文字列
internal、private。repositories[].allowMergeCommit boolean
repositories[].allowSquashMerge ブール値
repositories[].deleteBranchOnMerge ブール値
nextPageToken 文字列
curl --request GET \ --url 'https://api.cursor.com/v1/origin/repos/OWNER_SLUG' \ --header 'Authorization: Bearer YOUR_ORIGIN_TOKEN'レスポンスの構造:
{ "repositories": [ { "id": "repo_01k2ja2000e0080000000000q4", "name": "rocket", "fullName": "acme/rocket", "owner": { "slug": "acme", "id": "ns_01k2ja2000e0080000000000p3", "type": "team" }, "defaultBranch": "main", "createdAt": "2026-08-01T09:30:00Z", "updatedAt": "2026-08-02T14:45:00Z", "pushedAt": "2026-08-02T14:45:00Z", "cloneUrl": "https://origin.cursor.com/git/acme/rocket.git" } ]}Get Repo
/v1/origin/repos/{ownerSlug}/{repoName}(owner_id, name) 識別子で指定した単一のリポジトリを返します。
cloneUrl は出力専用の HTTPS クローン URL です。リポジトリの取得結果には cloneUrl が含まれます。
パスパラメータ
ownerSlug 文字列 必須
repoName 文字列 必須
レスポンスフィールド
id 文字列
name 文字列
fullName 文字列
owner オブジェクト
owner.slug 文字列
owner.id 文字列
owner.type 文字列
team, user。不明な場合は省略されます。defaultBranch 文字列
createdAt 文字列
updatedAt 文字列
pushedAt 文字列
cloneUrl 文字列
mirror オブジェクト
mirror.source 文字列
github。mirror.sourceId 文字列
mirror.status 文字列
inbound、outbound。visibility 文字列
internal、private。allowMergeCommit ブール値
allowSquashMerge ブール値
deleteBranchOnMerge boolean
curl --request GET \ --url 'https://api.cursor.com/v1/origin/repos/OWNER_SLUG/REPO_NAME' \ --header 'Authorization: Bearer YOUR_ORIGIN_TOKEN'レスポンスの構造:
{ "id": "repo_01k2ja2000e0080000000000q4", "name": "rocket", "fullName": "acme/rocket", "owner": { "slug": "acme", "id": "ns_01k2ja2000e0080000000000p3", "type": "team" }, "defaultBranch": "main", "createdAt": "2026-08-01T09:30:00Z", "updatedAt": "2026-08-02T14:45:00Z", "pushedAt": "2026-08-02T14:45:00Z", "cloneUrl": "https://origin.cursor.com/git/acme/rocket.git"}リポジトリを更新
/v1/origin/repos/{ownerSlug}/{repoName}リポジトリの設定を更新します。省略したフィールドは変更されず、設定可能なフィールドを少なくとも 1 つ指定する必要があります。
設定は、デフォルトブランチ、自動headブランチ削除、可視性、マージ方法の順に、独立したグループとして固定順で適用されます。更新はグループ間でアトミックではありません。あるグループが拒否された場合、その前のグループはすでに適用されており、そのまま適用された状態が維持されます。要求した状態にするには、拒否されたグループを修正して再試行してください。レスポンスには、最後に適用されたグループ時点のリポジトリが含まれます。
フィールドが1つも設定されていないリクエストでは、InvalidArgument (HTTP 400) が返されます。デフォルトブランチへの同時変更では、409 Conflict が返されます。
パスパラメータ
ownerSlug string 必須
repoName string 必須
リクエスト本文
defaultBranch string
FailedPrecondition (HTTP 400) が返されます。allowMergeCommit boolean
allowSquashMerge と一緒に送信する必要があり、2つのうち少なくとも一方は true でなければなりません。一方のみを送信した場合は InvalidArgument (HTTP 400) が返されます。allowSquashMerge boolean
allowMergeCommit と一緒に送信する必要があり、2つのうち少なくとも1つは true でなければなりません。片方だけを送信すると InvalidArgument (HTTP 400) が返されます。deleteBranchOnMerge boolean
FailedPrecondition (HTTP 400) を返します。visibility string
internal、private。可視性を変更しない場合は省略します。レスポンスフィールド
id string
name string
fullName string
owner object
owner.slug string
owner.id string
owner.type string
team、user。不明な場合は省略されます。defaultBranch string
createdAt string
updatedAt string
pushedAt string
cloneUrl string
mirror mirror オブジェクト
mirror.source string
github。mirror.sourceId string
mirror.status string
inbound、outbound。visibility string
internal、private。allowMergeCommit boolean
allowSquashMerge boolean
deleteBranchOnMerge boolean
curl --request PATCH \ --url 'https://api.cursor.com/v1/origin/repos/OWNER_SLUG/REPO_NAME' \ --header 'Authorization: Bearer YOUR_ORIGIN_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "defaultBranch": "main", "allowMergeCommit": false, "allowSquashMerge": true, "deleteBranchOnMerge": true, "visibility": "private"}'レスポンスの構造:
{ "id": "repo_01k2ja2000e0080000000000q4", "name": "rocket", "fullName": "acme/rocket", "owner": { "slug": "acme", "id": "ns_01k2ja2000e0080000000000p3", "type": "team" }, "defaultBranch": "main", "createdAt": "2026-08-01T09:30:00Z", "updatedAt": "2026-08-02T14:45:00Z", "pushedAt": "2026-08-02T14:45:00Z", "cloneUrl": "https://origin.cursor.com/git/acme/rocket.git", "visibility": "private", "allowMergeCommit": false, "allowSquashMerge": true, "deleteBranchOnMerge": true}リポジトリを作成
/v1/origin/repos/{ownerSlug}オーナーに属するリポジトリを作成します。
リクエストが行われた時点で、オーナーは Origin に書き込みできる資格が必要です。ユーザーオーナーは Pro、Pro Student、Pro+、Ultra、または Start プランである必要があります。チームオーナーは有効な有料チームプランを持ち、Privacy Mode (レガシー) になっておらず、チーム管理者によって Origin が無効化されていない必要があります。資格のないオーナーの場合は FailedPrecondition (HTTP 400) が返されます。既存のリポジトリの読み取りにはこの要件は適用されません。
リポジトリ名は大文字と小文字を区別せずに確保されます。オーナーが既に所有しているリポジトリと大文字・小文字だけが異なる名前は拒否されるため、widgets と Widgets は同じ名前空間に共存できません。送信した名前はそのままの表記で保存されます。
新しいリポジトリへの最初のプッシュでは、そのリポジトリのデフォルトブランチが再設定されることがあります。そのプッシュがブランチの作成のみを行い、作成されたブランチのいずれもリポジトリに保存されているデフォルトブランチでない場合、Origin は作成されたブランチをデフォルトブランチに設定します。プッシュで複数のブランチが作成され、その中に main または master という名前が含まれている場合は、それらの名前のいずれかがデフォルトブランチに設定されます。それ以外の場合はデフォルトブランチは変更されません。現在の値は Get Repo から確認してください。
パスパラメータ
ownerSlug 文字列 必須
リクエスト本文
name 文字列 必須
defaultBranch 文字列
レスポンスフィールド
id 文字列
name 文字列
fullName 文字列
owner オブジェクト
owner.slug 文字列
owner.id 文字列
owner.type 文字列
team、user。不明な場合は省略されます。defaultBranch 文字列
createdAt 文字列
updatedAt 文字列
pushedAt 文字列
cloneUrl 文字列
mirror オブジェクト
mirror.source 文字列
github のみです。mirror.sourceId 文字列
mirror.status 文字列
inbound、outbound。visibility 文字列
internal、private。allowMergeCommit ブール値
allowSquashMerge ブール値
deleteBranchOnMerge boolean
curl --request POST \ --url 'https://api.cursor.com/v1/origin/repos/OWNER_SLUG' \ --header 'Authorization: Bearer YOUR_ORIGIN_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "name": "rocket", "defaultBranch": "main"}'レスポンスの構造:
{ "id": "repo_01k2ja2000e0080000000000q4", "name": "rocket", "fullName": "acme/rocket", "owner": { "slug": "acme", "id": "ns_01k2ja2000e0080000000000p3", "type": "team" }, "defaultBranch": "main", "createdAt": "2026-08-01T09:30:00Z", "updatedAt": "2026-08-02T14:45:00Z", "pushedAt": "2026-08-02T14:45:00Z", "cloneUrl": "https://origin.cursor.com/git/acme/rocket.git"}ブランチ一覧
/v1/origin/repos/{ownerSlug}/{repoName}/branchesリポジトリのブランチとその先端コミットを名前の昇順で取得します。page_size と page_token によるページネーションに対応しています。
パスパラメータ
ownerSlug 文字列 必須
repoName 文字列 必須
クエリパラメータ
pageSize integer
pageToken 文字列
next_page_token から取得した不透明なカーソル。最初のページでは空です。ページオフセットをエンコードしているため、トークンが指定されている場合、後続リクエストの page_size は無視されます。レスポンスフィールド
branches 配列
branches[].name 文字列
branches[].commit オブジェクト
branches[].commit.sha 文字列
nextPageToken 文字列
curl --request GET \ --url 'https://api.cursor.com/v1/origin/repos/OWNER_SLUG/REPO_NAME/branches' \ --header 'Authorization: Bearer YOUR_ORIGIN_TOKEN'レスポンスの構造:
{ "branches": [ { "name": "main", "commit": { "sha": "9a41f0c3d2b8e7f6a5c4d3e2f1b0a9c8d7e6f5a4" } } ]}リポジトリの Tarball を取得
/v1/origin/repos/{ownerSlug}/{repoName}/tarball/{ref}ref 時点のリポジトリツリーを gzip 圧縮された tar としてダウンロードします。
Origin は、リポジトリと ref が解決されるコミットを基にアーカイブを識別します。特定のコミットへの最初のリクエストでは、Content-Type: application/gzip を含む 200 が返され、アーカイブがレスポンス本文としてストリーミングされます。同じコミットへの後続のリクエストでは、空の本文を含む 302 と、15 分間有効な署名付きダウンロード URL が Location に返されます。リダイレクトに従ってバイト列を取得してください。アーカイブのエントリは tar のルートに配置され、ラップ用のディレクトリはありません。空のリポジトリでは ABORTED (HTTP 409 Conflict) が返され、解決できないリファレンスでは 404 が返されます。
"/" を含むリファレンスを指定するには、パスセグメントではなくクエリパラメータとしてリファレンスを送信します: GET /v1/origin/repos/{ownerSlug}/{repoName}/tarball?ref=refs/heads/main。省略すると、リポジトリのデフォルトブランチをアーカイブします。
パスパラメータ
ownerSlug 文字列 必須
repoName 文字列 必須
ref 文字列 必須
refs/heads/... または refs/tags/...、あるいはシンボリック HEAD。グロブや revspec は使用できないため、<rev>~3 は拒否されます。空の場合はリポジトリのデフォルトブランチが使用されます。レスポンスフィールド
sha 文字列
downloadUrl 文字列
302 の Location ヘッダーとして送信されます。curl --request GET --location --output repo.tar.gz \ --url 'https://api.cursor.com/v1/origin/repos/OWNER_SLUG/REPO_NAME/tarball/HEAD' \ --header 'Authorization: Bearer YOUR_ORIGIN_TOKEN'レスポンスの構造:
{ "downloadUrl": "https://artifacts.origin.cursor.com/tarballs/0192f7a4-6c1e-7b3a-9f21-3d54c9a7e6b0/9a41f0c3d2b8e7f6a5c4d3e2f1b0a9c8d7e6f5a4.tar.gz?Expires=1767225600&Signature=EXAMPLE&Key-Pair-Id=KEXAMPLE123", "sha": "9a41f0c3d2b8e7f6a5c4d3e2f1b0a9c8d7e6f5a4"}ミラーを同期
/v1/origin/repos/{ownerSlug}/{repoName}:syncMirrorミラーリポジトリの1つのリファレンスを上流ソースと同期します。同期対象が満たされている場合は HTTP 200、同期がまだ保留中の場合は HTTP 202 を返します。wait=false (デフォルト) は同期をスケジュールし、通常は 202 を返します。sha がすでに ref から到達可能な場合は、直ちに 200 を返します。wait=true は、同期対象が満たされるか待機時間の上限 (約2分) に達するまでブロックします。上限に達した場合も 202 を返し、同期はバックグラウンドで継続します。上流ソースから pull しないリポジトリは拒否されます。
パスパラメータ
ownerSlug 文字列 必須
repoName 文字列 必須
リクエスト本文
ref 文字列 必須
refs/ で始まり、そのプレフィックスに続くリファレンス名を指定する必要があります (例: refs/heads/main、refs/tags/v1) 。main のような短縮名は INVALID_ARGUMENT で拒否されます。wait boolean
sha 文字列
ref の先端を待機するには、省略するか空欄のままにします。指定されており ref から到達可能な場合、他のミラー処理の完了を待たずに呼び出しは早期に返ります。それ以外の値は INVALID_ARGUMENT で拒否されます。レスポンスフィールド
synced boolean
200、false の場合は 202。curl --request POST \ --url 'https://api.cursor.com/v1/origin/repos/OWNER_SLUG/REPO_NAME:syncMirror' \ --header 'Authorization: Bearer YOUR_ORIGIN_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "ref": "refs/heads/main", "wait": true}'レスポンスの構造:
{ "synced": true}ミラーの移行に関するエンドポイントは Origin Migration API に記載されています。ミラーを同期 はこのページに残ります。
ミラーリポジトリを切断
ミラーリポジトリを切断を参照してください。
ミラー移行ジョブを取得
ミラー移行ジョブを取得を参照してください。
有効なミラー移行ジョブを取得
有効なミラー移行ジョブを取得を参照してください。
ミラーリポジトリのカットオーバーを強制
Force Repo Mirror を参照してください。
ミラーリポジトリを移行
Transition Repo Mirror を参照してください。
チェック
- 初回の実行のupsertでは、対応するスイートが自動的に作成されます。
- 必須チェックは、インストール元のアプリとスイートの
key、必要に応じて実行のkeyによって照合されます。nameは表示専用で、照合には使用されません。 - 必須チェックの設定では
key値が照合に使用されるため、試行をまたいでkey値を安定させ、ユーザーにとってわかりやすい値にしてください。 - 試行を更新するには
externalIdを再利用します (その試行の以前の結果は破棄されます) 。再試行には新しいexternalIdを使用すると、以前の試行が履歴として残ります。 - 人間が読みやすい結果には
checkRun.outputを使用します。title:255文字以内の短い結果見出し。summary:65,535 UTF-8バイト以内の主要なMarkdown要約。text:65,535 UTF-8バイト以内の詳細なMarkdown情報。
- プロバイダーの外部結果ページへのリンクには
detailsUrlを使用します。
チェック実行後
/v1/origin/repos/{ownerSlug}/{repoName}/check-runsrepository:checks:write を持つインストールアクセストークンを使用して、チェックスイートとチェックランをアップサートします。書き込みは認証されたインストールを所有するアプリに帰属します。同じ (repo, head_sha, suite.key, check.key) で繰り返し呼び出すと、重複を作成せず既存のチェックランがその場で更新されます。
このエンドポイントはスイートの試行をアトミックに解決または作成し、1つのラン試行をアップサートします。externalUpdatedAt は同じラン識別子への更新の順序を決めるため、古いリトライが新しい状態を上書きすることはできません。
deadlineAt は実行の任意の締め切りを記録します。Origin はこれを保存し、読み取り時に返し、実行が completed に達するとクリアします。24時間より先の締め切りは、丸められるのではなく InvalidArgument (HTTP 400) で拒否されます。
まだ in_progress の実行が期限を過ぎると、Origin はその実行を timed_out の結論で自ら完了し、repository.check_run.completed を配信します。期限切れは実行ごとのタイマーではなく定期的なスイープとして行われるため、Origin が実行を終了するまでの間、実行が期限を過ぎた状態でしばらく残ることがあります。queued の実行や deadlineAt を持たない実行は期限切れになりません。期限前に自分で実行を完了すると、期限は解除されます。Origin は実行をタイムアウトさせる際にその実行の externalUpdatedAt を変更しないため、後からプロバイダー側で完了すると timed_out の結論を上書きできます。
パスパラメータ
ownerSlug string 必須
repoName string 必須
リクエストボディ
headSha string 必須
checkSuite オブジェクト 必須
checkSuite.key string 必須
checkSuite.name string 必須
checkSuite.detailsUrl string
checkSuite.externalId string 必須
checkRun オブジェクト 必須
checkRun.key string 必須
checkRun.name string 必須
checkRun.status string 必須
CHECK_RUN_LIFECYCLE_STATUS_UNSPECIFIED, queued, in_progress, completed。スキーマには rerequested も記載されていますが、これは再リクエスト時に Origin のみが設定します。これを含むリクエストは InvalidArgument (HTTP 400) を返します。checkRun.conclusion string
status == completed の場合にのみ必須です。許可されている値: CHECK_RUN_CONCLUSION_UNSPECIFIED, success, failure, neutral, cancelled, skipped, timed_out, action_required, stale。checkRun.externalUpdatedAt string 必須
checkRun.startedAt 文字列
checkRun.completedAt string
checkRun.detailsUrl 文字列
checkRun.externalId string 必須
checkRun.output object
checkRun.output.title string
checkRun.output.summary string
checkRun.output.text string
checkRun.deadlineAt string
InvalidArgument (HTTP 400) として拒否されます。作成時に省略すると締め切りなしとして記録され、更新時に省略すると保存されている締め切りは変更されません。checkRun.isRerequestable boolean
true に設定すると、アプリはrepository.check_run.rerequested を購読し、配信ごとに同じ head SHA と key に対して新しい実行を投稿して応答することを約束することになります。古い試行を履歴として残す新しい externalId での新規実行の投稿、または同じ externalId の下で再リクエストされた実行を更新してその場で更新する、いずれかの方法です。その新しい投稿が到着するまで、再リクエストされた実行はコミットの最新のチェック状態では保留中として読み取られるため、必須のチェックはマージをブロックし、プルリクエストには実行が再実行待ちであると表示されます。応答せずに再リクエスト可能と宣言すると、チェックが宙に浮いた状態になります。投稿時に Origin がサブスクリプションを検証することはありません。省略すると保存されている値が維持され、新しい実行では false になります。宣言を取り下げるには false を送信してください。レスポンスフィールド
checkSuite オブジェクト
checkSuite.id string
checkSuite.repository オブジェクト
checkSuite.repository.id string
checkSuite.repository.name string
checkSuite.repository.owner オブジェクト
checkSuite.repository.owner.slug string
checkSuite.repository.owner.id string
checkSuite.repository.owner.type string
team、user。不明な場合は省略されます。checkSuite.sha string
checkSuite.key string
checkSuite.name string
checkSuite.detailsUrl string
checkSuite.createdAt string
checkSuite.updatedAt string
checkSuite.externalId string
checkSuite.actor オブジェクト
checkSuite.actor.user object
checkSuite.actor.user.id string
checkSuite.actor.user.email string
checkSuite.actor.user.displayName string
checkSuite.actor.user.handle string
@ プレフィックスなし)。そのプロフィールが公開されている間のみ含まれ、それ以外の場合は省略されます。checkSuite.actor.app オブジェクト
checkSuite.actor.app.id 文字列
checkSuite.actor.app.displayName string
checkSuite.actor.serviceAccount オブジェクト
checkSuite.actor.serviceAccount.id string
checkRun オブジェクト
checkRun.id string
checkRun.repository オブジェクト
checkRun.repository.id string
checkRun.repository.name string
checkRun.repository.owner オブジェクト
checkRun.repository.owner.slug string
checkRun.repository.owner.id string
checkRun.repository.owner.type string
team、user。不明な場合は省略されます。checkRun.checkSuite オブジェクト
checkRun.checkSuite.id string
checkRun.sha string
checkRun.key string
checkRun.name string
checkRun.status string
checkRun.conclusion string
status が completed の場合にのみ参照してください。checkRun.detailsUrl 文字列
checkRun.externalUpdatedAt string
checkRun.startedAt 文字列
checkRun.completedAt string
checkRun.createdAt 文字列
checkRun.updatedAt string
checkRun.externalId string
checkRun.actor オブジェクト
checkRun.actor.user object
checkRun.actor.user.id string
checkRun.actor.user.email string
checkRun.actor.user.displayName string
checkRun.actor.user.handle string
@ プレフィックスなし)。そのプロフィールが公開されている間のみ含まれ、それ以外の場合は省略されます。checkRun.actor.app オブジェクト
checkRun.actor.app.id string
checkRun.actor.app.displayName string
checkRun.actor.serviceAccount オブジェクト
checkRun.actor.serviceAccount.id string
checkRun.output object
checkRun.output.title string
checkRun.output.summary string
checkRun.output.text string
checkRun.deadlineAt string
checkRun.isRerequestable boolean
checkRun.rerequestedAt string
status は rerequested となり、実行はコミットの最新のチェック状態のままで保留と見なされます。conclusion と各時刻は引き続き上書きされた結果を保持しているため、必須のチェックはアプリが応答するまでマージをブロックします。checkRun.rerequestedBy オブジェクト
actor と同じアクターのバリアントを持ちます。rerequestedAt が設定されている場合に存在し、これと共にクリアされます。curl --request POST \ --url 'https://api.cursor.com/v1/origin/repos/OWNER_SLUG/REPO_NAME/check-runs' \ --header 'Authorization: Bearer YOUR_ORIGIN_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "headSha": "9a41f0c3d2b8e7f6a5c4d3e2f1b0a9c8d7e6f5a4", "checkSuite": { "key": "ci-8842", "name": "CI", "detailsUrl": "https://ci.acme.dev/runs/8842", "externalId": "build-8842" }, "checkRun": { "key": "ci-8842-unit-tests", "name": "unit-tests", "status": "completed", "conclusion": "success", "externalUpdatedAt": "2026-08-02T14:44:30Z", "startedAt": "2026-08-02T14:40:00Z", "completedAt": "2026-08-02T14:44:30Z", "detailsUrl": "https://ci.acme.dev/runs/8842", "externalId": "run-8842", "output": { "title": "Unit tests", "summary": "128 tests passed.", "text": "All suites green." } }}'レスポンスの構造:
{ "checkSuite": { "id": "crg_01k2ja2000e0080000000000h8", "repository": { "id": "repo_01k2ja2000e0080000000000q4", "name": "rocket", "owner": { "slug": "acme", "id": "ns_01k2ja2000e0080000000000p3", "type": "team" } }, "sha": "9a41f0c3d2b8e7f6a5c4d3e2f1b0a9c8d7e6f5a4", "key": "ci-8842", "name": "CI", "detailsUrl": "https://ci.acme.dev/runs/8842", "createdAt": "2026-08-01T09:30:00Z", "updatedAt": "2026-08-02T14:45:00Z", "externalId": "build-8842", "actor": { "user": { "id": "user_01k2ja2000e0080000000000c3", "email": "jane@acme.dev" } } }, "checkRun": { "id": "cr_01k2ja2000e0080000000000g7", "repository": { "id": "repo_01k2ja2000e0080000000000q4", "name": "rocket", "owner": { "slug": "acme", "id": "ns_01k2ja2000e0080000000000p3", "type": "team" } }, "checkSuite": { "id": "crg_01k2ja2000e0080000000000h8" }, "sha": "9a41f0c3d2b8e7f6a5c4d3e2f1b0a9c8d7e6f5a4", "key": "ci-8842-unit-tests", "name": "unit-tests", "status": "completed", "conclusion": "success", "detailsUrl": "https://ci.acme.dev/runs/8842", "externalUpdatedAt": "2026-08-02T14:44:30Z", "startedAt": "2026-08-02T14:40:00Z", "completedAt": "2026-08-02T14:44:30Z", "createdAt": "2026-08-01T09:30:00Z", "updatedAt": "2026-08-02T14:45:00Z", "externalId": "run-8842", "actor": { "user": { "id": "user_01k2ja2000e0080000000000c3", "email": "jane@acme.dev" } }, "output": { "title": "Unit tests", "summary": "128 tests passed.", "text": "All suites green." } }}チェック実行の一括アップサート
/v1/origin/repos/{ownerSlug}/{repoName}/check-runs:batchUpsert1つのスイートに属する複数のチェックランを原子的にアップサートします。リクエストは最大10件のランを受け付け、(external_id, key) の重複する識別子は拒否されます。すべてのランがコミットされるか、リクエスト全体がロールバックされます。
各実行では、チェック実行を投稿と同じ任意のdeadlineAtを指定できます。
パスパラメーター
ownerSlug string 必須
repoName string 必須
リクエストボディ
headSha string 必須
checkSuite オブジェクト 必須
checkSuite.key string 必須
checkSuite.name string 必須
checkSuite.detailsUrl string
checkSuite.externalId string 必須
checkRuns array 必須
(external_id, key) が一意のエントリを1~10件含める必要があります。checkRuns[0].key string 必須
checkRuns[0].name string 必須
checkRuns[0].status string 必須
CHECK_RUN_LIFECYCLE_STATUS_UNSPECIFIED、queued、in_progress、completed。スキーマには rerequested も記載されていますが、これは再リクエスト時に Origin のみが設定します。この値を含むリクエストは InvalidArgument (HTTP 400) を返します。checkRuns[0].conclusion string
status == completed の場合にのみ必須。許容値: CHECK_RUN_CONCLUSION_UNSPECIFIED、success、failure、neutral、cancelled、skipped、timed_out、action_required、stale。checkRuns[0].externalUpdatedAt string 必須
checkRuns[0].startedAt 文字列
checkRuns[0].completedAt string
checkRuns[0].detailsUrl string
checkRuns[0].externalId string 必須
checkRuns[0].output object
checkRuns[0].output.title 文字列
checkRuns[0].output.summary string
checkRuns[0].output.text string
checkRuns[0].deadlineAt string
InvalidArgument (HTTP 400) として拒否されます。作成時に省略すると期限なしとして記録され、更新時に省略すると保存された期限は変更されません。checkRuns[0].isRerequestable boolean
true に設定すると、アプリは repository.check_run.rerequested を購読し、各配信に対して同じ head SHA と key に対する新しい実行を投稿して応答することを約束したことになります。新しい externalId のもとで新しい実行を投稿して古い試行を履歴として残すか、同じ externalId のもとで再リクエストされた実行を更新してその場でリフレッシュすることができます。新しい投稿が届くまで再リクエストされた実行はコミットの最新チェック状態で保留中と見なされるため、必須のチェックはマージをブロックし、プルリクエストには再実行待ちとして表示されます。再リクエスト可能と宣言して応答しないとチェックが取り残されます。投稿時に Origin がサブスクリプションを検証することはありません。省略すると保存されている値が維持され、新しい実行ではデフォルトが false になります。宣言を取り消すには false を送信してください。レスポンスフィールド
checkSuite オブジェクト
checkSuite.id string
checkSuite.repository オブジェクト
checkSuite.repository.id string
checkSuite.repository.name string
checkSuite.repository.owner オブジェクト
checkSuite.repository.owner.slug string
checkSuite.repository.owner.id string
checkSuite.repository.owner.type string
team、user。不明な場合は省略されます。checkSuite.sha string
checkSuite.key 文字列
checkSuite.name string
checkSuite.detailsUrl string
checkSuite.createdAt string
checkSuite.updatedAt string
checkSuite.externalId string
checkSuite.actor オブジェクト
checkSuite.actor.user オブジェクト
checkSuite.actor.user.id string
checkSuite.actor.user.email string
checkSuite.actor.user.displayName string
checkSuite.actor.user.handle string
@ は含みません)。そのプロフィールが公開されている場合にのみ存在し、そうでない場合は省略されます。checkSuite.actor.app オブジェクト
checkSuite.actor.app.id 文字列
checkSuite.actor.app.displayName string
checkSuite.actor.serviceAccount オブジェクト
checkSuite.actor.serviceAccount.id string
checkRuns array
checkRuns[].id string
checkRuns[].repository object
checkRuns[].repository.id string
checkRuns[].repository.name string
checkRuns[].repository.owner object
checkRuns[].repository.owner.slug string
checkRuns[].repository.owner.id string
checkRuns[].repository.owner.type string
team、user。不明な場合は省略されます。checkRuns[].checkSuite オブジェクト
checkRuns[].checkSuite.id string
checkRuns[].sha 文字列
checkRuns[].key string
checkRuns[].name string
checkRuns[].status string
checkRuns[].conclusion string
status が completed の場合にのみ読み取ってください。checkRuns[].detailsUrl 文字列
checkRuns[].externalUpdatedAt string
checkRuns[].startedAt string
checkRuns[].completedAt string
checkRuns[].createdAt string
checkRuns[].updatedAt string
checkRuns[].externalId string
checkRuns[].actor オブジェクト
checkRuns[].actor.user オブジェクト
checkRuns[].actor.user.id string
checkRuns[].actor.user.email 文字列
checkRuns[].actor.user.displayName string
checkRuns[].actor.user.handle string
@ は含みません)。そのプロフィールが公開されている場合にのみ存在し、そうでない場合は省略されます。checkRuns[].actor.app オブジェクト
checkRuns[].actor.app.id string
checkRuns[].actor.app.displayName string
checkRuns[].actor.serviceAccount オブジェクト
checkRuns[].actor.serviceAccount.id string
checkRuns[].output オブジェクト
checkRuns[].output.title string
checkRuns[].output.summary string
checkRuns[].output.text string
checkRuns[].deadlineAt string
checkRuns[].isRerequestable boolean
checkRuns[].rerequestedAt string
status が rerequested となり、その実行はコミットの最新チェック状態に残って保留中として扱われます。conclusion と各時刻には置き換えられる前の結果が引き続き保持されるため、アプリが応答するまで必須チェックはマージをブロックします。checkRuns[].rerequestedBy オブジェクト
actor と同じアクターバリアントを保持します。rerequestedAt が設定されている間は存在し、それと同時にクリアされます。curl --request POST \ --url 'https://api.cursor.com/v1/origin/repos/OWNER_SLUG/REPO_NAME/check-runs:batchUpsert' \ --header 'Authorization: Bearer YOUR_ORIGIN_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "headSha": "9a41f0c3d2b8e7f6a5c4d3e2f1b0a9c8d7e6f5a4", "checkSuite": { "key": "ci-8842", "name": "CI", "detailsUrl": "https://ci.acme.dev/runs/8842", "externalId": "build-8842" }, "checkRuns": [ { "key": "ci-8842-unit-tests", "name": "unit-tests", "status": "completed", "conclusion": "success", "externalUpdatedAt": "2026-08-02T14:44:30Z", "startedAt": "2026-08-02T14:40:00Z", "completedAt": "2026-08-02T14:44:30Z", "detailsUrl": "https://ci.acme.dev/runs/8842", "externalId": "run-8842", "output": { "title": "Unit tests", "summary": "128 tests passed.", "text": "All suites green." } } ]}'レスポンスの構造:
{ "checkSuite": { "id": "crg_01k2ja2000e0080000000000h8", "repository": { "id": "repo_01k2ja2000e0080000000000q4", "name": "rocket", "owner": { "slug": "acme", "id": "ns_01k2ja2000e0080000000000p3", "type": "team" } }, "sha": "9a41f0c3d2b8e7f6a5c4d3e2f1b0a9c8d7e6f5a4", "key": "ci-8842", "name": "CI", "detailsUrl": "https://ci.acme.dev/runs/8842", "createdAt": "2026-08-01T09:30:00Z", "updatedAt": "2026-08-02T14:45:00Z", "externalId": "build-8842", "actor": { "user": { "id": "user_01k2ja2000e0080000000000c3", "email": "jane@acme.dev" } } }, "checkRuns": [ { "id": "cr_01k2ja2000e0080000000000g7", "repository": { "id": "repo_01k2ja2000e0080000000000q4", "name": "rocket", "owner": { "slug": "acme", "id": "ns_01k2ja2000e0080000000000p3", "type": "team" } }, "checkSuite": { "id": "crg_01k2ja2000e0080000000000h8" }, "sha": "9a41f0c3d2b8e7f6a5c4d3e2f1b0a9c8d7e6f5a4", "key": "ci-8842-unit-tests", "name": "unit-tests", "status": "completed", "conclusion": "success", "detailsUrl": "https://ci.acme.dev/runs/8842", "externalUpdatedAt": "2026-08-02T14:44:30Z", "startedAt": "2026-08-02T14:40:00Z", "completedAt": "2026-08-02T14:44:30Z", "createdAt": "2026-08-01T09:30:00Z", "updatedAt": "2026-08-02T14:45:00Z", "externalId": "run-8842", "actor": { "user": { "id": "user_01k2ja2000e0080000000000c3", "email": "jane@acme.dev" } }, "output": { "title": "Unit tests", "summary": "128 tests passed.", "text": "All suites green." } } ]}チェック実行を取得
/v1/origin/repos/{ownerSlug}/{repoName}/check-runs/{checkRunId}サーバーによって割り当てられた ID (cr_...) で単一のチェック実行を返します。
パスパラメータ
ownerSlug string 必須
repoName string 必須
checkRunId string 必須
cr_...) 。レスポンスフィールド
id string
repository object
repository.id string
repository.name string
repository.owner object
repository.owner.slug string
repository.owner.id string
repository.owner.type string
team, user。不明な場合は省略されます。checkSuite オブジェクト
checkSuite.id string
sha string
key string
name string
status string
conclusion string
status が completed の場合にのみ読み取ってください。detailsUrl string
externalUpdatedAt string
startedAt 文字列
completedAt string
createdAt string
updatedAt string
externalId string
actor オブジェクト
actor.user オブジェクト
actor.user.id string
actor.user.email string
actor.user.displayName string
actor.user.handle string
@ プレフィックスは含みません。プロフィールが公開されている間のみ存在し、それ以外の場合は省略されます。actor.app object
actor.app.id string
actor.app.displayName string
actor.serviceAccount object
actor.serviceAccount.id string
output object
output.title string
output.summary string
output.text string
deadlineAt 文字列
isRerequestable boolean
rerequestedAt string
status が rerequested となり、実行はコミットの最新のチェック状態に留まり「保留」として表示されます。conclusion とタイミング情報には置き換えられた結果が引き続き保持されるため、必須チェックはアプリが応答するまでマージをブロックします。rerequestedBy object
actor と同じアクターのバリアントを保持します。rerequestedAt が設定されている場合に存在し、それとともにクリアされます。curl --request GET \ --url 'https://api.cursor.com/v1/origin/repos/OWNER_SLUG/REPO_NAME/check-runs/CHECK_RUN_ID' \ --header 'Authorization: Bearer YOUR_ORIGIN_TOKEN'レスポンスの構造:
{ "id": "cr_01k2ja2000e0080000000000g7", "repository": { "id": "repo_01k2ja2000e0080000000000q4", "name": "rocket", "owner": { "slug": "acme", "id": "ns_01k2ja2000e0080000000000p3", "type": "team" } }, "checkSuite": { "id": "crg_01k2ja2000e0080000000000h8" }, "sha": "9a41f0c3d2b8e7f6a5c4d3e2f1b0a9c8d7e6f5a4", "key": "ci-8842-unit-tests", "name": "unit-tests", "status": "completed", "conclusion": "success", "detailsUrl": "https://ci.acme.dev/runs/8842", "externalUpdatedAt": "2026-08-02T14:44:30Z", "startedAt": "2026-08-02T14:40:00Z", "completedAt": "2026-08-02T14:44:30Z", "createdAt": "2026-08-01T09:30:00Z", "updatedAt": "2026-08-02T14:45:00Z", "externalId": "run-8842", "actor": { "user": { "id": "user_01k2ja2000e0080000000000c3", "email": "jane@acme.dev" } }, "output": { "title": "Unit tests", "summary": "128 tests passed.", "text": "All suites green." }}チェック実行の一覧注釈
/v1/origin/repos/{ownerSlug}/{repoName}/check-runs/{checkRunId}/annotationsチェック実行のアノテーションをIDの昇順で一覧表示します。
アノテーション ID は時系列でソート可能なため、ID の昇順は作成順でもあります。ページトークンを送信すると、以降のページネーションではページサイズとスコープが固定されるため、pageSize は無視されます。
パスパラメータ
ownerSlug string 必須
repoName string 必須
checkRunId string 必須
クエリパラメータ
pageSize 整数
pageToken string
nextPageToken からの不透明なカーソル。最初のページでは省略してください。レスポンスフィールド
annotations 配列
annotations[].id string
annotations[].checkRunId string
annotations[].annotationLevel string
notice、warning、failure。annotations[].message string
annotations[].title string
annotations[].rawDetails string
annotations[].createdAt string
annotations[].updatedAt string
annotations[].location オブジェクト
annotations[].location.path string
annotations[].location.startLine 整数
annotations[].location.endLine integer
annotations[].location.columns object
annotations[].location.columns.startColumn integer
annotations[].location.columns.endColumn integer
nextPageToken string
curl --request GET \ --url 'https://api.cursor.com/v1/origin/repos/OWNER_SLUG/REPO_NAME/check-runs/CHECK_RUN_ID/annotations' \ --header 'Authorization: Bearer YOUR_ORIGIN_TOKEN'レスポンスの構造:
{ "annotations": [ { "id": "cra_01k2ja2000e0080000000000v1", "checkRunId": "cr_01k2ja2000e0080000000000g7", "annotationLevel": "warning", "message": "Deprecated API usage; migrate to the v2 client.", "title": "Deprecated API", "createdAt": "2026-08-02T14:45:00Z", "updatedAt": "2026-08-02T14:45:00Z", "location": { "path": "src/telemetry.ts", "startLine": 42, "endLine": 42 } } ]}チェック実行アノテーションの作成
/v1/origin/repos/{ownerSlug}/{repoName}/check-runs/{checkRunId}/annotations1〜25 件の注釈を、単一のアトミックなバッチでチェック実行に追加します。
チェック実行には最大100件のアノテーションを保持できます。この上限を超えるバッチは ResourceExhausted (HTTP 429) で拒否され、何も書き込まれません。1~25件の範囲外のバッチは InvalidArgument (HTTP 400) で拒否されます。この操作は追記のみで冪等ではないため、不確かな通信障害の後に再試行すると重複が追加されて容量を消費する可能性があります。同一の内容は許容されます。
パスパラメータ
ownerSlug string 必須
repoName string 必須
checkRunId string 必須
リクエスト本文
annotations array 必須
annotations[].annotationLevel string 必須
notice、warning、failure。annotations[].message string 必須
annotations[].title string
annotations[].rawDetails string
annotations[].location オブジェクト
annotations[].location.path string 必須
annotations[].location.startLine integer 必須
annotations[].location.endLine integer 必須
startLine と同じかそれ以降の行です。annotations[].location.columns オブジェクト
startLine と endLine が同じ行の場合にのみサポートされ、両方の列は一緒に送信する必要があります。annotations[].location.columns.startColumn integer
annotations[].location.columns.endColumn integer
startColumn 以上である必要があります。レスポンスフィールド
annotations 配列
annotations[].id string
annotations[].checkRunId string
annotations[].annotationLevel string
notice, warning, failure。annotations[].message string
annotations[].title string
annotations[].rawDetails string
annotations[].createdAt string
annotations[].updatedAt string
annotations[].location オブジェクト
annotations[].location.path string
annotations[].location.startLine integer
annotations[].location.endLine integer
annotations[].location.columns オブジェクト
annotations[].location.columns.startColumn integer
annotations[].location.columns.endColumn integer
curl --request POST \ --url 'https://api.cursor.com/v1/origin/repos/OWNER_SLUG/REPO_NAME/check-runs/CHECK_RUN_ID/annotations' \ --header 'Authorization: Bearer YOUR_ORIGIN_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "annotations": [ { "annotationLevel": "warning", "message": "Deprecated API usage; migrate to the v2 client.", "title": "Deprecated API", "location": { "path": "src/telemetry.ts", "startLine": 42, "endLine": 42 } } ]}'レスポンスの構造:
{ "annotations": [ { "id": "cra_01k2ja2000e0080000000000v1", "checkRunId": "cr_01k2ja2000e0080000000000g7", "annotationLevel": "warning", "message": "Deprecated API usage; migrate to the v2 client.", "title": "Deprecated API", "createdAt": "2026-08-02T14:45:00Z", "updatedAt": "2026-08-02T14:45:00Z", "location": { "path": "src/telemetry.ts", "startLine": 42, "endLine": 42 } } ]}チェック実行を再リクエスト
/v1/origin/repos/{ownerSlug}/{repoName}/check-runs/{checkRunId}/rerequestチェック実行を報告したアプリに、再度実行するよう要求します。Origin はこのリクエストを実行に rerequestedAt として記録し、repository.check_run.rerequested で所有元のアプリに通知します。アプリは、同じ HEAD SHA と key に対して新しい実行 (新規の実行またはこの実行の更新) を投稿することで応答し、これにより rerequestedAt がクリアされ、投稿されたステータスが保存されます。リクエストが未処理の間、実行の status は rerequested になります。conclusion と各時刻は、置き換えられた試行の内容を引き続き表します。この呼び出しは、rerequestedAt が設定され status が rerequested の実行を返します。
対象の実行は completed であり、isRerequestable を持ち、その key における現在の試行であり、かつオープンなプルリクエストの現在の head 上にある必要があります。これ以外の場合は FailedPrecondition (HTTP 400) を返します。
実行ごとに未処理の再リクエストは 1 件までです。rerequestedAt が設定されている間に再度リクエストすると AlreadyExists (HTTP 409 Conflict) が返され、所有する app が応答すると、その実行は再び再リクエスト可能になります。repository:contents:write を持つ任意の principal は、報告元の app にかかわらず、再リクエスト可能な任意の実行を再リクエストできます。不明な checkRunId、または別のリポジトリに属する checkRunId では 404 が返されます。
パスパラメータ
ownerSlug string 必須
repoName string 必須
checkRunId string 必須
cr_...)。リクエストボディ
このリクエストにフィールドはありません。空の JSON オブジェクトを送信してください。
レスポンスフィールド
id string
repository object
repository.id string
repository.name string
repository.owner object
repository.owner.slug string
repository.owner.id string
repository.owner.type string
team, user。不明な場合は省略されます。checkSuite オブジェクト
checkSuite.id string
sha string
key string
name string
status string
conclusion string
status が completed の場合にのみ参照してください。detailsUrl string
externalUpdatedAt string
startedAt 文字列
completedAt string
createdAt string
updatedAt string
externalId string
actor オブジェクト
actor.user オブジェクト
actor.user.id string
actor.user.email string
actor.user.displayName string
actor.user.handle string
@ プレフィックスは含みません。プロフィールが公開されている間のみ存在し、それ以外の場合は省略されます。actor.app object
actor.app.id string
actor.app.displayName string
actor.serviceAccount object
actor.serviceAccount.id string
output object
output.title string
output.summary string
output.text string
deadlineAt 文字列
isRerequestable boolean
rerequestedAt string
status は rerequested となり、実行はコミットの最新のチェック状態に留まり保留として表示されます。conclusion と各時刻は引き続き旧結果を保持しているため、必須チェックはアプリが応答するまでマージをブロックします。rerequestedBy object
actor と同じアクター バリアントを保持します。rerequestedAt が設定されている場合は常に存在し、それとともにクリアされます。curl --request POST \ --url 'https://api.cursor.com/v1/origin/repos/OWNER_SLUG/REPO_NAME/check-runs/CHECK_RUN_ID/rerequest' \ --header 'Authorization: Bearer YOUR_ORIGIN_TOKEN' \ --header 'Content-Type: application/json' \ --data '{}'レスポンスの構造:
{ "id": "cr_01k2ja2000e0080000000000g7", "repository": { "id": "repo_01k2ja2000e0080000000000q4", "name": "rocket", "owner": { "slug": "acme", "id": "ns_01k2ja2000e0080000000000p3", "type": "team" } }, "checkSuite": { "id": "crg_01k2ja2000e0080000000000h8" }, "sha": "9a41f0c3d2b8e7f6a5c4d3e2f1b0a9c8d7e6f5a4", "key": "ci-8842-unit-tests", "name": "unit-tests", "status": "rerequested", "conclusion": "failure", "detailsUrl": "https://ci.acme.dev/runs/8842", "externalUpdatedAt": "2026-08-02T14:44:30Z", "startedAt": "2026-08-02T14:40:00Z", "completedAt": "2026-08-02T14:44:30Z", "createdAt": "2026-08-01T09:30:00Z", "updatedAt": "2026-08-02T15:02:10Z", "externalId": "run-8842", "actor": { "app": { "id": "app_01k2ja2000e0080000000000a1", "displayName": "Acme CI" } }, "output": { "title": "Unit tests", "summary": "3 of 128 tests failed." }, "isRerequestable": true, "rerequestedAt": "2026-08-02T15:02:10Z", "rerequestedBy": { "user": { "id": "user_01k2ja2000e0080000000000c3", "email": "jane@acme.dev" } }}チェック スイートの取得
/v1/origin/repos/{ownerSlug}/{repoName}/check-suites/{checkSuiteId}サーバーによって割り当てられた ID (crg_...) でチェック スイートのメタデータを取得します。チェック実行は含まれません。スイートのチェック実行は ListCheckRunsForSuite を使用して取得してください。
パス パラメータ
ownerSlug string 必須
repoName string 必須
checkSuiteId string 必須
crg_...) 。レスポンスフィールド
id string
repository object
repository.id string
repository.name string
repository.owner object
repository.owner.slug string
repository.owner.id string
repository.owner.type string
team、user。不明な場合は省略されます。sha 文字列
key string
name string
detailsUrl string
createdAt string
updatedAt 文字列
externalId string
actor オブジェクト
actor.user オブジェクト
actor.user.id string
actor.user.email string
actor.user.displayName string
actor.user.handle string
@ プレフィックスは含みません。プロフィールが公開されている場合にのみ表示され、それ以外は省略されます。actor.app object
actor.app.id string
actor.app.displayName string
actor.serviceAccount オブジェクト
actor.serviceAccount.id string
curl --request GET \ --url 'https://api.cursor.com/v1/origin/repos/OWNER_SLUG/REPO_NAME/check-suites/CHECK_SUITE_ID' \ --header 'Authorization: Bearer YOUR_ORIGIN_TOKEN'レスポンスの構造:
{ "id": "crg_01k2ja2000e0080000000000h8", "repository": { "id": "repo_01k2ja2000e0080000000000q4", "name": "rocket", "owner": { "slug": "acme", "id": "ns_01k2ja2000e0080000000000p3", "type": "team" } }, "sha": "9a41f0c3d2b8e7f6a5c4d3e2f1b0a9c8d7e6f5a4", "key": "ci-8842", "name": "CI", "detailsUrl": "https://ci.acme.dev/runs/8842", "createdAt": "2026-08-01T09:30:00Z", "updatedAt": "2026-08-02T14:45:00Z", "externalId": "build-8842", "actor": { "user": { "id": "user_01k2ja2000e0080000000000c3", "email": "jane@acme.dev" } }}スイートのチェック実行一覧
/v1/origin/repos/{ownerSlug}/{repoName}/check-suites/{checkSuiteId}/check-runsスイートの現在のチェック実行を列挙します。スイート内で実行キーが複数回報告された場合、そのキーに対する最新の試行のみが返され、上書きされた試行は省略されます。再リクエストされた実行は一覧に残り、その実行を所有するアプリが応答するまで、status が rerequested となり rerequestedAt が設定され、上書きされた conclusion と時刻は変更されないまま、保留中として表示されます。上書きされた試行は、そのIDを指定してチェック実行を取得で確認できます。ページネーション対応。
パスパラメータ
ownerSlug string 必須
repoName string 必須
checkSuiteId string 必須
crg_...) 。クエリパラメータ
pageSize 整数
pageToken string
next_page_token による不透明なカーソル。最初のページでは空です。このスイートにスコープされた最後に確認したチェックランのIDをエンコードするため、トークンが指定されている場合は後続リクエストの page_size は無視されます。レスポンスフィールド
checkRuns 配列
checkRuns[].id string
checkRuns[].repository object
checkRuns[].repository.id string
checkRuns[].repository.name string
checkRuns[].repository.owner オブジェクト
checkRuns[].repository.owner.slug string
checkRuns[].repository.owner.id string
checkRuns[].repository.owner.type string
team, user。不明な場合は省略されます。checkRuns[].checkSuite オブジェクト
checkRuns[].checkSuite.id string
checkRuns[].sha string
checkRuns[].key string
checkRuns[].name string
checkRuns[].status string
checkRuns[].conclusion string
status が completed の場合にのみ読み取ってください。checkRuns[].detailsUrl string
checkRuns[].externalUpdatedAt string
checkRuns[].startedAt string
checkRuns[].completedAt string
checkRuns[].createdAt string
checkRuns[].updatedAt string
checkRuns[].externalId string
checkRuns[].actor オブジェクト
checkRuns[].actor.user オブジェクト
checkRuns[].actor.user.id string
checkRuns[].actor.user.email string
checkRuns[].actor.user.displayName string
checkRuns[].actor.user.handle string
@ プレフィックスなし) 。そのプロフィールが公開されている間のみ表示され、それ以外は省略されます。checkRuns[].actor.app object
checkRuns[].actor.app.id string
checkRuns[].actor.app.displayName string
checkRuns[].actor.serviceAccount オブジェクト
checkRuns[].actor.serviceAccount.id string
checkRuns[].output object
checkRuns[].output.title string
checkRuns[].output.summary string
checkRuns[].output.text 文字列
checkRuns[].deadlineAt string
checkRuns[].isRerequestable boolean
checkRuns[].rerequestedAt string
status が rerequested となり、実行はコミットの最新のチェック状態に残って保留中として読み取られます。conclusion とタイミングは上書きされた結果を保持したままのため、必須チェックはアプリが応答するまでマージをブロックします。checkRuns[].rerequestedBy object
actor と同じアクターバリアントを持ちます。rerequestedAt が設定されていると存在し、それと同時にクリアされます。nextPageToken string
curl --request GET \ --url 'https://api.cursor.com/v1/origin/repos/OWNER_SLUG/REPO_NAME/check-suites/CHECK_SUITE_ID/check-runs' \ --header 'Authorization: Bearer YOUR_ORIGIN_TOKEN'レスポンスの構造:
{ "checkRuns": [ { "id": "cr_01k2ja2000e0080000000000g7", "repository": { "id": "repo_01k2ja2000e0080000000000q4", "name": "rocket", "owner": { "slug": "acme", "id": "ns_01k2ja2000e0080000000000p3", "type": "team" } }, "checkSuite": { "id": "crg_01k2ja2000e0080000000000h8" }, "sha": "9a41f0c3d2b8e7f6a5c4d3e2f1b0a9c8d7e6f5a4", "key": "ci-8842-unit-tests", "name": "unit-tests", "status": "completed", "conclusion": "success", "detailsUrl": "https://ci.acme.dev/runs/8842", "externalUpdatedAt": "2026-08-02T14:44:30Z", "startedAt": "2026-08-02T14:40:00Z", "completedAt": "2026-08-02T14:44:30Z", "createdAt": "2026-08-01T09:30:00Z", "updatedAt": "2026-08-02T14:45:00Z", "externalId": "run-8842", "actor": { "user": { "id": "user_01k2ja2000e0080000000000c3", "email": "jane@acme.dev" } }, "output": { "title": "Unit tests", "summary": "128 tests passed.", "text": "All suites green." } } ]}コミットのチェック実行一覧
/v1/origin/repos/{ownerSlug}/{repoName}/commits/{sha}/check-runsすべてのスイートにわたるコミットの現在のチェック実行を一覧表示します。各スイートの最新の試行に属する実行のみが対象で、各スイート内では実行キーごとに最新の試行のみが含まれます。置き換えられた試行は省略されます。再リクエストされた実行は、それを所有するアプリが応答するまで一覧に残り、status が rerequested、rerequestedAt が設定された保留中として表示され、置き換え前の conclusion と時刻情報は変更されません。置き換えられた試行はその ID を指定して チェック実行を取得 で取得できます。チェック名とステータスで任意にフィルタリングできます。ページネーション対応。
フィルターは集約されたセットに適用されるため、実行は最新の試行のステータスで一致し、フィルターは置き換えられた試行を再び表示することはありません。ページトークンには発行時のフィルターが埋め込まれるため、異なるフィルターで再生されたトークンは拒否されます。フィルターを変更した場合はページネーションを再開してください。
パスパラメータ
ownerSlug string 必須
repoName string 必須
sha string 必須
クエリパラメータ
pageSize 整数
pageToken string
next_page_tokenに含まれる不透明なカーソル。最初のページでは空です。このコミットおよび以下のフィルターに紐づく最後に確認されたチェックランのIDがエンコードされているため、トークンが指定されている場合は後続リクエストのpage_sizeは無視され、異なるフィルターで同じトークンを再利用するとInvalidArgument (HTTP 400) が返されます。checkName string
checkRuns[].name と照合されます。省略すると名前に関係なく実行が一覧表示されます。status string
queued、in_progress、completed、rerequested。それ以外の値を指定すると InvalidArgument (HTTP 400) が返されます。省略すると任意のステータスの実行を一覧表示します。レスポンスフィールド
checkRuns 配列
checkRuns[].id string
checkRuns[].repository object
checkRuns[].repository.id string
checkRuns[].repository.name string
checkRuns[].repository.owner オブジェクト
checkRuns[].repository.owner.slug string
checkRuns[].repository.owner.id 文字列
checkRuns[].repository.owner.type string
team、user。不明な場合は省略されます。checkRuns[].checkSuite object
checkRuns[].checkSuite.id string
checkRuns[].sha 文字列
checkRuns[].key string
checkRuns[].name string
checkRuns[].status string
checkRuns[].conclusion string
status が completed の場合にのみ参照してください。checkRuns[].detailsUrl string
checkRuns[].externalUpdatedAt 文字列
checkRuns[].startedAt 文字列
checkRuns[].completedAt string
checkRuns[].createdAt 文字列
checkRuns[].updatedAt string
checkRuns[].externalId string
checkRuns[].actor オブジェクト
checkRuns[].actor.user オブジェクト
checkRuns[].actor.user.id 文字列
checkRuns[].actor.user.email string
checkRuns[].actor.user.displayName string
checkRuns[].actor.user.handle string
@プレフィックスは含みません。プロフィールが公開されている間のみ表示され、そうでない場合は省略されます。checkRuns[].actor.app object
checkRuns[].actor.app.id string
checkRuns[].actor.app.displayName string
checkRuns[].actor.serviceAccount object
checkRuns[].actor.serviceAccount.id string
checkRuns[].output object
checkRuns[].output.title string
checkRuns[].output.summary string
checkRuns[].output.text 文字列
checkRuns[].deadlineAt 文字列
checkRuns[].isRerequestable boolean
checkRuns[].rerequestedAt 文字列
status は rerequested となり、ランはコミットの最新のチェック状態に留まり「保留中」と表示されますが、conclusion と各時刻には依然として置き換え前の結果が保持されるため、必須のチェックはアプリが応答するまでマージをブロックします。checkRuns[].rerequestedBy object
actorと同じアクターバリアントを持ちます。rerequestedAtが設定されている場合に存在し、rerequestedAtとともにクリアされます。nextPageToken string
curl --request GET \ --url 'https://api.cursor.com/v1/origin/repos/OWNER_SLUG/REPO_NAME/commits/SHA/check-runs' \ --header 'Authorization: Bearer YOUR_ORIGIN_TOKEN'レスポンスの構造:
{ "checkRuns": [ { "id": "cr_01k2ja2000e0080000000000g7", "repository": { "id": "repo_01k2ja2000e0080000000000q4", "name": "rocket", "owner": { "slug": "acme", "id": "ns_01k2ja2000e0080000000000p3", "type": "team" } }, "checkSuite": { "id": "crg_01k2ja2000e0080000000000h8" }, "sha": "9a41f0c3d2b8e7f6a5c4d3e2f1b0a9c8d7e6f5a4", "key": "ci-8842-unit-tests", "name": "unit-tests", "status": "completed", "conclusion": "success", "detailsUrl": "https://ci.acme.dev/runs/8842", "externalUpdatedAt": "2026-08-02T14:44:30Z", "startedAt": "2026-08-02T14:40:00Z", "completedAt": "2026-08-02T14:44:30Z", "createdAt": "2026-08-01T09:30:00Z", "updatedAt": "2026-08-02T14:45:00Z", "externalId": "run-8842", "actor": { "user": { "id": "user_01k2ja2000e0080000000000c3", "email": "jane@acme.dev" } }, "output": { "title": "Unit tests", "summary": "128 tests passed.", "text": "All suites green." } } ]}コミットのチェックスイートを一覧表示
/v1/origin/repos/{ownerSlug}/{repoName}/commits/{sha}/check-suitesコミットに報告されたチェックスイートを一覧表示します。報告アクターとスイートキーごとに各スイートの最新の試行のみを返します。置き換えられた試行は省略されます。置き換えられた試行は チェックスイートを取得 でその試行自身の ID を指定して参照できます。スイートのメタデータのみを返します (実行の埋め込みは含まれません) 。ページネーション対応です。
パスパラメータ
ownerSlug string 必須
repoName string 必須
sha string 必須
クエリパラメータ
pageSize 整数
pageToken string
next_page_tokenによる不透明なカーソル。最初のページでは空です。このコミットに紐づく最後に確認されたチェックスイートIDがエンコードされているため、トークンが指定されている場合は後続リクエストのpage_sizeは無視されます。レスポンスフィールド
checkSuites 配列
checkSuites[].id string
checkSuites[].repository オブジェクト
checkSuites[].repository.id string
checkSuites[].repository.name string
checkSuites[].repository.owner object
checkSuites[].repository.owner.slug string
checkSuites[].repository.owner.id 文字列
checkSuites[].repository.owner.type string
team、user。不明な場合は省略されます。checkSuites[].sha string
checkSuites[].key string
checkSuites[].name string
checkSuites[].detailsUrl 文字列
checkSuites[].createdAt 文字列
checkSuites[].updatedAt 文字列
checkSuites[].externalId string
checkSuites[].actor オブジェクト
checkSuites[].actor.user オブジェクト
checkSuites[].actor.user.id string
checkSuites[].actor.user.email string
checkSuites[].actor.user.displayName string
checkSuites[].actor.user.handle string
@ プレフィックスは含みません。プロフィールが公開されている間のみ表示され、それ以外の場合は省略されます。checkSuites[].actor.app オブジェクト
checkSuites[].actor.app.id string
checkSuites[].actor.app.displayName string
checkSuites[].actor.serviceAccount オブジェクト
checkSuites[].actor.serviceAccount.id string
nextPageToken string
curl --request GET \ --url 'https://api.cursor.com/v1/origin/repos/OWNER_SLUG/REPO_NAME/commits/SHA/check-suites' \ --header 'Authorization: Bearer YOUR_ORIGIN_TOKEN'レスポンスの構造:
{ "checkSuites": [ { "id": "crg_01k2ja2000e0080000000000h8", "repository": { "id": "repo_01k2ja2000e0080000000000q4", "name": "rocket", "owner": { "slug": "acme", "id": "ns_01k2ja2000e0080000000000p3", "type": "team" } }, "sha": "9a41f0c3d2b8e7f6a5c4d3e2f1b0a9c8d7e6f5a4", "key": "ci-8842", "name": "CI", "detailsUrl": "https://ci.acme.dev/runs/8842", "createdAt": "2026-08-01T09:30:00Z", "updatedAt": "2026-08-02T14:45:00Z", "externalId": "build-8842", "actor": { "user": { "id": "user_01k2ja2000e0080000000000c3", "email": "jane@acme.dev" } } } ]}コミットとコンテンツ
コミットでは、commit 配下の Git オブジェクトのメタデータと、トップレベルのリポジトリ関係を分けています。一覧レスポンスには stats は含まれません。コミットを取得には、コミット全体の集計 stats が含まれます。変更ファイルは、ページネーション対応の コミットファイルを一覧表示 コレクションでのみ返されます。author と committer は、Origin ユーザーオブジェクトではなく、コミットに記録された Git ID 情報です。
比較は概要のみです。コミット一覧やファイル diff が埋め込まれることはありません。status は identical、ahead、behind、または diverged のいずれかです。aheadBy と behindBy はコミット数です。baseCommit、headCommit、mergeBaseCommit は簡略化されたコミット表現を使用します (stats やファイルは含まれません) 。
コミット一覧
/v1/origin/repos/{ownerSlug}/{repoName}/commitsブランチまたは開始リファレンスのコミットを一覧表示します。
一覧結果には stats は含まれません。集計統計については コミットを取得 を、ページネーション対応のファイル差分については コミットファイルを一覧表示 を使用してください。
パスパラメータ
ownerSlug string 必須
repoName string 必須
クエリパラメータ
sha string
HEAD) 。空の場合はリポジトリのデフォルトブランチを使用します。pageSize integer
pageToken string
next_page_tokenに由来する不透明なカーソル。最初のページでは空です。開始する ref とページがエンコードされているため、トークンが指定されている場合は後続リクエストの sha/page_size は無視されます。レスポンスフィールド
commits 配列
stats を含まない簡略化されたコミット。変更されたファイルは埋め込まれません。commits[].sha string
commits[].commit オブジェクト
commits[].commit.author オブジェクト
commits[].commit.author.name string
commits[].commit.author.email string
commits[].commit.author.date string
commits[].commit.committer object
commits[].commit.committer.name string
commits[].commit.committer.email string
commits[].commit.committer.date string
commits[].commit.message string
commits[].commit.tree オブジェクト
commits[].commit.tree.sha string
commits[].parents 配列
commits[].parents[].sha string
nextPageToken string
curl --request GET \ --url 'https://api.cursor.com/v1/origin/repos/OWNER_SLUG/REPO_NAME/commits' \ --header 'Authorization: Bearer YOUR_ORIGIN_TOKEN'レスポンスの構造:
{ "commits": [ { "sha": "9a41f0c3d2b8e7f6a5c4d3e2f1b0a9c8d7e6f5a4", "commit": { "author": { "name": "Jane Doe", "email": "jane@acme.dev", "date": "2026-08-01T09:30:00Z" }, "committer": { "name": "Jane Doe", "email": "jane@acme.dev", "date": "2026-08-01T09:30:00Z" }, "message": "Add launch telemetry", "tree": { "sha": "a7b6c5d4e3f2a1b0c9d8e7f6a5b4c3d2e1f0a9b8" } }, "parents": [ { "sha": "3b1f9c2d8a7e6f5049c8b7a6d5e4f3a2b1c0d9e8" } ], "stats": { "additions": 128, "deletions": 46, "total": 174 } } ]}コミットを取得
/v1/origin/repos/{ownerSlug}/{repoName}/commits/{sha}SHA または ref による単一のコミットを返し、コミット全体の集計 stats を含みます。変更されたファイルは含まれません。コミットファイルの一覧表示 を使用してください。
author と committer はコミットに記録された Git アイデンティティであり、Origin ユーザーオブジェクトではありません。
パスパラメータ
ownerSlug string 必須
repoName string 必須
sha string 必須
HEAD) 。レスポンスフィールド
sha string
commit object
commit.author object
commit.author.name string
commit.author.email string
commit.author.date string
commit.committer オブジェクト
commit.committer.name string
commit.committer.email string
commit.committer.date string
commit.message string
commit.tree オブジェクト
commit.tree.sha string
parents 配列
parents[].sha string
stats object
stats.additions 整数
stats.deletions integer
stats.total integer
curl --request GET \ --url 'https://api.cursor.com/v1/origin/repos/OWNER_SLUG/REPO_NAME/commits/SHA' \ --header 'Authorization: Bearer YOUR_ORIGIN_TOKEN'レスポンスの構造:
{ "sha": "9a41f0c3d2b8e7f6a5c4d3e2f1b0a9c8d7e6f5a4", "commit": { "author": { "name": "Jane Doe", "email": "jane@acme.dev", "date": "2026-08-01T09:30:00Z" }, "committer": { "name": "Jane Doe", "email": "jane@acme.dev", "date": "2026-08-01T09:30:00Z" }, "message": "Add launch telemetry", "tree": { "sha": "a7b6c5d4e3f2a1b0c9d8e7f6a5b4c3d2e1f0a9b8" } }, "parents": [ { "sha": "3b1f9c2d8a7e6f5049c8b7a6d5e4f3a2b1c0d9e8" } ], "stats": { "additions": 128, "deletions": 46, "total": 174 }}コミットで変更されたファイルを一覧表示
/v1/origin/repos/{ownerSlug}/{repoName}/commits/{sha}/filesコミットで変更されたファイルを一覧表示します。
sha はコミットの SHA、ブランチ、タグ、または HEAD のようなシンボリック参照を示す場合があります。結果はデフォルトで 30 件のファイルが返され、上限は 100 件です。ページトークンは解決されたコミット、ページサイズ、およびファイルカーソルを固定するため、後続のリクエストでは sha と pageSize がトークンと一致している必要があります。各ファイルには filename、status、additions、deletions、changes、patch が含まれ、名前が変更またはコピーされた場合は previousFilename も含まれます。バイナリファイルの場合、patch は空になります。
パスパラメータ
ownerSlug string 必須
repoName string 必須
sha string 必須
HEAD) 。クエリパラメータ
pageSize integer
pageToken string
next_page_tokenに由来する不透明なカーソル。最初のページでは空です。このトークンは解決されたコミット、ページサイズ、ファイルカーソルを固定するため、後続のリクエストではshaとpage_sizeがトークンと一致している必要があります。レスポンスフィールド
files 配列
files[].filename string
files[].status string
files[].additions 整数
files[].deletions integer
files[].changes integer
files[].patch string
files[].previousFilename string
nextPageToken string
curl --request GET \ --url 'https://api.cursor.com/v1/origin/repos/OWNER_SLUG/REPO_NAME/commits/SHA/files' \ --header 'Authorization: Bearer YOUR_ORIGIN_TOKEN'レスポンスの構造:
{ "files": [ { "filename": "src/telemetry.ts", "status": "modified", "additions": 6, "deletions": 3, "changes": 9, "patch": "@@ -12,6 +12,9 @@\n import { ignite } from \"./ignition\";\n+import { emitLaunchTelemetry } from \"./telemetry\";\n" } ]}コミットの比較
/v1/origin/repos/{ownerSlug}/{repoName}/compare/{basehead}マージベースに対してコミット、ref、またはタグを比較します。basehead は "{base}...{head}" です。スラッシュ ("/") を含む ref は SHA を使用する必要があります。
base と head はそれぞれ SHA、ブランチ、タグ、または HEAD のようなシンボリック参照にできます。レスポンスはページネーションされていない要約で、status は identical、ahead、behind、または diverged のいずれかです。3つのコミットオブジェクトは簡略化されており、stats とファイル情報を省略します。totalCommits、埋め込みの commits、および files フィールドは返されません。無関係な履歴の場合は 404 が返されます。
パスパラメータ
ownerSlug string 必須
repoName string 必須
basehead string 必須
"{base}...{head}"。各リビジョンは SHA、ブランチ、タグ、または HEAD のようなシンボリック参照で指定できます。レスポンスフィールド
status string
aheadBy integer
behindBy 整数
baseCommit object
baseCommit.sha string
baseCommit.commit オブジェクト
baseCommit.commit.author object
baseCommit.commit.author.name string
baseCommit.commit.author.email string
baseCommit.commit.author.date string
baseCommit.commit.committer オブジェクト
baseCommit.commit.committer.name string
baseCommit.commit.committer.email string
baseCommit.commit.committer.date string
baseCommit.commit.message string
baseCommit.commit.tree オブジェクト
baseCommit.commit.tree.sha string
baseCommit.parents 配列
baseCommit.parents[].sha string
headCommit オブジェクト
headCommit.sha string
headCommit.commit オブジェクト
headCommit.commit.author object
headCommit.commit.author.name string
headCommit.commit.author.email string
headCommit.commit.author.date string
headCommit.commit.committer オブジェクト
headCommit.commit.committer.name string
headCommit.commit.committer.email string
headCommit.commit.committer.date string
headCommit.commit.message string
headCommit.commit.tree オブジェクト
headCommit.commit.tree.sha string
headCommit.parents array
headCommit.parents[].sha string
mergeBaseCommit オブジェクト
mergeBaseCommit.sha string
mergeBaseCommit.commit オブジェクト
mergeBaseCommit.commit.author オブジェクト
mergeBaseCommit.commit.author.name string
mergeBaseCommit.commit.author.email string
mergeBaseCommit.commit.author.date string
mergeBaseCommit.commit.committer オブジェクト
mergeBaseCommit.commit.committer.name string
mergeBaseCommit.commit.committer.email string
mergeBaseCommit.commit.committer.date string
mergeBaseCommit.commit.message string
mergeBaseCommit.commit.tree オブジェクト
mergeBaseCommit.commit.tree.sha string
mergeBaseCommit.parents 配列
mergeBaseCommit.parents[].sha string
curl --request GET \ --url 'https://api.cursor.com/v1/origin/repos/OWNER_SLUG/REPO_NAME/compare/BASE...HEAD' \ --header 'Authorization: Bearer YOUR_ORIGIN_TOKEN'レスポンスの構造:
{ "status": "ahead", "aheadBy": 2, "behindBy": 0, "baseCommit": { "sha": "3b1f9c2d8a7e6f5049c8b7a6d5e4f3a2b1c0d9e8", "commit": { "author": { "name": "Jane Doe", "email": "jane@acme.dev", "date": "2026-08-01T09:30:00Z" }, "committer": { "name": "Jane Doe", "email": "jane@acme.dev", "date": "2026-08-01T09:30:00Z" }, "message": "Add launch telemetry", "tree": { "sha": "a7b6c5d4e3f2a1b0c9d8e7f6a5b4c3d2e1f0a9b8" } }, "parents": [ { "sha": "3b1f9c2d8a7e6f5049c8b7a6d5e4f3a2b1c0d9e8" } ], "stats": { "additions": 128, "deletions": 46, "total": 174 } }, "headCommit": { "sha": "9a41f0c3d2b8e7f6a5c4d3e2f1b0a9c8d7e6f5a4", "commit": { "author": { "name": "Jane Doe", "email": "jane@acme.dev", "date": "2026-08-01T09:30:00Z" }, "committer": { "name": "Jane Doe", "email": "jane@acme.dev", "date": "2026-08-01T09:30:00Z" }, "message": "Add launch telemetry", "tree": { "sha": "a7b6c5d4e3f2a1b0c9d8e7f6a5b4c3d2e1f0a9b8" } }, "parents": [ { "sha": "3b1f9c2d8a7e6f5049c8b7a6d5e4f3a2b1c0d9e8" } ], "stats": { "additions": 128, "deletions": 46, "total": 174 } }, "mergeBaseCommit": { "sha": "3b1f9c2d8a7e6f5049c8b7a6d5e4f3a2b1c0d9e8", "commit": { "author": { "name": "Jane Doe", "email": "jane@acme.dev", "date": "2026-08-01T09:30:00Z" }, "committer": { "name": "Jane Doe", "email": "jane@acme.dev", "date": "2026-08-01T09:30:00Z" }, "message": "Add launch telemetry", "tree": { "sha": "a7b6c5d4e3f2a1b0c9d8e7f6a5b4c3d2e1f0a9b8" } }, "parents": [ { "sha": "3b1f9c2d8a7e6f5049c8b7a6d5e4f3a2b1c0d9e8" } ], "stats": { "additions": 128, "deletions": 46, "total": 174 } }}リスト比較ファイル
/v1/origin/repos/{ownerSlug}/{repoName}/compare/{basehead}/files比較によって変更されたファイルを一覧表示します。すなわち、base と head のマージベースに対する head の差分です。
basehead は "{base}...{head}" です。"/" を含むリファレンスは SHA を使用する必要があります。ファイル一覧は常に Compare Commits の要約と一致するため、identical または behind の比較では空の一覧が返され、無関係な履歴の場合は 404 が返されます。結果はデフォルトで 30 ファイル、上限は 100 ファイルです。各ファイルには List Commit Files と同じフィールドが含まれます。
パスパラメータ
ownerSlug string 必須
repoName string 必須
basehead string 必須
"{base}...{head}"。各リビジョンには SHA、ブランチ、タグ、または HEAD のようなシンボリック参照を指定できます。クエリパラメータ
pageSize 整数
pageToken string
next_page_tokenに由来する不透明なカーソル。最初のページでは空です。このトークンは解決された比較、ページサイズ、およびファイルカーソルに紐づけられているため、後続のリクエストではbaseheadとpage_sizeがトークンと一致している必要があります。Origin は各ページで比較を再解決します。トークン発行後にコミットが移動している場合、リクエストはInvalidArgument (HTTP 400) を返し、一覧は最初のページからやり直す必要があります。レスポンスフィールド
files 配列
files[].filename string
files[].status string
files[].additions 整数
files[].deletions integer
files[].changes integer
files[].patch string
files[].previousFilename string
nextPageToken string
curl --request GET \ --url 'https://api.cursor.com/v1/origin/repos/OWNER_SLUG/REPO_NAME/compare/BASE...HEAD/files' \ --header 'Authorization: Bearer YOUR_ORIGIN_TOKEN'レスポンスの構造:
{ "files": [ { "filename": "src/telemetry.ts", "status": "modified", "additions": 6, "deletions": 3, "changes": 9, "patch": "@@ -12,6 +12,9 @@\n import { ignite } from \"./ignition\";\n+import { emitLaunchTelemetry } from \"./telemetry\";\n" } ]}コンテンツを取得
/v1/origin/repos/{ownerSlug}/{repoName}/contents指定した リファレンス におけるファイルまたはディレクトリの内容を返します。ファイルパスは path クエリパラメータで指定します (ネストしたパスに対応) 。リポジトリのルートディレクトリを指定する場合は、省略するか空欄のままにします。1 MiB (デコード後) を超えるファイルは FailedPrecondition (HTTP 400) で拒否されます。
ファイルにはbase64コンテンツが含まれます。ディレクトリには entries に直接の子要素が含まれます。ディレクトリエントリは type、name、path、sha、size を含む簡略化された子要素です。子パスを取得してそのコンテンツを読み取ります。
パスパラメータ
ownerSlug string 必須
repoName string 必須
クエリパラメータ
path string
ref string
HEAD) 。空の場合はリポジトリのデフォルトブランチを使用します。レスポンスフィールド
type string
encoding string
size string
name string
path string
sha string
content string
entries array
curl --request GET \ --url 'https://api.cursor.com/v1/origin/repos/OWNER_SLUG/REPO_NAME/contents' \ --header 'Authorization: Bearer YOUR_ORIGIN_TOKEN'レスポンスの構造:
{ "type": "file", "encoding": "base64", "size": "312", "name": "telemetry.ts", "path": "src/telemetry.ts", "sha": "c9d8e7f6a5b4c3d2e1f0a9b8c7d6e5f4a3b2c1d0", "content": "Y29uc29sZS5sb2coImxhdW5jaCIpOwo="}コンテンツを一括取得
/v1/origin/repos/{ownerSlug}/{repoName}/contents:batchGet1 回のリクエストで、指定したリファレンスにおける複数の明示的なパスのコンテンツを返します。リクエストした各パスについて、見つかったかどうかを示す結果が返されます。見つかったパスには GetContents と同じ Content 形式が含まれます (ファイルは base64、ディレクトリは直下の entries、シンボリックリンクはファイルとして扱います) 。パスは完全一致で照合され、グロブやパターンは使用できません。要求できるパスは最大 20 件で、重複は削除されます。レスポンスの結果はリクエストで最初に現れた順序を保持します。コンテンツを取得 の 1 MiB 上限を超える単一のファイルがあると、バッチ全体が FailedPrecondition (HTTP 400) で失敗します。パス一覧がリクエスト本文で送信されるため、POST を使用します。
パスパラメータ
ownerSlug string 必須
repoName string 必須
リクエスト本文
paths array 必須
ref string
HEAD) 。空の場合はリポジトリのデフォルトブランチを使用します。レスポンスフィールド
results array
results[].path string
results[].found boolean
results[].content オブジェクト
results[].content.type string
results[].content.encoding string
results[].content.size string
results[].content.name string
results[].content.path string
results[].content.sha string
results[].content.content string
results[].content.entries array
resolvedCommitSha string
curl --request POST \ --url 'https://api.cursor.com/v1/origin/repos/OWNER_SLUG/REPO_NAME/contents:batchGet' \ --header 'Authorization: Bearer YOUR_ORIGIN_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "paths": [ "src/telemetry.ts" ], "ref": "main"}'レスポンスの構造:
{ "results": [ { "path": "src/telemetry.ts", "found": true, "content": { "type": "file", "encoding": "base64", "size": "312", "name": "telemetry.ts", "path": "src/telemetry.ts", "sha": "c9d8e7f6a5b4c3d2e1f0a9b8c7d6e5f4a3b2c1d0", "content": "Y29uc29sZS5sb2coImxhdW5jaCIpOwo=" } } ], "resolvedCommitSha": "9a41f0c3d2b8e7f6a5c4d3e2f1b0a9c8d7e6f5a4"}コンテンツをGrep検索
/v1/origin/repos/{ownerSlug}/{repoName}:grep指定した ref 時点のリポジトリ内にあるファイルのテキストを検索し、一致した行と、要求された場合は前後のコンテキスト行を返します。検索は行単位で行われ、pattern が改行をまたいで一致することはなく、返される各エントリは 1 行です。リクエストごとにリポジトリ全体がスキャンされるため、pagination も cursor もありません。レスポンスが完全な結果となるのは limitHit が false の場合のみです。refs を持たない空のリポジトリでは、一致は返されず limitHit は false になります。検索パラメータはリクエスト本文で送信されるため、POST を使用します。
パスパラメータ
ownerSlug 文字列 必須
repoName 文字列 必須
リクエスト本文
ref 文字列
HEAD) 。空の場合はリポジトリのdefault branchが対象になります。query 文字列 必須
literal を指定してください。空白文字も意味を持ち、指定されたとおりに検索されます。パターンが空の場合は InvalidArgument (HTTP 400) を返します。UTF-8 の最大サイズ: 4096 バイト。literal boolean
query を正規表現ではなく、完全一致のテキストとして検索します。caseInsensitive boolean
wholeWord boolean
contextBefore integer
contextAfter integer
filterPath 文字列
includes 配列
/ を含まないパターンは任意の階層にマッチし、* は単一のパスセグメント内にマッチし、** は複数のセグメントをまたいでマッチします。include が1つでも指定されている場合、そのいずれにもマッチしないパスは検索対象外となります。エントリは最大20個。パターンごとの最大 UTF-8 サイズ: 4096 バイト。excludes 配列
includes と同じです。exclude は include よりも優先され、directory を除外するとその配下すべてが除外されます。エントリは最大 20 件。1 つの pattern あたりの最大 UTF-8 サイズは 4096 バイトです。maxResults integer
レスポンスフィールド
matches 配列
matches[].path 文字列
matches[].lineNumber integer
matches[].line 文字列
matches[].kind 文字列
match、context。matches[].submatches 配列
line 内でマッチが位置する箇所。コンテキスト行では常に空です。limitHit が true の場合、マッチした最後の行にはマッチの一部しか含まれないことがあります。line の範囲を完全に超える範囲は省略され、line の範囲をはみ出す範囲は残りのバイトまでに切り詰められます。matches[].submatches[].start integer
matches[].submatches[].end integer
limitHit boolean
maxResults に達したかどうか。query、filterPath、または glob リストを絞り込んで、検索対象のファイルを減らしてください。curl --request POST \ --url 'https://api.cursor.com/v1/origin/repos/OWNER_SLUG/REPO_NAME:grep' \ --header 'Authorization: Bearer YOUR_ORIGIN_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "ref": "main", "query": "emitLaunchTelemetry\\(", "contextBefore": 1, "contextAfter": 1, "includes": [ "*.ts" ], "excludes": [ "**/node_modules/**" ], "maxResults": 50}'{ "matches": [ { "path": "src/telemetry.ts", "lineNumber": 11, "line": "export function emitLaunchTelemetry(stage: string): void {", "kind": "match", "submatches": [ { "start": 16, "end": 37 } ] }, { "path": "src/telemetry.ts", "lineNumber": 12, "line": " console.log(\"launch\", stage);", "kind": "context", "submatches": [] } ], "limitHit": false}Git データ
低レベルの git オブジェクト。読み取りには repository:contents:read が必要で、空のリポジトリでは 409 が返されます。Create Commit From Files と Create Git Ref は git オブジェクトを書き込むため、repository:contents:write が必要です。
Blob を取得
/v1/origin/repos/{ownerSlug}/{repoName}/git/blobs/{sha}SHA を指定して Git blob オブジェクトを取得します。デフォルトでは、MIME エンコードされた base64 の content を含む JSON を返します。代わりに生の blob バイトを受け取るには、REST で Accept: application/vnd.origin.raw+json (または application/vnd.origin.raw) を指定します。4 MiB (デコード後) を超える blob は拒否されます。より大きなファイルは、Git HTTPS 経由でリポジトリをクローンして取得してください。空のリポジトリでは 409 Conflict が返されます。
パスパラメータ
ownerSlug 文字列 必須
repoName 文字列 必須
sha 文字列 必須
レスポンスフィールド
sha 文字列
size integer
encoding 文字列
content 文字列
curl --request GET \ --url 'https://api.cursor.com/v1/origin/repos/OWNER_SLUG/REPO_NAME/git/blobs/SHA' \ --header 'Authorization: Bearer YOUR_ORIGIN_TOKEN'レスポンスの構造:
{ "sha": "c9d8e7f6a5b4c3d2e1f0a9b8c7d6e5f4a3b2c1d0", "size": 312, "encoding": "base64", "content": "Y29uc29sZS5sb2coImxhdW5jaCIpOwo="}Gitコミットを取得
/v1/origin/repos/{ownerSlug}/{repoName}/git/commits/{sha}SHA (または解決可能なリビジョン) によって Git コミットオブジェクトを返します。これは低レベルの Git Database のコミット形式 (フラットな author/message/tree) であり、/commits/{sha} の下にある高レベルの GetCommit リソースとは異なります。sha にはコミット SHA、ブランチ、タグ、または HEAD のようなシンボリック参照を指定できます。空のリポジトリは 409 Conflict を返します。
パス パラメータ
ownerSlug string 必須
repoName string 必須
sha string 必須
HEAD のようなシンボリックリファレンス。レスポンスフィールド
sha string
author object
author.name string
author.email string
author.date string
committer オブジェクト
committer.name string
committer.email string
committer.date string
message string
tree object
tree.sha string
parents array
parents[].sha string
curl --request GET \ --url 'https://api.cursor.com/v1/origin/repos/OWNER_SLUG/REPO_NAME/git/commits/SHA' \ --header 'Authorization: Bearer YOUR_ORIGIN_TOKEN'レスポンスの構造:
{ "sha": "9a41f0c3d2b8e7f6a5c4d3e2f1b0a9c8d7e6f5a4", "author": { "name": "Jane Doe", "email": "jane@acme.dev", "date": "2026-08-01T09:30:00Z" }, "committer": { "name": "Jane Doe", "email": "jane@acme.dev", "date": "2026-08-01T09:30:00Z" }, "message": "Add launch telemetry", "tree": { "sha": "a7b6c5d4e3f2a1b0c9d8e7f6a5b4c3d2e1f0a9b8" }, "parents": [ { "sha": "3b1f9c2d8a7e6f5049c8b7a6d5e4f3a2b1c0d9e8" } ]}ファイルから commit を作成
/v1/origin/repos/{ownerSlug}/{repoName}/git/commits:createFromFilesインラインのファイル変更からブランチにコミットを作成し、ブランチをそのコミットまで進めます。
変更は expectedHeadSha の tree に適用され、その tree が新しい commit の parent になります。branch が移動している、または存在しない場合、tree に変化をもたらさない changes の set、tree に存在しない path の delete、push ruleset によって block される write、contents が別の host からミラーリングされている repository のいずれの場合も、FailedPrecondition (HTTP 400) が返されます。
1 回のリクエストで扱えるのは、ファイル変更が最大 1,000 件、1 ファイルあたり 8 MiB、コンテンツ合計 32 MiB までです。上限を超えた場合、同じパスを重複して指定した場合、または形式が不正なフィールドを送信した場合は InvalidArgument (HTTP 400) が返され、google.rpc.BadRequest のフィールド違反で問題のある files[i] エントリが示されます。
ブランチは事前に存在している必要があります。まず Create Git Ref で作成してから、そのブランチにコミットしてください。
パスパラメータ
ownerSlug string 必須
repoName string 必須
リクエストボディ
targetBranch string 必須
<branch>、heads/<branch>、refs/heads/<branch> のいずれかの形式で指定します。ブランチは既に存在している必要があります。HEAD はどの表記でも受け付けられません。expectedHeadSha string 必須
message string 必須
author object 必須
author.name string 必須
author.email string 必須
committer オブジェクト
author が使用されます。committer.name string
committer が指定されている場合は必須です。committer.email string
committer がある場合は必須です。files array 必須
files[].path string 必須
/ 区切りで表したリポジトリからの相対パス (例: docs/changelog.md) 。files[].content string
files[].encoding に従ってエンコードします。ファイルを作成するか、その内容を置き換えます。files[].content と files[].delete のうち、いずれか一方のみを指定してください。files[].delete boolean
true にする必要があります。files[].content と files[].delete のうち、いずれか一方のみを指定してください。files[].encoding string
files[].content のエンコーディング。指定できる値: utf-8 (デフォルト) 、base64。削除の場合は無視されます。files[].mode string
files[].content のファイルモード。指定できる値は file (デフォルト) 、executable、symlink で、symlink の場合はコンテンツがリンクのターゲットになります。削除の場合は無視されます。レスポンスフィールド
sha string
treeSha string
previousHeadSha string
curl --request POST \ --url 'https://api.cursor.com/v1/origin/repos/OWNER_SLUG/REPO_NAME/git/commits:createFromFiles' \ --header 'Authorization: Bearer YOUR_ORIGIN_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "targetBranch": "feature/login", "expectedHeadSha": "9a41f0c3d2b8e7f6a5c4d3e2f1b0a9c8d7e6f5a4", "message": "Add login telemetry", "author": { "name": "Jane Doe", "email": "jane@acme.dev" }, "files": [ { "path": "src/login/telemetry.ts", "content": "export const LOGIN_EVENT = 1;" }, { "path": "assets/login.png", "content": "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNkYPhfDwAChwGA60e6kgAAAABJRU5ErkJggg==", "encoding": "base64" }, { "path": "src/login/legacy.ts", "delete": true } ]}'レスポンスの構造:
{ "sha": "5c4d3e2f1a0b9c8d7e6f5a4b3c2d1e0f9a8b7c6d", "treeSha": "a7b6c5d4e3f2a1b0c9d8e7f6a5b4c3d2e1f0a9b8", "previousHeadSha": "9a41f0c3d2b8e7f6a5c4d3e2f1b0a9c8d7e6f5a4"}Git リファレンスを取得
/v1/origin/repos/{ownerSlug}/{repoName}/git/ref/{ref}名前で指定した単一の Git リファレンスを返します。ref は通常、heads/<branch> または tags/<tag> (先頭の refs/ の有無は問いません)、あるいはシンボリック HEAD です。完全一致のみをサポートします。プレフィックスで検索する場合は ListMatchingGitRefs を使用してください。空のリポジトリでは 409 Conflict が返されます。
パスパラメータ
ownerSlug 文字列 必須
repoName 文字列 必須
ref 文字列 必須
heads/<branch> または tags/<tag> です。先頭の refs/ は受け付けられ、正規化されます。シンボリック HEAD も受け付けられます (ref: "HEAD" として、先端のコミットとともに返されます)。完全なリファレンス名との完全一致が必要です。レスポンスフィールド
ref 文字列
object オブジェクト
object.type は "tag"、object.sha はタグオブジェクトの SHA です。object.sha 文字列
object.type 文字列
curl --request GET \ --url 'https://api.cursor.com/v1/origin/repos/OWNER_SLUG/REPO_NAME/git/ref/REF' \ --header 'Authorization: Bearer YOUR_ORIGIN_TOKEN'レスポンスの構造:
{ "ref": "refs/heads/main", "object": { "sha": "9a41f0c3d2b8e7f6a5c4d3e2f1b0a9c8d7e6f5a4", "type": "commit" }}Git Ref の作成
/v1/origin/repos/{ownerSlug}/{repoName}/git/refs既存の commit を指すブランチリファレンスを作成します。
作成できるのはブランチリファレンスのみです。tag やその他のリファレンス namespace を指定した場合、およびリポジトリ内の commit の完全な hex SHA ではない sha を指定した場合は、InvalidArgument (HTTP 400) を返します。すでに sha を指しているブランチを作成した場合は成功し、既存のリファレンスを返します。別の commit を指すブランチがすでに存在する場合は AlreadyExists (HTTP 409 Conflict) を返します。作成が push ルールセットによってブロックされる場合、またはコンテンツが別の host からミラーリングされているリポジトリでの作成は、FailedPrecondition (HTTP 400) を返します。
Path Parameters
ownerSlug string 必須
repoName string 必須
Request Body
ref string 必須
refs/heads/<branch> または heads/<branch> の形式で指定します。sha string 必須
Response Fields
ref string
object object
object.type は "commit" です。object.sha string
object.type string
curl --request POST \ --url 'https://api.cursor.com/v1/origin/repos/OWNER_SLUG/REPO_NAME/git/refs' \ --header 'Authorization: Bearer YOUR_ORIGIN_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "ref": "refs/heads/feature/login", "sha": "9a41f0c3d2b8e7f6a5c4d3e2f1b0a9c8d7e6f5a4"}'レスポンスの構造:
{ "ref": "refs/heads/feature/login", "object": { "sha": "9a41f0c3d2b8e7f6a5c4d3e2f1b0a9c8d7e6f5a4", "type": "commit" }}一致する Git リファレンスを一覧表示
/v1/origin/repos/{ownerSlug}/{repoName}/git/matching-refs名前が指定したプレフィックスで始まる Git リファレンスを一覧表示します。REST レスポンスは response_body を介して JSON 配列として直接返されます。ref の末尾のスラッシュは保持されます (heads/ → refs/heads/) 。シンボリック HEAD は完全一致で照合されます (refs/ 配下にはありません) 。空のリポジトリでは 409 Conflict が返されます。
パスパラメータ
ownerSlug string 必須
repoName string 必須
クエリパラメータ
ref string
heads/<prefix> または tags/<prefix> です。先頭の refs/ は受け付けられ、正規化されます。空の場合はすべてのリファレンスを一覧表示します (末尾のパスセグメントなしの REST バインディング) 。レスポンスフィールド
レスポンスは配列です。各項目には次が含まれます。
ref string
object オブジェクト
object.type は "tag" で、object.sha はタグオブジェクトの SHA です。object.sha string
object.type string
curl --request GET \ --url 'https://api.cursor.com/v1/origin/repos/OWNER_SLUG/REPO_NAME/git/matching-refs' \ --header 'Authorization: Bearer YOUR_ORIGIN_TOKEN'レスポンスの構造:
{ "refs": [ { "ref": "refs/heads/main", "object": { "sha": "9a41f0c3d2b8e7f6a5c4d3e2f1b0a9c8d7e6f5a4", "type": "commit" } } ]}パスで一致する Git リファレンスを一覧表示
/v1/origin/repos/{ownerSlug}/{repoName}/git/matching-refs/{ref}指定したプレフィックスで名前が始まる Git リファレンスを一覧表示します。REST レスポンスは response_body を介して JSON 配列として直接返されます。ref の末尾のスラッシュは保持されます (heads/ → refs/heads/) 。シンボリック HEAD は完全一致で照合されます (refs/ 配下にはありません) 。空のリポジトリでは 409 Conflict が返されます。
パスパラメータ
ownerSlug 文字列 必須
repoName 文字列 必須
ref 文字列 必須
heads/<prefix> または tags/<prefix> を指定します。先頭の refs/ は指定可能で、正規化されます。空の場合はすべてのリファレンスを一覧表示します (末尾のパスセグメントなしの REST バインディング) 。レスポンスフィールド
レスポンスは配列です。各項目には以下が含まれます。
ref 文字列
object オブジェクト
object.type は "tag" で、object.sha はタグオブジェクトの SHA です。object.sha 文字列
object.type 文字列
curl --request GET \ --url 'https://api.cursor.com/v1/origin/repos/OWNER_SLUG/REPO_NAME/git/matching-refs/REF' \ --header 'Authorization: Bearer YOUR_ORIGIN_TOKEN'レスポンスの構造:
{ "refs": [ { "ref": "refs/heads/main", "object": { "sha": "9a41f0c3d2b8e7f6a5c4d3e2f1b0a9c8d7e6f5a4", "type": "commit" } } ]}タグを取得
/v1/origin/repos/{ownerSlug}/{repoName}/git/tags/{sha}SHA で指定した注釈付き Git タグオブジェクトを返します。軽量タグはタグオブジェクトではないため、NotFound が返されます。空のリポジトリでは 409 Conflict が返されます。
パスパラメータ
ownerSlug string 必須
repoName string 必須
sha string 必須
レスポンスフィールド
sha string
tag string
message string
tagger object
tagger.name string
tagger.email string
tagger.date string
object object
object.sha string
object.type string
curl --request GET \ --url 'https://api.cursor.com/v1/origin/repos/OWNER_SLUG/REPO_NAME/git/tags/SHA' \ --header 'Authorization: Bearer YOUR_ORIGIN_TOKEN'レスポンスの構造:
{ "sha": "e1f0a9b8c7d6e5f4a3b2c1d0e9f8a7b6c5d4e3f2", "tag": "v1.2.0", "message": "Release v1.2.0", "tagger": { "name": "Jane Doe", "email": "jane@acme.dev", "date": "2026-08-01T09:30:00Z" }, "object": { "sha": "9a41f0c3d2b8e7f6a5c4d3e2f1b0a9c8d7e6f5a4", "type": "commit" }}ツリーを取得
/v1/origin/repos/{ownerSlug}/{repoName}/git/trees/{sha}SHA または解決可能なリビジョンで Git ツリーオブジェクトを返します。sha にはツリー SHA、コミット SHA、ブランチ、タグ、または HEAD のようなシンボリック ref を指定できます。recursive=true (または 1) を設定するとツリー全体を走査します。パラメータを省略するか他の値を渡すと直下の子のみが一覧表示されます。再帰的な一覧は 100,000 エントリまたは 7 MiB で切り詰められ、truncated=true が設定されます。空のリポジトリでは 409 Conflict が返されます。
パスパラメータ
ownerSlug string 必須
repoName string 必須
sha string 必須
HEAD のようなシンボリックリファレンス。クエリパラメータ
recursive boolean
true の場合、ツリー全体を再帰的に巡回して返します。クエリ値 true または 1 を指定すると再帰が有効になります。パラメータを省略するか、false や 0 を含むそれ以外の値を指定した場合は、直接の子のみが一覧表示されます。レスポンスフィールド
sha string
tree array
tree[].path string
tree[].mode string
tree[].type string
tree[].sha string
tree[].size integer
int32 により REST JSON は数値を出力します。個々の blob が 2 GiB を超える場合は表現できません。truncated boolean
curl --request GET \ --url 'https://api.cursor.com/v1/origin/repos/OWNER_SLUG/REPO_NAME/git/trees/SHA' \ --header 'Authorization: Bearer YOUR_ORIGIN_TOKEN'レスポンスの構造:
{ "sha": "a7b6c5d4e3f2a1b0c9d8e7f6a5b4c3d2e1f0a9b8", "tree": [ { "path": "src/telemetry.ts", "mode": "100644", "type": "blob", "sha": "c9d8e7f6a5b4c3d2e1f0a9b8c7d6e5f4a3b2c1d0", "size": 312 } ], "truncated": false}Grants
grant は、1 つの principal を 1 つのリポジトリまたは 1 つの owner に、1 つの permission で結び付けるものです。これらの endpoint は resource に直接設定された grant を read、set、remove するため、access の変更をコードと同じようにスクリプト化して確認できます。write は Codebase permissions UI の背後にあるチェックを再利用し、repository.access_changed と namespace.access_changed という同じ audit イベントを記録します。principal の種類、2 つの permission 階層、owner レベルの grant とリポジトリレベルの grant の関係については、Origin Grants API を参照してください。
リポジトリのグラント一覧
/v1/origin/repos/{ownerSlug}/{repoName}/grantsリポジトリに対して直接付与された権限を持つユーザー、グループ、所有チームのグループを一覧表示します。リポジトリのオーナーから継承された権限は含まれません。
パスパラメータ
ownerSlug string 必須
repoName string 必須
クエリパラメータ
pageSize integer
pageToken が設定されている場合は無視されます。pageToken string
next_page_token から取得した opaque cursor。最初のページでは空にします。レスポンスフィールド
grants 配列
pageSize に満たない場合があります。grants[].user object
user、group、teamGroup のうち、いずれか 1 つのみが存在します。grants[].user.id string
user_ のプレフィックスが付きます。grants[].user.email string
grants[].user.displayName string
grants[].user.handle string
@ プレフィックスなし) 。そのプロフィールが公開されている間のみ含まれ、それ以外の場合は省略されます。grants[].group オブジェクト
grants[].group.id string
grp_ のプレフィックスが付きます。grants[].teamGroup オブジェクト
grants[].teamGroup.kind string
members、admins。grants[].permission string
read、write、admin、custom。custom はカスタムポリシーが設定されていることを示す値で、Upsert Repository Grant では受け入れられません。repository object
nextPageToken string
curl --request GET \ --url 'https://api.cursor.com/v1/origin/repos/{ownerSlug}/{repoName}/grants' \ --header 'Authorization: Bearer YOUR_ORIGIN_TOKEN'レスポンスの構造:
{ "grants": [ { "group": { "id": "grp_01k2ja2000e0080000000000n2" }, "permission": "admin" }, { "teamGroup": { "kind": "admins" }, "permission": "admin" }, { "teamGroup": { "kind": "members" }, "permission": "write" }, { "user": { "id": "user_01k2ja2000e0080000000000c3", "email": "jane@acme.dev" }, "permission": "read" } ], "repository": { "id": "repo_01k2ja2000e0080000000000q4", "name": "rocket", "owner": { "slug": "acme", "id": "ns_01k2ja2000e0080000000000p3", "type": "team" } }, "nextPageToken": ""}リポジトリの grant を upsert
/v1/origin/repos/{ownerSlug}/{repoName}/grantsユーザー、グループ、または所有チームのグループがリポジトリに対して直接保持する権限を設定し、そのプリンシパルに以前直接付与されていた権限を置き換えます。プリンシパルがすでに保持している権限を再度付与した場合も、変更は発生せず成功します。ユーザーはリポジトリ所有者のチームまたは組織の有効なメンバーであり、グループはその組織の有効なグループである必要があります。条件を満たさない場合、リクエストは FailedPrecondition (HTTP 400) を返します。
パスパラメータ
ownerSlug string 必須
repoName string 必須
リクエストボディ
user オブジェクト
user、group、teamGroup のいずれか 1 つのみが存在します。user.id string
user_ のプレフィックスが付きます。user.email string
user.displayName string
user.handle string
@ プレフィックスなし) 。そのプロフィールが公開されている間のみ含まれ、それ以外の場合は省略されます。group オブジェクト
group.id string
grp_ のプレフィックスが付きます。teamGroup オブジェクト
teamGroup.kind string
members、admins。permission string 必須
read、write、admin。custom は InvalidArgument (HTTP 400) を返します。カスタムポリシーはこの API の対象外です。レスポンスフィールド
user オブジェクト
user、group、teamGroup のうち、必ず 1 つだけが含まれます。user.id string
user_ のプレフィックスが付きます。user.email string
user.displayName string
user.handle string
@ プレフィックスなし) 。そのプロフィールが公開されている間のみ含まれ、それ以外の場合は省略されます。group オブジェクト
group.id string
grp_ です。teamGroup オブジェクト
teamGroup.kind string
members、admins。permission string
curl --request POST \ --url 'https://api.cursor.com/v1/origin/repos/OWNER_SLUG/REPO_NAME/grants' \ --header 'Authorization: Bearer YOUR_ORIGIN_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "user": { "id": "user_01k2ja2000e0080000000000c3" }, "permission": "write"}'レスポンスの構造:
{ "user": { "id": "user_01k2ja2000e0080000000000c3", "email": "jane@acme.dev" }, "permission": "write"}リポジトリの Grant を削除
/v1/origin/repos/{ownerSlug}/{repoName}/grantsuser、group、または所有チームの group がリポジトリに対して直接保持している権限を削除します。リポジトリの owner から継承された権限は影響を受けないため、所有チームの group は owner レベルの default に戻ります。principal が直接保持していない権限を削除した場合も、変更は行われずに成功します。レスポンスの body は空です。
Path Parameters
ownerSlug string Required
repoName string Required
Request Body
user object
user、group、teamGroup のいずれか 1 つだけが含まれます。user.id string
user_ のプレフィックスが付きます。user.email string
user.displayName string
user.handle string
@ プレフィックスなし) 。その profile が public に表示されている間のみ含まれ、それ以外では省略されます。group object
group.id string
grp_ のプレフィックスが付きます。teamGroup object
teamGroup.kind string
members、admins。Response Fields
成功したリクエストは response body を返しません。
curl --request DELETE \ --url 'https://api.cursor.com/v1/origin/repos/OWNER_SLUG/REPO_NAME/grants' \ --header 'Authorization: Bearer YOUR_ORIGIN_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "group": { "id": "grp_01k2ja2000e0080000000000n2" }}'レスポンス:
204 No Contentnamespace の grants 一覧を取得
/v1/origin/owners/{ownerSlug}/grantsオーナーへのアクセス権が付与されている対象 (ユーザー、グループ、および所有チームに組み込みの admin グループと member グループ) を一覧表示します。各グラントは、そのオーナー配下のすべてのリポジトリに対して付与する権限を保持します。個々のリポジトリに対するグラントは含まれません。それらは List Repository Grants で取得してください。
パスパラメータ
ownerSlug string 必須
クエリパラメータ
pageSize integer
pageToken が設定されている場合は無視されます。pageToken string
next_page_token から取得した Opaque cursor。最初のページでは空にします。レスポンスフィールド
grants 配列
pageSize 未満になる場合があります。grants[].user object
user、group、teamGroup のうち、必ずいずれか 1 つのみが含まれます。grants[].user.id string
user_ のプレフィックスが付きます。grants[].user.email string
grants[].user.displayName string
grants[].user.handle string
@ プレフィックスなし) 。そのプロフィールが公開されている間のみ含まれ、それ以外の場合は省略されます。grants[].group オブジェクト
grants[].group.id string
grp_ です。grants[].teamGroup オブジェクト
grants[].teamGroup.kind string
members、admins。grants[].permission string
PERMISSION_READ、PERMISSION_CONTRIBUTOR、PERMISSION_WRITE、PERMISSION_ADMIN、PERMISSION_CUSTOM。PERMISSION_CUSTOM は custom policy が設定されていることを示し、この値は Upsert Namespace Grant では受け入れられません。nextPageToken string
curl --request GET \ --url 'https://api.cursor.com/v1/origin/owners/{ownerSlug}/grants' \ --header 'Authorization: Bearer YOUR_ORIGIN_TOKEN'レスポンスの構造:
{ "grants": [ { "group": { "id": "grp_01k2ja2000e0080000000000n2" }, "permission": "PERMISSION_ADMIN" }, { "teamGroup": { "kind": "admins" }, "permission": "PERMISSION_ADMIN" }, { "teamGroup": { "kind": "members" }, "permission": "PERMISSION_CONTRIBUTOR" }, { "user": { "id": "user_01k2ja2000e0080000000000c3", "email": "jane@acme.dev" }, "permission": "PERMISSION_WRITE" } ], "nextPageToken": ""}Namespace Grant の Upsert
/v1/origin/owners/{ownerSlug}/grantsユーザー、グループ、または所有チームのグループが owner に対して直接保持する permission を設定し、その principal に直接付与されていた既存の permission を置き換えます。principal がすでに保持している grant を再度付与した場合は、変更は生じずに成功します。ユーザーが所有チームまたはその organization の有効なメンバーでない場合、グループがその organization の有効なグループでない場合、または write によって owner に admin が 1 人もいなくなる場合、request は FailedPrecondition (HTTP 400) を返します。
パスパラメータ
ownerSlug string 必須
リクエストボディ
user オブジェクト
user、group、teamGroup のうち、いずれか 1 つだけが含まれます。user.id string
user_ です。user.email string
user.displayName string
user.handle string
@ プレフィックスなし) 。そのプロフィールが公開されている間のみ含まれ、それ以外の場合は省略されます。group オブジェクト
group.id string
grp_ というプレフィックスが付きます。teamGroup オブジェクト
teamGroup.kind string
members、admins。permission string 必須
PERMISSION_READ、PERMISSION_CONTRIBUTOR、PERMISSION_WRITE、PERMISSION_ADMIN。PERMISSION_READ、PERMISSION_CONTRIBUTOR、PERMISSION_WRITE は owner の internal リポジトリに対してそのレベルの権限を付与し、PERMISSION_ADMIN は owner 自体を管理します。PERMISSION_CUSTOM を指定すると InvalidArgument (HTTP 400) が返されます。レスポンスフィールド
user オブジェクト
user、group、teamGroup のいずれか 1 つだけが存在します。user.id string
user_ のプレフィックスが付きます。user.email string
user.displayName string
user.handle string
@ プレフィックスなし) 。そのプロフィールが公開されている間のみ含まれ、それ以外の場合は省略されます。group オブジェクト
group.id string
grp_ のプレフィックスが付きます。teamGroup object
teamGroup.kind string
members、admins。permission string
curl --request POST \ --url 'https://api.cursor.com/v1/origin/owners/OWNER_SLUG/grants' \ --header 'Authorization: Bearer YOUR_ORIGIN_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "user": { "id": "user_01k2ja2000e0080000000000c3" }, "permission": "PERMISSION_WRITE"}'レスポンスの構造:
{ "user": { "id": "user_01k2ja2000e0080000000000c3", "email": "jane@acme.dev" }, "permission": "PERMISSION_WRITE"}Namespace grant の削除
/v1/origin/owners/{ownerSlug}/grantsuser、group、または owning-team group が owner に対して直接保持している permission を削除します。リポジトリごとの grant には影響しません。principal が直接保持していない permission を削除した場合も、変更なしで成功します。owner に admin が 1 人もいなくなるような削除は FailedPrecondition (HTTP 400) を返します。レスポンス本文は空です。
パスパラメータ
ownerSlug string Required
リクエスト本文
user object
user、group、teamGroup のうち、いずれか 1 つのみが存在します。user.id string
user_。user.email string
user.displayName string
user.handle string
@ プレフィックスなし) 。その profile が公開されている間のみ存在し、それ以外では省略されます。group object
group.id string
grp_。teamGroup object
teamGroup.kind string
members、admins。レスポンスフィールド
成功した requests は レスポンス本文を返しません。
curl --request DELETE \ --url 'https://api.cursor.com/v1/origin/owners/OWNER_SLUG/grants' \ --header 'Authorization: Bearer YOUR_ORIGIN_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "group": { "id": "grp_01k2ja2000e0080000000000n2" }}'レスポンス:
204 No Contentラベル
ラベル定義は1つのリポジトリに属し、名前で指定します。プルリクエストへのラベルの割り当ては別の機能です。プルリクエストのラベルを設定を参照してください。
ラベルを一覧表示
/v1/origin/repos/{ownerSlug}/{repoName}/labelsリポジトリに定義されているラベルを名前順に一覧表示します。
ページトークンは、発行先のリポジトリに紐付けられます。別のリポジトリに対して再利用されたトークンや、その他の不正なトークンでは InvalidArgument (HTTP 400) が返されます。
パスパラメータ
ownerSlug string 必須
repoName string 必須
クエリパラメータ
pageSize integer
pageToken string
nextPageToken で返された不透明なカーソル。最初のページでは省略します。レスポンスフィールド
labels array
labels[].id string
labels[].name string
labels[].color string
# を除く6桁の16進数カラーコード。labels[].description string
nextPageToken string
curl --request GET \ --url 'https://api.cursor.com/v1/origin/repos/OWNER_SLUG/REPO_NAME/labels' \ --header 'Authorization: Bearer YOUR_ORIGIN_TOKEN'レスポンスの構造:
{ "labels": [ { "id": "lbl_01k2ja2000e0080000000000m1", "name": "bug", "color": "d73a4a", "description": "Something isn't working" } ]}ラベルを作成
/v1/origin/repos/{ownerSlug}/{repoName}/labelsリポジトリにラベルを作成します。
リポジトリ内の別のラベルですでに使用されている名前を指定すると、AlreadyExists (HTTP 409 Conflict) が返されます。color が6桁の16進数でない場合、name が50文字を超える場合、または description が255文字を超える場合は、InvalidArgument (HTTP 400) が返されます。
パスパラメータ
ownerSlug string 必須
repoName string 必須
リクエスト本文
name string 必須
color string 必須
# を付けない6桁の16進数カラー。大文字の入力は小文字で保存されます。description string
レスポンスフィールド
id string
name string
color string
# を付けない6桁の16進数カラー。description string
curl --request POST \ --url 'https://api.cursor.com/v1/origin/repos/OWNER_SLUG/REPO_NAME/labels' \ --header 'Authorization: Bearer YOUR_ORIGIN_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "name": "bug", "color": "d73a4a", "description": "Something isn'\''t working"}'レスポンスの構造:
{ "id": "lbl_01k2ja2000e0080000000000m1", "name": "bug", "color": "d73a4a", "description": "Something isn't working"}ラベルを取得
/v1/origin/repos/{ownerSlug}/{repoName}/labels/{labelName}名前を指定して単一のリポジトリラベルを取得します。
名前が不明な場合は 404 を返します。labelName が空の場合は InvalidArgument (HTTP 400) を返します。
パスパラメータ
ownerSlug string 必須
repoName string 必須
labelName string 必須
レスポンスフィールド
id string
name string
color string
# を除く6文字の16進数カラーコード。description string
curl --request GET \ --url 'https://api.cursor.com/v1/origin/repos/OWNER_SLUG/REPO_NAME/labels/LABEL_NAME' \ --header 'Authorization: Bearer YOUR_ORIGIN_TOKEN'レスポンスの構造:
{ "id": "lbl_01k2ja2000e0080000000000m1", "name": "bug", "color": "d73a4a", "description": "Something isn't working"}ラベルを削除
/v1/origin/repos/{ownerSlug}/{repoName}/labels/{labelName}名前でリポジトリのラベルを削除します。レスポンス本文は空です。
ラベルを削除すると、割り当てられているすべてのプルリクエストからも削除されます。不明な名前を指定すると 404 が返されます。labelName が空の場合は InvalidArgument (HTTP 400) が返されます。
パスパラメータ
ownerSlug string 必須
repoName string 必須
labelName string 必須
レスポンスフィールド
成功したリクエストではレスポンス本文は返されません。
curl --request DELETE \ --url 'https://api.cursor.com/v1/origin/repos/OWNER_SLUG/REPO_NAME/labels/LABEL_NAME' \ --header 'Authorization: Bearer YOUR_ORIGIN_TOKEN'レスポンス:
204 No Contentラベルを更新
/v1/origin/repos/{ownerSlug}/{repoName}/labels/{labelName}現在の名前で指定したリポジトリラベルを更新します。
省略したフィールドは変更されません。3つのフィールドをすべて省略した場合は、現在のラベルがそのまま返されます。別のラベルですでに使用されている名前に変更すると、AlreadyExists (HTTP 409 Conflict) が返されます。不明なlabelNameを指定した場合は404が返されます。
パスパラメータ
ownerSlug string 必須
repoName string 必須
labelName string 必須
リクエスト本文
name string
color string
#を除く6文字の16進数カラーコード。変更しない場合は省略します。description string
レスポンスフィールド
id string
name string
color string
#を除く6文字の16進数カラーコード。description string
curl --request PATCH \ --url 'https://api.cursor.com/v1/origin/repos/OWNER_SLUG/REPO_NAME/labels/LABEL_NAME' \ --header 'Authorization: Bearer YOUR_ORIGIN_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "color": "b60205"}'レスポンスの構造:
{ "id": "lbl_01k2ja2000e0080000000000m1", "name": "bug", "color": "b60205", "description": "Something isn't working"}Pull Requests
クローズまたはマージされたPull Requestsには、closedAt、mergedAt、mergeCommitSha が追加で含まれる場合があります。head.ref と base.ref は不透明な Origin リファレンス文字列として扱ってください。短いブランチ名の場合もあれば、完全修飾された refs/heads/… 値の場合もあります。
確認の verdict は approve、request_changes、comment のいずれかです。未送信の下書き確認には submittedAt はありません。判定が有効な間、dismissal はありません。却下された確認も確認一覧に表示され続けます。新しい判定によって自動的に置き換えられた確認には、サーバー生成のメッセージが付与されます。
コメントには、グループ化用の thread リファレンスが含まれます。返信時のコメント作成リクエストでは、引き続きスカラーの threadId コマンドパラメータを受け付けます。Pull Request Thread を更新してスレッドを解決または再オープンします。
プルリクエストの一覧
/v1/origin/repos/{ownerSlug}/{repoName}/pullsリポジトリ内のプルリクエストを一覧表示します。head ブランチ、base ブランチ、作成者、作成日時の範囲、状態で任意に絞り込めます。各プルリクエストには割り当てられたラベルが含まれます。
結果は sortBy で選択した作成順または最終更新順に、新しいものが先で返されます。逆順にするには direction=asc を設定してください。ページトークンには発行時のソート順とフィルターが埋め込まれているため、異なるソート順やフィルターの組み合わせで同じトークンを再利用すると拒否されます。いずれかが変更された場合はページネーションをやり直してください。
パスパラメータ
ownerSlug string 必須
repoName string 必須
クエリパラメータ
head string
state string
open (デフォルト) 、closed、merged、all。closed は、マージ済みのものも含め、open でなくなったすべてのプルリクエストを対象とします。merged はマージ済みのものだけに絞り込みます。その他の値を指定すると InvalidArgument (HTTP 400) が返されます。pageSize 整数
pageToken 文字列
nextPageTokenからの不透明なカーソル。最初のページでは省略してください。author string
pullRequests[].author.user.id、pullRequests[].author.app.id、または pullRequests[].author.serviceAccount.id として返す公開アクターID (user_…、app_…、または sa_…) をそのまま渡すか、ユーザーの正確なメールアドレスを指定してください。メールアドレスの照合は大文字小文字を区別しません。アプリとサービスアカウントにはメールアドレスの識別子がないため、この方法で指定できるのはユーザー作成者のみです。プルリクエストを持たない作成者、あるいは単一のユーザーに解決されないメールアドレスは空のリストを返します。共有の origin-cursor-managed-actor ID を含むその他の値を指定すると、InvalidArgument (HTTP 400) が返されます。base string
main) または完全修飾リファレンス (refs/heads/main) を受け付けます。省略すると全てのベースにわたって一覧表示されます。direction string
sortBy に沿ったソート方向。デフォルトは "desc" で、sortBy=created では作成が新しい順、sortBy=updated では更新が新しい順に返します。"asc" はそれぞれ逆順になります。その他の値は InvalidArgument (HTTP 400) を返します。since string
2026-08-01T00:00:00Z のような RFC 3339 形式のタイムスタンプで指定します。その時点以降に作成されたプルリクエストのみが返されます。形式が不正なタイムスタンプを指定すると InvalidArgument (HTTP 400) が返されます。until 文字列
since と同じ RFC 3339 形式で指定する、作成日時の上限値 (任意、指定時刻を含む) 。その時点以前に作成されたプルリクエストのみを返します。形式が不正なタイムスタンプを指定すると InvalidArgument (HTTP 400) が返されます。sortBy string
created (作成順、デフォルト) または updated (最終更新時刻) です。その他の値は InvalidArgument (HTTP 400) を返します。レスポンスフィールド
pullRequests 配列
pullRequests[].id string
pullRequests[].number string
pullRequests[].state string
pullRequests[].draft boolean
pullRequests[].merged boolean
pullRequests[].title string
pullRequests[].body string
pullRequests[].head オブジェクト
pullRequests[].head.ref string
pullRequests[].head.sha string
pullRequests[].base オブジェクト
pullRequests[].base.ref string
pullRequests[].base.sha string
pullRequests[].author オブジェクト
pullRequests[].author.user オブジェクト
pullRequests[].author.user.id 文字列
pullRequests[].author.user.email string
pullRequests[].author.user.displayName string
pullRequests[].author.user.handle string
@ プレフィックスは含みません。プロフィールが公開されている場合のみ存在し、それ以外は省略されます。pullRequests[].author.app オブジェクト
pullRequests[].author.app.id string
pullRequests[].author.app.displayName 文字列
pullRequests[].author.serviceAccount オブジェクト
pullRequests[].author.serviceAccount.id string
pullRequests[].createdAt 文字列
pullRequests[].updatedAt string
pullRequests[].closedAt string
pullRequests[].mergedAt string
pullRequests[].mergeCommitSha string
pullRequests[].additions 整数
pullRequests[].deletions 整数
pullRequests[].changedFiles integer
pullRequests[].labels 配列
pullRequests[].labels[].id string
pullRequests[].labels[].name string
pullRequests[].labels[].color string
# を付けない6桁の16進数カラーコード。pullRequests[].labels[].description 文字列
pullRequests[].version オブジェクト
pullRequests[].version.number 文字列
pullRequests[].version.headSha string
pullRequests[].version.baseSha string
pullRequests[].version.createdAt string
nextPageToken string
curl --request GET \ --url 'https://api.cursor.com/v1/origin/repos/OWNER_SLUG/REPO_NAME/pulls' \ --header 'Authorization: Bearer YOUR_ORIGIN_TOKEN'レスポンスの構造:
{ "pullRequests": [ { "id": "pr_01k2ja2000e0080000000000d4", "number": "17", "state": "open", "draft": false, "merged": false, "title": "Add launch telemetry", "body": "Adds structured launch telemetry to the ignition path.", "head": { "ref": "add-telemetry", "sha": "9a41f0c3d2b8e7f6a5c4d3e2f1b0a9c8d7e6f5a4" }, "base": { "ref": "main", "sha": "3b1f9c2d8a7e6f5049c8b7a6d5e4f3a2b1c0d9e8" }, "author": { "user": { "id": "user_01k2ja2000e0080000000000c3", "email": "jane@acme.dev" } }, "createdAt": "2026-08-01T09:30:00Z", "updatedAt": "2026-08-02T14:45:00Z", "additions": 128, "deletions": 46, "changedFiles": 5, "labels": [ { "id": "lbl_01k2ja2000e0080000000000m1", "name": "bug", "color": "d73a4a", "description": "Something isn't working" } ], "version": { "number": "3", "headSha": "9a41f0c3d2b8e7f6a5c4d3e2f1b0a9c8d7e6f5a4", "baseSha": "3b1f9c2d8a7e6f5049c8b7a6d5e4f3a2b1c0d9e8", "createdAt": "2026-08-01T09:30:00Z" } } ]}プルリクエストを取得
/v1/origin/repos/{ownerSlug}/{repoName}/pulls/{pullNumber}割り当てられたラベルを含む単一のプルリクエストを返します。
クローズ済みまたはマージ済みのプルリクエストには、closedAt、mergedAt、mergeCommitSha が追加で含まれる場合があります。head.ref と base.ref は不透明な Origin リファレンス文字列として扱ってください。これらは短いブランチ名である場合も、完全修飾された refs/heads/… の値である場合もあります。
パスパラメータ
ownerSlug string 必須
repoName string 必須
pullNumber string 必須
レスポンスフィールド
id string
number string
state string
draft boolean
merged boolean
title string
body string
head オブジェクト
head.ref string
head.sha string
base オブジェクト
base.ref string
base.sha string
author オブジェクト
author.user オブジェクト
author.user.id string
author.user.email string
author.user.displayName string
author.user.handle string
@プレフィックスは含みません。プロフィールが公開されている間のみ存在し、それ以外の場合は省略されます。author.app オブジェクト
author.app.id string
author.app.displayName string
author.serviceAccount オブジェクト
author.serviceAccount.id string
createdAt 文字列
updatedAt string
closedAt 文字列
mergedAt string
mergeCommitSha string
additions 整数
deletions 整数
changedFiles 整数
labels 配列
labels[].id 文字列
labels[].name string
labels[].color string
# を含まない6桁の16進カラーコード。labels[].description string
version object
version.number 文字列
version.headSha string
version.baseSha string
version.createdAt 文字列
curl --request GET \ --url 'https://api.cursor.com/v1/origin/repos/OWNER_SLUG/REPO_NAME/pulls/PULL_NUMBER' \ --header 'Authorization: Bearer YOUR_ORIGIN_TOKEN'レスポンスの構造:
{ "id": "pr_01k2ja2000e0080000000000d4", "number": "17", "state": "open", "draft": false, "merged": false, "title": "Add launch telemetry", "body": "Adds structured launch telemetry to the ignition path.", "head": { "ref": "add-telemetry", "sha": "9a41f0c3d2b8e7f6a5c4d3e2f1b0a9c8d7e6f5a4" }, "base": { "ref": "main", "sha": "3b1f9c2d8a7e6f5049c8b7a6d5e4f3a2b1c0d9e8" }, "author": { "user": { "id": "user_01k2ja2000e0080000000000c3", "email": "jane@acme.dev" } }, "createdAt": "2026-08-01T09:30:00Z", "updatedAt": "2026-08-02T14:45:00Z", "additions": 128, "deletions": 46, "changedFiles": 5, "labels": [ { "id": "lbl_01k2ja2000e0080000000000m1", "name": "bug", "color": "d73a4a", "description": "Something isn't working" } ], "version": { "number": "3", "headSha": "9a41f0c3d2b8e7f6a5c4d3e2f1b0a9c8d7e6f5a4", "baseSha": "3b1f9c2d8a7e6f5049c8b7a6d5e4f3a2b1c0d9e8", "createdAt": "2026-08-01T09:30:00Z" }}プルリクエストを作成
/v1/origin/repos/{ownerSlug}/{repoName}/pullshead から base へのプルリクエストを作成します。
オプションの parent_pull_number は、この変更を同じリポジトリ内の別のオープンまたはドラフトのプルリクエストに重ねます。
title が256文字より長い、または body が65,536文字より長い場合は InvalidArgument (HTTP 400) が返されます。どちらの制限も Unicode のコードポイントでカウントされます。
base と共通の履歴を持たない head は InvalidArgument (HTTP 400) を返し、何も作成しません。後のプッシュでオープン中のプルリクエストの head が base と分離した場合、Origin はそのプルリクエストをクローズし、pull_request.closed を送信します。その後の関連するプッシュで再オープンされることはありません。
パスパラメータ
ownerSlug string 必須
repoName string 必須
リクエスト本文
title string 必須
body string
head string 必須
base string 必須
InvalidArgument (HTTP 400) が返されます。draft boolean
parentPullNumber 文字列
レスポンスフィールド
id string
number string
state string
draft boolean
merged boolean
title string
body string
head オブジェクト
head.ref string
head.sha string
base オブジェクト
base.ref string
base.sha string
author object
author.user オブジェクト
author.user.id string
author.user.email string
author.user.displayName string
author.user.handle string
@ プレフィックスは含みません) 。そのプロフィールが公開されている場合にのみ表示され、そうでない場合は省略されます。author.app オブジェクト
author.app.id string
author.app.displayName string
author.serviceAccount オブジェクト
author.serviceAccount.id string
createdAt string
updatedAt 文字列
closedAt 文字列
mergedAt string
mergeCommitSha string
additions integer
deletions integer
changedFiles 整数
labels array
labels[].id string
labels[].name string
labels[].color string
#のない6桁の16進数カラーコード。labels[].description string
version オブジェクト
version.number string
version.headSha string
version.baseSha string
version.createdAt 文字列
curl --request POST \ --url 'https://api.cursor.com/v1/origin/repos/OWNER_SLUG/REPO_NAME/pulls' \ --header 'Authorization: Bearer YOUR_ORIGIN_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "title": "Add launch telemetry", "body": "Adds structured launch telemetry to the ignition path.", "head": "add-telemetry", "base": "main", "draft": false}'レスポンスの構造:
{ "id": "pr_01k2ja2000e0080000000000d4", "number": "17", "state": "open", "draft": false, "merged": false, "title": "Add launch telemetry", "body": "Adds structured launch telemetry to the ignition path.", "head": { "ref": "add-telemetry", "sha": "9a41f0c3d2b8e7f6a5c4d3e2f1b0a9c8d7e6f5a4" }, "base": { "ref": "main", "sha": "3b1f9c2d8a7e6f5049c8b7a6d5e4f3a2b1c0d9e8" }, "author": { "user": { "id": "user_01k2ja2000e0080000000000c3", "email": "jane@acme.dev" } }, "createdAt": "2026-08-01T09:30:00Z", "updatedAt": "2026-08-02T14:45:00Z", "additions": 128, "deletions": 46, "changedFiles": 5, "labels": [ { "id": "lbl_01k2ja2000e0080000000000m1", "name": "bug", "color": "d73a4a", "description": "Something isn't working" } ], "version": { "number": "3", "headSha": "9a41f0c3d2b8e7f6a5c4d3e2f1b0a9c8d7e6f5a4", "baseSha": "3b1f9c2d8a7e6f5049c8b7a6d5e4f3a2b1c0d9e8", "createdAt": "2026-08-01T09:30:00Z" }}プルリクエストの更新
/v1/origin/repos/{ownerSlug}/{repoName}/pulls/{pullNumber}プルリクエストのタイトル、本文、ベースブランチ、ライフサイクル状態のいずれかまたはすべてを更新します。
省略されたフィールドは変更されません。指定されたフィールドは次の順序で適用されます: metadata、次に reopen/draft/ready-for-review、次に base、最後に close。close は最後に実行されるため、同一リクエスト内でのリターゲットでもオープンな変更を参照できます。reopen は base の前に実行されるため、クローズされたプルリクエストをリターゲットできます。後のステップが失敗した場合、前のステップは既にコミットされている可能性があります。
title が256文字より長い、または body が65,536文字より長い場合、InvalidArgument (HTTP 400) が返されます。いずれの上限も Unicode のコードポイントでカウントされます。
パスパラメータ
ownerSlug string 必須
repoName string 必須
pullNumber string 必須
リクエストボディ
title 文字列
body string
state string
"open" または "closed"。"closed" はプルリクエストをクローズします。draft: true を指定しない "open" は、既存のドラフトの公開を含め、レビュー可能な状態にします。Merged は書き込みできません。MergePullRequest を使用してください。draft boolean
true はプルリクエストをドラフトとしてマークします。false はレビュー準備完了としてマークし (現在クローズされている場合は再オープンします) 。state が "closed" の場合は無視されます。base string
InvalidArgument (HTTP 400) が返されます。レスポンスフィールド
id string
number string
state string
draft boolean
merged boolean
title 文字列
body string
head object
head.ref string
head.sha string
base オブジェクト
base.ref string
base.sha string
author object
author.user object
author.user.id string
author.user.email string
author.user.displayName string
author.user.handle string
@ プレフィックスは含みません。プロフィールが公開されている間のみ表示され、それ以外の場合は省略されます。author.app オブジェクト
author.app.id string
author.app.displayName 文字列
author.serviceAccount オブジェクト
author.serviceAccount.id string
createdAt 文字列
updatedAt string
closedAt string
mergedAt string
mergeCommitSha string
additions integer
deletions integer
changedFiles 整数
labels 配列
labels[].id string
labels[].name string
labels[].color 文字列
# のない6桁の16進カラーコード。labels[].description string
version オブジェクト
version.number 文字列
version.headSha string
version.baseSha string
version.createdAt 文字列
curl --request PATCH \ --url 'https://api.cursor.com/v1/origin/repos/OWNER_SLUG/REPO_NAME/pulls/PULL_NUMBER' \ --header 'Authorization: Bearer YOUR_ORIGIN_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "title": "Add launch telemetry", "body": "Adds structured launch telemetry to the ignition path.", "state": "open", "draft": false, "base": "main"}'レスポンスの構造:
{ "id": "pr_01k2ja2000e0080000000000d4", "number": "17", "state": "open", "draft": false, "merged": false, "title": "Add launch telemetry", "body": "Adds structured launch telemetry to the ignition path.", "head": { "ref": "add-telemetry", "sha": "9a41f0c3d2b8e7f6a5c4d3e2f1b0a9c8d7e6f5a4" }, "base": { "ref": "main", "sha": "3b1f9c2d8a7e6f5049c8b7a6d5e4f3a2b1c0d9e8" }, "author": { "user": { "id": "user_01k2ja2000e0080000000000c3", "email": "jane@acme.dev" } }, "createdAt": "2026-08-01T09:30:00Z", "updatedAt": "2026-08-02T14:45:00Z", "additions": 128, "deletions": 46, "changedFiles": 5, "labels": [ { "id": "lbl_01k2ja2000e0080000000000m1", "name": "bug", "color": "d73a4a", "description": "Something isn't working" } ], "version": { "number": "3", "headSha": "9a41f0c3d2b8e7f6a5c4d3e2f1b0a9c8d7e6f5a4", "baseSha": "3b1f9c2d8a7e6f5049c8b7a6d5e4f3a2b1c0d9e8", "createdAt": "2026-08-01T09:30:00Z" }}プルリクエストコメントの一覧取得
/v1/origin/repos/{ownerSlug}/{repoName}/pulls/{pullNumber}/commentsプルリクエストのすべてのコメントを時系列順に一覧表示します。必要に応じて作成時刻のウィンドウで範囲を絞り込めます。各コメントには、ID、diff アンカー、解決状態を含むスレッド情報が含まれます。追加のリクエストを行わずに、フラットなレスポンスを thread.id ごとにグループ化できます。
ページトークンには発行時のフィルターが埋め込まれているため、異なるフィルターで再送されたトークンは拒否されます。フィルターを変更した場合は、ページネーションを最初からやり直してください。
パスパラメータ
ownerSlug string 必須
repoName string 必須
pullNumber string 必須
クエリパラメータ
pageSize 整数
pageToken string
nextPageToken からの不透明なカーソル。最初のページでは省略してください。since string
2026-08-01T00:00:00Z のような RFC 3339 タイムスタンプで指定します。その時点以降に作成されたコメントのみを返します。形式が不正なタイムスタンプの場合は InvalidArgument (HTTP 400) を返します。until string
since と同じ RFC 3339 形式で指定します。その時点以前または同時に作成されたコメントのみを返します。タイムスタンプが不正な形式の場合は InvalidArgument (HTTP 400) を返します。threadIds 配列
InvalidArgument (HTTP 400) を返します。レスポンスフィールド
comments 配列
comments[].id string
comments[].thread object
comments[].thread.id string
comments[].thread.version object
comments[].thread.version.number string
comments[].thread.version.headSha string
comments[].thread.version.baseSha string
comments[].thread.version.createdAt string
comments[].thread.path string
comments[].thread.side string
left、right。general-discussion スレッドでは未設定です。comments[].thread.startLine 整数
side バージョンでアンカーされた範囲の先頭行。ファイルレベルおよび一般ディスカッションのスレッドの場合は 0。comments[].thread.endLine 整数
0。comments[].thread.resolvedAt string
comments[].thread.createdAt string
comments[].thread.updatedAt string
comments[].body string
comments[].author object
comments[].author.user object
comments[].author.user.id string
comments[].author.user.email string
comments[].author.user.displayName string
comments[].author.user.handle string
@ は含みません) 。プロフィールが公開されている間のみ表示され、それ以外の場合は省略されます。comments[].author.app object
comments[].author.app.id string
comments[].author.app.displayName string
comments[].author.serviceAccount object
comments[].author.serviceAccount.id string
comments[].createdAt string
comments[].updatedAt string
pullRequest オブジェクト
pullRequest.id string
pullRequest.number string
pullRequest.repository オブジェクト
pullRequest.repository.id 文字列
pullRequest.repository.name string
pullRequest.repository.owner オブジェクト
pullRequest.repository.owner.slug string
pullRequest.repository.owner.id string
pullRequest.repository.owner.type string
team、user。不明な場合は省略されます。nextPageToken string
curl --request GET \ --url 'https://api.cursor.com/v1/origin/repos/OWNER_SLUG/REPO_NAME/pulls/PULL_NUMBER/comments' \ --header 'Authorization: Bearer YOUR_ORIGIN_TOKEN'レスポンスの構造:
{ "comments": [ { "id": "cmt_01k2ja2000e0080000000000e5", "thread": { "id": "cth_01k2ja2000e0080000000000s6", "version": { "number": "3", "headSha": "9a41f0c3d2b8e7f6a5c4d3e2f1b0a9c8d7e6f5a4", "baseSha": "3b1f9c2d8a7e6f5049c8b7a6d5e4f3a2b1c0d9e8", "createdAt": "2026-08-01T09:30:00Z" }, "path": "src/telemetry/retry.ts", "side": "right", "startLine": 42, "endLine": 45, "createdAt": "2026-08-01T09:30:00Z", "updatedAt": "2026-08-02T14:45:00Z" }, "body": "Should the retry budget be configurable?", "author": { "user": { "id": "user_01k2ja2000e0080000000000c3", "email": "jane@acme.dev" } }, "createdAt": "2026-08-01T09:30:00Z", "updatedAt": "2026-08-02T14:45:00Z" } ], "pullRequest": { "id": "pr_01k2ja2000e0080000000000d4", "number": "17", "repository": { "id": "repo_01k2ja2000e0080000000000q4", "name": "rocket", "owner": { "slug": "acme", "id": "ns_01k2ja2000e0080000000000p3", "type": "team" } } }}プルリクエストコメントを取得
/v1/origin/repos/{ownerSlug}/{repoName}/pulls/comments/{commentId}安定した Origin ID によって指定されたプルリクエストコメントを1件返します。認可されたリポジトリの外にあるコメント、または呼び出し元に表示されない保留中のレビューコメントの場合は、404 を返します。
パスパラメータ
ownerSlug string 必須
repoName string 必須
commentId string 必須
レスポンスフィールド
id string
thread object
thread.id string
thread.version object
thread.version.number string
thread.version.headSha string
thread.version.baseSha string
thread.version.createdAt string
thread.path string
thread.side string
left、right。一般ディスカッションのスレッドでは未設定にします。thread.startLine integer
side バージョンにおけるアンカー範囲の開始行。ファイル単位のスレッドおよび一般ディスカッションのスレッドでは 0 です。thread.endLine integer
0。thread.resolvedAt string
thread.createdAt string
thread.updatedAt string
body string
author object
author.user object
author.user.id string
author.user.email string
author.user.displayName string
author.user.handle string
@プレフィックスは含みません。プロフィールが公開されている場合にのみ表示され、それ以外の場合は省略されます。author.app object
author.app.id string
author.app.displayName string
author.serviceAccount object
author.serviceAccount.id string
createdAt string
updatedAt string
curl --request GET \ --url 'https://api.cursor.com/v1/origin/repos/OWNER_SLUG/REPO_NAME/pulls/comments/COMMENT_ID' \ --header 'Authorization: Bearer YOUR_ORIGIN_TOKEN'レスポンスの構造:
{ "id": "cmt_01k2ja2000e0080000000000e5", "thread": { "id": "cth_01k2ja2000e0080000000000s6", "version": { "number": "3", "headSha": "9a41f0c3d2b8e7f6a5c4d3e2f1b0a9c8d7e6f5a4", "baseSha": "3b1f9c2d8a7e6f5049c8b7a6d5e4f3a2b1c0d9e8", "createdAt": "2026-08-01T09:30:00Z" }, "path": "src/telemetry/retry.ts", "side": "right", "startLine": 42, "endLine": 45, "createdAt": "2026-08-01T09:30:00Z", "updatedAt": "2026-08-02T14:45:00Z" }, "body": "Should the retry budget be configurable?", "author": { "user": { "id": "user_01k2ja2000e0080000000000c3", "email": "jane@acme.dev" } }, "createdAt": "2026-08-01T09:30:00Z", "updatedAt": "2026-08-02T14:45:00Z"}プルリクエストコメントを作成
/v1/origin/repos/{ownerSlug}/{repoName}/pulls/{pullNumber}/commentsOriginプルリクエストにコメントを作成します。コメントの対象は次の4つのうちのいずれか1つです: threadId は既存のスレッドに返信します (一般ディスカッション・インラインのいずれでも可) 。inline はプルリクエストのバージョンの差分内の行範囲に紐づく新しいスレッドを開きます。file はその差分内のファイル全体に対する新しいスレッドを開きます。いずれも指定しない場合は新しい一般ディスカッションスレッドが作成されます。本文が65,536文字を超えると InvalidArgument (HTTP 400) として拒否されます。
inlineアンカーはそのバージョンの差分を参照する必要があります。pathはその差分の一部でなければならず、sideには当該箇所に内容が存在している必要があります。そのため、追加されたファイルに対してleftを指定したり、削除されたファイルに対してrightを指定したりすることはInvalidArgument (HTTP 400) として拒否されます。変更されたファイルの任意の行をアンカーにでき、範囲は差分のハンクに限定されません。範囲はアンカーした側のファイルに収まっている必要があります。leftはベースコミット時点、rightはヘッド時点のファイルとして読み取られ、最終行を超える範囲はInvalidArgument (HTTP 400) として拒否されます。アンカーが無効な場合、Originは一般的なディスカッションのコメントにフォールバックしません。
fileアンカーはパスのみを保持します。Originはファイルの変更種別からサイドを導出し、削除されたファイルの場合はベース版を、そうでない場合はヘッド版をthread.sideに設定します。削除の場合は削除されたパスを送信し、それ以外の変更の場合はヘッドのパスを送信してください。差分の外にあるパスや、名前変更されたファイルの名前変更前のソースパスはInvalidArgument (HTTP 400) として拒否されます。
パスパラメータ
ownerSlug 文字列 必須
repoName 文字列 必須
pullNumber 文字列 必須
リクエスト本文
body 文字列 必須
threadId 文字列
versionNumberと併用できません。inline オブジェクト
threadId と併用できません。inline.path 文字列 必須
inline.side 文字列 必須
left、ヘッド版はrightです。inline.startLine 整数 必須
side バージョンでアンカーされた範囲の1始まりの最初の行。範囲はそのファイルの末尾を超えてはいけません。inline.endLine 整数
startLine 以上である必要があります。1 行のみのアンカーの場合は省略してください。file オブジェクト
threadIdまたはinlineと併用できません。file.path 文字列 必須
versionNumber 文字列
0または未設定の場合は呼び出し時点の最新バージョンを意味します。新しいスレッドに対してのみ有効です。レスポンスフィールド
id 文字列
thread オブジェクト
thread.id 文字列
thread.version オブジェクト
thread.version.number 文字列
thread.version.headSha 文字列
thread.version.baseSha 文字列
thread.version.createdAt 文字列
thread.path 文字列
thread.side 文字列
left、right。一般ディスカッションスレッドでは未設定です。thread.startLine 整数
sideバージョンでアンカーされた範囲の先頭行。ファイルレベルおよび一般ディスカッションのスレッドでは0。thread.endLine 整数
0。thread.resolvedAt 文字列
thread.createdAt 文字列
thread.updatedAt 文字列
body 文字列
author オブジェクト
author.user オブジェクト
author.user.id 文字列
author.user.email 文字列
author.user.displayName 文字列
author.user.handle 文字列
@ プレフィックス無し) 。そのプロフィールが公開されている間のみ表示され、それ以外は省略されます。author.app オブジェクト
author.app.id 文字列
author.app.displayName 文字列
author.serviceAccount オブジェクト
author.serviceAccount.id 文字列
createdAt 文字列
updatedAt 文字列
curl --request POST \ --url 'https://api.cursor.com/v1/origin/repos/OWNER_SLUG/REPO_NAME/pulls/PULL_NUMBER/comments' \ --header 'Authorization: Bearer YOUR_ORIGIN_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "body": "Should the retry budget be configurable?"}'レスポンスの構造:
{ "id": "cmt_01k2ja2000e0080000000000e5", "thread": { "id": "cth_01k2ja2000e0080000000000s6", "version": { "number": "3", "headSha": "9a41f0c3d2b8e7f6a5c4d3e2f1b0a9c8d7e6f5a4", "baseSha": "3b1f9c2d8a7e6f5049c8b7a6d5e4f3a2b1c0d9e8", "createdAt": "2026-08-01T09:30:00Z" }, "path": "src/telemetry/retry.ts", "side": "right", "startLine": 42, "endLine": 45, "createdAt": "2026-08-01T09:30:00Z", "updatedAt": "2026-08-02T14:45:00Z" }, "body": "Should the retry budget be configurable?", "author": { "user": { "id": "user_01k2ja2000e0080000000000c3", "email": "jane@acme.dev" } }, "createdAt": "2026-08-01T09:30:00Z", "updatedAt": "2026-08-02T14:45:00Z"}プルリクエストコメントを更新
/v1/origin/repos/{ownerSlug}/{repoName}/pulls/comments/{commentId}永続的なOrigin IDを指定して、プルリクエストコメントを更新します。
コメント本文を置き換えます。対象のコメントは、パスで指定したリポジトリに属し、呼び出し元から参照可能で、かつその呼び出し元が作成したものである必要があります。リポジトリをまたぐコメントや非表示のレビュー保留中コメントは404を返します。参照可能だが別のアクターが所有するコメントは403を返します。本文が65,536文字を超える場合はInvalidArgument (HTTP 400) で拒否されます。
パスパラメータ
ownerSlug 文字列 必須
repoName 文字列 必須
commentId 文字列 必須
リクエスト本文
body 文字列 必須
レスポンスフィールド
id 文字列
thread オブジェクト
thread.id 文字列
thread.version オブジェクト
thread.version.number 文字列
thread.version.headSha 文字列
thread.version.baseSha 文字列
thread.version.createdAt 文字列
thread.path 文字列
thread.side 文字列
left, right。general-discussion のスレッドでは未設定になります。thread.startLine 整数
sideバージョンでアンカーされた範囲の先頭行。ファイルレベルおよび一般ディスカッションのスレッドでは0。thread.endLine 整数
0。thread.resolvedAt 文字列
thread.createdAt 文字列
thread.updatedAt 文字列
body 文字列
author オブジェクト
author.user オブジェクト
author.user.id 文字列
author.user.email 文字列
author.user.displayName 文字列
author.user.handle 文字列
@プレフィックスなし) 。そのプロフィールが公開されている間のみ表示され、それ以外の場合は省略されます。author.app オブジェクト
author.app.id 文字列
author.app.displayName 文字列
author.serviceAccount オブジェクト
author.serviceAccount.id 文字列
createdAt 文字列
updatedAt 文字列
curl --request PATCH \ --url 'https://api.cursor.com/v1/origin/repos/OWNER_SLUG/REPO_NAME/pulls/comments/COMMENT_ID' \ --header 'Authorization: Bearer YOUR_ORIGIN_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "body": "Should the retry budget be configurable?"}'レスポンスの構造:
{ "id": "cmt_01k2ja2000e0080000000000e5", "thread": { "id": "cth_01k2ja2000e0080000000000s6", "version": { "number": "3", "headSha": "9a41f0c3d2b8e7f6a5c4d3e2f1b0a9c8d7e6f5a4", "baseSha": "3b1f9c2d8a7e6f5049c8b7a6d5e4f3a2b1c0d9e8", "createdAt": "2026-08-01T09:30:00Z" }, "path": "src/telemetry/retry.ts", "side": "right", "startLine": 42, "endLine": 45, "createdAt": "2026-08-01T09:30:00Z", "updatedAt": "2026-08-02T14:45:00Z" }, "body": "Should the retry budget be configurable?", "author": { "user": { "id": "user_01k2ja2000e0080000000000c3", "email": "jane@acme.dev" } }, "createdAt": "2026-08-01T09:30:00Z", "updatedAt": "2026-08-02T14:45:00Z"}プルリクエストのスレッドを更新
/v1/origin/repos/{ownerSlug}/{repoName}/pulls/threads/{threadId}プルリクエストコメントのスレッドを解決または再オープンし、そのスレッドの更新後の状態を返します。すでに解決済みのスレッドを解決した場合や、すでにオープンなスレッドを再オープンした場合は、何も行われません。
スレッドはパスで指定したリポジトリに属している必要があります。別のリポジトリに保存されているスレッドの場合は 404 が返されます。解決済みのスレッドへ プルリクエストコメントの作成 で返信することは可能で、返信してもスレッドが再オープンされることはありません。
パスパラメータ
ownerSlug string 必須
repoName string 必須
threadId string 必須
リクエストボディ
resolved boolean 必須
true でスレッドを解決済みにし、false で再オープンします。レスポンスフィールド
id string
version object
version.number string
version.headSha string
version.baseSha string
version.createdAt string
path string
side string
left、right。一般的な議論のスレッドでは未設定です。startLine 整数
side バージョンのファイルにおけるアンカー範囲の先頭行。ファイルレベルおよび一般的なディスカッションのスレッドでは 0 です。endLine integer
0。resolvedAt string
createdAt string
updatedAt string
curl --request PATCH \ --url 'https://api.cursor.com/v1/origin/repos/OWNER_SLUG/REPO_NAME/pulls/threads/THREAD_ID' \ --header 'Authorization: Bearer YOUR_ORIGIN_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "resolved": true}'レスポンスの構造:
{ "id": "cth_01k2ja2000e0080000000000s6", "version": { "number": "3", "headSha": "9a41f0c3d2b8e7f6a5c4d3e2f1b0a9c8d7e6f5a4", "baseSha": "3b1f9c2d8a7e6f5049c8b7a6d5e4f3a2b1c0d9e8", "createdAt": "2026-08-01T09:30:00Z" }, "path": "src/telemetry/retry.ts", "side": "right", "startLine": 42, "endLine": 45, "resolvedAt": "2026-08-03T10:00:00Z", "createdAt": "2026-08-01T09:30:00Z", "updatedAt": "2026-08-03T10:00:00Z"}プルリクエストのコミット一覧
/v1/origin/repos/{ownerSlug}/{repoName}/pulls/{pullNumber}/commitsプルリクエスト内のコミットを一覧表示します。
プルリクエストのコミットをスパースな Commit オブジェクト (stats は含まれません) として返します。結果のデフォルトは 30 件で上限は 100 件、全体で表示されるコミットは最大 250 件です。ページトークンはプルリクエストのバージョン、ページサイズ、コミットカーソルを固定します。後続のリクエストでは pageSize がトークンと一致している必要があり、現在の head または base と一致しなくなったトークンは 400 を返します。
パスパラメータ
ownerSlug string 必須
repoName string 必須
pullNumber string 必須
クエリパラメータ
pageSize integer
pageToken string
next_page_tokenに対応する不透明なカーソル。最初のページでは空です。トークンはリポジトリ、プルリクエストのバージョン、ページサイズ、およびコミットオフセットに紐づいています。レスポンスフィールド
commits 配列
commits[].sha string
commits[].commit オブジェクト
commits[].commit.author object
commits[].commit.author.name string
commits[].commit.author.email string
commits[].commit.author.date string
commits[].commit.committer オブジェクト
commits[].commit.committer.name string
commits[].commit.committer.email string
commits[].commit.committer.date string
commits[].commit.message string
commits[].commit.tree オブジェクト
commits[].commit.tree.sha string
commits[].parents array
commits[].parents[].sha string
nextPageToken string
curl --request GET \ --url 'https://api.cursor.com/v1/origin/repos/OWNER_SLUG/REPO_NAME/pulls/PULL_NUMBER/commits' \ --header 'Authorization: Bearer YOUR_ORIGIN_TOKEN'レスポンスの構造:
{ "commits": [ { "sha": "9a41f0c3d2b8e7f6a5c4d3e2f1b0a9c8d7e6f5a4", "commit": { "author": { "name": "Jane Doe", "email": "jane@acme.dev", "date": "2026-08-01T09:30:00Z" }, "committer": { "name": "Jane Doe", "email": "jane@acme.dev", "date": "2026-08-01T09:30:00Z" }, "message": "Add launch telemetry", "tree": { "sha": "a7b6c5d4e3f2a1b0c9d8e7f6a5b4c3d2e1f0a9b8" } }, "parents": [ { "sha": "3b1f9c2d8a7e6f5049c8b7a6d5e4f3a2b1c0d9e8" } ], "stats": { "additions": 128, "deletions": 46, "total": 174 } } ]}プルリクエストの変更ファイル一覧
/v1/origin/repos/{ownerSlug}/{repoName}/pulls/{pullNumber}/filesプルリクエストで変更されたファイルを一覧で取得します。
ファイル名、ステータス、行数、パッチ、および (必要に応じて) 以前のファイル名を返します。結果はデフォルトで30ファイルで、最大100ファイルに制限されます。ページトークンはプルリクエストのバージョン、ページサイズ、ファイルカーソルを固定します。後続のリクエストでは pageSize がトークンと一致する必要があり、現在の head または base と一致しないトークンは 400 を返します。
パスパラメータ
ownerSlug string 必須
repoName string 必須
pullNumber string 必須
クエリパラメータ
pageSize integer
pageToken string
next_page_tokenに由来する不透明なカーソル。最初のページでは空です。このトークンはリポジトリ、プルリクエストのバージョン、ページサイズ、および変更ファイルカーソルに紐づきます。レスポンスフィールド
files 配列
files[].filename string
files[].status string
files[].additions integer
files[].deletions integer
files[].changes integer
files[].patch string
files[].previousFilename string
nextPageToken string
curl --request GET \ --url 'https://api.cursor.com/v1/origin/repos/OWNER_SLUG/REPO_NAME/pulls/PULL_NUMBER/files' \ --header 'Authorization: Bearer YOUR_ORIGIN_TOKEN'レスポンスの構造:
{ "files": [ { "filename": "src/telemetry.ts", "status": "modified", "additions": 6, "deletions": 3, "changes": 9, "patch": "@@ -12,6 +12,9 @@\n import { ignite } from \"./ignition\";\n+import { emitLaunchTelemetry } from \"./telemetry\";\n" } ]}プルリクエストのラベル一覧
/v1/origin/repos/{ownerSlug}/{repoName}/pulls/{pullNumber}/labelsプルリクエストに付与されたすべてのラベルを名前順に一覧表示します。
レスポンスにはページ単位ではなく、付与されたラベルの完全な一覧が含まれるため、このエンドポイントにページネーションパラメータはありません。プルリクエストに付与できるラベルは最大100件です。存在しないプルリクエストの場合は 404 が返されます。
パスパラメータ
ownerSlug string 必須
repoName string 必須
pullNumber string 必須
レスポンスフィールド
labels array
labels[].id string
labels[].name string
labels[].color string
# を含まない6文字の16進カラーコード。labels[].description string
curl --request GET \ --url 'https://api.cursor.com/v1/origin/repos/OWNER_SLUG/REPO_NAME/pulls/PULL_NUMBER/labels' \ --header 'Authorization: Bearer YOUR_ORIGIN_TOKEN'レスポンスの構造:
{ "labels": [ { "id": "lbl_01k2ja2000e0080000000000m1", "name": "bug", "color": "d73a4a", "description": "Something isn't working" } ]}プルリクエストのラベルを設定
/v1/origin/repos/{ownerSlug}/{repoName}/pulls/{pullNumber}/labelsプルリクエストに割り当てられているすべてのラベルを、指定したラベルに置き換えます。
空のリストを指定すると、割り当てられているすべてのラベルが削除されます。ラベルはあらかじめリポジトリ内に存在している必要があります。不明なラベル名またはプルリクエストを指定した場合は 404 が返されます。プルリクエストに付与できるラベルは最大100件であるため、100件を超えて指定した場合は FailedPrecondition (HTTP 400) が返されます。レスポンスには、置き換え後に割り当てられたラベルが名前順で返されます。
パスパラメータ
ownerSlug string 必須
repoName string 必須
pullNumber string 必須
リクエスト本文
labels array
レスポンスフィールド
labels array
id、name、color、description が含まれます。curl --request PUT \ --url 'https://api.cursor.com/v1/origin/repos/OWNER_SLUG/REPO_NAME/pulls/PULL_NUMBER/labels' \ --header 'Authorization: Bearer YOUR_ORIGIN_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "labels": [ "bug" ]}'レスポンスの構造:
{ "labels": [ { "id": "lbl_01k2ja2000e0080000000000m1", "name": "bug", "color": "d73a4a", "description": "Something isn't working" } ]}プルリクエストにラベルを追加
/v1/origin/repos/{ownerSlug}/{repoName}/pulls/{pullNumber}/labels既存のリポジトリラベルをプルリクエストに追加します。
すでにプルリクエストに付与されているラベルはそのまま維持されます。ラベルはあらかじめリポジトリに存在している必要があります。存在しないラベル名またはプルリクエストを指定すると、404 が返されます。リクエストには1~100個のラベルを指定する必要があり、プルリクエストに付与できるラベルの合計数は最大100個です。その上限を超えるリクエストでは、FailedPrecondition (HTTP 400) が返されます。レスポンスにはプルリクエストのすべてのラベルではなく、指定したラベルのみが含まれます。すべてのラベルを取得するには、プルリクエストのラベル一覧を参照してください。
パスパラメータ
ownerSlug string 必須
repoName string 必須
pullNumber string 必須
リクエスト本文
labels array 必須
レスポンスフィールド
labels array
id、name、color、description が含まれます。curl --request POST \ --url 'https://api.cursor.com/v1/origin/repos/OWNER_SLUG/REPO_NAME/pulls/PULL_NUMBER/labels' \ --header 'Authorization: Bearer YOUR_ORIGIN_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "labels": [ "bug" ]}'レスポンスの構造:
{ "labels": [ { "id": "lbl_01k2ja2000e0080000000000m1", "name": "bug", "color": "d73a4a", "description": "Something isn't working" } ]}プルリクエストのすべてのラベルを削除
/v1/origin/repos/{ownerSlug}/{repoName}/pulls/{pullNumber}/labelsプルリクエストからすべてのラベルを削除します。
プルリクエストにラベルがない場合も、リクエストは成功します。存在しないプルリクエストの場合は 404 が返されます。レスポンス本文は空です。
パスパラメータ
ownerSlug string 必須
repoName string 必須
pullNumber string 必須
レスポンスフィールド
成功時、レスポンス本文は返されません。
curl --request DELETE \ --url 'https://api.cursor.com/v1/origin/repos/OWNER_SLUG/REPO_NAME/pulls/PULL_NUMBER/labels' \ --header 'Authorization: Bearer YOUR_ORIGIN_TOKEN'レスポンス:
204 No Contentプルリクエストのラベルを削除
/v1/origin/repos/{ownerSlug}/{repoName}/pulls/{pullNumber}/labels/{labelName}プルリクエストからラベルを1つ削除します。
プルリクエストに割り当てられていないラベルや存在しないプルリクエストの場合は、404 が返されます。レスポンスには、プルリクエストに残っているラベルが名前順で含まれます。
パスパラメータ
ownerSlug string 必須
repoName string 必須
pullNumber string 必須
labelName string 必須
レスポンスフィールド
labels array
id、name、color、description が含まれます。curl --request DELETE \ --url 'https://api.cursor.com/v1/origin/repos/OWNER_SLUG/REPO_NAME/pulls/PULL_NUMBER/labels/LABEL_NAME' \ --header 'Authorization: Bearer YOUR_ORIGIN_TOKEN'レスポンスの構造:
{ "labels": [ { "id": "lbl_01k2ja2000e0080000000000m1", "name": "bug", "color": "d73a4a", "description": "Something isn't working" } ]}プルリクエストのマージ
/v1/origin/repos/{ownerSlug}/{repoName}/pulls/{pullNumber}/mergeプルリクエストをベースブランチにマージします。
スタックされたプルリクエストの場合、このプル番号で終わるルートからターゲットへのプレフィックス全体をマージします。つまり、このプルリクエストだけをマージするわけではありません。ネイティブの Origin リポジトリでのみサポートされ、ミラーされたリポジトリは拒否されます。
パスパラメータ
ownerSlug string 必須
repoName string 必須
pullNumber string 必須
リクエスト本文
expectedHeadSha string
ABORTED (HTTP 409 Conflict) で拒否され、何もマージされません。完全なコミット SHA でない値は InvalidArgument (HTTP 400) で拒否されます。現在の head をそのままマージする場合は指定を省略してください。プルリクエストがすでにマージされている場合は評価されず、冪等な成功が返されます。mergeMethod string
merge と、単一のスカッシュコミットを書き込む squash。リポジトリで許可されていないメソッドは FailedPrecondition (HTTP 400)、それ以外の値は InvalidArgument (HTTP 400) で拒否されます。省略した場合はリポジトリの既定値が使用されます: リポジトリがマージコミットを許可している場合はマージコミット、許可していない場合はスカッシュ、ベースブランチが線形の履歴を要求する場合はスカッシュとなります。レスポンスフィールド
mergeCommitSha string
mergedPullNumbers 配列
pullRequest オブジェクト
pullRequest.id string
pullRequest.number 文字列
pullRequest.state string
pullRequest.draft boolean
pullRequest.merged boolean
pullRequest.title 文字列
pullRequest.body 文字列
pullRequest.head object
pullRequest.head.ref string
pullRequest.head.sha string
pullRequest.base オブジェクト
pullRequest.base.ref string
pullRequest.base.sha string
pullRequest.author オブジェクト
pullRequest.author.user オブジェクト
pullRequest.author.user.id 文字列
pullRequest.author.user.email string
pullRequest.author.user.displayName string
pullRequest.author.user.handle string
@ プレフィックスは含みません。そのプロフィールが公開されている間のみ存在し、それ以外の場合は省略されます。pullRequest.author.app オブジェクト
pullRequest.author.app.id string
pullRequest.author.app.displayName string
pullRequest.author.serviceAccount オブジェクト
pullRequest.author.serviceAccount.id string
pullRequest.createdAt string
pullRequest.updatedAt string
pullRequest.closedAt string
pullRequest.mergedAt 文字列
pullRequest.mergeCommitSha string
pullRequest.additions 整数
pullRequest.deletions 整数
pullRequest.changedFiles 整数
pullRequest.labels 配列
pullRequest.labels[].id string
pullRequest.labels[].name string
pullRequest.labels[].color 文字列
# を付けない6桁の16進数カラーコード。pullRequest.labels[].description 文字列
pullRequest.version オブジェクト
pullRequest.version.number 文字列
pullRequest.version.headSha string
pullRequest.version.baseSha string
pullRequest.version.createdAt 文字列
curl --request POST \ --url 'https://api.cursor.com/v1/origin/repos/OWNER_SLUG/REPO_NAME/pulls/PULL_NUMBER/merge' \ --header 'Authorization: Bearer YOUR_ORIGIN_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "expectedHeadSha": "9a41f0c3d2b8e7f6a5c4d3e2f1b0a9c8d7e6f5a4", "mergeMethod": "squash"}'レスポンスの構造:
{ "mergeCommitSha": "5c4d3e2f1a0b9c8d7e6f5a4b3c2d1e0f9a8b7c6d", "mergedPullNumbers": [ "17" ], "pullRequest": { "id": "pr_01k2ja2000e0080000000000d4", "number": "17", "state": "closed", "draft": false, "merged": true, "title": "Add launch telemetry", "body": "Adds structured launch telemetry to the ignition path.", "head": { "ref": "add-telemetry", "sha": "9a41f0c3d2b8e7f6a5c4d3e2f1b0a9c8d7e6f5a4" }, "base": { "ref": "main", "sha": "3b1f9c2d8a7e6f5049c8b7a6d5e4f3a2b1c0d9e8" }, "author": { "user": { "id": "user_01k2ja2000e0080000000000c3", "email": "jane@acme.dev" } }, "createdAt": "2026-08-01T09:30:00Z", "updatedAt": "2026-08-02T14:45:00Z", "closedAt": "2026-08-03T10:15:00Z", "mergedAt": "2026-08-03T10:15:00Z", "mergeCommitSha": "5c4d3e2f1a0b9c8d7e6f5a4b3c2d1e0f9a8b7c6d", "additions": 128, "deletions": 46, "changedFiles": 5, "labels": [ { "id": "lbl_01k2ja2000e0080000000000m1", "name": "bug", "color": "d73a4a", "description": "Something isn't working" } ], "version": { "number": "3", "headSha": "9a41f0c3d2b8e7f6a5c4d3e2f1b0a9c8d7e6f5a4", "baseSha": "3b1f9c2d8a7e6f5049c8b7a6d5e4f3a2b1c0d9e8", "createdAt": "2026-08-01T09:30:00Z" } }}プルリクエストのマージ可否を取得
/v1/origin/repos/{ownerSlug}/{repoName}/pulls/{pullNumber}/mergeabilityそのプルリクエストをマージできるかどうかを返し、できない場合はマージを妨げている条件を返します。判定は Merge Pull Request が適用する条件と同じ条件で評価されるため、mergeable という判定は、同じ head のマージが成功すると見込まれることを意味します。スタックされたプルリクエストの場合、判定はスタックのルートからこのプルリクエストまでのすべてのプルリクエストを対象とし、各ブロッカーにはそれが属するプルリクエストが示されます。
マージ済みの祖先を含めて合計200件を超えるプルリクエストからなるスタックの場合は FailedPrecondition (HTTP 400) が返されます。
この操作はプレビュー段階であり、コントラクトが確定するまでは構造が変わる可能性があります。レスポンスのデコードでは未知のフィールドや未知の enum 値を許容し、認識できない verdict は blocked として扱い、blockers[].kind を認識できない場合は blockers[].message を表示してください。
パスパラメータ
ownerSlug 文字列 必須
repoName 文字列 必須
pullNumber 文字列 必須
クエリパラメータ
expectedHeadSha 文字列
Aborted (HTTP 409 Conflict) を返します。完全な commit SHA でない値を指定した場合は InvalidArgument (HTTP 400) を返します。レスポンスフィールド
pullRequest オブジェクト
pullRequest.id 文字列
pullRequest.number 文字列
pullRequest.repository オブジェクト
pullRequest.repository.id 文字列
pullRequest.repository.name 文字列
pullRequest.repository.owner オブジェクト
pullRequest.repository.owner.slug 文字列
pullRequest.repository.owner.id 文字列
pullRequest.repository.owner.type 文字列
team、user。不明な場合は省略されます。verdict 文字列
evaluatedPullRequests 内のすべてのプルリクエストに対する総合的な結果です。指定可能な値は mergeable (pullRequest をマージすれば、そのすべてが取り込まれることを意味します) と blocked です。認識できない値は blocked として扱ってください。blockers 配列
verdict が mergeable の場合は空です。ブロッカーはプルリクエストごと・種類ごとに最大1件です。ただし required_checks は state ごとに1件、rule_failure と ruleset_error は異なる message ごとに1件になります。blockers[].pullRequest オブジェクト
evaluatedPullRequests 内のプルリクエスト。pullRequest と同じフィールドを持ちます。blockers[].kind 文字列
draft、closed、merged、merge_conflict、required_checks、required_approvals、codeowner_approval、behind_base、needs_restack、restack_pending、conflict_check_pending、invalid_stack、ruleset_error、rule_failure。種類は今後も追加されます。お使いのクライアントより後に追加された種類のブロッカーは、kind が未設定の状態でデコードされますが、引き続きブロック中として扱われます。blockers[].message 文字列
kind が認識されない場合に表示する内容として使用します。blockers[].requiredChecks オブジェクト
required_checks ブロッカーに設定されます。blockers[].requiredChecks.state 文字列
missing、pending、failing、action_required。blockers[].requiredChecks.checks 配列
blockers[].requiredChecks.checks[].name 文字列
blockers[].requiredChecks.checks[].owner オブジェクト
actor と同じ actor バリアントを持ちます。blockers[].requiredChecks.checks[].checkRun オブジェクト
headSha 上のチェック実行への参照。報告がない場合は省略され、その状態は missing です。含まれるのは id、name、checkSuite.id のみです。これは、この操作が repository:pull_requests:read のみで読み取れるのに対し、実行のステータス、結論、出力、詳細 URL には repository:checks:read が必要なためです。これらは Get Check Run で取得してください。blockers[].requiredApprovals オブジェクト
required_approvals ブロッカーに設定されます。blockers[].requiredApprovals.requiredCount integer
blockers[].requiredApprovals.approvedCount 整数
blockers[].codeownerApproval オブジェクト
codeowner_approval ブロッカーに設定されます。blockers[].codeownerApproval.requirements 配列
blockers[].codeownerApproval.requirements[].owners 配列
blockers[].codeownerApproval.requirements[].paths 配列
blockers[].mergeConflict オブジェクト
merge_conflict ブロッカーに設定されます。blockers[].mergeConflict.conflictedPaths 配列
blockers[].mergeConflict.truncated boolean
blockers[].mergeConflict.inheritedFromDownstack boolean
blockers[].stackShape オブジェクト
invalid_stack ブロッカーで設定されます。blockers[].stackShape.reason 文字列
partially_merged、cycle、missing_parent、cross_repository_parent、base_branch_missing。blockers[].stackShape.relatedPullRequests 配列
pullRequest と同じフィールドを持ちます。evaluatedPullRequests 配列
pullRequest のマージによって land するプルリクエストの一覧です。stack の root から順に並び、最後が pullRequest になります。すでにマージ済みの祖先は history 扱いとなり、一覧には含まれません。stack されていないプルリクエストの場合、要素はちょうど 1 つです。各要素は pullRequest と同じフィールドを持ちます。headSha 文字列
pullRequest の head commit。baseRef 文字列
baseSha 文字列
evaluatedAt 時点における baseRef の tip commit です。その後 baseRef に push があると verdict が変わることがあります。無効な stack の場合など、base branch を特定できなかった場合は空になります。evaluatedAt 文字列
curl --request GET \ --url 'https://api.cursor.com/v1/origin/repos/OWNER_SLUG/REPO_NAME/pulls/PULL_NUMBER/mergeability' \ --header 'Authorization: Bearer YOUR_ORIGIN_TOKEN'{ "pullRequest": { "id": "pr_01k2ja2000e0080000000000d4", "number": "17", "repository": { "id": "repo_01k2ja2000e0080000000000a1", "name": "launch-control", "owner": { "slug": "acme", "id": "ns_01k2ja2000e0080000000000b2" } } }, "verdict": "blocked", "blockers": [ { "pullRequest": { "id": "pr_01k2ja2000e0080000000000d4", "number": "17", "repository": { "id": "repo_01k2ja2000e0080000000000a1", "name": "launch-control", "owner": { "slug": "acme", "id": "ns_01k2ja2000e0080000000000b2" } } }, "kind": "required_approvals", "message": "Approving review count is 0; 1 required. Request reviews and wait for the required approvals.", "requiredApprovals": { "requiredCount": 1, "approvedCount": 0 } }, { "pullRequest": { "id": "pr_01k2ja2000e0080000000000d4", "number": "17", "repository": { "id": "repo_01k2ja2000e0080000000000a1", "name": "launch-control", "owner": { "slug": "acme", "id": "ns_01k2ja2000e0080000000000b2" } } }, "kind": "required_checks", "message": "Required status checks are pending. Wait for checks to finish or fix the failing checks.", "requiredChecks": { "state": "pending", "checks": [ { "name": "ci / build", "owner": { "app": { "id": "app_01k2ja2000e0080000000000e5", "displayName": "Launch CI" } }, "checkRun": { "id": "cr_01k2ja2000e0080000000000f6", "name": "ci / build", "checkSuite": { "id": "crg_01k2ja2000e0080000000000f7" } } } ] } } ], "evaluatedPullRequests": [ { "id": "pr_01k2ja2000e0080000000000d4", "number": "17", "repository": { "id": "repo_01k2ja2000e0080000000000a1", "name": "launch-control", "owner": { "slug": "acme", "id": "ns_01k2ja2000e0080000000000b2" } } } ], "headSha": "9a41f0c3d2b8e7f6a5c4d3e2f1b0a9c8d7e6f5a4", "baseRef": "main", "baseSha": "3b1f9c2d8a7e6f5049c8b7a6d5e4f3a2b1c0d9e8", "evaluatedAt": "2026-08-02T14:45:00Z"}プルリクエストの確認依頼先の一覧取得
/v1/origin/repos/{ownerSlug}/{repoName}/pulls/{pullNumber}/requested_reviewersプルリクエストで現在確認が依頼されているユーザーとグループを一覧表示します。
個別の依頼は該当ユーザーが確認を送信すると解除され、グループへの依頼はグループの現在のメンバーのいずれかが送信すると解除されます。未送信の下書き確認では依頼は保留のままとなり、送信後に再度確認を依頼すると、そのレビュアーがこの一覧に戻ります。読み取り可能な公開識別子を持たないグループは除外されます。
パスパラメータ
ownerSlug string 必須
repoName string 必須
pullNumber string 必須
レスポンスフィールド
users array
users[].id string
user_…)。organization API が使用する形式と同じです。users[].email string
users[].displayName string
users[].handle string
@ プレフィックスなし)。そのプロフィールが公開されている場合にのみ含まれ、それ以外は省略されます。groups array
groups[].id string
grp_…)。curl --request GET \ --url 'https://api.cursor.com/v1/origin/repos/OWNER_SLUG/REPO_NAME/pulls/PULL_NUMBER/requested_reviewers' \ --header 'Authorization: Bearer YOUR_ORIGIN_TOKEN'レスポンスの構造:
{ "users": [ { "id": "user_01k2ja2000e0080000000000c3", "email": "jane@acme.dev" } ], "groups": [ { "id": "grp_01k2ja2000e0080000000000n2" } ]}Request Pull Request Reviewers
/v1/origin/repos/{ownerSlug}/{repoName}/pulls/{pullNumber}/requested_reviewers指定したユーザーとグループにプルリクエストのレビューを依頼し、この呼び出しで依頼したレビュー担当者を返します。
識別子はリポジトリのレビュアー候補と、public id、ユーザーのメールアドレス、またはグループのスラグで照合されます。表示名では解決されません。不明または曖昧な識別子の場合は、その識別子を示す InvalidArgument (HTTP 400) が返されます。また、users と groups の合計で少なくとも1つの空でないエントリが必要です。
すでに依頼済みのレビュー担当者を再度依頼すると依頼のタイムスタンプが更新されるため、レビューを提出済みの担当者が再び保留中として表示されます。リポジトリの候補でないレビュー担当者を指定した場合は PermissionDenied (HTTP 403) が返されます。
パスパラメータ
ownerSlug string 必須
repoName string 必須
pullNumber string 必須
リクエストボディ
users array
user_… ID またはメールアドレスによってリポジトリ内のユーザー候補と一意に一致する必要があります。groups array
grp_… ID、修飾済みグループスラッグ、またはグループスラッグによって、リポジトリ内のグループ候補と一意に一致している必要があります。レスポンスフィールド
users array
users[].id string
user_…) 。Organization API で使用されるものと同じ形式です。users[].email string
users[].displayName string
users[].handle string
@ プレフィックスは含みません。そのプロフィールが公開されている場合にのみ存在し、それ以外の場合は省略されます。groups array
groups[].id string
grp_…) 。curl --request POST \ --url 'https://api.cursor.com/v1/origin/repos/OWNER_SLUG/REPO_NAME/pulls/PULL_NUMBER/requested_reviewers' \ --header 'Authorization: Bearer YOUR_ORIGIN_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "users": [ "user_01k2ja2000e0080000000000c3" ], "groups": [ "grp_01k2ja2000e0080000000000n2" ]}'レスポンスの構造:
{ "users": [ { "id": "user_01k2ja2000e0080000000000c3", "email": "jane@acme.dev" } ], "groups": [ { "id": "grp_01k2ja2000e0080000000000n2" } ]}プルリクエストの確認依頼先の削除
/v1/origin/repos/{ownerSlug}/{repoName}/pulls/{pullNumber}/requested_reviewersプルリクエストに対する、指定したユーザーおよびグループへの確認依頼を削除します。レスポンス本文は空です。
識別子は、公開ID、ユーザーのメールアドレス、またはグループのslugによって、リポジトリの確認担当候補と照合されます。表示名では解決されません。不明または曖昧な識別子の場合は、その識別子を示す InvalidArgument (HTTP 400) が返されます。また、users と groups を合わせて少なくとも1つは空でないエントリが必要です。
現在確認依頼されていないユーザーやグループを削除しても、何も起こりません。すでに確認担当候補ではない識別子でも、安定した公開ID (user_… または grp_…) であれば受け付けられるため、リポジトリを離れた確認担当者も解除できます。
パスパラメータ
ownerSlug string 必須
repoName string 必須
pullNumber string 必須
リクエスト本文
users array
user_… ID またはメールアドレスによって、リポジトリのユーザー候補と一意に一致する必要があります。groups array
grp_… ID、修飾されたグループslug、またはグループslugによって、リポジトリのグループ候補と一意に一致する必要があります。レスポンスフィールド
リクエストが成功した場合、レスポンス本文は返されません。
curl --request DELETE \ --url 'https://api.cursor.com/v1/origin/repos/OWNER_SLUG/REPO_NAME/pulls/PULL_NUMBER/requested_reviewers' \ --header 'Authorization: Bearer YOUR_ORIGIN_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "users": [ "user_01k2ja2000e0080000000000c3" ], "groups": [ "grp_01k2ja2000e0080000000000n2" ]}'レスポンス:
204 No Contentプルリクエストレビューを一覧表示
/v1/origin/repos/{ownerSlug}/{repoName}/pulls/{pullNumber}/reviewsプルリクエストの送信済みレビューをsubmitted_atの昇順で一覧表示します。保留中のレビューは除外されます。
パスパラメータ
ownerSlug string 必須
repoName string 必須
pullNumber string 必須
クエリパラメータ
pageSize 整数
pageToken string
nextPageTokenからの不透明なカーソル。最初のページでは省略してください。レスポンスフィールド
reviews 配列
reviews[].id string
reviews[].author オブジェクト
reviews[].author.user オブジェクト
reviews[].author.user.id string
reviews[].author.user.email string
reviews[].author.user.displayName string
reviews[].author.user.handle string
@プレフィックスなし) 。そのプロフィールが公開されている間のみ表示され、公開されていない場合は省略されます。reviews[].author.app オブジェクト
reviews[].author.app.id string
reviews[].author.app.displayName string
reviews[].author.serviceAccount オブジェクト
reviews[].author.serviceAccount.id string
reviews[].verdict string
reviews[].body string
reviews[].submittedAt string
reviews[].pullRequestVersion オブジェクト
reviews[].pullRequestVersion.number string
reviews[].pullRequestVersion.headSha string
reviews[].pullRequestVersion.baseSha string
reviews[].pullRequestVersion.createdAt 文字列
reviews[].dismissal オブジェクト
reviews[].dismissal.dismissedBy object
reviews[].dismissal.dismissedBy.user object
reviews[].dismissal.dismissedBy.user.id string
reviews[].dismissal.dismissedBy.user.email string
reviews[].dismissal.dismissedBy.user.displayName string
reviews[].dismissal.dismissedBy.user.handle string
@ プレフィックスなし) 。そのプロフィールが公開されている間のみ表示され、公開されていない場合は省略されます。reviews[].dismissal.dismissedBy.app object
reviews[].dismissal.dismissedBy.app.id string
reviews[].dismissal.dismissedBy.app.displayName string
reviews[].dismissal.dismissedBy.serviceAccount オブジェクト
reviews[].dismissal.dismissedBy.serviceAccount.id string
reviews[].dismissal.dismissedAt 文字列
reviews[].dismissal.message string
pullRequest オブジェクト
pullRequest.id string
pullRequest.number 文字列
pullRequest.repository object
pullRequest.repository.id 文字列
pullRequest.repository.name string
pullRequest.repository.owner オブジェクト
pullRequest.repository.owner.slug 文字列
pullRequest.repository.owner.id string
pullRequest.repository.owner.type string
team, user。不明な場合は省略されます。nextPageToken 文字列
curl --request GET \ --url 'https://api.cursor.com/v1/origin/repos/OWNER_SLUG/REPO_NAME/pulls/PULL_NUMBER/reviews' \ --header 'Authorization: Bearer YOUR_ORIGIN_TOKEN'レスポンスの構造:
{ "reviews": [ { "id": "rev_01k2ja2000e0080000000000f6", "author": { "user": { "id": "user_01k2ja2000e0080000000000c3", "email": "jane@acme.dev" } }, "verdict": "approve", "body": "Approving. The telemetry schema matches the spec.", "submittedAt": "2026-08-02T15:00:00Z", "pullRequestVersion": { "number": "3", "headSha": "9a41f0c3d2b8e7f6a5c4d3e2f1b0a9c8d7e6f5a4", "baseSha": "3b1f9c2d8a7e6f5049c8b7a6d5e4f3a2b1c0d9e8", "createdAt": "2026-08-01T09:30:00Z" } } ], "pullRequest": { "id": "pr_01k2ja2000e0080000000000d4", "number": "17", "repository": { "id": "repo_01k2ja2000e0080000000000q4", "name": "rocket", "owner": { "slug": "acme", "id": "ns_01k2ja2000e0080000000000p3", "type": "team" } } }}プルリクエストレビューを作成
/v1/origin/repos/{ownerSlug}/{repoName}/pulls/{pullNumber}/reviewsプルリクエストのレビューを作成して送信します。コメントを含めて単一のアトミックなリクエストとしてまとめて送信することもできます。各コメントが指定するターゲットはプルリクエストコメントを作成と同じで、行範囲にはcomments[].inline、ファイル全体にはcomments[].file、返信にはcomments[].threadId、一般的なディスカッションにはいずれも指定しません。
レビューは直ちに送信されます。新しい approve または request_changes のレビューは同じプルリクエストに対する呼び出し元の以前のライブな決定レビューを上書きし、そのレビューは取り消されます。プルリクエストの作成者は自分のプルリクエストを approve できません。呼び出し元がプルリクエストに未送信の下書きレビューを持っている間は FAILED_PRECONDITION で失敗します。
comments が設定されている場合、書き込まれる前に Create Pull Request Comment と同じ diff 内チェックを使って、すべてのアンカーがレビュー対象バージョンの diff に対して検証されます。1 件のコメントでも失敗すると、リクエスト全体が InvalidArgument (HTTP 400) で失敗し、何も公開されません。コメントはレビューとともに原子的に表示されます。レビューが送信されるまではコメントやイベントは観測されず、送信されると各コメントがレビューのイベントと並んでそれぞれ pull_request.comment.created webhook を発行します。
この操作には冪等性キーが含まれていないため、原因が不明な通信障害後に再試行すると2件目のレビューが作成される可能性があります。再試行する前に、プルリクエストのレビューを一覧表示 を呼び出してください。
パスパラメータ
ownerSlug string 必須
repoName string 必須
pullNumber string 必須
リクエスト本文
verdict string 必須
PULL_REQUEST_REVIEW_VERDICT_UNSPECIFIED、approve、request_changes、comment。body string
versionNumber 文字列
PullRequestVersion.number を参照) 。省略すると呼び出し時点の最新版をレビューします。コメントは同じバージョンに紐付けられます。comments 配列
comments[].body string 必須
comments[].inline オブジェクト
inline と同じです。comments[].threadId と併用することはできません。comments[].inline.path string 必須
comments[].inline.side string 必須
left、ヘッド版は right。comments[].inline.startLine 整数 必須
side バージョンにおけるアンカー範囲の1始まりの最初の行。範囲はそのファイルの末尾を超えてはいけません。comments[].inline.endLine 整数
startLine 以上である必要があります。単一行のアンカーの場合は省略してください。comments[].threadId string
comments[].inline、comments[].file、およびこのフィールドを省略すると、新しい一般ディスカッションスレッドが開始されます。comments[].file オブジェクト
file と同じです。comments[].inline や comments[].threadId と併用できません。comments[].file.path string 必須
レスポンスフィールド
id string
author オブジェクト
author.user オブジェクト
author.user.id string
author.user.email string
author.user.displayName string
author.user.handle string
@ プレフィックスは含みません。プロフィールが公開されている場合にのみ存在し、それ以外では省略されます。author.app オブジェクト
author.app.id 文字列
author.app.displayName 文字列
author.serviceAccount オブジェクト
author.serviceAccount.id string
verdict string
body string
submittedAt 文字列
pullRequestVersion オブジェクト
pullRequestVersion.number string
pullRequestVersion.headSha string
pullRequestVersion.baseSha string
pullRequestVersion.createdAt 文字列
dismissal オブジェクト
dismissal.dismissedBy オブジェクト
dismissal.dismissedBy.user オブジェクト
dismissal.dismissedBy.user.id string
dismissal.dismissedBy.user.email string
dismissal.dismissedBy.user.displayName string
dismissal.dismissedBy.user.handle string
@ プレフィックスは含みません。プロフィールが公開されている場合にのみ存在し、それ以外では省略されます。dismissal.dismissedBy.app オブジェクト
dismissal.dismissedBy.app.id 文字列
dismissal.dismissedBy.app.displayName string
dismissal.dismissedBy.serviceAccount オブジェクト
dismissal.dismissedBy.serviceAccount.id string
dismissal.dismissedAt string
dismissal.message 文字列
curl --request POST \ --url 'https://api.cursor.com/v1/origin/repos/OWNER_SLUG/REPO_NAME/pulls/PULL_NUMBER/reviews' \ --header 'Authorization: Bearer YOUR_ORIGIN_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "verdict": "approve", "body": "Approving. The telemetry schema matches the spec.", "versionNumber": "3"}'レスポンスの構造:
{ "id": "rev_01k2ja2000e0080000000000f6", "author": { "user": { "id": "user_01k2ja2000e0080000000000c3", "email": "jane@acme.dev" } }, "verdict": "approve", "body": "Approving. The telemetry schema matches the spec.", "submittedAt": "2026-08-02T15:00:00Z", "pullRequestVersion": { "number": "3", "headSha": "9a41f0c3d2b8e7f6a5c4d3e2f1b0a9c8d7e6f5a4", "baseSha": "3b1f9c2d8a7e6f5049c8b7a6d5e4f3a2b1c0d9e8", "createdAt": "2026-08-01T09:30:00Z" }}プルリクエストレビューを更新
/v1/origin/repos/{ownerSlug}/{repoName}/pulls/{pullNumber}/reviews/{reviewId}レビューの本文を更新します。更新できるのはレビューの作成者のみで、その他の呼び出し元には PERMISSION_DENIED が返されます。指定されたプルリクエストに属さないレビューの場合は NOT_FOUND が返されます。
未送信の下書きレビューも更新できます。下書きのレスポンスには submitted_at がありません。
パスパラメータ
ownerSlug string 必須
repoName string 必須
pullNumber string 必須
reviewId string 必須
リクエスト本文
body string 必須
レスポンスフィールド
id string
author オブジェクト
author.user オブジェクト
author.user.id string
author.user.email string
author.user.displayName string
author.user.handle string
@ プレフィックスなし) 。そのプロフィールが公開されている場合にのみ表示され、公開されていない場合は省略されます。author.app オブジェクト
author.app.id string
author.app.displayName string
author.serviceAccount オブジェクト
author.serviceAccount.id string
verdict string
body string
submittedAt string
pullRequestVersion オブジェクト
pullRequestVersion.number string
pullRequestVersion.headSha string
pullRequestVersion.baseSha string
pullRequestVersion.createdAt string
dismissal オブジェクト
dismissal.dismissedBy オブジェクト
dismissal.dismissedBy.user オブジェクト
dismissal.dismissedBy.user.id string
dismissal.dismissedBy.user.email string
dismissal.dismissedBy.user.displayName string
dismissal.dismissedBy.user.handle string
@ プレフィックスなし) 。そのプロフィールが公開されている場合にのみ表示され、公開されていない場合は省略されます。dismissal.dismissedBy.app オブジェクト
dismissal.dismissedBy.app.id string
dismissal.dismissedBy.app.displayName string
dismissal.dismissedBy.serviceAccount オブジェクト
dismissal.dismissedBy.serviceAccount.id string
dismissal.dismissedAt 文字列
dismissal.message string
curl --request PATCH \ --url 'https://api.cursor.com/v1/origin/repos/OWNER_SLUG/REPO_NAME/pulls/PULL_NUMBER/reviews/REVIEW_ID' \ --header 'Authorization: Bearer YOUR_ORIGIN_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "body": "Approving. The telemetry schema matches the spec."}'レスポンスの構造:
{ "id": "rev_01k2ja2000e0080000000000f6", "author": { "user": { "id": "user_01k2ja2000e0080000000000c3", "email": "jane@acme.dev" } }, "verdict": "approve", "body": "Approving. The telemetry schema matches the spec.", "submittedAt": "2026-08-02T15:00:00Z", "pullRequestVersion": { "number": "3", "headSha": "9a41f0c3d2b8e7f6a5c4d3e2f1b0a9c8d7e6f5a4", "baseSha": "3b1f9c2d8a7e6f5049c8b7a6d5e4f3a2b1c0d9e8", "createdAt": "2026-08-01T09:30:00Z" }}プルリクエストのレビューを却下
/v1/origin/repos/{ownerSlug}/{repoName}/pulls/{pullNumber}/reviews/{reviewId}/dismissals送信済みのレビューを却下し、その判定がプルリクエストのレビュー状態に反映されないようにします。レビュー自体は保持され、dismissal が設定された状態で ListPullRequestReviews に引き続き表示されます。
却下するために、プルリクエストレビューの作成者である必要はありません。リポジトリのプルリクエストレビューに対する書き込み権限があれば十分です。
却下できるのは approve と request_changes のレビューのみで、しかも一度だけです。comment レビュー、未送信のドラフトレビュー、または既に却下されたレビューは FAILED_PRECONDITION を返し、呼び出しを繰り返しても最初の却下のままになります。指定されたプルリクエストに属さないレビューは NOT_FOUND を返します。
パスパラメータ
ownerSlug string 必須
repoName string 必須
pullNumber string 必須
reviewId string 必須
リクエスト本文
message string 必須
レスポンスフィールド
id string
author オブジェクト
author.user オブジェクト
author.user.id string
author.user.email string
author.user.displayName string
author.user.handle string
@プレフィックスは含みません。プロフィールが公開されている間のみ表示され、それ以外の場合は省略されます。author.app オブジェクト
author.app.id string
author.app.displayName string
author.serviceAccount オブジェクト
author.serviceAccount.id string
verdict string
body string
submittedAt 文字列
pullRequestVersion オブジェクト
pullRequestVersion.number string
pullRequestVersion.headSha 文字列
pullRequestVersion.baseSha string
pullRequestVersion.createdAt 文字列
dismissal object
dismissal.dismissedBy オブジェクト
dismissal.dismissedBy.user オブジェクト
dismissal.dismissedBy.user.id string
dismissal.dismissedBy.user.email string
dismissal.dismissedBy.user.displayName string
dismissal.dismissedBy.user.handle string
@ プレフィックスは含みません。プロフィールが公開されている間のみ存在し、それ以外の場合は省略されます。dismissal.dismissedBy.app オブジェクト
dismissal.dismissedBy.app.id string
dismissal.dismissedBy.app.displayName string
dismissal.dismissedBy.serviceAccount オブジェクト
dismissal.dismissedBy.serviceAccount.id string
dismissal.dismissedAt 文字列
dismissal.message 文字列
curl --request PUT \ --url 'https://api.cursor.com/v1/origin/repos/OWNER_SLUG/REPO_NAME/pulls/PULL_NUMBER/reviews/REVIEW_ID/dismissals' \ --header 'Authorization: Bearer YOUR_ORIGIN_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "message": "Superseded by a newer review."}'レスポンスの構造:
{ "id": "rev_01k2ja2000e0080000000000f6", "author": { "user": { "id": "user_01k2ja2000e0080000000000c3", "email": "jane@acme.dev" } }, "verdict": "approve", "body": "Approving. The telemetry schema matches the spec.", "submittedAt": "2026-08-02T15:00:00Z", "pullRequestVersion": { "number": "3", "headSha": "9a41f0c3d2b8e7f6a5c4d3e2f1b0a9c8d7e6f5a4", "baseSha": "3b1f9c2d8a7e6f5049c8b7a6d5e4f3a2b1c0d9e8", "createdAt": "2026-08-01T09:30:00Z" }, "dismissal": { "dismissedBy": { "user": { "id": "user_01k2ja2000e0080000000000c3", "email": "jane@acme.dev" } }, "dismissedAt": "2026-08-02T15:00:00Z", "message": "Superseded by a newer review." }}ルールセット
ルールセットの一覧
/v1/origin/repos/{ownerSlug}/{repoName}/rulesetsリポジトリに設定されているすべてのルールセットを一覧表示します。
リポジトリごとのルールセットは設定が制限されているため、完全なセットは1つのレスポンスで返され、このエンドポイントはページネーションを行いません。repository は1回だけ上位に移動され、レスポンス内のすべてのルールセットで共有されるリポジトリを表します。
パスパラメータ
ownerSlug string 必須
repoName string 必須
レスポンスフィールド
rulesets array
rulesets[].id string
rulesets[].name string
rulesets[].description 文字列
rulesets[].enforcement string
active、evaluate、disabled。rulesets[].kind string
merge_branch、push_branch、push_tag、push_repository。rulesets[].includedRefNames 配列
~ALL、~DEFAULT_BRANCH をサポートします。rulesets[].excludedRefNames 配列
rulesets[].includedRefNames と同じパターン言語です。rulesets[].rules 配列
rulesets[].rules[].id string
rulesets[].rules[].ruleType 文字列
pull_request、require_status_checks、require_branch_up_to_date、deletion、non_fast_forward。rulesets[].rules[].parameters オブジェクト
rulesets[].rules[].ruleTypeによって異なります。rulesets[].bypassActors 配列
rulesets[].bypassActors[].id string
rulesets[].bypassActors[].bypassMode string
always、pull_request_only。rulesets[].bypassActors[].user オブジェクト
user、team、app、originRole のうち正確に1つが存在します。rulesets[].bypassActors[].user.id string
rulesets[].bypassActors[].team オブジェクト
rulesets[].bypassActors[].team.organizationPublicId string
rulesets[].bypassActors[].team.groupPublicId string
rulesets[].bypassActors[].app オブジェクト
rulesets[].bypassActors[].app.id string
app_で始まるApp ID。rulesets[].bypassActors[].originRole オブジェクト
rulesets[].bypassActors[].originRole.role string
namespace_admin、repository_admin、repository_write。repository オブジェクト
repository.id string
repository.name string
repository.owner オブジェクト
repository.owner.slug string
repository.owner.id string
repository.owner.type 文字列
team、user。不明な場合は省略されます。curl --request GET \ --url 'https://api.cursor.com/v1/origin/repos/OWNER_SLUG/REPO_NAME/rulesets' \ --header 'Authorization: Bearer YOUR_ORIGIN_TOKEN'レスポンスの構造:
{ "rulesets": [ { "id": "rs_01k2ja2000e0080000000000t7", "name": "require-review", "description": "Require an approving review before merging to main.", "enforcement": "active", "kind": "merge_branch", "includedRefNames": [ "refs/heads/main" ], "rules": [ { "id": "rsr_01k2ja2000e0080000000000v8", "ruleType": "pull_request", "parameters": { "requiredApprovingReviewCount": 1 } } ], "bypassActors": [ { "id": "rsba_01k2ja2000e0080000000000w9", "bypassMode": "always", "user": { "id": "act_01k2ja2000e0080000000000x0" } } ] } ], "repository": { "id": "repo_01k2ja2000e0080000000000q4", "name": "rocket", "owner": { "slug": "acme", "id": "ns_01k2ja2000e0080000000000p3", "type": "team" } }}ルールセットを作成
/v1/origin/repos/{ownerSlug}/{repoName}/rulesetsリポジトリのルールセットを作成します。
レスポンスには、保存されたルールセットと、Origin が各ルールおよびバイパスアクターに割り当てた ID が含まれます。name が空の場合は、InvalidArgument (HTTP 400) で拒否されます。
パスパラメータ
ownerSlug string 必須
repoName string 必須
リクエスト本文
name string 必須
description 文字列
enforcement string 必須
active、evaluate、disabled。kind string 必須
merge_branch、push_branch、push_tag、push_repository。includedRefNames 配列
~ALL および ~DEFAULT_BRANCH をサポートします。64 件を超えるエントリは InvalidArgument (HTTP 400) によって拒否されます。excludedRefNames 配列
includedRefNames と同じです。rules array
ruleType と省略可能な parameters が含まれ、Origin が各ルールの id を割り当てます。エントリ数が20を超える場合は InvalidArgument (HTTP 400) で拒否されます。bypassActors 配列
bypassMode と user、team、app、または originRole のいずれか1つだけが含まれます。Origin は各アクターの id を割り当てます。エントリが15件を超えると InvalidArgument (HTTP 400) で拒否されます。レスポンスフィールド
id string
name string
description 文字列
enforcement 文字列
active、evaluate、disabled。kind string
merge_branch、push_branch、push_tag、push_repository。includedRefNames 配列
~ALL、~DEFAULT_BRANCH トークンをサポートします。excludedRefNames 配列
includedRefNamesと同じパターン言語です。rules 配列
rules[].id string
rules[].ruleType string
pull_request、require_status_checks、require_branch_up_to_date、deletion、non_fast_forward。rules[].parameters オブジェクト
rules[].ruleTypeに依存します。bypassActors 配列
bypassActors[].id string
bypassActors[].bypassMode string
always、pull_request_only。bypassActors[].user オブジェクト
user、team、app、またはoriginRoleのうち正確に1つが存在します。bypassActors[].user.id string
bypassActors[].team オブジェクト
bypassActors[].team.organizationPublicId string
bypassActors[].team.groupPublicId string
bypassActors[].app オブジェクト
bypassActors[].app.id string
app_ のプレフィックスが付きます。bypassActors[].originRole オブジェクト
bypassActors[].originRole.role string
namespace_admin、repository_admin、repository_write。curl --request POST \ --url 'https://api.cursor.com/v1/origin/repos/OWNER_SLUG/REPO_NAME/rulesets' \ --header 'Authorization: Bearer YOUR_ORIGIN_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "name": "require-review", "description": "Require an approving review before merging to main.", "enforcement": "active", "kind": "merge_branch", "includedRefNames": [ "refs/heads/main" ], "rules": [ { "ruleType": "pull_request", "parameters": { "requiredApprovingReviewCount": 1 } } ], "bypassActors": [ { "bypassMode": "always", "user": { "id": "act_01k2ja2000e0080000000000x0" } } ]}'レスポンスの構造:
{ "id": "rs_01k2ja2000e0080000000000t7", "name": "require-review", "description": "Require an approving review before merging to main.", "enforcement": "active", "kind": "merge_branch", "includedRefNames": [ "refs/heads/main" ], "rules": [ { "id": "rsr_01k2ja2000e0080000000000v8", "ruleType": "pull_request", "parameters": { "requiredApprovingReviewCount": 1 } } ], "bypassActors": [ { "id": "rsba_01k2ja2000e0080000000000w9", "bypassMode": "always", "user": { "id": "act_01k2ja2000e0080000000000x0" } } ]}ルールセットを取得
/v1/origin/repos/{ownerSlug}/{repoName}/rulesets/{rulesetId}安定したOrigin IDによって単一のリポジトリルールセットを返します。
不明なリポジトリと不明なルールセットはどちらも 404 を返しますが、メッセージで区別できます。
パスパラメータ
ownerSlug string 必須
repoName string 必須
rulesetId string 必須
レスポンスフィールド
id string
name string
description string
enforcement string
active、evaluate、disabled。kind string
merge_branch、push_branch、push_tag、push_repository。includedRefNames 配列
~ALL、~DEFAULT_BRANCH をサポートします。excludedRefNames 配列
includedRefNames と同じパターン言語です。rules 配列
rules[].id string
rules[].ruleType 文字列
pull_request、require_status_checks、require_branch_up_to_date、deletion、non_fast_forward。rules[].parameters オブジェクト
rules[].ruleTypeによって異なります。bypassActors 配列
bypassActors[].id string
bypassActors[].bypassMode string
always、pull_request_only。bypassActors[].user オブジェクト
user、team、app、または originRole のうち正確に1つが存在します。bypassActors[].user.id 文字列
bypassActors[].team オブジェクト
bypassActors[].team.organizationPublicId 文字列
bypassActors[].team.groupPublicId string
bypassActors[].app オブジェクト
bypassActors[].app.id string
app_ プレフィックス付きの App ID。bypassActors[].originRole オブジェクト
bypassActors[].originRole.role string
namespace_admin、repository_admin、repository_write。curl --request GET \ --url 'https://api.cursor.com/v1/origin/repos/OWNER_SLUG/REPO_NAME/rulesets/RULESET_ID' \ --header 'Authorization: Bearer YOUR_ORIGIN_TOKEN'レスポンスの構造:
{ "id": "rs_01k2ja2000e0080000000000t7", "name": "require-review", "description": "Require an approving review before merging to main.", "enforcement": "active", "kind": "merge_branch", "includedRefNames": [ "refs/heads/main" ], "rules": [ { "id": "rsr_01k2ja2000e0080000000000v8", "ruleType": "pull_request", "parameters": { "requiredApprovingReviewCount": 1 } } ], "bypassActors": [ { "id": "rsba_01k2ja2000e0080000000000w9", "bypassMode": "always", "user": { "id": "act_01k2ja2000e0080000000000x0" } } ]}ルールセットの更新
/v1/origin/repos/{ownerSlug}/{repoName}/rulesets/{rulesetId}既存のリポジトリ ルールセットを更新します。
このリクエストはルールセット設定全体を置き換えます。rules と bypassActors はマージではなく完全に置き換えられ、Origin は保存されたエントリに新しい ID を割り当てます。そのため、保持したいルールとバイパスアクターはすべて送信してください。
パスパラメータ
ownerSlug string 必須
repoName string 必須
rulesetId string 必須
リクエスト本文
name string 必須
description 文字列
enforcement string 必須
active、evaluate、disabled。kind string 必須
merge_branch, push_branch, push_tag, push_repository。includedRefNames 配列
~ALL、~DEFAULT_BRANCH をサポートします。64 件を超えるエントリは InvalidArgument (HTTP 400) で拒否されます。excludedRefNames 配列
includedRefNames と同じパターン言語を使用し、上限は64件です。rules array
ruleType と省略可能な parameters を持ちます。各ルールの id は Origin が割り当てます。エントリが20件を超えると InvalidArgument (HTTP 400) で拒否されます。bypassActors 配列
bypassMode と user、team、app、または originRole のいずれか1つを持ちます。Origin は各アクターの id を割り当てます。エントリが15件を超えると InvalidArgument (HTTP 400) で拒否されます。レスポンスフィールド
id string
name string
description 文字列
enforcement 文字列
active、evaluate、disabled。kind string
merge_branch, push_branch, push_tag, push_repository。includedRefNames 配列
~ALL、~DEFAULT_BRANCH をサポートします。excludedRefNames 配列
includedRefNames と同じパターン言語です。rules array
rules[].id string
rules[].ruleType string
pull_request、require_status_checks、require_branch_up_to_date、deletion、non_fast_forward。rules[].parameters オブジェクト
rules[].ruleType によって異なります。bypassActors 配列
bypassActors[].id string
bypassActors[].bypassMode string
always、pull_request_only。bypassActors[].user オブジェクト
user、team、app、originRole のうち、存在するのは 1 つだけです。bypassActors[].user.id string
bypassActors[].team オブジェクト
bypassActors[].team.organizationPublicId string
bypassActors[].team.groupPublicId string
bypassActors[].app オブジェクト
bypassActors[].app.id string
app_ のプレフィックスが付きます。bypassActors[].originRole オブジェクト
bypassActors[].originRole.role 文字列
namespace_admin、repository_admin、repository_write。curl --request PUT \ --url 'https://api.cursor.com/v1/origin/repos/OWNER_SLUG/REPO_NAME/rulesets/RULESET_ID' \ --header 'Authorization: Bearer YOUR_ORIGIN_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "name": "require-review", "description": "Require an approving review before merging to main.", "enforcement": "active", "kind": "merge_branch", "includedRefNames": [ "refs/heads/main" ], "rules": [ { "ruleType": "pull_request", "parameters": { "requiredApprovingReviewCount": 1 } } ], "bypassActors": [ { "bypassMode": "always", "user": { "id": "act_01k2ja2000e0080000000000x0" } } ]}'レスポンスの構造:
{ "id": "rs_01k2ja2000e0080000000000t7", "name": "require-review", "description": "Require an approving review before merging to main.", "enforcement": "active", "kind": "merge_branch", "includedRefNames": [ "refs/heads/main" ], "rules": [ { "id": "rsr_01k2ja2000e0080000000000v8", "ruleType": "pull_request", "parameters": { "requiredApprovingReviewCount": 1 } } ], "bypassActors": [ { "id": "rsba_01k2ja2000e0080000000000w9", "bypassMode": "always", "user": { "id": "act_01k2ja2000e0080000000000x0" } } ]}ルールセットを削除
/v1/origin/repos/{ownerSlug}/{repoName}/rulesets/{rulesetId}安定した Origin ID を指定してリポジトリ ルールセットを削除します。レスポンス本文は空です。
存在しないリポジトリと存在しないルールセットはいずれも 404 を返しますが、メッセージで区別されます。別のリポジトリに保存されているルールセットは、存在しないルールセットとして扱われます。空の rulesetId を指定すると InvalidArgument (HTTP 400) が返されます。
パスパラメータ
ownerSlug string 必須
repoName string 必須
rulesetId string 必須
レスポンスフィールド
成功したリクエストでは、レスポンス本文は返されません。
curl --request DELETE \ --url 'https://api.cursor.com/v1/origin/repos/OWNER_SLUG/REPO_NAME/rulesets/RULESET_ID' \ --header 'Authorization: Bearer YOUR_ORIGIN_TOKEN'レスポンス:
204 No ContentWebhooks
Origin は、署名付き HTTP POST リクエストを、アプリに登録された HTTPS Webhook URL に content-type: application/json として送信します。
配信は少なくとも 1 回行われます。webhook-id を使用して再試行を重複排除し、リクエストを永続的に受け付け、速やかに 2xx を返し、イベントは非同期で処理してください。
Origin は、トランスポートエラー、429、5xx レスポンスに対して、合計最大 7 回まで再試行します。再試行間隔は 5 秒、30 秒、1 分、2 分、4 分、8 分です。その他の 4xx レスポンスは再試行されません。
実際のイベントが到達する前に受信側が動作することを確認するには、Ping Webhook を呼び出してください。
Origin はミラーリポジトリのイベントを配信し、インストールイベントのペイロードでは、それらのリポジトリが選択されたリポジトリ配列に一覧表示されます。配信によってインストールが呼び出せる範囲が広がることはありません。ミラーリポジトリ を参照してください。
ヘッダー
| ヘッダー | 説明 |
|---|---|
content-type | application/json |
user-agent | Cursor-Origin-Webhook/1.0 |
webhook-id | 配信ごとに一定のIDおよび冪等性キー。 |
webhook-timestamp | 署名に含まれるUnixタイムスタンプ。 |
webhook-signature | v1ed,BASE64_SIGNATURE |
webhook-event-type | ルーティング用のイベントスラッグ。 |
webhook-event-id | 署名付き本文に含まれる元のOriginイベントID。 |
webhook-app-id | ターゲットアプリID。 |
webhook-installation-id | ターゲットインストールID。 |
ルーティングヘッダーは補助的な情報です。署名検証後は、本文を正とします。
署名の検証
解析前の生のリクエスト本文を使用します。次のように構築します。
lowercaseHex(SHA-256("<webhook-id>.<webhook-timestamp>.<raw-request-body>"))その16進数ダイジェストのUTF-8バイトに対するEd25519署名を、有効なOrigin JWKSキーで確認します。現在時刻から5分を超えてずれたタイムスタンプは拒否します。
import { createHash, createPublicKey, verify, type JsonWebKeyInput,} from "node:crypto";export async function verifyOriginWebhook( body: Buffer, headers: Record<string, string | undefined>): Promise<boolean> { const id = headers["webhook-id"]; const timestamp = Number(headers["webhook-timestamp"]); const signature = headers["webhook-signature"] ?.split(/\s+/) .find((value) => value.startsWith("v1ed,")); const now = Math.floor(Date.now() / 1000); if ( !id || !signature || !Number.isInteger(timestamp) || Math.abs(now - timestamp) > 300 ) { return false; } const digest = createHash("sha256") .update(`${id}.${timestamp}.`) .update(body) .digest("hex"); // 本番環境ではこのレスポンスをキャッシュしてください。 const { keys } = await fetch( "https://api.cursor.com/v1/origin/keys" ).then((response) => response.json()) as { keys: JsonWebKeyInput[]; }; return keys.some((jwk) => { try { return verify( null, Buffer.from(digest), createPublicKey({ key: jwk, format: "jwk" }), Buffer.from(signature.slice(5), "base64") ); } catch { return false; } });}配信エンベロープ
各リクエストでは、イベントペイロードが配信、アプリ、インストール ID の情報とともにラップされます。
{ "deliveryId": "whd_01...", "appId": "app_01...", "installationId": "i_01...", "event": { "id": "evt_01...", "type": "pull_request.comment.created", "eventTime": "2026-07-01T10:03:00Z", "payload": {} }}deliveryId は再試行しても変わりません。event.id は基となるドメインイベントを識別します。
復旧
アプリ JWT を使用して GET /app/webhook/deliveries をクエリします。配信ステータス、イベントタイプ、インストール、時間範囲、ページトークンでフィルタリングできます。delivered=false を指定すると、受信者が 2xx で一度も確認応答していないすべての配信を取得できます。配信は 7 日間一覧表示できるため、その期間内に復旧してください。
POST /app/webhook/deliveries:batchRedeliver を使用すると、最大 100 件の配信 ID の再配信をキューに登録できます。この操作では ID の重複を排除し、各配信の結果を返します。
所有者は、アプリの設定からそのアプリの webhook 配信を一時停止できます。また、オリジン側が自動で一時停止することもあります。受信者が 72 時間のウィンドウ内で 20 回以上の配信ラウンドに失敗し、そのウィンドウ内で成功した配信が 1 件もなく、失敗が複数のインストーラー名前空間に及んでいる場合、そのアプリは自動的に無効化されます。いずれの場合も、所有者が再開するまで配信は停止し、再配信リクエストは FailedPrecondition (HTTP 400) を返して何もキューに登録されません。API には一時停止状態を示すフィールドがないため、再配信時の FailedPrecondition をその判断材料として扱ってください。Update App でアプリの webhookUrl をクリアすると、さらに強い影響があります。保留中の配信が完全にキャンセルされ、再度 URL を設定しても元に戻すことはできません。
Webhooks リファレンス
Origin が配信するすべてのイベントと、各イベントのペイロードをフィールドごとに解説します。サブスクリプションの仕組み、ヘッダー、署名の検証、エンベロープ、再試行については、Webhooks を参照してください。
イベント
| イベント | 配信されるタイミング |
|---|---|
repository.created | リポジトリが作成されたとき。 |
repository.deleted | リポジトリが削除されたとき。 |
repository.pushed | プッシュにより1つ以上のリファレンスが変更されたとき。 |
repository.metadata.updated | リポジトリのデフォルトブランチが変更されたとき。 |
pull_request.created | プルリクエストが作成されたとき。 |
pull_request.head_ref.pushed | プルリクエストのヘッドが進んだとき。 |
pull_request.base_ref.updated | ベースリファレンスまたは解決済みのベースコミットが変更されたとき。 |
pull_request.metadata.updated | タイトルまたは説明が変更されたとき。 |
pull_request.closed | プルリクエストがマージされずにクローズされたとき。プッシュによりヘッドとベースに共通の履歴がなくなり、Originがクローズした場合を含みます。 |
pull_request.merged | プルリクエストがマージされたとき。 |
pull_request.reopened | クローズされたプルリクエストが再オープンされたとき。 |
pull_request.published | 下書きのプルリクエストがオープンになったとき。 |
pull_request.comment.created | 表示可能なプルリクエストコメントが作成されたとき。 |
pull_request.review.submitted | 任意の判定で確認が送信されたとき。 |
pull_request.review.dismissed | 送信済み確認が明示的に、または後続のレビューにより無効化されたとき。 |
pull_request.reviewer.added | レビュアーがリクエストされたとき。 |
pull_request.reviewer.removed | レビュアーが削除されたとき。 |
pull_request.reviewer.rerequested | レビュアーが再度リクエストされたとき。 |
repository.check_run.created | チェック実行が作成されたとき。 |
repository.check_run.completed | チェック実行が完了したとき。 |
repository.check_run.rerequested | 完了したチェック実行が再リクエストされたとき。その実行を所有するアプリにのみ配信されます。 |
installation.created | アプリがインストールされたとき。 |
installation.updated | スコープ、リポジトリの選択、またはオーナーのnamespaceスラッグが変更されたとき。 |
installation.suspended | インストールが一時停止されたとき。 |
installation.unsuspended | 一時停止されたインストールが復元されたとき。 |
installation.deleted | アプリがアンインストールされたとき。 |
各イベントのペイロードの構造は、イベントペイロードでフィールドごとに記載されています。
5つのinstallation.*イベントは、リポジトリのサブスクリプションではなく、アプリ自体に送信されます。Originは常にこれらを送信するため、アプリの選択可能なイベントリストには表示されません。この表のその他すべてのイベントは、リポジトリスコープのサブスクリプションです。
OriginはGitHubからミラーリングしているリポジトリに対してrepository.pushedを配信しません。これらのプッシュはGitHubが管理し、GitHub自身がプッシュのWebhookを送信するため、Originからも配信すると重複してしまいます。ネイティブのOriginリポジトリおよびアウトバウンドミラーへのプッシュは通常どおり配信され、ミラーの状態が他のイベントに影響することはありません。repository.deletedはGitHubからミラーリングされたリポジトリに対しても配信されます。同期を停止するとCursor側のリポジトリのみが削除され、GitHubからは何も送信されません。
イベントペイロード
各イベントのエンベロープは、payload にそのイベントのペイロードオブジェクトを格納します。同じ形状を持つイベントは同一のペイロードファミリーに属します。以下の各ファミリーでは、それを配信するイベント、フィールド、および OpenAPI 仕様 から生成したサンプルペイロードを記載しています。
リポジトリ作成完了
repository.createdペイロードのフィールド
repository object
repository.id string
repository.name string 必須
repository.fullName string
repository.owner object
repository.owner.slug string
repository.owner.id string
repository.owner.type string
team または user。出力専用。不明な場合は未設定。team、user のいずれか。repository.defaultBranch string
repository.createdAt string
repository.updatedAt string
repository.pushedAt string
repository.cloneUrl string
repository.mirror object
repository.mirror.source string
github のいずれか。repository.mirror.sourceId string
repository.mirror.status string
inbound、outbound のいずれか。repository.visibility string
internal または private。internal、private のいずれか。repository.allowMergeCommit boolean
repository.allowSquashMerge boolean
repository.deleteBranchOnMerge boolean
event.payload の例:
{ "repository": { "id": "repo_01k2ja2000e0080000000000q4", "name": "rocket", "fullName": "acme/rocket", "owner": { "slug": "acme", "id": "ns_01k2ja2000e0080000000000p3", "type": "team" }, "defaultBranch": "main", "createdAt": "2026-08-01T09:30:00Z", "updatedAt": "2026-08-01T09:30:00Z", "cloneUrl": "https://origin.cursor.com/git/acme/rocket.git" }}リポジトリ削除
repository.deletedペイロードのフィールド
repository object
repository.id string
repository.name string
repository.owner object
repository.owner.slug string
repository.owner.id string
repository.owner.type string
team または user。output-only で、不明な場合は未設定です。team、user のいずれか。deletedAt string
event.payload のサンプル:
{ "repository": { "id": "repo_01k2ja2000e0080000000000q4", "name": "rocket", "owner": { "slug": "acme", "id": "ns_01k2ja2000e0080000000000p3", "type": "team" } }, "deletedAt": "2026-08-03T08:15:00Z"}リポジトリへのプッシュ
repository.pushed1 回のアトミックなプッシュで、複数のリファレンスが更新される場合があります。commits 配列はありません。各リファレンスの更新には、ベストエフォートの tip メタデータのみが含まれます。
ペイロードのフィールド
repository object
repository.id string
repository.name string
repository.owner object
repository.owner.slug string
repository.owner.id string
repository.owner.type string
team または user。出力専用。不明な場合は未設定。team、user のいずれか。refUpdates 配列
refUpdates[].ref string
refs/heads/main、refs/tags/v3.14.1。refUpdates[].before string
ref 上の最新コミットの SHA。ref が作成された直後の場合はすべてゼロ (0000000000000000000000000000000000000000) になります。refUpdates[].after string
ref における最新コミットの SHA。ref が削除された場合はすべてゼロ (0000000000000000000000000000000000000000) になります。refUpdates[].created boolean
refUpdates[].deleted boolean
refUpdates[].forced boolean
refUpdates[].headCommit object
refUpdates[].headCommit.sha string
refUpdates[].headCommit.author オブジェクト
refUpdates[].headCommit.author.name string
refUpdates[].headCommit.author.email string
refUpdates[].headCommit.author.date string
refUpdates[].headCommit.committer object
refUpdates[].headCommit.committer.name string
refUpdates[].headCommit.committer.email string
refUpdates[].headCommit.committer.date string
refUpdates[].headCommit.message string
pushedAt string
pusher オブジェクト
pusher.user オブジェクト
pusher.user.id string
pusher.user.email string 必須
pusher.user.displayName string
pusher.user.handle string
pusher.app オブジェクト
pusher.app.id string
pusher.app.displayName string
pusher.serviceAccount オブジェクト
pusher.serviceAccount.id string
refUpdatesCount integer
event.payload の例:
{ "repository": { "id": "repo_01k2ja2000e0080000000000q4", "name": "rocket", "owner": { "slug": "acme", "id": "ns_01k2ja2000e0080000000000p3", "type": "team" } }, "refUpdates": [ { "ref": "refs/heads/add-telemetry", "before": "5c8d7e6f5a4b3c2d1e0f9a8b7c6d5e4f3a2b1c0d", "after": "9a41f0c3d2b8e7f6a5c4d3e2f1b0a9c8d7e6f5a4", "created": false, "deleted": false, "forced": false, "headCommit": { "sha": "9a41f0c3d2b8e7f6a5c4d3e2f1b0a9c8d7e6f5a4", "author": { "name": "Jane Doe", "email": "jane@acme.dev", "date": "2026-08-01T09:30:00Z" }, "committer": { "name": "Jane Doe", "email": "jane@acme.dev", "date": "2026-08-01T09:30:00Z" }, "message": "Add launch telemetry" } } ], "pushedAt": "2026-08-02T14:45:00Z", "pusher": { "user": { "id": "user_01k2ja2000e0080000000000c3", "email": "jane@acme.dev" } }, "refUpdatesCount": 1}リポジトリのメタデータが更新されました
repository.metadata.updatedリポジトリの完全なスナップショットを含みますが、デルタと更新を行ったアクターは含まれません。変更内容を確認するには、連続するスナップショットを比較するか、リポジトリを再取得してください。
ペイロードのフィールド
repository object
repository.id string
repository.name string 必須
repository.fullName string
repository.owner object
repository.owner.slug string
repository.owner.id string
repository.owner.type string
team または user。出力専用。不明な場合は未設定。team、user のいずれか。repository.defaultBranch string
repository.createdAt string
repository.updatedAt string
repository.pushedAt string
repository.cloneUrl string
repository.mirror object
repository.mirror.source string
github のいずれか。repository.mirror.sourceId string
repository.mirror.status string
inbound、outbound のいずれか。repository.visibility string
internal または private。internal、private のいずれか。repository.allowMergeCommit boolean
repository.allowSquashMerge boolean
repository.deleteBranchOnMerge boolean
event.payload のサンプル:
{ "repository": { "id": "repo_01k2ja2000e0080000000000q4", "name": "rocket", "fullName": "acme/rocket", "owner": { "slug": "acme", "id": "ns_01k2ja2000e0080000000000p3", "type": "team" }, "defaultBranch": "release", "createdAt": "2026-08-01T09:30:00Z", "updatedAt": "2026-08-03T08:15:00Z", "cloneUrl": "https://origin.cursor.com/git/acme/rocket.git", "pushedAt": "2026-08-02T14:45:00Z" }}プルリクエストイベント
pull_request.createdpull_request.publishedpull_request.reopenedpull_request.closedpull_request.mergedpull_request.metadata.updatedpull_request.head_ref.pushedpull_request.base_ref.updatedプルリクエストのライフサイクルの変更です。ライフサイクルのアクションはエンベロープの event.type で表され、独立した action フィールドはありません。
ペイロードのフィールド
pullRequest オブジェクト
GetPullRequest で取得してください。pullRequest.id string
pullRequest.number string
pullRequest.state string
pullRequest.draft boolean
pullRequest.merged boolean
pullRequest.title string
pullRequest.body string
pullRequest.head object
pullRequest.head.ref string
pullRequest.head.sha string
pullRequest.base object
pullRequest.base.ref string
pullRequest.base.sha string
pullRequest.author object
pullRequest.author.user オブジェクト
pullRequest.author.user.id string
pullRequest.author.user.email string 必須
pullRequest.author.user.displayName string
pullRequest.author.user.handle string
pullRequest.author.app オブジェクト
pullRequest.author.app.id string
pullRequest.author.app.displayName string
pullRequest.author.serviceAccount object
pullRequest.author.serviceAccount.id string
pullRequest.createdAt string
pullRequest.updatedAt string
pullRequest.closedAt string
pullRequest.mergedAt string
pullRequest.mergeCommitSha string
pullRequest.additions integer
pullRequest.deletions integer
pullRequest.changedFiles integer
pullRequest.version object
pullRequest.version.number string
pullRequest.version.headSha string
pullRequest.version.baseSha string
pullRequest.version.createdAt string
repository object
repository.id string
repository.name string
repository.owner object
repository.owner.slug string
repository.owner.id string
repository.owner.type string
team または user。出力専用。不明な場合は未設定。team、user のいずれか。event.payload のサンプル:
{ "pullRequest": { "id": "pr_01k2ja2000e0080000000000d4", "number": "17", "state": "open", "draft": false, "merged": false, "title": "Add launch telemetry", "body": "Adds structured launch telemetry to the ignition path.", "head": { "ref": "add-telemetry", "sha": "9a41f0c3d2b8e7f6a5c4d3e2f1b0a9c8d7e6f5a4" }, "base": { "ref": "main", "sha": "3b1f9c2d8a7e6f5049c8b7a6d5e4f3a2b1c0d9e8" }, "author": { "user": { "id": "user_01k2ja2000e0080000000000c3", "email": "jane@acme.dev" } }, "createdAt": "2026-08-01T09:30:00Z", "updatedAt": "2026-08-02T14:45:00Z", "additions": 128, "deletions": 46, "changedFiles": 5, "version": { "number": "3", "headSha": "9a41f0c3d2b8e7f6a5c4d3e2f1b0a9c8d7e6f5a4", "baseSha": "3b1f9c2d8a7e6f5049c8b7a6d5e4f3a2b1c0d9e8", "createdAt": "2026-08-01T09:30:00Z" } }, "repository": { "id": "repo_01k2ja2000e0080000000000q4", "name": "rocket", "owner": { "slug": "acme", "id": "ns_01k2ja2000e0080000000000p3", "type": "team" } }}プルリクエストコメント
pull_request.comment.createdプルリクエストに作成されたコメント。レビューと一緒に登録されたコメントは、そのレビューが送信された時点で、コメント1件ごとに1イベントとして配信されます。
ペイロードのフィールド
pullRequest オブジェクト
pullRequest.id string
pullRequest.number string
pullRequest.repository object
pullRequest.repository.id string
pullRequest.repository.name string
pullRequest.repository.owner object
pullRequest.repository.owner.slug string
pullRequest.repository.owner.id string
pullRequest.repository.owner.type string
team または user。出力専用。不明な場合は未設定。team、user のいずれか。comment object
comment.thread.id のみが含まれます。スレッドの解決状態はこのイベントに含まれないため、GetPullRequestComment で取得してください。comment.id string
comment.thread オブジェクト
comment.thread.id string
comment.thread.version object
PullRequestReview.pull_request_version を参照してください) 。comment.thread.version.number string
comment.thread.version.headSha string
comment.thread.version.baseSha string
comment.thread.version.createdAt string
comment.thread.path string
comment.thread.side string
left、right のいずれか。comment.thread.startLine integer
side バージョンにおけるアンカー範囲の開始行。ファイル単位のスレッドおよび一般的なディスカッションのスレッドでは 0 になります。comment.thread.endLine integer (整数)
comment.thread.resolvedAt string
comment.thread.createdAt string
comment.thread.updatedAt string
comment.body string
comment.author object
comment.author.user object
comment.author.user.id string
comment.author.user.email string 必須
comment.author.user.displayName string
comment.author.user.handle string
comment.author.app オブジェクト
comment.author.app.id string
comment.author.app.displayName string
comment.author.serviceAccount オブジェクト
comment.author.serviceAccount.id string
comment.createdAt string
comment.updatedAt string
event.payload の例:
{ "pullRequest": { "id": "pr_01k2ja2000e0080000000000d4", "number": "17", "repository": { "id": "repo_01k2ja2000e0080000000000q4", "name": "rocket", "owner": { "slug": "acme", "id": "ns_01k2ja2000e0080000000000p3", "type": "team" } } }, "comment": { "id": "cmt_01k2ja2000e0080000000000e5", "thread": { "id": "cth_01k2ja2000e0080000000000s6", "version": { "number": "3", "headSha": "9a41f0c3d2b8e7f6a5c4d3e2f1b0a9c8d7e6f5a4", "baseSha": "3b1f9c2d8a7e6f5049c8b7a6d5e4f3a2b1c0d9e8", "createdAt": "2026-08-01T09:30:00Z" }, "path": "src/telemetry/retry.ts", "side": "right", "startLine": 42, "endLine": 45, "createdAt": "2026-08-01T09:30:00Z", "updatedAt": "2026-08-02T14:45:00Z" }, "body": "Should the retry budget be configurable?", "author": { "user": { "id": "user_01k2ja2000e0080000000000c3", "email": "jane@acme.dev" } }, "createdAt": "2026-08-01T09:30:00Z", "updatedAt": "2026-08-02T14:45:00Z" }}プルリクエストレビューイベント
pull_request.review.submittedpull_request.review.dismissedペイロードのフィールド
pullRequest オブジェクト
pullRequest.id string
pullRequest.number string
pullRequest.repository object
pullRequest.repository.id string
pullRequest.repository.name string
pullRequest.repository.owner object
pullRequest.repository.owner.slug string
pullRequest.repository.owner.id string
pullRequest.repository.owner.type string
team または user。出力専用。不明な場合は未設定。team、user のいずれか。review オブジェクト
review.dismissal が設定されます。review.id string
review.author object
review.author.user object
review.author.user.id string
review.author.user.email string 必須
review.author.user.displayName string
review.author.user.handle string
review.author.app object
review.author.app.id string
review.author.app.displayName string
review.author.serviceAccount object
review.author.serviceAccount.id string
review.verdict string
approve、request_changes、comment のいずれか。review.body string
review.submittedAt string
review.pullRequestVersion オブジェクト
review.pullRequestVersion.number string
review.pullRequestVersion.headSha string
review.pullRequestVersion.baseSha string
review.pullRequestVersion.createdAt string
review.dismissal オブジェクト
review.dismissal.dismissedBy object
review.dismissal.dismissedBy.user object
review.dismissal.dismissedBy.user.id string
review.dismissal.dismissedBy.user.email string 必須
review.dismissal.dismissedBy.user.displayName string
review.dismissal.dismissedBy.user.handle string
review.dismissal.dismissedBy.app object
review.dismissal.dismissedBy.app.id string
review.dismissal.dismissedBy.app.displayName string
review.dismissal.dismissedBy.serviceAccount object
review.dismissal.dismissedBy.serviceAccount.id string
review.dismissal.dismissedAt string
review.dismissal.message string
event.payload の例:
{ "pullRequest": { "id": "pr_01k2ja2000e0080000000000d4", "number": "17", "repository": { "id": "repo_01k2ja2000e0080000000000q4", "name": "rocket", "owner": { "slug": "acme", "id": "ns_01k2ja2000e0080000000000p3", "type": "team" } } }, "review": { "id": "rev_01k2ja2000e0080000000000f6", "author": { "user": { "id": "user_01k2ja2000e0080000000000c3", "email": "jane@acme.dev" } }, "verdict": "approve", "body": "Approving. The telemetry schema matches the spec.", "submittedAt": "2026-08-02T15:00:00Z", "pullRequestVersion": { "number": "3", "headSha": "9a41f0c3d2b8e7f6a5c4d3e2f1b0a9c8d7e6f5a4", "baseSha": "3b1f9c2d8a7e6f5049c8b7a6d5e4f3a2b1c0d9e8", "createdAt": "2026-08-01T09:30:00Z" } }}プルリクエストレビュアーのイベント
pull_request.reviewer.addedpull_request.reviewer.removedpull_request.reviewer.rerequestedプルリクエストのレビュー依頼先の変更。現在保留中の一覧は ListPullRequestRequestedReviewers で取得できます。
ペイロードのフィールド
pullRequest オブジェクト
pullRequest.id string
pullRequest.number string
pullRequest.repository object
pullRequest.repository.id string
pullRequest.repository.name string
pullRequest.repository.owner object
pullRequest.repository.owner.slug string
pullRequest.repository.owner.id string
pullRequest.repository.owner.type string
team または user。出力専用。不明な場合は未設定。team、user のいずれか。reviewer object
reviewer.user object
reviewer.user.id string
reviewer.user.email string 必須
reviewer.user.displayName string
reviewer.user.handle string
reviewer.group object
grp_…) 。現在は id のみ。reviewer.group.id string
createdVia string
manual、codeowners のいずれか。createdBy オブジェクト
createdBy.user オブジェクト
createdBy.user.id string
createdBy.user.email string 必須
createdBy.user.displayName string
createdBy.user.handle string
createdBy.app オブジェクト
createdBy.app.id string
createdBy.app.displayName string
createdBy.serviceAccount オブジェクト
createdBy.serviceAccount.id string
createdAt string
event.payload のサンプル:
{ "pullRequest": { "id": "pr_01k2ja2000e0080000000000d4", "number": "17", "repository": { "id": "repo_01k2ja2000e0080000000000q4", "name": "rocket", "owner": { "slug": "acme", "id": "ns_01k2ja2000e0080000000000p3", "type": "team" } } }, "reviewer": { "user": { "id": "user_01k2ja2000e0080000000000c3", "email": "jane@acme.dev" } }, "createdVia": "codeowners", "createdAt": "2026-08-02T14:45:00Z"}チェック実行イベント
repository.check_run.createdrepository.check_run.completedOrigin の check-run ライフサイクルイベントのコミット済みスナップショット。
ペイロードのフィールド
repository object
repository.id string
repository.name string
repository.owner object
repository.owner.slug string
repository.owner.id string
repository.owner.type string
team または user。出力専用。不明な場合は未設定。team または user のいずれか。checkSuite オブジェクト
checkSuite.id string
checkSuite.repository object
checkSuite.repository.id string
checkSuite.repository.name string
checkSuite.repository.owner object
checkSuite.repository.owner.slug string
checkSuite.repository.owner.id string
checkSuite.repository.owner.type string
team または user。出力専用。不明な場合は未設定。team、user のいずれか。checkSuite.sha string
checkSuite.key string
checkSuite.name string
checkSuite.detailsUrl string
checkSuite.createdAt string
checkSuite.updatedAt string
checkSuite.externalId string
checkSuite.actor オブジェクト
checkSuite.actor.user オブジェクト
checkSuite.actor.user.id string
checkSuite.actor.user.email string 必須
checkSuite.actor.user.displayName string
checkSuite.actor.user.handle string
checkSuite.actor.app オブジェクト
checkSuite.actor.app.id string
checkSuite.actor.app.displayName string
checkSuite.actor.serviceAccount オブジェクト
checkSuite.actor.serviceAccount.id string
checkRun object
checkRun.id string
checkRun.repository object
checkRun.repository.id string
checkRun.repository.name string
checkRun.repository.owner オブジェクト
checkRun.repository.owner.slug string
checkRun.repository.owner.id string
checkRun.repository.owner.type string
team または user。出力専用。unknown の場合は未設定。team、user のいずれか。checkRun.checkSuite オブジェクト
checkRun.checkSuite.id string
checkRun.sha string
checkRun.key string
checkRun.name string
checkRun.status string
rerequested は再実行がリクエストされた完了済みの実行で、所有アプリがまだ応答していないものです:読み取り者向けには保留中 (queued と同様にレンダリング) で、conclusion と時刻は引き続き置き換えられた試行を示します。再リクエスト時 (RerequestCheckRun) に Origin のみが設定します。アプリは投稿できません。queued、in_progress、completed、rerequested のいずれか。checkRun.conclusion string
status が completed または rerequested の場合にのみ存在します。rerequested の実行では、置き換えられた試行の判定です。実行は保留中として扱い、status == completed のときにのみ conclusion を読み取ってください。success、failure、neutral、cancelled、skipped、timed_out、action_required、stale のいずれかです。checkRun.detailsUrl string
checkRun.externalUpdatedAt string
checkRun.startedAt string
checkRun.completedAt string
checkRun.createdAt string
checkRun.updatedAt string
checkRun.externalId string
CheckRunInput.external_id を参照。実行ごとに1つとすることが推奨されます) 。checkRun.actor オブジェクト
checkRun.actor.user object
checkRun.actor.user.id string
checkRun.actor.user.email string 必須
checkRun.actor.user.displayName string
checkRun.actor.user.handle string
checkRun.actor.app オブジェクト
checkRun.actor.app.id string
checkRun.actor.app.displayName string
checkRun.actor.serviceAccount object
checkRun.actor.serviceAccount.id string
checkRun.output object
checkRun.output.title string
checkRun.output.summary string
checkRun.output.text string
checkRun.deadlineAt string
checkRun.isRerequestable boolean
CheckRunInput.is_rerequestable) 。checkRun.rerequestedAt string
status は rerequested となり、その実行はコミットの CI 状態では保留中として扱われます (conclusion と時刻は置き換えられた結果です) 。所有アプリは is_rerequestable を宣言してコミット先の実行を投稿することで応答します — 同じ key に対する新しい実行、またはこの実行の更新 (この場合このフィールドはクリアされます) — その後、その実行は再び再リクエストできるようになります。RFC 3339 形式のタイムスタンプ。checkRun.rerequestedBy オブジェクト
rerequested_at が設定されている場合にのみ存在し、所有するアプリが応答すると rerequested_at とともにクリアされます。checkRun.rerequestedBy.user オブジェクト
checkRun.rerequestedBy.user.id string
checkRun.rerequestedBy.user.email string 必須
checkRun.rerequestedBy.user.displayName string
checkRun.rerequestedBy.user.handle string
checkRun.rerequestedBy.app オブジェクト
checkRun.rerequestedBy.app.id string
checkRun.rerequestedBy.app.displayName string
checkRun.rerequestedBy.serviceAccount オブジェクト
checkRun.rerequestedBy.serviceAccount.id string
actor object
actor.user object
actor.user.id string
actor.user.email string 必須
actor.user.displayName string
actor.user.handle string
actor.app オブジェクト
actor.app.id string
actor.app.displayName string
actor.serviceAccount オブジェクト
actor.serviceAccount.id string
event.payload のサンプル:
{ "repository": { "id": "repo_01k2ja2000e0080000000000q4", "name": "rocket", "owner": { "slug": "acme", "id": "ns_01k2ja2000e0080000000000p3", "type": "team" } }, "checkSuite": { "id": "crg_01k2ja2000e0080000000000h8", "repository": { "id": "repo_01k2ja2000e0080000000000q4", "name": "rocket", "owner": { "slug": "acme", "id": "ns_01k2ja2000e0080000000000p3", "type": "team" } }, "sha": "9a41f0c3d2b8e7f6a5c4d3e2f1b0a9c8d7e6f5a4", "key": "ci-8842", "name": "CI", "detailsUrl": "https://ci.acme.dev/runs/8842", "createdAt": "2026-08-01T09:30:00Z", "updatedAt": "2026-08-02T14:45:00Z", "externalId": "build-8842", "actor": { "user": { "id": "user_01k2ja2000e0080000000000c3", "email": "jane@acme.dev" } } }, "checkRun": { "id": "cr_01k2ja2000e0080000000000g7", "repository": { "id": "repo_01k2ja2000e0080000000000q4", "name": "rocket", "owner": { "slug": "acme", "id": "ns_01k2ja2000e0080000000000p3", "type": "team" } }, "checkSuite": { "id": "crg_01k2ja2000e0080000000000h8" }, "sha": "9a41f0c3d2b8e7f6a5c4d3e2f1b0a9c8d7e6f5a4", "key": "ci-8842-unit-tests", "name": "unit-tests", "status": "completed", "conclusion": "success", "detailsUrl": "https://ci.acme.dev/runs/8842", "externalUpdatedAt": "2026-08-02T14:44:30Z", "startedAt": "2026-08-02T14:40:00Z", "completedAt": "2026-08-02T14:44:30Z", "createdAt": "2026-08-01T09:30:00Z", "updatedAt": "2026-08-02T14:45:00Z", "externalId": "run-8842", "actor": { "user": { "id": "user_01k2ja2000e0080000000000c3", "email": "jane@acme.dev" } }, "output": { "title": "Unit tests", "summary": "128 tests passed.", "text": "All suites green." } }, "actor": { "user": { "id": "user_01k2ja2000e0080000000000c3", "email": "jane@acme.dev" } }}チェック実行の再リクエスト
repository.check_run.rerequestedrepository.check_run.rerequested webhook payload, delivered only to the app that owns the check run. Answer by posting a fresh run for the same head SHA and key — a new run (new external_id) or an update of the re-requested run. 記録済みの run は、応答となる POST によって rerequested_at が clear されるまで status: rerequested と表示されます (conclusion と timings は置き換えられた結果です) 。 Each accepted re-request emits one event, and a run may be re-requested again once answered, so dedupe redeliveries on the event id alone; check_run.rerequested_at carries the outstanding stamp. The payload carries no pull request context (check runs attach to (repository, sha)): a consumer that needs the pull request resolves it from check_run.sha via its own head mapping, or ListPullRequests filtered to the head branch it built.
ペイロードのフィールド
repository オブジェクト
repository.id string
repository.name string
repository.owner オブジェクト
repository.owner.slug string
repository.owner.id string
repository.owner.type string
team または user。出力専用。不明な場合は未設定。team または user。checkSuite オブジェクト
checkSuite.id string
checkSuite.repository object
checkSuite.repository.id string
checkSuite.repository.name string
checkSuite.repository.owner object
checkSuite.repository.owner.slug string
checkSuite.repository.owner.id string
checkSuite.repository.owner.type string
team または user。出力専用。不明な場合は未設定。team、user のいずれか。checkSuite.sha string
checkSuite.key string
checkSuite.name string
checkSuite.detailsUrl string
checkSuite.createdAt string
checkSuite.updatedAt string
checkSuite.externalId string
checkSuite.actor オブジェクト
checkSuite.actor.user オブジェクト
checkSuite.actor.user.id string
checkSuite.actor.user.email string 必須
checkSuite.actor.user.displayName string
checkSuite.actor.user.handle string
checkSuite.actor.app オブジェクト
checkSuite.actor.app.id string
checkSuite.actor.app.displayName string
checkSuite.actor.serviceAccount オブジェクト
checkSuite.actor.serviceAccount.id string
checkRun object
status: rerequested) 。時刻はcheck_run.rerequested_atに記録され、リクエストした主体はcheck_run.rerequested_byに記録されます。checkRun.id 文字列
checkRun.repository object
checkRun.repository.id string
checkRun.repository.name string
checkRun.repository.owner オブジェクト
checkRun.repository.owner.slug string
checkRun.repository.owner.id string
checkRun.repository.owner.type string
team または user。出力専用。不明な場合は未設定。team、user のいずれか。checkRun.checkSuite オブジェクト
checkRun.checkSuite.id string
checkRun.sha string
checkRun.key string
checkRun.name string
checkRun.status string
rerequested は再実行がリクエストされ、所有アプリがまだ応答していない完了済みの実行です。読み取り側では保留として扱われ (queued と同様に表示され) 、conclusion とタイミングは引き続き置き換え前の試行を示します。再リクエスト時には Origin によってのみ設定されます (RerequestCheckRun) 。アプリはこれを投稿できません。queued、in_progress、completed、rerequested のいずれか。checkRun.conclusion string
status が completed または rerequested の場合にのみ存在します。rerequested の実行では、置き換えられた試行の結果を表します。実行は保留中として扱い、conclusion は status == completed の場合にのみ参照してください。success、failure、neutral、cancelled、skipped、timed_out、action_required、stale のいずれかです。checkRun.detailsUrl string
checkRun.externalUpdatedAt string
checkRun.startedAt string
checkRun.completedAt string
checkRun.createdAt string
checkRun.updatedAt string
checkRun.externalId string
CheckRunInput.external_id を参照) 。実行ごとに1つ使用することを推奨します。checkRun.actor オブジェクト
checkRun.actor.user object
checkRun.actor.user.id string
checkRun.actor.user.email string 必須
checkRun.actor.user.displayName string
checkRun.actor.user.handle string
checkRun.actor.app オブジェクト
checkRun.actor.app.id string
checkRun.actor.app.displayName string
checkRun.actor.serviceAccount オブジェクト
checkRun.actor.serviceAccount.id string
checkRun.output オブジェクト
checkRun.output.title string
checkRun.output.summary string
checkRun.output.text string
checkRun.deadlineAt string
checkRun.isRerequestable boolean
CheckRunInput.is_rerequestable) 。checkRun.rerequestedAt string
statusがrerequestedとなり、実行はコミットのCI状態で保留のままです (conclusionおよびタイミング情報は置き換えられた結果のものになります) 。所有アプリはis_rerequestableを宣言して自身がコミットした実行を投稿することで応答します — 同じkeyの新しい実行、またはこの実行の更新 (これによりこのフィールドはクリアされます) — その後、その実行は再度再リクエストされる可能性があります。RFC 3339 のタイムスタンプ。checkRun.rerequestedBy オブジェクト
rerequested_at が設定されている場合にのみ存在し、所有アプリが応答すると同時にクリアされます。checkRun.rerequestedBy.user オブジェクト
checkRun.rerequestedBy.user.id string
checkRun.rerequestedBy.user.email string 必須
checkRun.rerequestedBy.user.displayName string
checkRun.rerequestedBy.user.handle string
checkRun.rerequestedBy.app オブジェクト
checkRun.rerequestedBy.app.id string
checkRun.rerequestedBy.app.displayName string
checkRun.rerequestedBy.serviceAccount オブジェクト
checkRun.rerequestedBy.serviceAccount.id string
event.payload のサンプル:
{ "repository": { "id": "repo_01k2ja2000e0080000000000q4", "name": "rocket", "owner": { "slug": "acme", "id": "ns_01k2ja2000e0080000000000p3", "type": "team" } }, "checkSuite": { "id": "crg_01k2ja2000e0080000000000h8", "repository": { "id": "repo_01k2ja2000e0080000000000q4", "name": "rocket", "owner": { "slug": "acme", "id": "ns_01k2ja2000e0080000000000p3", "type": "team" } }, "sha": "9a41f0c3d2b8e7f6a5c4d3e2f1b0a9c8d7e6f5a4", "key": "ci-8842", "name": "CI", "detailsUrl": "https://ci.acme.dev/runs/8842", "createdAt": "2026-08-01T09:30:00Z", "updatedAt": "2026-08-02T15:10:00Z", "externalId": "build-8842", "actor": { "user": { "id": "user_01k2ja2000e0080000000000c3", "email": "jane@acme.dev" } } }, "checkRun": { "id": "cr_01k2ja2000e0080000000000g7", "repository": { "id": "repo_01k2ja2000e0080000000000q4", "name": "rocket", "owner": { "slug": "acme", "id": "ns_01k2ja2000e0080000000000p3", "type": "team" } }, "checkSuite": { "id": "crg_01k2ja2000e0080000000000h8" }, "sha": "9a41f0c3d2b8e7f6a5c4d3e2f1b0a9c8d7e6f5a4", "key": "ci-8842-unit-tests", "name": "unit-tests", "status": "rerequested", "conclusion": "failure", "detailsUrl": "https://ci.acme.dev/runs/8842", "externalUpdatedAt": "2026-08-02T14:44:30Z", "startedAt": "2026-08-02T14:40:00Z", "completedAt": "2026-08-02T14:44:30Z", "createdAt": "2026-08-01T09:30:00Z", "updatedAt": "2026-08-02T15:10:00Z", "externalId": "run-8842", "actor": { "user": { "id": "user_01k2ja2000e0080000000000c3", "email": "jane@acme.dev" } }, "output": { "title": "Unit tests", "summary": "1 of 129 tests failed.", "text": "FAIL telemetry.spec.ts > flushes queued events on shutdown" }, "isRerequestable": true, "rerequestedAt": "2026-08-02T15:10:00Z", "rerequestedBy": { "user": { "id": "user_01k2ja2000e0080000000000c3", "email": "jane@acme.dev" } } }}インストール作成時
installation.createdペイロードのフィールド
installation オブジェクト
installation.id string
installation.appId string
app.id と同じ値です。installation.target オブジェクト
installation.target.slug string
installation.target.id string
installation.target.type string
team または user。出力専用。不明な場合は未設定。team、user のいずれか。installation.repoSelectionMode string
all、selected のいずれか。installation.repositories array
installation.repositories[].id string
installation.repositories[].name string
installation.repositories[].owner object
installation.repositories[].owner.slug string
installation.repositories[].owner.id string
installation.repositories[].owner.type string
team または user。出力専用。不明な場合は未設定。team、user のいずれか。installation.scopes array
installation.repositoriesCount integer
installation.createdAt string
installation.updatedAt string
installation.deletedAt string
installation.suspendedAt string
installation.installedBy object
installation.installedBy.id string
installation.installedBy.email string 必須
installation.installedBy.displayName string
installation.installedBy.handle string
app オブジェクト
app.id string
app.displayName string
event.payload のサンプル:
{ "installation": { "id": "inst_01k2ja2000e0080000000000b2", "appId": "app_01k2ja2000e0080000000000a1", "target": { "slug": "acme", "id": "ns_01k2ja2000e0080000000000p3", "type": "team" }, "repoSelectionMode": "selected", "repositories": [ { "id": "repo_01k2ja2000e0080000000000q4", "name": "rocket", "owner": { "slug": "acme", "id": "ns_01k2ja2000e0080000000000p3", "type": "team" } } ], "scopes": [ "repository:contents:read", "repository:pull_requests:read" ], "repositoriesCount": 1, "createdAt": "2026-08-01T09:30:00Z", "updatedAt": "2026-08-01T09:30:00Z", "installedBy": { "id": "user_01k2ja2000e0080000000000c3", "email": "jane@acme.dev" } }, "app": { "id": "app_01k2ja2000e0080000000000a1", "displayName": "CI Status Bot" }}インストールの更新
installation.updatedペイロードのフィールド
installation オブジェクト
installation.id string
installation.appId string
app.id と同じ値です。installation.target オブジェクト
installation.target.slug string
installation.target.id string
installation.target.type string
team または user。出力専用。不明な場合は未設定。team、user のいずれか。installation.repoSelectionMode string
all、selected のいずれか。installation.repositories array
installation.repositories[].id string
installation.repositories[].name string
installation.repositories[].owner object
installation.repositories[].owner.slug string
installation.repositories[].owner.id string
installation.repositories[].owner.type string
team または user。出力専用。不明な場合は未設定。team、user のいずれか。installation.scopes array
installation.repositoriesCount integer
installation.createdAt string
installation.updatedAt string
installation.deletedAt string
installation.suspendedAt string
installation.installedBy object
installation.installedBy.id string
installation.installedBy.email string 必須
installation.installedBy.displayName string
installation.installedBy.handle string
app オブジェクト
app.id string
app.displayName string
event.payload のサンプル:
{ "installation": { "id": "inst_01k2ja2000e0080000000000b2", "appId": "app_01k2ja2000e0080000000000a1", "target": { "slug": "acme", "id": "ns_01k2ja2000e0080000000000p3", "type": "team" }, "repoSelectionMode": "selected", "repositories": [ { "id": "repo_01k2ja2000e0080000000000q4", "name": "rocket", "owner": { "slug": "acme", "id": "ns_01k2ja2000e0080000000000p3", "type": "team" } } ], "scopes": [ "repository:contents:read", "repository:pull_requests:read" ], "repositoriesCount": 1, "createdAt": "2026-08-01T09:30:00Z", "updatedAt": "2026-08-02T14:45:00Z", "installedBy": { "id": "user_01k2ja2000e0080000000000c3", "email": "jane@acme.dev" } }, "app": { "id": "app_01k2ja2000e0080000000000a1", "displayName": "CI Status Bot" }}インストールの一時停止
installation.suspendedペイロードのフィールド
installation オブジェクト
installation.id string
installation.appId string
app.id と同じ値です。installation.target オブジェクト
installation.target.slug string
installation.target.id string
installation.target.type string
team または user。出力専用。不明な場合は未設定。team、user のいずれか。installation.repoSelectionMode string
all、selected のいずれか。installation.repositories array
installation.repositories[].id string
installation.repositories[].name string
installation.repositories[].owner object
installation.repositories[].owner.slug string
installation.repositories[].owner.id string
installation.repositories[].owner.type string
team または user。出力専用。不明な場合は未設定。team、user のいずれか。installation.scopes array
installation.repositoriesCount integer
installation.createdAt string
installation.updatedAt string
installation.deletedAt string
installation.suspendedAt string
installation.installedBy object
installation.installedBy.id string
installation.installedBy.email string 必須
installation.installedBy.displayName string
installation.installedBy.handle string
app オブジェクト
app.id string
app.displayName string
event.payload のサンプル:
{ "installation": { "id": "inst_01k2ja2000e0080000000000b2", "appId": "app_01k2ja2000e0080000000000a1", "target": { "slug": "acme", "id": "ns_01k2ja2000e0080000000000p3", "type": "team" }, "repoSelectionMode": "selected", "repositories": [ { "id": "repo_01k2ja2000e0080000000000q4", "name": "rocket", "owner": { "slug": "acme", "id": "ns_01k2ja2000e0080000000000p3", "type": "team" } } ], "scopes": [ "repository:contents:read", "repository:pull_requests:read" ], "repositoriesCount": 1, "createdAt": "2026-08-01T09:30:00Z", "installedBy": { "id": "user_01k2ja2000e0080000000000c3", "email": "jane@acme.dev" }, "suspendedAt": "2026-08-03T08:15:00Z" }, "app": { "id": "app_01k2ja2000e0080000000000a1", "displayName": "CI Status Bot" }}インストールの一時停止解除
installation.unsuspendedペイロードのフィールド
installation オブジェクト
installation.id string
installation.appId string
app.id と同じ値です。installation.target オブジェクト
installation.target.slug string
installation.target.id string
installation.target.type string
team または user。出力専用。不明な場合は未設定。team、user のいずれか。installation.repoSelectionMode string
all、selected のいずれか。installation.repositories array
installation.repositories[].id string
installation.repositories[].name string
installation.repositories[].owner object
installation.repositories[].owner.slug string
installation.repositories[].owner.id string
installation.repositories[].owner.type string
team または user。出力専用。不明な場合は未設定。team、user のいずれか。installation.scopes array
installation.repositoriesCount integer
installation.createdAt string
installation.updatedAt string
installation.deletedAt string
installation.suspendedAt string
installation.installedBy object
installation.installedBy.id string
installation.installedBy.email string 必須
installation.installedBy.displayName string
installation.installedBy.handle string
app オブジェクト
app.id string
app.displayName string
event.payload のサンプル:
{ "installation": { "id": "inst_01k2ja2000e0080000000000b2", "appId": "app_01k2ja2000e0080000000000a1", "target": { "slug": "acme", "id": "ns_01k2ja2000e0080000000000p3", "type": "team" }, "repoSelectionMode": "selected", "repositories": [ { "id": "repo_01k2ja2000e0080000000000q4", "name": "rocket", "owner": { "slug": "acme", "id": "ns_01k2ja2000e0080000000000p3", "type": "team" } } ], "scopes": [ "repository:contents:read", "repository:pull_requests:read" ], "repositoriesCount": 1, "createdAt": "2026-08-01T09:30:00Z", "installedBy": { "id": "user_01k2ja2000e0080000000000c3", "email": "jane@acme.dev" } }, "app": { "id": "app_01k2ja2000e0080000000000a1", "displayName": "CI Status Bot" }}インストールの削除
installation.deletedペイロードのフィールド
installation オブジェクト
installation.id string
installation.appId string
app.id と同じ値です。installation.target オブジェクト
installation.target.slug string
installation.target.id string
installation.target.type string
team または user。出力専用。不明な場合は未設定。team、user のいずれか。installation.repoSelectionMode string
all、selected のいずれか。installation.repositories array
installation.repositories[].id string
installation.repositories[].name string
installation.repositories[].owner object
installation.repositories[].owner.slug string
installation.repositories[].owner.id string
installation.repositories[].owner.type string
team または user。出力専用。不明な場合は未設定。team、user のいずれか。installation.scopes array
installation.repositoriesCount integer
installation.createdAt string
installation.updatedAt string
installation.deletedAt string
installation.suspendedAt string
installation.installedBy object
installation.installedBy.id string
installation.installedBy.email string 必須
installation.installedBy.displayName string
installation.installedBy.handle string
app オブジェクト
app.id string
app.displayName string
event.payload のサンプル:
{ "installation": { "id": "inst_01k2ja2000e0080000000000b2", "appId": "app_01k2ja2000e0080000000000a1", "target": { "slug": "acme", "id": "ns_01k2ja2000e0080000000000p3", "type": "team" }, "repoSelectionMode": "selected", "repositories": [ { "id": "repo_01k2ja2000e0080000000000q4", "name": "rocket", "owner": { "slug": "acme", "id": "ns_01k2ja2000e0080000000000p3", "type": "team" } } ], "scopes": [ "repository:contents:read", "repository:pull_requests:read" ], "repositoriesCount": 1, "createdAt": "2026-08-01T09:30:00Z", "installedBy": { "id": "user_01k2ja2000e0080000000000c3", "email": "jane@acme.dev" }, "deletedAt": "2026-08-03T08:15:00Z" }, "app": { "id": "app_01k2ja2000e0080000000000a1", "displayName": "CI Status Bot" }}