メインコンテンツへスキップ
Readiness Reports APIは、組織のエージェント準備状況評価データへのプログラマティックアクセスを提供します。

認証

すべてのリクエストにはAuthorizationヘッダーにFactory APIキーが必要です:
Authorization: Bearer fk-your-api-key
APIキーはapp.factory.ai/settings/api-keysで生成してください。

ベースURL

https://app.factory.ai

エンドポイント

Readiness Reportsの一覧取得

組織の準備状況レポートを取得します。
GET /api/organization/maturity-level-reports

クエリパラメータ

パラメータ必須説明
repoIdstringNoリポジトリIDでレポートをフィルタ
limitintegerNo返すレポートの最大数(正の値である必要があります)
startAfterstringNoページネーションカーソル用のレポートID

レスポンス

{
  "reports": [
    {
      "reportId": "550e8400-e29b-41d4-a716-446655440000",
      "createdAt": 1701792000000,
      "repoUrl": "https://github.com/org/repo",
      "apps": {
        "apps/web": {
          "description": "Main Next.js application"
        },
        "apps/api": {
          "description": "Backend API service"
        }
      },
      "report": {
        "lint_config": {
          "numerator": 2,
          "denominator": 2,
          "rationale": "ESLint configured in both applications"
        },
        "type_check": {
          "numerator": 2,
          "denominator": 2,
          "rationale": "TypeScript strict mode enabled"
        }
      },
      "commitHash": "abc123def456",
      "branch": "main",
      "hasLocalChanges": false,
      "hasNonRemoteCommits": false,
      "modelUsed": {
        "id": "claude-sonnet-4-5",
        "reasoningEffort": "high"
      },
      "droidVersion": "0.30.0"
    }
  ]
}

リクエスト例

curl -X GET "https://app.factory.ai/api/organization/maturity-level-reports?limit=10" \
  -H "Authorization: Bearer fk-your-api-key"

Readiness Reportスキーマ

Reportオブジェクト

フィールド説明
reportIdstringレポートの一意識別子(UUID)
createdAtnumberレポートが作成されたUnixタイムスタンプ(ミリ秒)
repoUrlstring評価されたリポジトリURL
appsobjectアプリケーションパスから説明オブジェクトへのマップ
reportobject基準IDから評価結果へのマップ
commitHashstring?評価時のGitコミットハッシュ
branchstring?評価時のGitブランチ名
hasLocalChangesboolean?コミットされていない変更が存在したかどうか
hasNonRemoteCommitsboolean?プッシュされていないコミットが存在したかどうか
modelUsedobject?評価に使用されたモデル設定
droidVersionstring?レポートを生成したCLIバージョン

App Descriptionオブジェクト

フィールド説明
descriptionstringアプリケーションの機能に関する簡潔な説明

Criterion Evaluationオブジェクト

フィールド説明
numeratornumber基準を満たしたサブアプリケーションの数(0からdenominatorまで)
denominatornumber基準が評価されたサブアプリケーションの数(最低1)
rationalestring評価結果の説明

Model Usedオブジェクト

フィールド説明
idstringモデル識別子
reasoningEffortstring推論労力レベル(lowmediumhighoff

ページネーション

大きな結果セットに対しては、カーソルベースのページネーションを使用してください:
  1. 希望するlimitで初回リクエストを実行
  2. レスポンスの最後のアイテムのreportIdを取得
  3. そのIDを次のリクエストでstartAfterとして渡す
# First page
curl "https://app.factory.ai/api/organization/maturity-level-reports?limit=10"

# Next page (using last reportId from previous response)
curl "https://app.factory.ai/api/organization/maturity-level-reports?limit=10&startAfter=550e8400-e29b-41d4-a716-446655440000"

使用例

CI/CD統合

各評価後にレポートを取得することで、時系列での準備状況スコアを追跡:
# Get latest report for a specific repository
curl "https://app.factory.ai/api/organization/maturity-level-reports?repoId=123&limit=1" \
  -H "Authorization: Bearer $FACTORY_API_KEY"

カスタムダッシュボード

すべてのレポートを取得し、集約メトリクスを計算することで内部ダッシュボードを構築:
const response = await fetch(
  "https://app.factory.ai/api/organization/maturity-level-reports",
  { headers: { Authorization: `Bearer ${apiKey}` } }
);
const { reports } = await response.json();

// Calculate average level
const avgLevel =
  reports.reduce((sum, r) => sum + calculateLevel(r), 0) / reports.length;

自動アラート

準備状況スコアが閾値を下回った際のアラートを設定:
# Fetch recent reports and check for regressions
reports=$(curl -s "https://app.factory.ai/api/organization/maturity-level-reports?limit=50" \
  -H "Authorization: Bearer $FACTORY_API_KEY")

# Process and alert on regressions...

エラーレスポンス

ステータス説明
400無効なリクエストパラメータ
401APIキーが欠如または無効
500内部サーバーエラー