Skip to content

GitHub: List pull requests

GitHub pulls.pullsList: arguments, response, policy and SDK examples.

← Pulls operations · Get started

Operation github.pulls_list

Provider route: GET /repos/{owner}/{repo}/pulls. Alter supplies the connection’s credentials and routing.

Install @alter-ai/sdk @alter-ai/github with npm, or alter-sdk-github with pip. Supply your connected customer’s grant ID and the arguments described below.

import { App } from "@alter-ai/sdk";
import { GitHubIntegration } from "@alter-ai/github";
async function execute(input: Parameters<GitHubIntegration["pulls"]["pullsList"]>[0]) {
const app = new App({ apiKey: process.env.ALTER_API_KEY! });
try {
const provider = new GitHubIntegration(app, { grantId: process.env.PROVIDER_GRANT_ID! });
const call = await provider.pulls.pullsList(input);
const result = await call.wait();
return result.bodyJson();
} finally {
await app.close();
}
}
import os
from alter_sdk import App
from alter_sdk_github import GitHubIntegration
async def execute(arguments):
async with App(api_key=os.environ["ALTER_API_KEY"]) as app:
provider = GitHubIntegration(app, {"grant_id": os.environ["PROVIDER_GRANT_ID"]})
call = await provider.pulls.pulls_list(arguments)
result = await call.wait()
return result.body_json()
FieldTypePresenceDescription and constraints
$objectRootAdditional keys: not allowed
pathobjectRequired within parentAdditional keys: not allowed
path.ownerstringRequired within parent
path.repostringRequired within parent
queryobjectOptionalAdditional keys: not allowed
query.statestringOptionalDefault: open
One of: open, closed, all
query.headstringOptional
query.basestringOptional
query.sortstringOptionalDefault: created
One of: created, updated, popularity, long-running
query.directionstringOptionalOne of: asc, desc
query.per_pageintegerOptionalDefault: 30
query.pageintegerOptionalDefault: 1

Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.

FieldTypePresenceDescription and constraints
$arrayRoot
$[]ModelEach itemExpand Request reviewers for a pull request — response body

Referenced models: Request reviewers for a pull request — response body

11 more schemas are linked from the tables above, on the schema pages.

