API reference

Pull Requests API

Access pull request data synced from GitHub, along with AI-generated explanations of each PR's changes and impact.

GET/api/v1/prs/{repo}/{number}prs:read

Returns a pull request and its cached AI-generated explanation. The explanation describes what changed, why, and the potential impact.

Parameters

NameTypeRequiredDescription
repostringrequiredRepository full name, e.g. "acme/backend". Supports slashes in path.
numberintegerrequiredThe pull request number on GitHub.

Request

curl https://scopedocs-ai-production.up.railway.app/api/v1/prs/acme/backend/42 \
  -H "X-API-Key: sk-sd_your_key_here"

Response

JSON
{
  "pr": {
    "number": 42,
    "repo": "acme/backend",
    "title": "feat: add rate limiting to API endpoints",
    "body": "This PR adds per-key rate limiting using Redis. Closes ENG-203.",
    "state": "merged",
    "author": "alice",
    "created_at": "2026-03-10T14:30:00Z",
    "merged_at": "2026-03-12T09:15:00Z"
  },
  "explanation": {
    "summary": "Adds per-API-key rate limiting (RPM + RPD) using Redis, with 429 responses and Retry-After headers.",
    "files_changed": 8,
    "impact": "medium",
    "areas": [
      "authentication",
      "api",
      "infrastructure"
    ]
  }
}