Origin API
Origin は Early Beta 段階であり、変更される可能性があります。連携を更新する際は、OpenAPI 仕様を確認してください。
Origin は Cherri Code のコードフォージです。公開 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 であり、未設定の場合はボディに含まれません。
プレビュー
一部の API サーフェスはプレビューとして公開されています。これらはこのリファレンスと仕様書に記載されていますが、一般提供 (GA) までに構造が変更される可能性があります。OpenAPI 仕様では、これらに x-cursor-visibility: PREVIEW が付与されています。このマーカーは操作、パラメータ、スキーマ、または個々のフィールドに付与されることがあるため、安定版の操作でもプレビューのフィールドが返される場合があります。プレビュー段階のエンドポイントには、このリファレンスで Preview バッジが表示されます。プレビューのフィールドは省略可能なものとして扱い、その構造に強く依存する実装は作らないでください。
はじめに
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 管理者に以下を送信してください:
/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 からのものであることを証明し、コールバックに必要な情報をすべて含みます。Cherri Code はこれがない場合はリダイレクトを拒否するため、外部コールバックには常に含まれます。
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": "[email protected]", "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"Cherri Code API キーはOriginのBearerトークンではありません。ユーザー認証されたリクエストには Origin CLI を使用してください。Origin CLIは、個人ユーザーの API キーを、Originが受け入れる短命なアクセストークンと交換します。Cherri Code API キーを Authorization ヘッダーに直接指定しないでください。
アプリの署名キーを生成する
Origin Apps は Ed25519 キーペアで認証します。キーペアをローカルで生成し、公開鍵のみを cursor.com/codebase/settings/apps に登録します。アプリでは有効な署名キーを最大 10 個保持できます。
秘密鍵は厳重に管理してください。アップロードしたり、アプリの設定に貼り付けたり、リポジトリにコミットしたり、共有したりしないでください。シークレットマネージャーに保存してください。Cherri Code に保存されるのは公開鍵のみです。
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 が含まれます。トークンは必要になる直前に発行し、有効期限が切れる前に更新してください。パスワードと同様に扱い、決してログに記録しないでください。
トークンの有効期限は作成から最大 15 分であり、それをリクエストしたアプリ JWT の有効期限を超えることはありません。そのため、上で推奨した 5 分の JWT では、トークンの有効期間も最大 5 分になります。有効期間を決め打ちせず、expiresAt を読み取り、期限を過ぎたら新しいトークンを発行してください。オリジンのトークンは GitHub App のインストールトークンよりも有効期間が短いため、GitHub のスケジュールに合わせてトークンを再利用する連携は、トークンの期限切れとともに失敗します。ジョブで 15 分すべてを必要とする場合は、CloneKit CI レシピのように、より遅い exp で JWT に署名してください。
インストールを削除するか、アプリを削除すると、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 より前に新しいトークンを発行してください。
HTTPS 経由の Git は、Rate limits の REST 用バジェットとは別に、独自のバジェットで計測されます。カウント対象となる Git レスポンスには、同じ X-RateLimit-Limit、X-RateLimit-Remaining、X-RateLimit-Used ヘッダーが含まれ、X-RateLimit-Resource は core ではなく git に設定されます。バジェットを超過した Git リクエストには、Retry-After と X-RateLimit-Reset を伴う 429 が返されます。数値を決め打ちせず、ヘッダーを読み取ってジョブのペースを調整してください。計測対象外のリクエストにはレート制限ヘッダーは含まれません。
ミラーリポジトリでは、インストールトークンで clone、fetch、pull を実行できますが、ミラーが安定したアウトバウンド ミラーになるまで、Origin は git push を 403 で拒否します。ミラーリポジトリを参照してください。
ユーザー認証による CLI リクエスト
ユーザー認証されたリクエストには origin api を使用します。対話型セッションの場合は、ブラウザからサインインします。
origin auth loginorigin api /repos/OWNER_SLUG/REPO_NAME/pulls非対話型セッションの場合は、Cherri Code 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 | Pull Requestsコメント、コメントスレッド、送信済み確認、レビュー依頼先を読み取る。 |
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 | 所有者に直接付与されている権限付与を読み取る。所有者が信頼する SSH 認証局と、証明書を必須とするかどうかを読み取る。 |
namespace:settings:write | 所有者の権限付与を upsert・削除する。SSH 認証局を追加・削除し、所有者が証明書を必須とするかどうかを設定する。これらの書き込みには Cherri Code ユーザー認証情報が必要です。 |
namespace:user_tokens:write | インストールの名前空間のメンバーとして動作するインストールユーザートークンを発行する。トークン自体がこのスコープを持つことはできません。ユーザーの代理としての操作を参照してください。 |
:write スコープをリクエストすると、対応する :read スコープも併せて付与されます。そのため repository:labels:write は repository:labels:read を含んでおり、両方を指定する必要はありません。ただし、その逆は成り立ちません。読み取りスコープが書き込みを許可することはありません。
インストールトークンでは、これらの権限付与を制限することしかできません。Workspace 管理者が承認していないスコープやリポジトリを追加することはできません。
ミラー状態の変更はこの表の対象外です。リポジトリミラーを移行、リポジトリミラーの切り替えを強制、リポジトリミラーを切断には repository:mirror:write または repository:mirror:delete が必要ですが、アプリはこれらをインストール時にリクエストできません。これらは Cherri Code ユーザー認証情報に付随し、呼び出し元はミラーのアップストリームソース上でもリポジトリを管理している必要があります。
インストールの管理も対象外です。アプリのインストールにリポジトリを追加には namespace:installations:write が必要ですが、アプリはこれをインストール時にリクエストできません。これは名前空間管理者が Cherri Code ユーザー認証情報上で保持するもので、インストールに同意したものと同じ種類の認証情報のみがその範囲を拡張できます。
アプリの管理も同じ理由で対象外です。アプリを作成には namespace:apps:create、名前空間のアプリ一覧を取得とアプリを取得には namespace:apps:read、アプリを更新、アプリの署名キーを追加、アプリの署名キーを失効には app:settings:write が必要です。発行者はこれらを Cherri Code ユーザー認証情報上で保持します。アプリが自身のためにこれらをリクエストすることはできません。
この表では、アプリがインストール時にリクエストするスコープを示しています。個別の操作に必要なスコープを確認するには、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 ポイント/分 |
| Cherri Code ユーザーまたはサービスアカウント | 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、リポジトリミラーを移行、リポジトリミラーの切り替えを強制 |
Cherri Code は、デザインパートナー向けにアプリごとの1分あたりの予算を引き上げることができます。連携により高い上限が必要な場合は、Cherri Code にお問い合わせください。
レスポンスヘッダー
課金対象のレスポンスおよびレート制限の取得には、以下のヘッダーが含まれます。
| ヘッダー | 説明 |
|---|---|
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が返されます。
一連のリクエストでは、続きのページを取得するリクエストも含め、すべてのリクエストで同じpageSizeを送信してください。ほとんどのリストエンドポイントでは、ページトークンとともに送信されたpageSizeがそのページに適用され、省略した場合は前のページサイズが維持されます。これに該当するエンドポイントでは、pageTokenのエントリにその旨が記載されています。それ以外のエンドポイントはページトークンが保持する内容が異なるため、pageSizeを常に同じ値にしておけば、どのエンドポイントでも同じページサイズで結果を取得できます。
エラー
エラーの本文には、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 エントリは存在するため、呼び出しの失敗について Cherri Code に問い合わせる際はリクエスト ID を伝えてください。
/v1/origin 配下で一致しないパスと、既知のパスに対して誤ったメソッドを使用するリクエストは、汎用ルーターエラーではなく同じ本文を返します。メッセージにはメソッドとパスが含まれ、クエリ文字列がエコーされることはありません。
ID
リソース ID は、型を示すプレフィックスが付いた不透明な文字列です。たとえば、アプリの ID は app_…、インストールの ID は i_… で始まります。ID は文字列全体として保存・比較してください。ID を解析したり、文字から意味を読み取ったり、ソート順に依存したりしないでください。
名前や slug は変更される可能性がありますが、ID はリソースが存在する限り変わりません。リポジトリは名前を変更しても同じ ID を保持するため、キャッシュしたデータのキーには {ownerSlug}/{repoName} ではなく ID を使用してください。また、リポジトリパスで説明しているとおり、リポジトリは ID で指定してください。
リポジトリパス
リポジトリスコープのパスでは、所有者スラッグとリポジトリ名を {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を読み取ってください。
チェック実行
Apps は Post Check Run と Batch Upsert Check Runs を使って、commit に対する CI の結果をチェック スイートおよびチェック実行として報告し、Checks エンドポイントで読み取ります。このセクションでは、これらのエンドポイントに共通する用語、すなわちどの試行が現在のものか、オリジンが書き込みをどのように順序付けて報告するか、タイムスタンプと期限がどのように扱われるかを定義します。
試行と現在の試行
コミットに対して報告される (actor, key, externalId) の組み合わせが 1 つのスイート試行となり、その中の (suite, key, externalId) が 1 つの実行試行となります。同じ externalId を再利用すると、その試行がその場で更新されます。新しい externalId を指定すると新しい試行が開始され、以前の試行は履歴として保持されます。置き換えられた試行も、Get Check Suite と Get Check Run で id を指定すれば引き続き読み取れます。
API がコミットの現在のチェックを示す箇所、つまり List Check Suites For Commit、List Check Runs For Commit、およびプルリクエストの CI 状態と必須チェックでは、オリジンは次の 2 段階で試行を集約します。
(actor, key)ごとの現在のスイート試行は、第 2 段階で選ばれた配下の現在の実行が最も新しいexternalUpdatedAtを持つものです。実行を持たないスイートは自身のcreatedAtで順位付けされます。同値の場合はスイートのcreatedAt、次にidの順で、新しいものが優先されます。- そのスイート試行の中で、ある
keyの現在の実行は、最も新しいexternalUpdatedAtを持つものです。同値の場合はcreatedAt、次にidの順で、新しいものが優先されます。
List Check Runs For Suite は、指定したスイートに対して第 2 段階のみを適用します。実行がそのコミットにとって現在のものとなるのは、その実行が属するスイートがコミットの現在のスイート試行である場合に限られます。第 1 段階ではスイート試行全体が順位付けされるため、置き換えられたスイート試行の下に投稿された実行は、別の試行がより新しい externalUpdatedAt を持っている間はコミットのチェックに表示されません。そのタイムスタンプが最新になった時点で、そのスイート試行が現在のものとなり、代わりにもう一方の試行の実行が非表示になります。
キャンセルされた試行が、成功した試行を置き換えることはありません。どちらの段階でも、同じ key のキャンセルされていない試行のうち最新のものが成功している場合、キャンセルされた試行はその key の他の試行より下位に順位付けされます。実行が成功とみなされるのは、completed であり、結論が success、neutral、skipped のいずれかである場合です。スイート試行が成功とみなされるのは、その現在の実行がすべて成功した場合です。また、現在の実行がすべて completed で、少なくとも 1 つの結論が cancelled、残りがすべて成功である場合、そのスイート試行はキャンセル済みとみなされます。成功した試行の再実行が要求された場合、externalUpdatedAt が要求時点以降であるキャンセル済みの試行は、再びタイムスタンプに基づいて順位付けされます。なお、より新しいキャンセル済みのスイート試行は、完全には成功していない古いスイート試行を引き続き置き換えます。
再実行が要求された実行は、その key の現在の試行としての位置を保ち、所有するアプリが応答するまで保留中として読み取られます。Rerequest Check Run を参照してください。
書き込みの順序付け
オリジンは、1つの実行 (スイート内で同じ externalId と key) への投稿を、ミリ秒精度の checkRun.externalUpdatedAt で順序付けします。投稿が適用されるのは、その値が実行に保存された externalUpdatedAt (再リクエストが未処理の間は rerequestedAt まで引き上げられます) 以降である場合のみです。値が等しい場合も適用されるため、後から投稿された方が優先されますが、同様に stale として扱われる例外が2つあります。すなわち、queued または in_progress の投稿は同一タイムスタンプで completed の実行を再オープンできません。また rerequestedAt が設定されている間は、保存されたタイムスタンプとちょうど一致する投稿は無視されます。より新しい値は適用され、completed の実行の再オープンも行われますが、タイムスタンプにかかわらず stale として扱われる例外が1つあります。conclusion が cancelled の completed の投稿は、conclusion が success、neutral、または skipped の completed の実行を置き換えることはできません。
stale な投稿でも成功します。レスポンスは HTTP 200 で、投稿された値ではなく保存されているスイートと実行が返り、実行の updatedAt は変化しません。投稿された各実行は、呼び出し後の保存済み実行である checkRun と、その書き込みが何を行ったかを示す outcome のペアとして返されます。Post Check Run はこのペアをレスポンスのトップレベル、checkSuite の隣に返します。Batch Upsert Check Runs は、投稿された実行ごとに1つのペアを results[] にリクエスト順で返すため、バッチの各要素は単一呼び出しがインラインで返すのと同じ実行ごとの結果を保持します。書き込みが何を行ったかは、outcome、または各 results[].outcome を読んで確認してください。
outcome | 意味 |
|---|---|
created | スイート内に (externalId, key) に対応する実行が存在せず、新たに作成されました。 |
updated | 既存の実行が投稿された値で置き換えられました。 |
unchanged | externalUpdatedAt を含む投稿された値が保存済みの実行と等しく、何も書き込まれませんでした。 |
ignored_stale | 投稿は stale として無視されました。checkRun には投稿された値ではなく保存済みの実行が入ります。 |
unchanged または ignored_stale の投稿では updatedAt は進まないため、この2つを区別することはできません。区別できるのは outcome だけです。認識できない値は「保存済みの実行がレスポンスに入っているが、書き込まれたかどうかは不明」として扱ってください。バッチでは、オリジンはこのルールを各実行に個別に適用します。stale な実行があってもバッチは失敗せず、results[] のその実行のスロットには保存済みの実行が入り、outcome は ignored_stale になります。
Batch Upsert Check Runs では、トップレベルの checkRuns[] は非推奨であり、results[] の使用が推奨されます。同じ保存済み実行が同じ順序で引き続き入りますが、outcome は含まれません。代わりに results[] を読んでください。これはバッチにのみ該当します。Post Check Run では、読むべきトップレベルのフィールドは checkRun と outcome です。
タイムスタンプと期限
externalUpdatedAt、startedAt、completedAt のいずれかが60秒を超えて未来を指す 投稿 は InvalidArgument (HTTP 400) を返します。同一の 投稿 に両方が含まれる場合、completedAt は startedAt より前であってはなりません。deadlineAt は24時間を超えて未来であってはなりません。
期限切れになるのは in_progress の 実行 だけです。deadlineAt を過ぎると、定期的なスイープがその 実行 を結論 timed_out で完了させ、実行 に未設定であれば completedAt を設定し、deadlineAt をクリアして、repository.check_run.completed を配信します。期限切れは期限ちょうどではなく数分後に発生します。スイープは既定で約30分ごとに実行されますが、これは変更され得る運用上の設定のため、この間隔に依存しないでください。queued の 実行 は期限切れになりません。deadlineAt のない 実行 も同様です。completed の 投稿 は期限をクリアします。オリジンは 実行 をタイムアウトさせる際に externalUpdatedAt を変更しないため、より新しい externalUpdatedAt を持つ後続の 投稿 は、タイムアウトした 実行 にも引き続き適用されます。
現在の制限事項
- 名前空間全体でのリポジトリ一覧取得とリポジトリ作成は、パートナー API ではサポートされていません。リポジトリはインストール経由で検出してください。
- コミット比較では、埋め込みのコミット一覧ではなく、要約データが返されます。変更されたファイルには、専用のページネーション対応のエンドポイント比較ファイルの一覧があります。
- スレッドは解決時にのみ指定できます。スレッドを直接一覧表示するエンドポイントはないため、含まれるコメントから読み取ってください。
- プッシュ Webhook には完全なコミット一覧は含まれません。
- プルリクエストのマージはネイティブのオリジン リポジトリでのみサポートされます。ミラーリポジトリは拒否されます。
- ミラーリポジトリは、安定したアウトバウンドミラーになるまで、インストールでは参照専用です。ミラーリポジトリを参照してください。
実装チェックリスト
- Ed25519 秘密鍵はシークレットマネージャーに保存し、意図的にローテーションします。アプリの署名キーを生成を参照してください。
- インストールコールバックでインストールレシートを確認し、そのクレームからインストール ID と
stateを読み取ります。 - 短期有効な app JWT を使用し、必要なタイミングでインストールトークンを発行します。
- リポジトリスコープの API、チェック実行の書き込み、Git HTTPS には、app JWT ではなくインストールトークンを使用します。
- 要求するスコープとリポジトリアクセスは最小限にします。
- ページトークンは不透明なものとして扱い、フィルターを変更した場合はページネーションを最初からやり直します。
- チェックの
key値は安定していて読みやすいものにします。再試行ごとに新しい不変のexternalIdを使用し、更新時にはより大きいexternalUpdatedAt値を使用します。 - Post Check Run のレスポンスごとに
outcomeを、Batch Upsert Check Runs のレスポンスごとに各results[].outcomeを読み取ります。古い投稿の場合は、保存済みの実行とともに200が返されます。チェック実行を参照してください。 - 解析前に、生のリクエスト本文を使用して webhook 署名を確認します。
webhook-idを使用して配信を重複排除し、2xxを返した後に非同期で処理します。- 将来の互換性のため、未知の JSON フィールドは無視します。
Retry-AfterとX-RateLimit-*ヘッダーの指示に従います。ポイントを消費せずに残りのポイントを監視するには、レート制限を取得 を使用します。
エンドポイントリファレンス
すべてのコンポーネントスキーマについては、OpenAPI specification をダウンロードしてください。このドキュメントでは、サーバーとして https://api.cursor.com を宣言し、bearerAuth HTTP Bearer セキュリティスキームを定義しています。また、各操作には、その操作が返しうるレスポンスコードと、リクエストおよびレスポンスの例が記載されています。すべての操作には x-origin-scopes 拡張も付いており、scopes にはその操作が必要とするスコープ、tokenTypes には受け入れる認証情報の種類が入ります。各 webhook のペイロードスキーマには、そのペイロードを配信するイベントを列挙した x-origin-webhook-events 拡張が付いており、プレビューの機能には x-cursor-visibility: PREVIEW が付いています。パスパラメータには、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 配列
installation.* イベントは常に配信されるため、ここには含まれません。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/app/installations/{installationId}/user_access_tokensインストールの名前空間に属するメンバーの代理として動作するインストールユーザートークンを作成します。
インストールは認証済みアプリに属し、namespace:user_tokens:write を承認済みである必要があります。ユーザーは userId または userEmail のどちらか一方だけで指定してください。ユーザーが見つからない、複数のユーザーに該当する、または利用対象外の場合、どの条件に該当したかを明かさずに PermissionDenied (HTTP 403) を返します。
トークンのアクセス権は、インストールとユーザーの両方が持つ権限に限定されます。scopes と repositoryIds の両方を設定した場合、指定したすべてのリポジトリで、各スコープがインストールとユーザーの両方に許可されている必要があります。満たさない場合は PermissionDenied (HTTP 403) を返します。詳しい手順は、ユーザーの代理として操作するを参照してください。
パスパラメータ
installationId string 必須
リクエスト本文
userId string
user_… ID。userId と userEmail のどちらか一方だけを設定してください。userEmail string
scopes array
namespace:user_tokens:write を要求すると InvalidArgument (HTTP 400) が返されます。このスコープはトークンの発行を許可するもので、トークンには委譲できません。空または省略した場合、スコープによる制限は追加されません。repositoryIds array
レスポンスフィールド
token string
expiresAt string
curl --request POST \ --url 'https://api.cursor.com/v1/origin/app/installations/INSTALLATION_ID/user_access_tokens' \ --header 'Authorization: Bearer YOUR_ORIGIN_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "userId": "user_01k2ja2000e0080000000000c3", "scopes": [ "repository:pull_requests:reviews:write" ], "repositoryIds": [ "repo_01k2ja2000e0080000000000q4" ]}'レスポンスの構造:
{ "token": "YOUR_INSTALLATION_USER_TOKEN", "expiresAt": "2026-08-01T10:30:00Z"}アプリのインストール用リポジトリ一覧
/v1/origin/installation/repos認証済みアプリのインストールがアクセス可能なリポジトリを一覧表示します。
CreateInstallationAccessToken で発行されたインストールアクセストークン (oit_) が必要です。
パートナーはこのエンドポイントを通じてリポジトリを発見します。一覧の各項目は簡略化されたリポジトリの概要です。完全なタイムスタンプについては Get Repo を使用してください。Get Repo には出力専用の cloneUrl が含まれます。
結果にはミラーリポジトリが含まれます。ミラーは安定したアウトバウンドミラーになるまで読み取り専用です。ミラーリポジトリを参照してください。
クエリパラメータ
pageSize 整数
pageToken 文字列
next_page_tokenに由来する不透明なカーソル。最初のページでは空です。後続のページをリクエストする際は同じフィルタを使用する必要があります。後続のリクエストでpageSizeを指定すると、そのページにのみ適用されます。前のページサイズを引き継ぐ場合は省略してください。filter 文字列
owner/repo 形式の値は、前後それぞれを対応するフィールドと照合します。先頭と末尾の空白は無視され、空の値の場合はフィルターが適用されません。レスポンスフィールド
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
installation.* イベントは常に配信され、ここには表示されません。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}アプリの設定を更新します。省略されたフィールドは変更されません。設定可能なフィールドを少なくとも1つ指定する必要があります。空文字列を送信してwebhookUrlをクリアすると、外部へのWebhook配信が無効になり、アプリの保留中の配信がキャンセルされます。URLを再設定しても、キャンセルされた配信は復元されません。
パスパラメータ
appId string 必須
app_ のプレフィックスが付きます。リクエスト本文
displayName string
webhookUrl string
events オブジェクト
events.events 配列
installation.* イベントは常に配信され、ここには指定できません。description string
websiteUrl string
installationRedirectUris object
installationRedirectUris.installationRedirectUris 配列
defaultScopes オブジェクト
defaultScopes.scopes 配列
レスポンスフィールド
id string
app_ のプレフィックスが付きます。displayName string
webhookUrl string
events 配列
installation.* イベントは常に配信され、ここには表示されません。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 が所有するアプリを作成します。アプリは非公開として作成されます。Ed25519 キーペアはローカルで生成し、公開鍵のみを送信してください。Origin は公開鍵を保存し、アプリの JWT の検証に使用します。webhook URL、イベントタイプ、リダイレクト URI、またはスコープが無効な場合は、InvalidArgument (HTTP 400) が返されます。
リクエスト時点で、名前空間の所有者はOriginへの書き込み要件を満たしている必要があります。これはCreate Repoと同じ要件です。ユーザー所有者の場合は、Pro、Pro Student、Pro+、Ultra、Startのいずれかのプランに加入している必要があります。チーム所有者の場合は、有効な有料チームプランに加入しており、Privacy Mode (Legacy)を使用しておらず、チーム管理者によってOriginが無効化されていない必要があります。要件を満たしていない所有者の場合はFailedPrecondition (HTTP 400)が返されます。Originが参照するのは名前空間の所有者の要件充足状況であり、呼び出し元ユーザーのものではありません。
パスパラメータ
namespaceSlug string 必須
リクエストボディ
displayName string 必須
publicKey string 必須
webhookUrl string
events 配列
installation.* イベントのみです。description string
websiteUrl string
installationRedirectUris 配列
defaultScopes 配列
repository:contents:read のようなカタログのスコープ文字列で指定します。インストール時にスコープを明示的に指定することも可能です。レスポンスフィールド
id string
app_ プレフィックスが付きます。displayName string
webhookUrl string
events 配列
installation.*イベントは常に配信され、ここには表示されません。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" ]}アプリインストール用リポジトリを追加する
/v1/origin/namespaces/{namespaceSlug}/installations/{installationId}/reposインストールのリポジトリ選択にリポジトリを追加し、更新後のインストールを返します。この書き込みは追加方式です。指定されたリポジトリは現在の選択と合併され、リクエストのリポジトリがすべてすでに付与されている場合は何も変更せずに成功し、インストールのスコープは変更されません。
列挙された各リポジトリはターゲットの名前空間に属している必要があり、そうでない場合はリクエストは FailedPrecondition (HTTP 400) を返し、権限付与は一切行われません。同じエラーは、名前空間内のすべてのリポジトリを既に含んでいるインストール (repoSelectionMode が all) 、一時停止中のインストール、インストール単位のスコープ導入より前に作成されたインストールにも適用されます。存在しないインストール、または別の名前空間に属するインストールは 404 を返します。この endpoint では初回インストールを実行できないため、アプリがその名前空間に一度もインストールされていない場合、メッセージに開くべき同意ページが示されます。
呼び出し元は、その名前空間に対するインストール管理権限を持つ Cherri Code ユーザーの認証情報である必要があります。アプリトークン、インストールトークン、サービスアカウントでは、インストールのリポジトリを変更できません。
パスパラメータ
namespaceSlug string 必須
installationId 文字列 必須
リクエスト本文
repoIds 配列 必須
レスポンスフィールド
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 ウェブフックのスナップショットにのみ含まれます。削除されたインストールは API を通じて解決されなくなるため、このエンドポイントはそれを返しません。curl --request POST \ --url 'https://api.cursor.com/v1/origin/namespaces/NAMESPACE_SLUG/installations/INSTALLATION_ID/repos' \ --header 'Authorization: Bearer YOUR_ORIGIN_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "repoIds": [ "repo_01k2ja2000e0080000000000q4", "repo_01k2ja2000e0080000000000q5" ]}'レスポンスの構造:
{ "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", "repository:metadata:read" ]}リポジトリ
cloneUrlは出力専用のHTTPSクローンURLです。Get RepoのレスポンスにはcloneUrlが含まれます。
パートナーはアプリのインストールのリポジトリ一覧を通じてリポジトリを確認します。名前空間全体でのリポジトリの一覧表示と作成は、パートナーAPIの対象外です。
名前空間の一覧取得
/v1/origin/namespacesリポジトリを一覧取得できる名前空間を、slug 順に一覧表示します。
対象候補は、所属チームの名前空間、個人の名前空間、およびアクセス権を付与されたリポジトリを含む名前空間です。このうち namespace:repositories:read 権限を持つものだけが返されるため、どの結果も List Repos の ownerSlug としてそのまま使用できます。
呼び出し元は Cherri Code ユーザーの認証情報である必要があります。この呼び出し自体に必要なスコープはありません。アプリトークン、インストールトークン、サービスアカウントで呼び出した場合は PermissionDenied (HTTP 403) が返されます。
クエリパラメータ
pageSize integer
pageToken string
next_page_token で返された不透明なカーソル。最初のページでは空にします。後続のリクエストで pageSize を指定すると、そのページに適用されます。前回のページサイズを引き継ぐ場合は省略してください。レスポンスフィールド
namespaces array
namespaces[].namespace object
namespaces[].namespace.slug string
ownerSlug として使用します。namespaces[].namespace.id string
namespaces[].namespace.type string
team、user。不明な場合は省略されます。namespaces[].viewerCanCreateRepositories boolean
nextPageToken string
curl --request GET \ --url 'https://api.cursor.com/v1/origin/namespaces' \ --header 'Authorization: Bearer YOUR_ORIGIN_TOKEN'レスポンスの構造:
{ "namespaces": [ { "namespace": { "slug": "acme", "id": "ns_01k2ja2000e0080000000000p3", "type": "team" }, "viewerCanCreateRepositories": true }, { "namespace": { "slug": "jane", "id": "ns_01k2ja2000e0080000000000p4", "type": "user" }, "viewerCanCreateRepositories": false } ]}リポジトリ一覧
/v1/origin/repos/{ownerSlug}オーナーエンティティに属するリポジトリを一覧表示します。
パスパラメータ
ownerSlug 文字列 必須
クエリパラメータ
pageSize 整数
pageToken 文字列
next_page_token による不透明なカーソル。最初のページでは空です。後続のリクエストで pageSize を指定すると、そのページに適用されます。省略した場合は前回のページサイズが引き継がれます。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 から取得した不透明なカーソル。最初のページでは空です。再開位置がエンコードされています。後続リクエストで pageSize を指定すると、そのページに適用されます。前回のページサイズを引き継ぐ場合は省略してください。レスポンスフィールド
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 に返されます。リダイレクトに従ってバイト列を取得してください。アーカイブには {ownerSlug}-{repoName}-{shortSha}/ という名前のトップレベルディレクトリが 1 つ含まれます。shortSha は解決されたコミットの先頭 7 文字の 16 進数で、GitHub の tarball endpoint と同じレイアウトです。空のリポジトリでは 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を使用します。
どの試行が現在のものかの定義、externalUpdatedAtによる書き込みの順序付け、outcomeが報告する内容、およびこれらのエンドポイントで共通のタイムスタンプと期限のルールについては、チェック実行を参照してください。
チェック実行後
/v1/origin/repos/{ownerSlug}/{repoName}/check-runsrepository:checks:write 権限を持つインストールアクセストークンを使用して、チェック スイートとチェックランを作成または更新します。書き込みは、認証済みインストールを所有するアプリによるものとして記録されます。同じ (repo, head_sha, suite.key, check.key) で再度呼び出すと、重複を作成せず、既存のチェックランがその場で更新されます。
このエンドポイントはスイートの試行をアトミックに解決または作成し、1つのラン試行をアップサートします。externalUpdatedAt は同じラン識別子への更新の順序を決めるため、古いリトライが新しい状態を上書きすることはできず、cancelled による完了が保存済みの成功結果を置き換えることもできません。詳しくは書き込みの順序付けを参照してください。古いものとして無視された投稿と、保存済みの値を繰り返す投稿はいずれも、保存済みのスイートとランを含む 200 を返します。ignored_stale と unchanged を created および updated と区別するには、outcome を確認してください。どちらの場合も updatedAt は更新されないため、これらを区別することはできません。
スイート内では、ある実行の key に対する現在の試行は、externalUpdatedAt が最も新しい実行です。同点の場合は createdAt、次いで id の新しい順で決まります。コミットに対して報告された (actor, key, externalId) の各組み合わせが 1 つのスイート試行であり、(actor, key) ごとの現在の試行は、その実行が最も新しい externalUpdatedAt を持つものです。実行を含まないスイートは、自身の createdAt で順位付けされます。実行がそのコミットにとって現在のものとなるのは、そのスイートがコミットの現在の試行である間だけです。そのため、古いスイートの externalId の下で投稿された実行は、同じスイートの別の試行により新しい活動がある間、コミットスコープの一覧には表示されません。いずれのレベルでも、キャンセルされた試行が成功した試行に取って代わることはありません。詳しいルールは 試行と現在の試行 を参照してください。置き換えられた試行は id で引き続き読み取れます。
deadlineAt は実行に設定できる任意の期限を記録します。Origin はこの値を保存し、読み取り時に返し、実行が completed に達するとクリアします。24時間を超えて先に設定された期限は、上限値に調整されるのではなく、InvalidArgument (HTTP 400) で拒否されます。
まだ in_progress の実行が期限を過ぎると、Origin はその実行を timed_out の結論で自ら完了し、completedAt が設定されていなければこれを設定して repository.check_run.completed を送信します。期限切れは実行ごとのタイマーではなく定期的なスイープとして実行されるため、期限その時点ではなく数分後に発生します。スイープはデフォルトで約30分ごとに実行されますが、これは運用設定により変更されることがあります。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 文字列
InvalidArgument (HTTP 400) が返されます。checkRun.completedAt string
InvalidArgument (HTTP 400) を返します。両方を同時に投稿する場合に startedAt より前の値を指定したときも同様です。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 オブジェクト
actor と同じです。checkRun.actor.user オブジェクト
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 が設定されている間は存在し、それとともにクリアされます。outcome string
checkRun に対して行った操作。許容値: created、updated、unchanged、ignored_stale。古いものとして無視された投稿と、保存されている値をそのまま繰り返した投稿はどちらも保存済みの実行を返すため、両者を区別できるのはこのフィールドだけです。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": "[email protected]" } } }, "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": "[email protected]" } }, "output": { "title": "単体テスト", "summary": "128 tests passed.", "text": "All suites green." } }, "outcome": "created"}チェック実行の一括アップサート
/v1/origin/repos/{ownerSlug}/{repoName}/check-runs:batchUpsert1つのスイートに属する複数のチェックランを原子的にアップサートします。リクエストは最大10件のランを受け付け、(external_id, key) の重複する識別子は拒否されます。すべてのランがコミットされるか、リクエスト全体がロールバックされます。
各実行では、チェック実行を投稿と同じ任意のdeadlineAtを指定できます。
Origin は externalUpdatedAt による順序付けルールを各実行に個別に適用します。古い (stale) として無視された実行があっても、バッチ全体が失敗することはありません。レスポンスにはその代わりに保存済みの実行が含まれ、results[].outcome が各実行の判定結果をリクエスト順で報告します。
パスパラメーター
ownerSlug string 必須
repoName string 必須
リクエスト本文
headSha string 必須
checkSuite オブジェクト 必須
checkSuite.key 文字列 必須
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 文字列
InvalidArgument (HTTP 400) を返します。checkRuns[0].completedAt string
InvalidArgument (HTTP 400) を返します。両方を同時に投稿した場合に startedAt より前の値を指定したときも同様です。checkRuns[0].detailsUrl string
checkRuns[0].externalId string 必須
checkRuns[0].output オブジェクト
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 配列
results[].checkRun を読み取ってください。リクエスト順で引き続き設定されています。checkRuns[].id string
checkRuns[].repository オブジェクト
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 オブジェクト
actor です。checkRuns[].actor.user オブジェクト
checkRuns[].actor.user.id 文字列
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 が設定されている間に存在し、それとともにクリアされます。results 配列
results[].checkRun オブジェクト
outcome が created または updated の場合は投稿された値、それ以外の場合は既存のままの実行です。checkRuns[] と同じフィールドを保持します。results[].outcome 文字列
results[].checkRun に対して行った処理。許容値: created、updated、unchanged、ignored_stale。古くなったため無視された実行と、保存された値をそのまま返した実行はいずれも保存済みの実行を返すため、これらを区別できるのはこのフィールドだけです。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": "[email protected]" } } }, "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": "[email protected]" } }, "output": { "title": "Unit tests", "summary": "128 tests passed.", "text": "All suites green." } } ], "results": [ { "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": "[email protected]" } }, "output": { "title": "Unit tests", "summary": "128 tests passed.", "text": "All suites green." } }, "outcome": "created" } ]}チェック実行を取得
/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 です。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": "[email protected]" } }, "output": { "title": "Unit tests", "summary": "128 tests passed.", "text": "All suites green." }}チェック実行の一覧注釈
/v1/origin/repos/{ownerSlug}/{repoName}/check-runs/{checkRunId}/annotationsチェック実行のアノテーションをIDの昇順で一覧表示します。
アノテーション ID は時系列でソート可能なため、ID の昇順は作成順でもあります。ページトークンを送信すると、以降のページネーションではスコープが固定されます。
パスパラメータ
ownerSlug string 必須
repoName string 必須
checkRunId string 必須
クエリパラメータ
pageSize 整数
pageToken string
nextPageToken からの不透明なカーソル。最初のページでは省略してください。後続のリクエストで pageSize を指定すると、そのページに適用されます。省略すると前回のページサイズが維持されます。レスポンスフィールド
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 で通知します。アプリは同じヘッド SHA と key に対する新しい実行 (新規の実行またはこの実行の更新) を投稿して応答し、これにより rerequestedAt がクリアされ、投稿されたステータスが保存されます。リクエストが保留中の間、実行の status は rerequested となり、その conclusion とタイミングは置き換えられた試行のまま記述されます。この呼び出しは rerequestedAt が設定され status が rerequested の実行を返します。
対象の実行は completed であり、isRerequestable を持ち、その key における現在の試行であり、かつオープンなプルリクエストの現在の head 上にある必要があります。これ以外の場合は FailedPrecondition (HTTP 400) を返します。
実行ごとに未処理の再リクエストは1件までです。rerequestedAt が設定されている間に繰り返しリクエストすると AlreadyExists (HTTP 409 Conflict) が返され、所有するアプリが応答するとその実行は再び再リクエスト可能になります。repository:contents:write を持つ任意のプリンシパルは、報告したアプリにかかわらず再リクエスト可能な任意の実行を再リクエストできます。不明な 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です。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": "[email protected]" } }}チェック スイートの取得
/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": "[email protected]" } }}スイートのチェック実行一覧
/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をエンコードします。後続リクエストで指定した pageSize はそのページに適用されます。前回のページサイズを維持するには省略してください。レスポンスフィールド
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 オブジェクト
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": "[email protected]" } }, "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がエンコードされており、異なるフィルターでトークンを再利用するとInvalidArgument (HTTP 400) が返されます。後続リクエストで指定したpageSizeはそのページに適用されます。省略すると前のページサイズが維持されます。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 オブジェクト
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": "[email protected]" } }, "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がエンコードされています。後続リクエストでpageSizeを指定すると、そのページに適用されます。省略すると前回のページサイズが維持されます。レスポンスフィールド
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": "[email protected]" } } } ]}コミットとコンテンツ
コミットでは、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
nextPageTokenに由来する不透明なカーソル。最初のページでは空です。開始する ref、走査位置、メールアドレスのフィルターがエンコードされています。トークンが指定されている場合、sha、pageSize、authorEmails、committerEmails は無視されます。nextPageToken が設定されていても、フィルター適用後のページに含まれるコミット数は pageSize より少ないか、0件の場合があります。nextPageToken が空になるまでページを取得し続けてください。authorEmails 配列
committerEmails 配列
authorEmails と同じ正規化処理とメールアドレス100件の上限が適用されます。空の場合はフィルターを適用しません。両方のフィルターを設定した場合、コミットは両方のリストに一致する必要があります。各ページでは、一致するコミットを探すために最大1,000件のコミットを走査します。レスポンスフィールド
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": "[email protected]", "date": "2026-08-01T09:30:00Z" }, "committer": { "name": "Jane Doe", "email": "[email protected]", "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 は Git コミットを取得 の場合と同じ方法で解決されます。レスポンスフィールド
sha string
commit object
commit.author object
commit.author.name string
commit.author.email string
commit.author.date string
commit.committer object
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": "[email protected]", "date": "2026-08-01T09:30:00Z" }, "committer": { "name": "Jane Doe", "email": "[email protected]", "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 がトークンと一致している必要があります。各ファイルには filename、status、additions、deletions、changes、patch が含まれ、名前が変更またはコピーされた場合は previousFilename も含まれます。バイナリファイルの場合、patch は空になります。
パスパラメータ
ownerSlug string 必須
repoName string 必須
sha string 必須
HEAD) 。短縮 SHA は Get Git Commit と同様に解決されます。クエリパラメータ
pageSize integer
pageToken string
next_page_tokenに由来する不透明なカーソル。最初のページでは空です。このトークンは解決されたコミットとファイルカーソルを固定するため、後続のリクエストではshaがトークンと一致している必要があります。後続のリクエストで指定したpageSizeはそのページに適用されます。省略すると前のページサイズが維持されます。レスポンスフィールド
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/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": "[email protected]", "date": "2026-08-01T09:30:00Z" }, "committer": { "name": "Jane Doe", "email": "[email protected]", "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": "[email protected]", "date": "2026-08-01T09:30:00Z" }, "committer": { "name": "Jane Doe", "email": "[email protected]", "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": "[email protected]", "date": "2026-08-01T09:30:00Z" }, "committer": { "name": "Jane Doe", "email": "[email protected]", "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 integer
pageToken string
next_page_tokenに由来する不透明なカーソル。最初のページでは空です。このトークンは解決された比較およびファイルカーソルに紐づけられているため、後続のリクエストではbaseheadがトークンと一致している必要があります。Origin は各ページで比較を再解決します。トークン発行後にコミットが移動している場合、リクエストはInvalidArgument (HTTP 400) を返し、一覧は最初のページからやり直す必要があります。後続のリクエストで指定したpageSizeはそのページに適用されます。前のページサイズを維持する場合は省略してください。レスポンスフィールド
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 行です。リクエストごとにリポジトリ全体がスキャンされるため、ページネーションもカーソルもありません。レスポンスが完全な結果となるのは limitHit が false の場合のみです。ref を持たない空のリポジトリでは、一致は返されず limitHit は false になります。検索パラメータはリクエスト本文で送信されるため、POST を使用します。
パスパラメータ
ownerSlug 文字列 必須
repoName 文字列 必須
リクエスト本文
ref 文字列
HEAD) 。空の場合はリポジトリのデフォルトブランチが対象になります。query 文字列 必須
literal を指定してください。空白文字も意味を持ち、指定されたとおりに検索されます。literal が false の場合、大文字小文字を区別しないマッチングはパターンの先頭に (?i) を付けて表し (例: (?i)launch)、単語全体のマッチングはその前後を \b で囲んで表します (例: \blaunch\b)。パターンが空の場合は InvalidArgument (HTTP 400) を返します。UTF-8 の最大サイズ: 4096 バイト。literal boolean
query を正規表現ではなく完全一致のテキストとして検索します。caseInsensitive boolean
literal が true の場合にのみ適用されます。正規表現検索では無視されるため、代わりに query の先頭に (?i) を記述してください。wholeWord boolean
literal が true の場合にのみ適用されます。正規表現検索では無視されるため、代わりにパターンの前後に \b を記述してください。contextBefore integer
contextAfter integer
filterPath 文字列
includes 配列
/ を含まないパターンは任意の深さでマッチし、* は1つのパスセグメント内にマッチし、** はセグメントをまたいでマッチします。include が1つでも存在する場合、それらのいずれにもマッチしないパスは検索されません。エントリは最大20件。パターンごとの最大 UTF-8 サイズ: 4096 バイト。excludes 配列
includes と同じです。exclude は include より優先され、ディレクトリを除外するとその配下はすべて除外されます。エントリは最大20件。パターンごとの最大 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 が必要です。
ブランチやタグに加えて、Git リファレンスを取得 は pull/{pullNumber}/merge (refs/pull/{pullNumber}/merge に正規化されます) でプルリクエストのマージプレビューを読み取れます。これは、最後の更新時点でプルリクエストの現在の head をそのベースブランチの tip にマージしたコミットです。オリジンは、プルリクエストの作成時、head のプッシュ時、ターゲットの変更時、再オープン時に、対応する pull_request.* webhook イベントが発行される前に、一定の時間内で更新します。時間内に完了しなかった更新では以前の ref がそのまま残り、イベントは引き続き発行されます。ベースブランチが独自に進んだことを理由とする更新は行われず、マージにコンフリクトがある場合はこの ref を削除します。そのため、オープンなプルリクエストで 404 が返される場合は、コンフリクトがあるか、プレビューがまだ準備されていないことを意味します。プルリクエストの各バージョンでは、独自のテストマージも version.potentialMergeCommit で報告され、その state でこの2つのケースを区別できます。プルリクエストを参照してください。プルリクエストの mergeCommitSha は別のコミットであり、マージされた後にのみ設定されます。
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 のようなシンボリックリファレンス。短縮形は16進数で5文字以上必要で、コミットオブジェクトの中からのみ解決されます。一致するコミットが存在しない場合や、複数のコミットに一致する場合は失敗します。レスポンスフィールド
sha string
author object
author.name string
author.email string
author.date string
committer object
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": "[email protected]", "date": "2026-08-01T09:30:00Z" }, "committer": { "name": "Jane Doe", "email": "[email protected]", "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": "[email protected]" }, "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 が返されます。
pull/<number>/merge はプルリクエストのマージプレビューです。前回の更新時点におけるベースブランチの先端に、現在の head をマージしたコミットです。これは、プルリクエストがマージされた後にのみ設定されるプルリクエストの mergeCommitSha とは異なるコミットです。プルリクエストの version.potentialMergeCommit は、バージョンごとのテストマージを示します。あるバージョンが最新で、かつその state が prepared である間は、その sha がこのリファレンスの指すコミットになります。
Origin は、プルリクエストの作成時、head のプッシュ時、ターゲット変更時、再オープン時に、対応する pull_request.* webhook イベントが公開される前かつ制限された時間内にプレビューを更新します。更新が時間内に完了しない場合、以前のリファレンスが維持され、イベントは引き続き公開されます。ベースブランチが単に進んだだけでは Origin は更新しません。また、マージ競合がある場合はリファレンスを削除します。そのため、オープン中のプルリクエストでの 404 は、マージ競合があるか、プレビューがまだ準備されていないことを意味します。
パスパラメータ
ownerSlug 文字列 必須
repoName 文字列 必須
ref 文字列 必須
heads/<branch> または tags/<tag> です。先頭の refs/ は受け付けられ、正規化されます。シンボリック HEAD も受け付けられます (ref: "HEAD" として、先端のコミットとともに返されます)。プルリクエストのマージプレビューには pull/<number>/merge も使用できます。完全なリファレンス名との完全一致が必要です。レスポンスフィールド
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/refs/{ref}ブランチのリファレンスを削除します。レスポンス本文は空です。
削除できるのはブランチのリファレンスのみです。存在しないブランチを指定した場合は 404 が返されます。リポジトリのデフォルトブランチ、削除ルールで保護されたブランチ、およびコンテンツが別のホストからミラーリングされたリポジトリでは、FailedPrecondition (HTTP 400) が返されます。削除したブランチを head とするプルリクエストは、push による削除の場合と同様にクローズされます。削除の処理中に tip が移動したブランチは、FailedPrecondition (HTTP 400) または Aborted (HTTP 409 Conflict) で失敗します。新しい tip を削除するには再試行してください。
パスパラメータ
ownerSlug 文字列 必須
repoName 文字列 必須
ref 文字列 必須
refs/heads/<branch> または heads/<branch> の形式で指定します。レスポンスフィールド
成功したリクエストではレスポンス本文は返されません。
curl --request DELETE \ --url 'https://api.cursor.com/v1/origin/repos/OWNER_SLUG/REPO_NAME/git/refs/REF' \ --header 'Authorization: Bearer YOUR_ORIGIN_TOKEN'レスポンス:
204 No Content一致する Git リファレンスを一覧表示
/v1/origin/repos/{ownerSlug}/{repoName}/git/matching-refs名前が指定したプレフィックスで始まる 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' \ --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": "[email protected]", "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 string
next_page_token から取得した opaque cursor。最初のページでは空にします。後続のリクエストで pageSize を指定すると、そのページに適用されます。前のページサイズを維持する場合は省略してください。レスポンスフィールド
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": "[email protected]" }, "permission": "read" } ], "repository": { "id": "repo_01k2ja2000e0080000000000q4", "name": "rocket", "owner": { "slug": "acme", "id": "ns_01k2ja2000e0080000000000p3", "type": "team" } }, "nextPageToken": ""}リポジトリのグラントをアップサート
/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": "[email protected]" }, "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 string
next_page_token からの不透明なカーソル。最初のページでは空です。後続のリクエストで指定した pageSize はそのページに適用されます。省略すると前回のページサイズが維持されます。レスポンスフィールド
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": "[email protected]" }, "permission": "PERMISSION_WRITE" } ], "nextPageToken": ""}Namespace Grant の Upsert
/v1/origin/owners/{ownerSlug}/grantsユーザー、グループ、または所有チームのグループが所有者に対して直接保持する権限を設定し、それまでにそのプリンシパルに直接付与されていた権限を置き換えます。プリンシパルがすでに保持している付与を繰り返して行っても、変更はなく成功します。ユーザーが所有チームまたはその組織のアクティブなメンバーでない場合、グループがそのチームに所有されておらずその組織のアクティブなグループでもない場合、または書き込みにより所有者に管理者がいなくなる場合、リクエストは 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 オブジェクト
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": "[email protected]" }, "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 文字列 Required
リクエスト本文
user オブジェクト
user、group、teamGroup のうち、いずれか 1 つのみが存在します。user.id 文字列
user_。user.email 文字列
user.displayName 文字列
user.handle 文字列
@ プレフィックスなし) 。その profile が公開されている間のみ存在し、それ以外では省略されます。group オブジェクト
group.id 文字列
grp_。teamGroup オブジェクト
teamGroup.kind 文字列
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 文字列 必須
repoName 文字列 必須
クエリパラメータ
pageSize integer
pageToken 文字列
nextPageToken で返された不透明なカーソル。最初のページでは省略します。後続のリクエストで pageSize を指定すると、そのページに適用されます。前回のページサイズを引き継ぐ場合は省略してください。レスポンスフィールド
labels 配列
labels[].id 文字列
labels[].name 文字列
labels[].color 文字列
# を除く6桁の16進数カラーコード。labels[].description 文字列
nextPageToken 文字列
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"}プルリクエスト
クローズまたはマージされたプルリクエストには、closedAt、mergedAt、mergeCommitSha が追加で含まれる場合があります。head.ref と base.ref は不透明な Origin リファレンス文字列として扱ってください。短いブランチ名の場合もあれば、完全修飾された refs/heads/… 値の場合もあります。
version は、そのプルリクエストの最新の番号付きリビジョンです。head がプッシュされたとき、プルリクエストが別の base に再ターゲットされたとき、およびクローズ中に head が移動したプルリクエストが再オープンされたときに、Origin は新しいバージョンを記録し、それぞれが独自の headSha、baseSha、diff 統計を持ちます。バージョンを記録する再オープンでは、プッシュ時と同じイベントである pull_request.head_ref.pushed が送信されます。base ブランチが単独で進んでも何も記録されないため、version.baseSha (およびそれをミラーする base.sha) は、そのバージョンが記録された時点で解決された base の tip であり、次のバージョンが記録されるまで、ブランチの現在の tip より遅れることがあります。ブランチの現在の tip は Get Git Ref で取得してください。
mergeCommitSha は、マージが base ブランチに書き込んだコミットです。マージされると設定され、それ以前は未設定です。マージ前のプレビューは pull/{pullNumber}/merge リファレンスであり、別のコミットです。Git data を参照してください。
version.potentialMergeCommit は、そのバージョンに対する Origin のテストマージの状態を示します。状態は prepared、merge_conflict、unknown のいずれかで、prepared の場合はマージコミットの sha と、その作成に使用された baseSha も示します。対象はそのバージョンだけなので、プルリクエストがマージされた後も報告されます。pull_request.* のウェブフックペイロードには、イベント時点の値が含まれます。イベントがテストマージの準備を待つ時間には上限があるため、後から プルリクエストを取得 すると prepared と表示される場合でも、イベントでは unknown となることがあります。プルリクエストを再取得するか、次のイベントを待ってください。
確認の verdict は approve、request_changes、comment のいずれかです。未送信の下書き確認には submittedAt はありません。判定が有効な間、dismissal はありません。却下された確認も確認一覧に表示され続けます。新しい判定によって自動的に置き換えられた確認には、サーバー生成のメッセージが付与されます。
コメントには、グループ化用の thread リファレンスが含まれます。返信時のコメント作成リクエストでは、引き続きスカラーの threadId コマンドパラメータを受け付けます。プルリクエスト 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 は、マージ済みのものも含め、オープンでなくなったすべてのプルリクエストを対象とします。merged はマージ済みのプルリクエストだけに絞り込みます。その他の値を指定すると InvalidArgument (HTTP 400) が返されます。pageSize 整数
pageToken 文字列
nextPageToken による不透明なカーソル。最初のページでは省略してください。後続のリクエストに指定した pageSize はそのページに適用されます。省略した場合は前のページサイズが維持されます。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) を返します。headSha 文字列
head.sha を比較してください。他のフィルターは引き続き適用され、state のデフォルトは open です。マージ済みおよびクローズ済みのプルリクエストを取得するには state=all を指定してください。形式が不正な SHA、省略された SHA、未知の SHA は一致しません。stackId 文字列
pullRequests[].stack.id で返されるスタック ID を指定します。そのスタックのメンバーのみを、スタック順ではなく要求されたソート順で返すため、各メンバーの stack.parentPullRequest からスタックを再構築してください。state のデフォルトは引き続き open で、マージ済みのメンバーは除外されます。スタック全体を取得するには state=all を指定してください。このリポジトリ内に存在しないスタックを示す、形式が正しい ID を指定した場合は空のリストを返し、それ以外の値を指定した場合は 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
pull/<number>/merge リファレンスから読み取れます。pullRequests[].additions 整数
pullRequests[].deletions integer
pullRequests[].changedFiles integer
pullRequests[].labels 配列
pullRequests[].labels[].id string
pullRequests[].labels[].name string
pullRequests[].labels[].color string
# を付けない6桁の16進数カラーコード。pullRequests[].labels[].description 文字列
pullRequests[].stack オブジェクト
pullRequests[].stack.id string
stackId として プルリクエストの一覧 に渡してください。pullRequests[].stack.parentPullRequest オブジェクト
pullRequests[].stack.parentPullRequest.id 文字列
pullRequests[].stack.parentPullRequest.number 文字列
pullRequests[].stack.parentPullRequest.repository オブジェクト
repository と同じ id、name、owner フィールドを持ちます。スタックがリポジトリをまたぐことはないため、これは常にそのプルリクエスト自身のリポジトリです。pullRequests[].version オブジェクト
pullRequests[].version.number 文字列
pullRequests[].version.headSha string
pullRequests[].version.baseSha string
pullRequests[].version.createdAt string
pullRequests[].version.potentialMergeCommit オブジェクト
headSha をベースブランチの先端にマージしたコミット) と、その準備の進捗状況。すべてのバージョンに含まれます。このバージョンのみを対象とし、プルリクエストのマージ後も読み取れます。mergeCommitSha とは別のコミットです。スタックされたプルリクエストではベースブランチが親のブランチになるため、テストマージの対象は、その上に積まれたこのプルリクエストの変更のみです。pullRequests[].version.potentialMergeCommit.state 文字列
unknown、prepared、merge_conflict。unknown はテストマージが未準備であることを示します。バージョンが準備待ちか、準備がタイムアウトまたは失敗した状態です。新しいバージョンはすべて unknown から始まるため、別のバージョンのコミットを引き継ぐことはありません。prepared はテストマージが存在し、sha と baseSha がその内容を表すことを示します。merge_conflict は headSha をベースブランチの先端にマージした際にコンフリクトが発生し、テストマージが存在しないことを示します。これは プルリクエストのマージ可否を取得 が merge_conflict ブロッカーとして報告する状態で、プルリクエストを再オープンするとバージョンが再度準備されます。認識できない値は unknown として扱ってください。pullRequests[].version.potentialMergeCommit.sha 文字列
baseSha が第1の親で、このバージョンの headSha が第2の親です。state が prepared の場合にのみ存在します。このバージョンが最新である間、pull/{pullNumber}/merge ref はこのコミットを指します。その後も コミットを取得 を通じて SHA で読み取れますが、Git 経由で SHA を指定してフェッチすることはできません。pullRequests[].version.potentialMergeCommit.baseSha 文字列
state が prepared の場合のみ存在します。pullRequests[].version.baseSha より新しい場合がありますが、ベースブランチが進んだだけではオリジンはこの値を更新しません。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": "add-telemetry-schema", "sha": "3b1f9c2d8a7e6f5049c8b7a6d5e4f3a2b1c0d9e8" }, "author": { "user": { "id": "user_01k2ja2000e0080000000000c3", "email": "[email protected]" } }, "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" } ], "stack": { "id": "stk_01k2ja2000e0080000000000s1", "parentPullRequest": { "id": "pr_01k2ja2000e0080000000000d3", "number": "16", "repository": { "id": "repo_01k2ja2000e0080000000000q4", "name": "rocket", "owner": { "slug": "acme", "id": "ns_01k2ja2000e0080000000000p3", "type": "team" } } } }, "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
pull/<number>/merge リファレンスを参照してください。additions integer
deletions 整数
changedFiles 整数
labels 配列
labels[].id 文字列
labels[].name string
labels[].color string
# を含まない6桁の16進カラーコード。labels[].description string
stack オブジェクト
stack.id string
stackId として プルリクエストを一覧表示 に渡してください。stack.parentPullRequest オブジェクト
stack.parentPullRequest.id string
stack.parentPullRequest.number string
stack.parentPullRequest.repository オブジェクト
repository と同じ id、name、owner フィールドを持ちます。スタックはリポジトリをまたがないため、常にプルリクエスト自身のリポジトリです。version object
version.number 文字列
version.headSha string
version.baseSha string
version.createdAt 文字列
version.potentialMergeCommit オブジェクト
headSha をベースブランチの先端にマージしたコミット) と、その準備の進行状況。すべてのバージョンに含まれます。このバージョンのみを表し、プルリクエストのマージ後も参照できます。mergeCommitSha とは別のコミットです。スタック内のプルリクエストでは、ベースブランチは親のブランチです。そのため、テストマージの対象は、親のブランチに重ねたこのプルリクエストの変更のみです。version.potentialMergeCommit.state string
unknown、prepared、merge_conflict。unknown はテストマージがまだ準備されていないことを示します。このバージョンが準備待ちであるか、準備がタイムアウトまたは失敗しています。新しいバージョンは必ず unknown から始まるため、別のバージョンのコミットを引き継ぐことはありません。prepared はテストマージが存在し、sha と baseSha がその内容を示すことを意味します。merge_conflict は、headSha をベースブランチの先端にマージする際に競合が発生し、テストマージが存在しないことを意味します。これは プルリクエストのマージ可否を取得 が merge_conflict ブロッカーとして報告する状態です。プルリクエストを再オープンすると、このバージョンの準備が再度行われます。認識できない値は unknown として扱ってください。version.potentialMergeCommit.sha string
baseSha、2つ目の親はこのバージョンの headSha です。state が prepared の場合にのみ存在します。このバージョンが最新である間は、pull/{pullNumber}/merge ref がこのコミットを指します。それ以降も コミットを取得 で SHA を指定して読み取れますが、Git 経由で SHA を指定してフェッチすることはできません。version.potentialMergeCommit.baseSha string
state が prepared の場合にのみ存在します。version.baseSha より新しい場合がありますが、ベースブランチが進んだだけでは、Origin はこの値を更新しません。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": "add-telemetry-schema", "sha": "3b1f9c2d8a7e6f5049c8b7a6d5e4f3a2b1c0d9e8" }, "author": { "user": { "id": "user_01k2ja2000e0080000000000c3", "email": "[email protected]" } }, "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" } ], "stack": { "id": "stk_01k2ja2000e0080000000000s1", "parentPullRequest": { "id": "pr_01k2ja2000e0080000000000d3", "number": "16", "repository": { "id": "repo_01k2ja2000e0080000000000q4", "name": "rocket", "owner": { "slug": "acme", "id": "ns_01k2ja2000e0080000000000p3", "type": "team" } } } }, "version": { "number": "3", "headSha": "9a41f0c3d2b8e7f6a5c4d3e2f1b0a9c8d7e6f5a4", "baseSha": "3b1f9c2d8a7e6f5049c8b7a6d5e4f3a2b1c0d9e8", "createdAt": "2026-08-01T09:30:00Z", "potentialMergeCommit": { "state": "prepared", "sha": "c7b6a5948372615049f8e7d6c5b4a3928170605f", "baseSha": "5e2d1c0b9a8f7e6d5c4b3a2918070605f4e3d2c1" } }}プルリクエストを作成
/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
parentPullRequest オブジェクト
clear を指定すると InvalidArgument (HTTP 400) が返されます。parentPullRequest.number string
parentPullRequest.id string
id で返される値) 。レスポンスフィールド
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
pull/<number>/merge の ref から読み取ります。additions integer
deletions integer
changedFiles 整数
labels array
labels[].id string
labels[].name string
labels[].color string
#のない6桁の16進数カラーコード。labels[].description string
stack オブジェクト
stack.id string
stackId として Pull Requests を一覧表示 に渡します。stack.parentPullRequest オブジェクト
stack.parentPullRequest.id 文字列
stack.parentPullRequest.number string
stack.parentPullRequest.repository オブジェクト
repository と同じ id、name、owner フィールドを持ちます。スタックはリポジトリをまたがないため、常にプルリクエスト自身のリポジトリです。version オブジェクト
version.number string
version.headSha string
version.baseSha string
version.createdAt 文字列
version.potentialMergeCommit オブジェクト
headShaをベースブランチの先端にマージするコミット) と、その準備がどこまで進んだかを示します。すべてのバージョンに存在します。このバージョンのみを表し、プルリクエストのマージ後も参照できます。mergeCommitShaとは別のコミットです。スタックされたプルリクエストでは、ベースブランチは親のブランチです。そのため、テストマージの対象は、そのブランチに加えられたこのプルリクエストの変更のみです。version.potentialMergeCommit.state string
unknown、prepared、merge_conflict。unknown はテストマージがまだ準備されていないことを示します。バージョンは準備待ちの状態か、準備がタイムアウトしたか失敗しています。新しいバージョンは必ず unknown から始まるため、別のバージョンのコミットを引き継ぐことはありません。prepared はテストマージが存在し、sha と baseSha がそれを表すことを示します。merge_conflict は headSha をベースブランチの先端にマージする際に競合が発生し、テストマージが存在しないことを示します。これは プルリクエストのマージ可否を取得 が merge_conflict ブロッカーとして報告する状態であり、プルリクエストを再オープンすると、このバージョンの準備が再度行われます。認識できない値は unknown として扱ってください。version.potentialMergeCommit.sha string
baseSha、第2の親はこのバージョンの headSha です。state が prepared の場合にのみ存在します。このバージョンが最新版である間、pull/{pullNumber}/merge の ref はこのコミットを指します。その後も コミットを取得 から SHA を指定して読み取れますが、Git 経由で SHA を指定してフェッチすることはできません。version.potentialMergeCommit.baseSha string
state が prepared の場合にのみ存在します。version.baseSha より新しい場合がありますが、ベースブランチが進んだだけではオリジンはこの値を更新しません。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": "[email protected]" } }, "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の前に実行されるため、クローズされたプルリクエストの対象を変更できます。スタックの親はbaseの後に実行されるため、明示的に指定した親は、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" は、既存のドラフトを公開する場合も含め、レビュー可能な状態にします。クローズ中に head が移動したプルリクエストを再オープンすると、新しい version が記録され、pull_request.head_ref.pushed が送信されます。マージ済みの状態は書き込み不可です。MergePullRequest を使用してください。draft boolean
true はプルリクエストをドラフトとしてマークし、false はレビュー可能な状態としてマークします (現在クローズされている場合は再オープンし、その際に新しい version が記録されることがあります) 。state が "closed" の場合は無視されます。base string
InvalidArgument (HTTP 400) が返されます。parentPullRequest オブジェクト
number または id を指定すると、このプルリクエストはその親にスタックされ、現在の親があれば置き換えられます。clear を指定すると親が削除されます。スタックを変更しない場合は、このフィールドを省略してください。セレクターが空の場合、clear: false を指定した場合、または複数のメンバーを指定した場合は、InvalidArgument (HTTP 400) が返されます。これは関連付けのみであり、ブランチは書き換えられません。また、base は同時に指定した場合にのみ変更されます。Origin は base の後にこの変更を適用するため、明示的に指定した親が、base の変更から導出される親より優先されます。parentPullRequest.number string
parentPullRequest.id 文字列
id で返される親プルリクエスト ID。parentPullRequest.clear boolean
true のみ許可されます。レスポンスフィールド
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
pull/<number>/merge リファレンスを Git リファレンスを取得 で参照してください。additions integer
deletions integer
changedFiles 整数
labels 配列
labels[].id string
labels[].name string
labels[].color 文字列
# のない6桁の16進カラーコード。labels[].description string
stack オブジェクト
stack.id 文字列
stackId として List Pull Requests に渡します。stack.parentPullRequest オブジェクト
stack.parentPullRequest.id 文字列
stack.parentPullRequest.number 文字列
stack.parentPullRequest.repository オブジェクト
repository と同じ id、name、owner フィールドを持ちます。スタックはリポジトリをまたがないため、これは常にプルリクエスト自身のリポジトリです。version オブジェクト
version.number 文字列
version.headSha string
version.baseSha string
version.createdAt 文字列
version.potentialMergeCommit オブジェクト
headSha をベースブランチの先端にマージしたコミット) と、その準備がどこまで進んだかを示します。すべてのバージョンに含まれます。このバージョンのみを表し、プルリクエストのマージ後も参照できます。mergeCommitSha とは別のコミットです。スタックされたプルリクエストでは、ベースブランチは親のブランチです。そのため、テストマージの対象は、親のブランチに対するこのプルリクエストの変更のみです。version.potentialMergeCommit.state 文字列
unknown、prepared、merge_conflict。unknown はテストマージが準備されていないことを示します。バージョンの準備待ちであるか、準備がタイムアウトまたは失敗しています。新しいバージョンは必ず unknown から始まるため、別のバージョンのコミットを引き継ぐことはありません。prepared はテストマージが存在し、sha と baseSha がその内容を示すことを意味します。merge_conflict は headSha をベースブランチの先端にマージした際に競合が発生し、テストマージが存在しないことを示します。これは プルリクエストのマージ可能性を取得 が merge_conflict ブロッカーとして報告する状態です。プルリクエストを再オープンすると、そのバージョンが再び準備されます。認識できない値は unknown として扱ってください。version.potentialMergeCommit.sha 文字列
baseSha、第2の親はこのバージョンの headSha です。state が prepared の場合にのみ存在します。このバージョンが最新である間、pull/{pullNumber}/merge ref はこのコミットを指します。その後も コミットを取得 でSHAを指定して参照できますが、Git経由でSHAを指定してフェッチすることはできません。version.potentialMergeCommit.baseSha 文字列
state が prepared の場合にのみ表示されます。version.baseSha より新しい場合がありますが、ベースブランチが進んだだけではOriginはこの値を更新しません。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": "[email protected]" } }, "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、差分アンカー、解決状態) が含まれます。追加のリクエストを行わずに、フラットなレスポンスを thread.id ごとにグループ化できます。
ページトークンには発行時のフィルターが埋め込まれているため、異なるフィルターで再送されたトークンは拒否されます。フィルターを変更した場合は、ページネーションを最初からやり直してください。
パスパラメータ
ownerSlug string 必須
repoName string 必須
pullNumber string 必須
クエリパラメータ
pageSize 整数
pageToken string
nextPageToken からの不透明なカーソル。最初のページでは省略してください。後続のリクエストで pageSize を指定すると、そのページに適用されます。省略した場合は、前のページサイズが維持されます。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.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" }, "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": "[email protected]" } }, "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.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" }, "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": "[email protected]" } }, "createdAt": "2026-08-01T09:30:00Z", "updatedAt": "2026-08-02T14:45:00Z"}プルリクエストコメントの削除
/v1/origin/repos/{ownerSlug}/{repoName}/pulls/comments/{commentId}安定した Origin ID を指定してプルリクエストコメントを削除します。レスポンス本文は空です。
コメントの作成者は常に削除できます。それ以外の呼び出し元は、repository:contents:write で付与されるリポジトリへの書き込み権限を持っている必要があり、持っていない場合は PermissionDenied (HTTP 403) を受け取ります。スレッドの最後のコメントを削除すると、スレッドも削除されます。スレッドの開始コメントを含むその他のコメントを削除した場合、スレッドと残りのコメントはそのまま残ります。スレッドが解決済みかどうかは削除の条件ではありません。コメントへのリアクションと編集履歴もコメントとともに削除されます。
不明な ID、すでに削除されたコメント、別のリポジトリ内のコメントはいずれも 404 を返します。不正な形式の ID は InvalidArgument (HTTP 400) を返します。
パスパラメータ
ownerSlug string 必須
repoName string 必須
commentId string 必須
レスポンスフィールド
成功したリクエストではレスポンス本文は返されません。
curl --request DELETE \ --url 'https://api.cursor.com/v1/origin/repos/OWNER_SLUG/REPO_NAME/pulls/comments/COMMENT_ID' \ --header 'Authorization: Bearer YOUR_ORIGIN_TOKEN'レスポンス:
204 No Contentプルリクエストコメントを作成
/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.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" }, "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": "[email protected]" } }, "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.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" }, "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": "[email protected]" } }, "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
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" }, "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 件です。ページトークンはプルリクエストのバージョンとコミットカーソルを固定します。現在の head または base と一致しなくなったトークンは 400 を返します。
パスパラメータ
ownerSlug string 必須
repoName string 必須
pullNumber string 必須
クエリパラメータ
pageSize integer
pageToken string
next_page_tokenから取得する不透明なカーソル。最初のページでは空です。トークンはリポジトリ、プルリクエストのバージョン、およびコミットオフセットに紐づいています。後続のリクエストで指定したpageSizeはそのページに適用されます。前回のページサイズを維持する場合は省略してください。レスポンスフィールド
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": "[email protected]", "date": "2026-08-01T09:30:00Z" }, "committer": { "name": "Jane Doe", "email": "[email protected]", "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ファイルに制限されます。ページトークンはプルリクエストのバージョンとファイルカーソルを固定します。現在の head または base と一致しないトークンは 400 を返します。
パスパラメータ
ownerSlug string 必須
repoName string 必須
pullNumber string 必須
クエリパラメータ
pageSize integer
pageToken string
next_page_tokenに由来する不透明なカーソル。最初のページでは空です。このトークンはリポジトリ、プルリクエストのバージョン、および変更ファイルカーソルに紐づきます。後続のリクエストで指定した pageSize はそのページに適用されます。省略すると前回のページサイズが維持されます。レスポンスフィールド
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 リポジトリでのみサポートされ、ミラーリポジトリは拒否されます。
マージされるのは、プルリクエストの最新の version の head コミットです。Origin がまだ新しいバージョンとして記録していないプッシュが反映された場合など、ヘッドブランチがそのコミットより先に進んでいる場合は、stale な expectedHeadSha を指定したときと同じく Aborted (HTTP 409 Conflict) が返され、何もマージされません。プルリクエストを取得 の version.headSha に新しい head が反映されてから再試行してください。
パスパラメータ
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
pull/<number>/merge ref 経由で取得します。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
pull/<number>/merge ref 経由で取得します。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.stack オブジェクト
pullRequest.stack.id string
stackId として List Pull Requests に渡してください。pullRequest.stack.parentPullRequest オブジェクト
pullRequest.stack.parentPullRequest.id string
pullRequest.stack.parentPullRequest.number 文字列
pullRequest.stack.parentPullRequest.repository オブジェクト
repository と同じ id、name、owner フィールドを持ちます。スタックはリポジトリをまたがないため、これは常にプルリクエスト自身のリポジトリです。pullRequest.version オブジェクト
pullRequest.version.number 文字列
pullRequest.version.headSha string
pullRequest.version.baseSha string
pullRequest.version.createdAt 文字列
pullRequest.version.potentialMergeCommit オブジェクト
headShaをベースブランチの先端にマージするコミット) と、その準備がどこまで進んだかを示します。すべてのバージョンに存在します。このバージョンのみを表し、プルリクエストのマージ後も参照できます。mergeCommitShaとは別のコミットです。スタックされたプルリクエストでは、ベースブランチは親のブランチとなるため、テストマージの対象は、そのブランチに対するこのプルリクエストの変更のみです。pullRequest.version.potentialMergeCommit.state string
unknown、prepared、merge_conflict。unknown はテストマージがまだ準備されていない状態です。準備待ち、または準備がタイムアウトもしくは失敗したことを示します。新しいバージョンは必ず unknown から始まるため、別のバージョンのコミットを引き継ぐことはありません。prepared はテストマージが存在し、sha と baseSha がその内容を示す状態です。merge_conflict は headSha をベースブランチの先端にマージする際に競合が発生し、テストマージが存在しない状態です。Get Pull Request Mergeability では merge_conflict ブロッカーとして報告され、プルリクエストを再オープンすると、このバージョンの準備が再度行われます。認識できない値は unknown として扱ってください。pullRequest.version.potentialMergeCommit.sha string
baseSha、第2の親はこのバージョンの headSha です。state が prepared の場合にのみ存在します。このバージョンが最新の間は、pull/{pullNumber}/merge リファレンスがこのコミットを指します。その後も Get Commit でSHAを指定して取得できますが、Git経由ではSHAを指定してフェッチできません。pullRequest.version.potentialMergeCommit.baseSha string
state が prepared の場合にのみ存在します。pullRequest.version.baseSha より新しい場合がありますが、ベースブランチが進んだだけではOriginはこの値を更新しません。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": "[email protected]" } }, "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": "[email protected]" } ], "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": "[email protected]" } ], "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からの不透明なカーソル。最初のページでは省略してください。後続のリクエストでpageSizeを指定すると、そのページに適用されます。省略した場合は前のページサイズが維持されます。レスポンスフィールド
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[].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": "[email protected]" } }, "verdict": "approve", "body": "Approving. The telemetry schema matches the spec.", "submittedAt": "2026-08-02T15:00:00Z", "pullRequestVersion": { "number": "3", "headSha": "9a41f0c3d2b8e7f6a5c4d3e2f1b0a9c8d7e6f5a4", "baseSha": "3b1f9c2d8a7e6f5049c8b7a6d5e4f3a2b1c0d9e8" } } ], "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
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": "[email protected]" } }, "verdict": "approve", "body": "Approving. The telemetry schema matches the spec.", "submittedAt": "2026-08-02T15:00:00Z", "pullRequestVersion": { "number": "3", "headSha": "9a41f0c3d2b8e7f6a5c4d3e2f1b0a9c8d7e6f5a4", "baseSha": "3b1f9c2d8a7e6f5049c8b7a6d5e4f3a2b1c0d9e8" }}プルリクエストレビューを更新
/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
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": "[email protected]" } }, "verdict": "approve", "body": "Approving. The telemetry schema matches the spec.", "submittedAt": "2026-08-02T15:00:00Z", "pullRequestVersion": { "number": "3", "headSha": "9a41f0c3d2b8e7f6a5c4d3e2f1b0a9c8d7e6f5a4", "baseSha": "3b1f9c2d8a7e6f5049c8b7a6d5e4f3a2b1c0d9e8" }}プルリクエストのレビューを却下
/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
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": "[email protected]" } }, "verdict": "approve", "body": "Approving. The telemetry schema matches the spec.", "submittedAt": "2026-08-02T15:00:00Z", "pullRequestVersion": { "number": "3", "headSha": "9a41f0c3d2b8e7f6a5c4d3e2f1b0a9c8d7e6f5a4", "baseSha": "3b1f9c2d8a7e6f5049c8b7a6d5e4f3a2b1c0d9e8" }, "dismissal": { "dismissedBy": { "user": { "id": "user_01k2ja2000e0080000000000c3", "email": "[email protected]" } }, "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}安定した オリジン ID を指定してリポジトリ ルールセットを削除します。レスポンス本文は空です。
存在しないリポジトリと存在しないルールセットはいずれも 404 を返しますが、メッセージで区別されます。別のリポジトリに保存されているルールセットは、存在しないルールセットとして扱われます。空の rulesetId を指定すると InvalidArgument (HTTP 400) が返されます。
パスパラメータ
ownerSlug 文字列 必須
repoName 文字列 必須
rulesetId 文字列 必須
レスポンスフィールド
成功したリクエストでは、レスポンス本文は返されません。
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 ContentSSH 認証局
SSH 認証局とは、所有者が信頼する公開鍵です。この認証局が署名したユーザー証明書によって、所有者のリポジトリに対する SSH 経由の git 操作が認証されます。そのため、所有チームのメンバーは SSH キーを登録しなくても SSH 経由で git を使用できます。これらのエンドポイントでは、所有者が信頼する認証局の一覧取得、追加、削除に加え、所有者が証明書を必須とするかどうかを設定できます。認証局はチーム所有の所有者に属します。追加時の重複チェックはオリジン全体ではなく所有者単位で行われるため、複数の所有者が同じ認証局を信頼できます。
一覧取得では、インストールトークンとユーザートークンを使用できます。認証局の追加・削除と必須要件の設定には、namespace:settings:write を持つ Cherri Code ユーザーの認証情報が必要です。アプリトークンとインストールトークンは使用できません。
SSH 認証局の一覧を取得
/v1/origin/owners/{ownerSlug}/ssh-certificate-authoritiesSSH 経由の git 操作で所有者が信頼している SSH 認証局を新しい順に一覧表示し、所有者が証明書を必須としているかどうかもあわせて返します。レスポンスはページネーション非対応で、すべての認証局が一度に返されます。
パスパラメータ
ownerSlug string 必須
レスポンスフィールド
certificateAuthorities array
certificateAuthorities[].id string
certificateAuthorityId として指定します。certificateAuthorities[].name string
certificateAuthorities[].keyType string
ssh-ed25519) 。certificateAuthorities[].fingerprint string
ssh-keygen -l が出力するのと同じ SHA256:<base64> 形式です。certificateAuthorities[].publicKey string
<key_type> <base64> 形式です。certificateAuthorities[].createdAt string
requireCertificates boolean
curl --request GET \ --url 'https://api.cursor.com/v1/origin/owners/OWNER_SLUG/ssh-certificate-authorities' \ --header 'Authorization: Bearer YOUR_ORIGIN_TOKEN'レスポンスの構造:
{ "certificateAuthorities": [ { "id": "nsca_01k2ja2000e0080000000000s5", "name": "Acme production CA", "keyType": "ssh-ed25519", "fingerprint": "SHA256:D5vlIclvaSZlwq4gmckavfLE7n7F542Eyhk/PvXkRq0", "publicKey": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPwoQNzBuiWhDF4EKwRyt8h48XRY7Bc4yWbQ9s3Tnj7Q", "createdAt": "2026-08-02T14:45:00Z" } ], "requireCertificates": true}SSH 認証局を追加する
/v1/origin/owners/{ownerSlug}/ssh-certificate-authorities所有者が信頼する SSH 認証局を追加し、追加した認証局を返します。追加後、所有者であるチームのメンバーは、SSH キーを登録しなくても、この認証局が署名したユーザー証明書を使って、所有者のリポジトリに SSH 経由で git アクセスできます。
publicKey には、認証局自身の公開鍵を OpenSSH の authorized_keys 形式の 1 行で指定します。証明書、サポートされていないキータイプ、または 2048 ビット未満の RSA キーを指定すると InvalidArgument (HTTP 400) が返されます。所有者がすでに登録しているキーを指定すると AlreadyExists (HTTP 409 Conflict) が返されます。この重複チェックは所有者単位で行われるため、複数の所有者が同じ認証局を信頼できます。認証局を追加できるのはチーム所有の所有者のみです。それ以外の所有者では FailedPrecondition (HTTP 400) が返されます。
呼び出し元は、namespace:settings:write を持つ Cherri Code ユーザーの認証情報である必要があります。アプリトークンおよびインストールトークンは使用できません。
パスパラメータ
ownerSlug string 必須
リクエスト本文
publicKey string 必須
authorized_keys 形式の 1 行 (<key_type> <base64> [comment]) で表した認証局の公開鍵。使用できるキータイプは ssh-ed25519、ecdsa-sha2-nistp256、ecdsa-sha2-nistp384、ecdsa-sha2-nistp521、およびモジュラスが 2048 ビット以上の ssh-rsa です。証明書は使用できません。name string 必須
レスポンスフィールド
id string
certificateAuthorityId として指定します。name string
keyType string
ssh-ed25519) 。fingerprint string
ssh-keygen -l が出力するのと同じ SHA256:<base64> 形式です。publicKey string
<key_type> <base64> 形式です。createdAt string
curl --request POST \ --url 'https://api.cursor.com/v1/origin/owners/OWNER_SLUG/ssh-certificate-authorities' \ --header 'Authorization: Bearer YOUR_ORIGIN_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "publicKey": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPwoQNzBuiWhDF4EKwRyt8h48XRY7Bc4yWbQ9s3Tnj7Q acme-ssh-ca", "name": "Acme production CA"}'レスポンスの構造:
{ "id": "nsca_01k2ja2000e0080000000000s5", "name": "Acme production CA", "keyType": "ssh-ed25519", "fingerprint": "SHA256:D5vlIclvaSZlwq4gmckavfLE7n7F542Eyhk/PvXkRq0", "publicKey": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPwoQNzBuiWhDF4EKwRyt8h48XRY7Bc4yWbQ9s3Tnj7Q", "createdAt": "2026-08-02T14:45:00Z"}SSH 認証局を削除
/v1/origin/owners/{ownerSlug}/ssh-certificate-authorities/{certificateAuthorityId}所有者から SSH 認証局を削除します。この認証局が署名した証明書はすべて無効になります。所有者が証明書を必須にしている場合、最後の認証局は削除できず、リクエストは FailedPrecondition (HTTP 400) を返します。レスポンス本文は空です。
呼び出し元は、namespace:settings:write を持つ Cherri Code ユーザーの認証情報である必要があります。App トークンとインストールトークンは使用できません。
パスパラメータ
ownerSlug 文字列 必須
certificateAuthorityId 文字列 必須
id。レスポンスフィールド
リクエストが成功した場合、レスポンス本文は返されません。
curl --request DELETE \ --url 'https://api.cursor.com/v1/origin/owners/OWNER_SLUG/ssh-certificate-authorities/CERTIFICATE_AUTHORITY_ID' \ --header 'Authorization: Bearer YOUR_ORIGIN_TOKEN'レスポンス:
204 No ContentSSH 証明書の必須設定を指定
/v1/origin/owners/{ownerSlug}/ssh-certificate-authorities:setRequirement所有者に SSH 証明書を必須とするかどうかを設定し、所有者の設定を返します。必須に設定されている間、所有者のリポジトリへの SSH 経由の git アクセスでは、所有者の認証局が発行した証明書のみが受け付けられます。ユーザーが登録した SSH キーは拒否され、HTTPS 経由のユーザー API キーも拒否されます。証明書を必須にするには、認証局が 1 つ以上登録されている必要があります。登録されていない場合、リクエストは FailedPrecondition (HTTP 400) を返します。現在と同じ値を設定した場合は、何も変更されずに成功します。
呼び出し元は、namespace:settings:write を持つ Cherri Code ユーザーの認証情報である必要があります。アプリトークンおよびインストールトークンは受け付けられません。
パスパラメータ
ownerSlug 文字列 必須
リクエスト本文
requireCertificates boolean 必須
レスポンスフィールド
requireCertificates boolean
curl --request POST \ --url 'https://api.cursor.com/v1/origin/owners/OWNER_SLUG/ssh-certificate-authorities:setRequirement' \ --header 'Authorization: Bearer YOUR_ORIGIN_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "requireCertificates": true}'レスポンスの構造:
{ "requireCertificates": true}Webhooks
Origin は、署名付き HTTP POST リクエストを、アプリに登録された HTTPS Webhook URL に content-type: application/json として送信します。
配信は少なくとも 1 回行われます。webhook-id を使用して再試行を重複排除し、リクエストを永続的に受け付け、速やかに 2xx を返し、イベントは非同期で処理してください。
Origin は受信側のレスポンスヘッダーを 10 秒間待機します。この制限時間には DNS 解決、接続、TLS ハンドシェイク、レスポンスまでの時間が含まれ、すべての試行に適用されます。この制限を超えた試行はトランスポートエラーとして記録され、再試行 のスケジュールに従って再試行されます。失敗が繰り返されると、配信が自動的に無効化されることがあります。
実際のイベントが到達する前に受信側が動作することを確認するには、Ping Webhook を呼び出してください。
Origin はミラーリポジトリのイベントを配信し、インストールイベントのペイロードでは、それらのリポジトリが選択されたリポジトリ配列に一覧表示されます。配信によってインストールが呼び出せる範囲が広がることはありません。ミラーリポジトリ を参照してください。
ヘッダー
| ヘッダー | 説明 |
|---|---|
content-type | application/json |
user-agent | Cherri Code-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署名を、有効なオリジン JWKSキーで確認します。現在時刻から5分を超えてずれたタイムスタンプは拒否します。
Standard Webhooks のライブラリでは オリジン の配信を確認できません。ヘッダー名は Standard Webhooks に準拠していますが、オリジン は署名対象のコンテンツそのものではなく SHA-256 ダイジェストに署名し、Standard Webhooks の仕様では定義されていない v1ed バージョンタグを使用します。次の例のように、上記の手順で確認してください。
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 は基となるドメインイベントを識別します。
Retries
オリジン は、トランスポートエラー、429、5xx レスポンスに対して、合計最大 7 回まで再試行します。その他の 4xx レスポンスは再試行されません。
最初の試行は元の送信です。6 回の再試行は、順に 5 秒、30 秒、1 分、2 分、4 分、8 分待機します。
すべての試行に失敗した受信側では、約 16 分間に 7 回の POST を受け取ることになります。webhook-id はすべての試行で同じ値のままです。これを使って重複排除してください。
自動無効化
所有者は、アプリの設定からアプリの Webhook 配信を一時停止できます。また、受信側が 72 時間のウィンドウ内で少なくとも 20 回の配信ラウンドに失敗し、そのウィンドウ内で成功した配信が 1 件もなく、かつ失敗が複数のインストーラー名前空間にまたがる場合、オリジンは自動的に無効化します。
配信は所有者が再開するまで停止します。Batch Redeliver Webhook Deliveries は FailedPrecondition (HTTP 400) を返し、何もキューに追加しません。API には一時停止状態を示すフィールドがないため、この FailedPrecondition をその判断材料として扱ってください。
Update App でアプリの webhookUrl を消去する操作は、これとは別のアクションです。保留中の配信は取り消され、再度 URL を設定しても復元されません。
復旧
アプリ JWT を使用して GET /app/webhook/deliveries をクエリします。配信ステータス、イベントタイプ、インストール、時間範囲、ページトークンでフィルタリングできます。delivered=false を指定すると、受信側が 2xx で一度も確認応答していないすべての配信を取得できます。配信は 7 日間一覧表示できるため、その期間内に復旧してください。
POST /app/webhook/deliveries:batchRedeliver を使用すると、最大 100 件の配信 ID の再配信をキューに登録できます。この操作では ID の重複を排除し、各配信の結果を返します。一時停止中または自動的に無効化されたアプリでは、この呼び出しは FailedPrecondition (HTTP 400) で拒否され、何もキューに登録されません。
Webhooks リファレンス
オリジン が配信するすべてのイベントと、各イベントのペイロードをフィールドごとに解説します。サブスクリプションの仕組み、ヘッダー、署名の検証、エンベロープ、再試行のスケジュール、自動無効化については、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 | プルリクエストがマージされずにクローズされたとき。プッシュによりヘッドとベースに共通の履歴がなくなり、オリジンがクローズした場合を含みます。 |
pull_request.merged | プルリクエストがマージされたとき。 |
pull_request.reopened | クローズされたプルリクエストが再オープンされたとき。 |
pull_request.published | 下書きのプルリクエストがオープンになったとき。 |
pull_request.label.added | プルリクエストにラベルが付与されたとき。 |
pull_request.label.removed | プルリクエストからラベルが解除されたとき。ラベル定義が削除された場合を含みます。 |
pull_request.comment.created | 表示可能なプルリクエストコメントが作成されたとき。 |
pull_request.comment.reaction.added | プルリクエストコメントにリアクションが付けられたとき。リアクションを行ったユーザーがすでに付けているリアクションを再度付けると、このイベントが再度配信されます。 |
pull_request.comment.reaction.removed | プルリクエストコメントからリアクションが削除されたとき。リアクションを行ったユーザーが付けていないリアクションを削除しても、何も配信されません。 |
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.*イベントは、リポジトリのサブスクリプションではなく、アプリ自体に送信されます。オリジンは常にこれらを送信するため、アプリの選択可能なイベントリストには表示されません。この表のその他すべてのイベントは、リポジトリスコープのサブスクリプションです。
新しく作成したアプリは、リポジトリスコープのイベントを1つも購読していません。必要なイベントをアプリの設定で選択するか、Create AppまたはUpdate Appのeventsフィールドで設定してください。オリジンがイベントを配信するのは、そのイベントを購読し、Webhook URLが設定されていて、インストールの対象に該当リポジトリが含まれ、かつイベントに必要なスコープを持つアプリに限られます。条件を満たさない場合、配信もエラーも発生しません。何も送信されず、List Webhook Deliveriesにも何も表示されません。
オリジンはGitHubからミラーリングしているリポジトリに対してrepository.pushedを配信しません。これらのプッシュはGitHubが管理し、GitHub自身がプッシュのWebhookを送信するため、オリジンからも配信すると重複してしまいます。ネイティブのオリジンリポジトリおよびアウトバウンドミラーへのプッシュは通常どおり配信され、ミラーの状態が他のイベントに影響することはありません。repository.deletedはGitHubからミラーリングされたリポジトリに対しても配信されます。同期を停止するとCherri Code側のリポジトリのみが削除され、GitHubからは何も送信されません。
イベントペイロード
各イベントのエンベロープは、payload にそのイベントのペイロードオブジェクトを格納します。同じ形状を持つイベントは同一のペイロードファミリーに属します。以下の各ファミリーでは、それを配信するイベント、フィールド、および OpenAPI 仕様 から生成したサンプルペイロードを記載しています。仕様では、各ペイロードスキーマの x-origin-webhook-events 拡張に、そのペイロードを配信するイベントが列挙されています。
リポジトリ作成完了
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.user.performedVia オブジェクト
pusher.user.performedVia.app object
pusher.user.performedVia.app.id string
pusher.user.performedVia.app.displayName string
pusher.app object
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": "[email protected]", "date": "2026-08-01T09:30:00Z" }, "committer": { "name": "Jane Doe", "email": "[email protected]", "date": "2026-08-01T09:30:00Z" }, "message": "Add launch telemetry" } } ], "pushedAt": "2026-08-02T14:45:00Z", "pusher": { "user": { "id": "user_01k2ja2000e0080000000000c3", "email": "[email protected]" } }, "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.updatedpull_request.stack_parent.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
base の場合はバージョンの base_sha であり、ブランチの現在の先端より遅れていることがあります (PullRequestVersion を参照) 。pullRequest.base object
pullRequest.base.ref string
pullRequest.base.sha string
base の場合はバージョンの base_sha であり、ブランチの現在の先端より遅れていることがあります (PullRequestVersion を参照) 。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.user.performedVia オブジェクト
pullRequest.author.user.performedVia.app オブジェクト
pullRequest.author.user.performedVia.app.id 文字列
pullRequest.author.user.performedVia.app.displayName 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
pull/\<number>/merge ref (GetGitRef を参照) で、別のコミットです。pullRequest.additions integer
pullRequest.deletions integer
pullRequest.changedFiles integer
pullRequest.stack オブジェクト
pullRequest.stack.id 文字列
stack_id として ListPullRequests に渡すと、そのスタックのメンバーを一覧表示できます。pullRequest.stack.parentPullRequest オブジェクト
pullRequest.stack.parentPullRequest.id 文字列
pullRequest.stack.parentPullRequest.number 文字列
pullRequest.stack.parentPullRequest.repository オブジェクト
pullRequest.stack.parentPullRequest.repository.id 文字列
pullRequest.stack.parentPullRequest.repository.name string
pullRequest.stack.parentPullRequest.repository.owner オブジェクト
pullRequest.stack.parentPullRequest.repository.owner.slug string
pullRequest.stack.parentPullRequest.repository.owner.id string
pullRequest.stack.parentPullRequest.repository.owner.type 文字列
team または user。出力専用。不明な場合は未設定。team、user のいずれか。pullRequest.version object
pullRequest.version.number string
pullRequest.version.headSha string
pullRequest.version.baseSha string
pullRequest.version.createdAt string
pullRequest.version.potentialMergeCommit オブジェクト
state)。このバージョン用に計算されます。コミットの第2の親は head_sha、第1の親はテストマージの base_sha です。これは準備時点のベースブランチの先端で、このバージョンの base_sha より新しい場合があります。pull/\<number>/merge ref が指すのは最新バージョンのコミットのみです。古いコミットは API (GetCommit) で SHA を指定して引き続き参照できますが、git 経由では SHA を指定してフェッチできません。マージ後にのみ設定される PullRequest.merge_commit_sha とは異なります。PullRequest.version と PullRequestWebhook.version に設定されます。pullRequest.version.potentialMergeCommit.state string
unknown で始まります。認識できない値は unknown として扱う必要があります。unknown、prepared、merge_conflict のいずれかです。pullRequest.version.potentialMergeCommit.sha 文字列
state が prepared の場合にのみ設定されます。親を 2 つ持つテストマージコミットで、2 番目の親はバージョンの head_sha、1 番目の親は base_sha です。このバージョンが最新である間は pull/\<number>/merge の先端を指し、その後も SHA で参照できます。pullRequest.version.potentialMergeCommit.baseSha 文字列
state が prepared の場合にのみ設定されます。準備時点のベースブランチの先端を指し、バージョンの base_sha より新しい場合があります。ベースブランチが進んだだけでは更新されず、再オープン時に準備し直されます。repository オブジェクト
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": "add-telemetry-schema", "sha": "3b1f9c2d8a7e6f5049c8b7a6d5e4f3a2b1c0d9e8" }, "author": { "user": { "id": "user_01k2ja2000e0080000000000c3", "email": "[email protected]" } }, "createdAt": "2026-08-01T09:30:00Z", "updatedAt": "2026-08-02T14:45:00Z", "additions": 128, "deletions": 46, "changedFiles": 5, "stack": { "id": "stk_01k2ja2000e0080000000000s1", "parentPullRequest": { "id": "pr_01k2ja2000e0080000000000d3", "number": "16", "repository": { "id": "repo_01k2ja2000e0080000000000q4", "name": "rocket", "owner": { "slug": "acme", "id": "ns_01k2ja2000e0080000000000p3", "type": "team" } } } }, "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.label.addedpull_request.label.removedプルリクエストに付与されたラベルの変更です。現在のラベルは ListPullRequestLabels で取得できます。
ペイロードのフィールド
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。出力専用。不明な場合は未設定。team、user のいずれか。label オブジェクト
label.id 文字列
label.name 文字列
label.color string
# を除く6文字の16進数カラーコード。label.description 文字列
actor オブジェクト
actor.user オブジェクト
actor.user.id 文字列
actor.user.email 文字列 必須
actor.user.displayName 文字列
actor.user.handle 文字列
actor.user.performedVia オブジェクト
actor.user.performedVia.app オブジェクト
actor.user.performedVia.app.id 文字列
actor.user.performedVia.app.displayName 文字列
actor.app オブジェクト
actor.app.id 文字列
actor.app.displayName 文字列
actor.serviceAccount オブジェクト
actor.serviceAccount.id 文字列
event.payload のサンプル:
{ "pullRequest": { "id": "pr_01k2ja2000e0080000000000d4", "number": "17", "repository": { "id": "repo_01k2ja2000e0080000000000q4", "name": "rocket", "owner": { "slug": "acme", "id": "ns_01k2ja2000e0080000000000p3", "type": "team" } } }, "label": { "id": "lbl_01k2ja2000e0080000000000m1", "name": "bug", "color": "d73a4a", "description": "Something isn't working" }, "actor": { "user": { "id": "user_01k2ja2000e0080000000000c3", "email": "[email protected]" } }}プルリクエストコメント
pull_request.comment.createdプルリクエストに作成されたコメント。レビューとともに提出されたコメントは、レビューの提出時に、コメントごとに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.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 オブジェクト
comment.author.user オブジェクト
comment.author.user.id string
comment.author.user.email string 必須
comment.author.user.displayName string
comment.author.user.handle string
comment.author.user.performedVia オブジェクト
comment.author.user.performedVia.app オブジェクト
comment.author.user.performedVia.app.id string
comment.author.user.performedVia.app.displayName 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" }, "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": "[email protected]" } }, "createdAt": "2026-08-01T09:30:00Z", "updatedAt": "2026-08-02T14:45:00Z" }}プルリクエストコメントのリアクションイベント
pull_request.comment.reaction.addedpull_request.comment.reaction.removedプルリクエストのコメントにリアクションが追加または削除されたことを示すイベントです。エンベロープの event.type にアクションが記録されます。追加イベントは少なくとも1回配信されます。リアクターがすでにそのコメントに付けているリアクションを再度付けると、同じ (comment, reactor, content) に対して pull_request.comment.reaction.added が再度配信されます。リアクターが付けていないリアクションを削除しても、何も配信されません。
ペイロードのフィールド
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.id string
comment.thread オブジェクト
comment.thread.id string
reaction オブジェクト
reaction.content 文字列
thumbs_up、thumbs_down、laugh、hooray、confused、heart、rocket、eyes のいずれか。reaction.reactor オブジェクト
reaction.reactor.user オブジェクト
reaction.reactor.user.id 文字列
reaction.reactor.user.email string 必須
reaction.reactor.user.displayName string
reaction.reactor.user.handle string
reaction.reactor.user.performedVia オブジェクト
reaction.reactor.user.performedVia.app オブジェクト
reaction.reactor.user.performedVia.app.id 文字列
reaction.reactor.user.performedVia.app.displayName 文字列
reaction.reactor.app オブジェクト
reaction.reactor.app.id string
reaction.reactor.app.displayName string
reaction.reactor.serviceAccount オブジェクト
reaction.reactor.serviceAccount.id 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" } }, "reaction": { "content": "thumbs_up", "reactor": { "user": { "id": "user_01k2ja2000e0080000000000c3", "email": "[email protected]" } } }}プルリクエストレビューイベント
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.user.performedVia object
review.author.user.performedVia.app オブジェクト
review.author.user.performedVia.app.id string
review.author.user.performedVia.app.displayName 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.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.user.performedVia object
review.dismissal.dismissedBy.user.performedVia.app オブジェクト
review.dismissal.dismissedBy.user.performedVia.app.id string
review.dismissal.dismissedBy.user.performedVia.app.displayName 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": "[email protected]" } }, "verdict": "approve", "body": "Approving. The telemetry schema matches the spec.", "submittedAt": "2026-08-02T15:00:00Z", "pullRequestVersion": { "number": "3", "headSha": "9a41f0c3d2b8e7f6a5c4d3e2f1b0a9c8d7e6f5a4", "baseSha": "3b1f9c2d8a7e6f5049c8b7a6d5e4f3a2b1c0d9e8" } }}プルリクエストレビュアーのイベント
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.user.performedVia オブジェクト
reviewer.user.performedVia.app オブジェクト
reviewer.user.performedVia.app.id string
reviewer.user.performedVia.app.displayName 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.user.performedVia オブジェクト
createdBy.user.performedVia.app オブジェクト
createdBy.user.performedVia.app.id string
createdBy.user.performedVia.app.displayName 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": "[email protected]" } }, "createdVia": "codeowners", "createdAt": "2026-08-02T14:45:00Z"}チェック実行イベント
repository.check_run.createdrepository.check_run.updatedrepository.check_run.completedOrigin の check-run ライフサイクルイベントのコミット済みスナップショット。
ペイロードのフィールド
repository オブジェクト
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.user.performedVia オブジェクト
checkSuite.actor.user.performedVia.app オブジェクト
checkSuite.actor.user.performedVia.app.id string
checkSuite.actor.user.performedVia.app.displayName 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。出力専用。不明な場合は未設定。team または user のいずれか。checkRun.checkSuite オブジェクト
checkRun.checkSuite.id string
checkRun.sha string
checkRun.key string
checkRun.name string
checkRun.status string
failing は、まだ実行中で、アプリがすでに失敗すると認識している実行です。ゲートと必須チェックでは保留として扱われ、conclusion はまだ設定されていません。読み手に対する早期警告となります。rerequested は、再実行がリクエストされたものの、所有アプリからまだ応答がない完了済みの実行です。読み手にとっては保留状態 (queued と同様に表示) であり、conclusion と所要時間は引き続き置き換えられた試行の内容を示します。再リクエスト時 (RerequestCheckRun) に Origin のみが設定でき、アプリはこの状態を投稿できません。queued、in_progress、completed、rerequested、failing のいずれかです。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
PostCheckRunResponse.outcome を参照) 。RFC 3339 形式のタイムスタンプ。checkRun.externalId string
CheckRunInput.external_id を参照。実行ごとに1つ割り当てることを推奨します) 。checkRun.actor オブジェクト
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.user.performedVia オブジェクト
checkRun.actor.user.performedVia.app オブジェクト
checkRun.actor.user.performedVia.app.id string
checkRun.actor.user.performedVia.app.displayName 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
timed_out になった場合も同様です (CheckRunInput.deadline_at を参照) 。RFC 3339 形式のタイムスタンプです。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.user.performedVia オブジェクト
checkRun.rerequestedBy.user.performedVia.app オブジェクト
checkRun.rerequestedBy.user.performedVia.app.id string
checkRun.rerequestedBy.user.performedVia.app.displayName 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-02T14:45:00Z", "externalId": "build-8842", "actor": { "user": { "id": "user_01k2ja2000e0080000000000c3", "email": "[email protected]" } } }, "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": "[email protected]" } }, "output": { "title": "Unit tests", "summary": "128 tests passed.", "text": "All suites green." } }}チェック実行の再リクエスト
repository.check_run.rerequestedチェックランを所有するアプリにのみ配信される repository.check_run.rerequested webhook ペイロードです。応答するには、同じ head SHA とキーに対して新しい run (新しい external_id) を投稿するか、再要求された run を更新します。スタンプが付いた run は、応答する投稿によって rerequested_at がクリアされるまで status: rerequested と表示されます (その conclusion と timings は置き換えられた結果のものです) 。受理された再要求ごとにイベントが1つ発行され、run は応答後に再度要求されることがあるため、再配信の重複排除にはイベント ID のみを使用してください。未処理のスタンプは check_run.rerequested_at に記録されます。ペイロードにはプルリクエストのコンテキストは含まれません (チェックランは (repository, sha) に紐づきます) 。プルリクエストが必要なコンシューマは、独自の head マッピングを介して check_run.sha から解決するか、ビルドした head ブランチでフィルタリングした ListPullRequests を使用します。
ペイロードのフィールド
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.user.performedVia オブジェクト
checkSuite.actor.user.performedVia.app オブジェクト
checkSuite.actor.user.performedVia.app.id string
checkSuite.actor.user.performedVia.app.displayName string
checkSuite.actor.app オブジェクト
checkSuite.actor.app.id string
checkSuite.actor.app.displayName string
checkSuite.actor.serviceAccount オブジェクト
checkSuite.actor.serviceAccount.id string
checkRun オブジェクト
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 文字列
checkRun.key string
checkRun.name 文字列
checkRun.status string
failing は、まだ実行中で、アプリがすでにチェックに通らないと判断している実行です。ゲートや必須チェックでは保留中として扱われ、conclusion はまだなく、読み取り側への早期警告となります。rerequested は、再実行がリクエストされたものの、所有アプリからまだ応答がない完了済みの実行です。読み取り側では保留中として扱われ (queued と同様に表示され) 、conclusion と実行時間は引き続き置き換えられた試行の内容を示します。再リクエスト時に Origin のみが設定します (RerequestCheckRun) 。アプリはこの状態を投稿できません。queued、in_progress、completed、rerequested、failing のいずれかです。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
PostCheckRunResponse.outcome を参照) 。そのため、この2つを区別することはできません。RFC 3339 形式のタイムスタンプ。checkRun.externalId string
CheckRunInput.external_idを参照。実行ごとに1つ割り当てる方式が推奨されます) 。checkRun.actor オブジェクト
actor と一致します。checkRun.actor.user オブジェクト
checkRun.actor.user.id string
checkRun.actor.user.email string 必須
checkRun.actor.user.displayName string
checkRun.actor.user.handle string
checkRun.actor.user.performedVia object
checkRun.actor.user.performedVia.app オブジェクト
checkRun.actor.user.performedVia.app.id string
checkRun.actor.user.performedVia.app.displayName 文字列
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 文字列
timed_out として期限切れになった場合も同様です (CheckRunInput.deadline_at を参照してください) 。RFC 3339形式のタイムスタンプ。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.user.performedVia オブジェクト
checkRun.rerequestedBy.user.performedVia.app オブジェクト
checkRun.rerequestedBy.user.performedVia.app.id string
checkRun.rerequestedBy.user.performedVia.app.displayName 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": "[email protected]" } } }, "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": "[email protected]" } }, "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": "[email protected]" } } }}インストールが作成されました
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
installation.installedBy.performedVia オブジェクト
installation.installedBy.performedVia.app オブジェクト
installation.installedBy.performedVia.app.id string
installation.installedBy.performedVia.app.displayName 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": "[email protected]" } }, "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
installation.installedBy.performedVia オブジェクト
installation.installedBy.performedVia.app オブジェクト
installation.installedBy.performedVia.app.id string
installation.installedBy.performedVia.app.displayName 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": "[email protected]" } }, "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
installation.installedBy.performedVia オブジェクト
installation.installedBy.performedVia.app オブジェクト
installation.installedBy.performedVia.app.id string
installation.installedBy.performedVia.app.displayName 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": "[email protected]" }, "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
installation.installedBy.performedVia オブジェクト
installation.installedBy.performedVia.app オブジェクト
installation.installedBy.performedVia.app.id string
installation.installedBy.performedVia.app.displayName 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": "[email protected]" } }, "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
installation.installedBy.performedVia オブジェクト
installation.installedBy.performedVia.app オブジェクト
installation.installedBy.performedVia.app.id string
installation.installedBy.performedVia.app.displayName 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": "[email protected]" }, "deletedAt": "2026-08-03T08:15:00Z" }, "app": { "id": "app_01k2ja2000e0080000000000a1", "displayName": "CI Status Bot" }}チェック実行の注釈
repository.check_run.annotations.created1 件の CreateCheckRunAnnotations リクエストで、チェック実行に注釈が追加されました (repository.check_run.annotations.created)。注釈は追加専用で、個別に編集・削除されることはありません。そのため、.created が注釈のライフサイクル全体を表し、1 件のリクエストにつき 1 件のイベントが発行されます。check_run はスナップショットではなく参照です。実行のステータス、結論、出力は GetCheckRun で確認してください。annotations はリクエスト内の順序で並びます。Origin が本文を配信可能なサイズに収めるためリストを制限した場合、注釈の件数は annotations_count より少なくなることがあります。残りは ListCheckRunAnnotations でページネーションして取得してください。他のチェック実行ウェブフックと同様に、ペイロードにはプルリクエストのコンテキストは含まれません。sha からプルリクエストを特定してください。
ペイロードのフィールド
repository オブジェクト
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 のいずれか。checkRun オブジェクト
checkRun.id 文字列
checkRun.name 文字列
checkRun.checkSuite オブジェクト
checkRun.checkSuite.id string
sha 文字列
annotations 配列
annotations[].id 文字列
annotations[].checkRunId 文字列
annotations[].annotationLevel 文字列
notice、warning、failure のいずれか。annotations[].message string
annotations[].title 文字列
annotations[].rawDetails 文字列
annotations[].createdAt 文字列
annotations[].updatedAt 文字列
annotations[].location オブジェクト
path、start_line、end_line は必須です。path は正規化されたリポジトリ相対パスです。行と列は 1 から始まる正の座標で、範囲の両端を含みます。columns は単一行の範囲でのみサポートされます。annotations[].location.path 文字列 必須
annotations[].location.startLine integer 必須
annotations[].location.endLine integer 必須
annotations[].location.columns オブジェクト
annotations[].location.columns.startColumn integer
annotations[].location.columns.endColumn integer
annotationsCount integer
createdAt 文字列
event.payload のサンプル:
{ "repository": { "id": "repo_01k2ja2000e0080000000000q4", "name": "rocket", "owner": { "slug": "acme", "id": "ns_01k2ja2000e0080000000000p3", "type": "team" } }, "checkRun": { "id": "cr_01k2ja2000e0080000000000g7", "name": "unit-tests", "checkSuite": { "id": "crg_01k2ja2000e0080000000000h8" } }, "sha": "9a41f0c3d2b8e7f6a5c4d3e2f1b0a9c8d7e6f5a4", "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, "columns": { "startColumn": 5, "endColumn": 31 } } }, { "id": "cra_01k2ja2000e0080000000000v2", "checkRunId": "cr_01k2ja2000e0080000000000g7", "annotationLevel": "failure", "message": "Three tests failed in telemetry.test.ts.", "title": "Test failures", "rawDetails": "FAIL telemetry.test.ts flushes on shutdown (expected 1 call, received 0)", "createdAt": "2026-08-02T14:45:00Z", "updatedAt": "2026-08-02T14:45:00Z" } ], "annotationsCount": 2, "createdAt": "2026-08-02T14:45:00Z"}