Request reviewers for a pull request — response body
FieldTypePresenceDescription and constraints
$objectRootPull Request Simple
_linksobjectRequired within parent
_links.commentsModelRequired within parentExpand Get a pull request — response body — links html
_links.commitsModelRequired within parentExpand Get a pull request — response body — links html
_links.htmlModelRequired within parentExpand Get a pull request — response body — links html
_links.issueModelRequired within parentExpand Get a pull request — response body — links html
_links.review_commentModelRequired within parentExpand Get a pull request — response body — links html
_links.review_commentsModelRequired within parentExpand Get a pull request — response body — links html
_links.selfModelRequired within parentExpand Get a pull request — response body — links html
_links.statusesModelRequired within parentExpand Get a pull request — response body — links html
active_lock_reasonJSONOptional
active_lock_reason (anyOf 1)stringAlternative
active_lock_reason (anyOf 2)nullAlternative
assigneesarrayOptional
assignees[]ModelEach itemExpand List users — response body — item
author_associationstringRequired within parentHow the author is associated with the repository.
Known values: COLLABORATOR, CONTRIBUTOR, FIRST_TIMER, FIRST_TIME_CONTRIBUTOR, MANNEQUIN, MEMBER, NONE, OWNER
auto_mergeModelRequired within parentExpand Get a pull request — response body — auto merge
baseobjectRequired within parent
base.labelstringRequired within parent
base.refstringRequired within parent
base.repoModelRequired within parentExpand List repositories for the authenticated user — response body — item
base.shastringRequired within parent
base.userModelRequired within parentExpand Get an issue — response body — user
bodyJSONRequired within parent
body (anyOf 1)stringAlternative
body (anyOf 2)nullAlternative
closed_atJSONRequired within parent
closed_at (anyOf 1)stringAlternativeFormat: date-time
closed_at (anyOf 2)nullAlternative
comments_urlstringRequired within parentFormat: uri
commits_urlstringRequired within parentFormat: uri
created_atstringRequired within parentFormat: date-time
diff_urlstringRequired within parentFormat: uri
draftbooleanOptionalIndicates whether or not the pull request is a draft.
headobjectRequired within parent
head.labelstringRequired within parent
head.refstringRequired within parent
head.repoModelRequired within parentExpand List repositories for the authenticated user — response body — item
head.shastringRequired within parent
head.userModelRequired within parentExpand Get an issue — response body — user
html_urlstringRequired within parentFormat: uri
idJSONRequired within parent
id (anyOf 1)integerAlternativeFormat: int64
id (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
issue_urlstringRequired within parentFormat: uri
labelsarrayRequired within parent
labels[]objectEach item
labels[].archived_byJSONRequired within parent
labels[].archived_by (anyOf 1)JSONAlternativeThe user who archived the label, or `null` if it has not been archived.
labels[].archived_by (anyOf 1) (allOf 1)ModelAll variants applyExpand List users — response body — item
labels[].archived_by (anyOf 2)nullAlternative
labels[].colorstringRequired within parent
labels[].defaultbooleanRequired within parent
labels[].descriptionstringRequired within parent
labels[].idJSONRequired within parent
labels[].id (anyOf 1)integerAlternativeFormat: int64
labels[].id (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
labels[].namestringRequired within parent
labels[].node_idstringRequired within parent
labels[].urlstringRequired within parent
lockedbooleanRequired within parent
merged_atJSONRequired within parent
merged_at (anyOf 1)stringAlternativeFormat: date-time
merged_at (anyOf 2)nullAlternative
milestoneModelRequired within parentExpand Get an issue — response body — milestone
node_idstringRequired within parent
numberJSONRequired within parent
number (anyOf 1)integerAlternative
number (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
patch_urlstringRequired within parentFormat: uri
requested_reviewersarrayOptional
requested_reviewers[]ModelEach itemExpand List users — response body — item
requested_teamsarrayOptional
requested_teams[]ModelEach itemExpand List teams — response body — item
review_comment_urlstringRequired within parent
review_comments_urlstringRequired within parentFormat: uri
stackModelOptionalExpand Get a pull request — response body — stack
statestringRequired within parent
statuses_urlstringRequired within parentFormat: uri
titlestringRequired within parent
updated_atstringRequired within parentFormat: date-time
urlstringRequired within parentFormat: uri
userModelRequired within parentExpand Get an issue — response body — user

Referenced models: Get a pull request — response body — auto merge, Get a pull request — response body — links html, Get an issue — response body — milestone, Get an issue — response body — user, Get a pull request — response body — stack, List repositories for the authenticated user — response body — item, List users — response body — item, List teams — response body — item

Get a pull request — response body — auto merge
FieldTypePresenceDescription and constraints
$JSONRoot
$ (anyOf 1)objectAlternativeThe status of auto merging a pull request.
$ (anyOf 1).commit_messagestringRequired within parentCommit message for the merge commit.
$ (anyOf 1).commit_titlestringRequired within parentTitle for the merge commit message.
$ (anyOf 1).enabled_byModelRequired within parentExpand List users — response body — item
$ (anyOf 1).merge_methodstringRequired within parentThe merge method to use.
Known values: merge, squash, rebase
$ (anyOf 2)nullAlternative

Referenced models: List users — response body — item

Get a pull request — response body — links html
FieldTypePresenceDescription and constraints
$objectRootHypermedia Link
hrefstringRequired within parent

SDK function policy ID: github.pulls_list. Catalog operation: pulls/list. Rules can name either ID; function rules distinguish managed calls and conservatively cover raw calls sharing the route. Existing grant permissions and policy rules apply. wait() returns an immediate result or waits for a required approval; it never approves the request itself. Persist the approval ID to resume after a restart.

Provider errors retain their response; JSON decoding raises ProviderAPIError for provider failures. ManagedOperationError identifies contract/input/retention errors. See error handling and provider-specific behavior. Sensitive input may be refused before approval storage. A decoding error never resubmits a write.

Pinned headers: {"X-GitHub-Api-Version": "2026-03-10", "User-Agent": "Alter", "Accept": "application/vnd.github+json"}

Official provider source

Report an issue with this page

Necessary

Required for sign-in, security, authorization, and remembering your choices.

Always active

Analytics

Helps us understand which product and documentation features are useful.

Performance diagnostics

Uses performance tracing and privacy-masked session replay to diagnose problems.

You can change these choices at any time from Cookie settings.