API Reference / Code - Repositories

Get PRs by state

post https://api.intelig.ai/api/v1/intelig/code/repositories/prs-by-state

Auth: Authorization: ApiKey <key> (an API key sent as Bearer is rejected) or Authorization: Bearer <jwt> for a dashboard session. operationId: getPRsByState

Returns PRs filtered by lifecycle state for Flow tab drill-down sheets. Supports OPEN, IN_REVIEW, APPROVED, and MERGED state filters with optional repository filter. Includes PR title, author, age, and review details.

Example request

curl -X POST "https://api.intelig.ai/api/v1/intelig/code/repositories/prs-by-state" \
  -H "Authorization: ApiKey $INTELIG_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "from": "2024-01-01",
    "to": "2024-01-31",
    "state": "OPEN",
    "repositoryIds": [
      10,
      11
    ]
  }'

Request body

application/json

FieldTypeRequiredDescription
from string yes Start date in YYYY-MM-DD format Example: 2024-01-01
to string yes End date in YYYY-MM-DD format Example: 2024-01-31
state string yes PR flow state to filter by (OPEN, IN_REVIEW, APPROVED, or MERGED) One of: OPEN, IN_REVIEW, APPROVED, MERGED Example: OPEN
repositoryIds integer[] no Optional list of repository IDs to filter by Example: [10,11]
limit integer (int32) no Maximum number of PRs to return (defaults to 50) Example: 50

Response 200

application/json · ApiResponsePRsByStateDto

FieldTypeDescription
success boolean
message string
data PRsByStateDto Pull requests filtered by flow state for drill-down views

Status codes

  • 200 — Filtered PR list returned
  • 400 — Invalid request body or unsupported state filter
  • 401 — Authentication required
  • 403 — Insufficient permissions for Code Intelligence pillar
  • 429 — —

Every response is wrapped in { success, message, data }. A 4xx means the request is wrong — do not retry it unchanged. A 429 carries Retry-After in seconds.