Pull Requests API
Octokraft analyzes pull requests for code quality issues, merge readiness, scope drift, health impact, and conflicts with other open PRs. Analyses run automatically on PR events or can be triggered manually.List PR Analyses
Returns paginated PR analyses for a project.Query Parameters
| Parameter | Type | Description | Default |
|---|---|---|---|
limit | integer | Items per page (max 100) | 20 |
offset | integer | Number of items to skip | 0 |
Get PR Analysis
Returns a full PR analysis by ID, including all analysis sections.Response Fields
| Field | Type | Description |
|---|---|---|
classification | object | PR intent, change categories, and risk signals |
merge_readiness | object | Merge status (ready, needs_review, blocked), issue counts, confidence |
health_impact | object | Net issue delta and overall impact rating |
health_projection | object | Per-category score projections showing how the PR would affect health scores |
graph_impact | object | Impact analysis of changed symbols on the codebase graph |
scope_drift | array | Detected changes outside the PR’s stated scope |
impact_zones | array | Logical groupings of changes with risk levels |
conflicts | object | Detected conflicts with other open PRs |
stacked_prs | object | Stacked PR detection (parent/child relationships) |
status | string | pending, running, completed, or failed |
Merge Readiness Status
| Status | Meaning |
|---|---|
ready | No blocking or advisory issues found |
needs_review | Advisory issues found but no blockers |
blocked | Blocking issues that should be resolved before merging |
Get Latest Analysis for PR
Returns the most recent analysis for a specific pull request.404 if no analysis exists for the PR.
Trigger PR Analysis
Starts a new analysis for a pull request. The analysis runs asynchronously.Request Body
| Field | Type | Required | Description |
|---|---|---|---|
head_sha | string | no | HEAD commit SHA. If omitted, uses the SHA from the most recently synced PR metadata. |
The analysis runs asynchronously. Poll the Get PR Analysis endpoint or use the Get Latest Analysis for PR endpoint to check for completion.
Get PR Statistics
Returns aggregate statistics for PR analyses in a project.Query Parameters
| Parameter | Type | Description |
|---|---|---|
since | string | ISO 8601 timestamp. Only count analyses created after this time. |