Skip to content

associate_pr

Associate an existing pull request with a Polygraph session.

Use to link PRs that were created outside of Polygraph (e.g., manually or by CI) to the current session. Provide either a prUrl or a branch name. In a multi-repo session, pass repo to disambiguate which repository the branch belongs to when using branch-based lookup.

NameTypeRequiredDescription
sessionIdstringyesThe Polygraph session ID, or a Polygraph app session URL (/s/<session-id> or /orgs/<org-id>/sessions/<session-id>).
descriptionstringyesUser-facing Polygraph session description summarizing the goal, progress, and next steps. Saved to the session description timeline.
prUrlstringnoURL of an existing pull request to associate with the session.
branchstringnoBranch name to find and associate PRs for. Used when prUrl is not provided. In a multi-repo session, requires repo to disambiguate which repository the branch belongs to.
repostringnoRepository full name (owner/repo) or repository id identifying which session repository this PR belongs to. Required when using branch in a multi-repo session. Optional (and ignored) when prUrl is provided.
agentSessionIdstringnoThe AI agent session ID. Can be used to resume the session later.