AgentConnect
Sessions

Get the session’s pull request

This session’s pull request: identity (repo, number, url, head/base) plus live state (checks, current reviews, unresolved review threads) proxied from GitHub in one GraphQL read. Identity comes from the owning hook run where one exists (linkedBy: run, which also carries the review facts a rate-limited answer falls back on); otherwise from the head branch of the checkout this session works in (linkedBy: head-branch, linkBranch, linkScope), so a pull request the agent opened mid-conversation is linked too — linkScope: shared means the branch came from the agent’s primary checkout, which every session on a shared-workspace agent works in, so the pull request is real but not exclusively this session’s; linkAmbiguous says the branch has more than one open pull request and this is the first of them. autoMergeSessionPlaced says whether an arm from this session names it — the pull request’s agent is this session’s and the serving daemon places arms by session — which is the one case in which this session’s own wake starts the pod a sleeping arm is refused for. GitHub being rate limited, denying the installation, or unreachable is data — degraded names which, identity survives, and the live lists are empty — because a panel that still names its PR beats an empty one. 404 when neither source names a pull request (no run and no pull request for that branch, a purged session, a workspace that is not a checkout, no daemon serving the agent) or when the deployment has no GitHub App configured; the console then draws its branch state and a create action instead. Review thread bodies are user content: proxied, never stored.

GET
/v1/orgs/{orgId}/sessions/{id}/pull-request

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Path Parameters

orgId*string
id*string

Query Parameters

refresh?string

Response Body

application/json

application/json

curl -X GET "https://example.com/v1/orgs/string/sessions/string/pull-request"
{  "repoFullName": "string",  "pullNumber": -9007199254740991,  "title": "string",  "body": "string",  "state": "open",  "isDraft": true,  "url": "string",  "headRef": "string",  "baseRef": "string",  "additions": -9007199254740991,  "deletions": -9007199254740991,  "reviewDecision": "approved",  "checks": [    {      "name": "string",      "state": "success",      "detail": "string",      "startedAt": "string",      "completedAt": "string",      "url": "string"    }  ],  "checksTruncated": true,  "reviews": [    {      "author": "string",      "state": "approved",      "isBot": true    }  ],  "threads": [    {      "location": "string",      "body": "string",      "author": "string",      "isOutdated": true    }  ],  "unresolvedCount": -9007199254740991,  "threadsTruncated": true,  "autoMergeArmed": true,  "autoMergePlacement": "sandbox",  "autoMergeWaitingOn": "string",  "autoMergeError": "string",  "autoMergeSessionPlaced": true,  "canArmAutoMerge": true,  "degraded": true,  "degradedReason": "rate_limited",  "agentReview": "approved",  "linkedBy": "run",  "linkBranch": "string",  "linkScope": "session",  "linkAmbiguous": true}