Quality Gate API
The quality gate endpoint evaluates whether a PR review passes your configured thresholds. Use it in CI/CD pipelines to automatically block risky merges.
Endpoint
GET /api/reviews/{review_id}/gateQuery Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
threshold | integer | Org setting | Override risk score threshold (0-100) |
Response
{
"gate": "passed",
"review_id": 42,
"risk_score": 35,
"threshold": 75,
"critical_issues": 0,
"high_issues": 2,
"total_issues": 8,
"vibe_coding_score": 15,
"message": "Quality gate passed — safe to merge"
}Gate Logic
The gate passes when:
- Risk score is below the configured threshold
- Critical issue count is within the allowed limit
The gate fails when:
- Risk score exceeds the threshold, OR
- Critical issues exceed the maximum allowed
Configuration
Thresholds are configurable at three levels (highest priority wins):
- Query parameter — override for a specific check
- Repository policy — set in Settings → Policies → Repository Overrides
- Organization policy — set in Settings → Policies
CI/CD Usage
CLI:
codestax gate <review_id> --threshold 75Exit code 0 = passed, 1 = failed, 2 = pending.
GitHub Actions / GitLab CI: See the CI/CD Integration guide for complete pipeline templates.