Skip to content

GitHub: Check team permissions for a repository (Legacy)

GitHub teams.teamsCheckPermissionsForRepoLegacy: arguments, response, policy and SDK examples.

← Teams operations · Get started

Operation github.teams_check_permissions_for_repo_legacy

Provider route: GET /teams/{team_id}/repos/{owner}/{repo}. 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["teams"]["teamsCheckPermissionsForRepoLegacy"]>[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.teams.teamsCheckPermissionsForRepoLegacy(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.teams.teams_check_permissions_for_repo_legacy(arguments)
result = await call.wait()
return result.body_json()
FieldTypePresenceDescription and constraints
$objectRootAdditional keys: not allowed
pathobjectRequired within parentAdditional keys: not allowed
path.team_idintegerRequired within parent
path.ownerstringRequired within parent
path.repostringRequired within parent

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

FieldTypePresenceDescription and constraints
$JSONRoot
$ (anyOf 1)ModelAlternativeExpand Check team permissions for a repository — response body — Team Repository
$ (anyOf 2)nullAlternative

Referenced models: Check team permissions for a repository — response body — Team Repository

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

Check team permissions for a repository — response body — Team Repository
FieldTypePresenceDescription and constraints
$objectRootA team's access to a repository.
allow_auto_mergebooleanOptionalWhether to allow Auto-merge to be used on pull requests.
Default: false
allow_forkingbooleanOptionalWhether to allow forking this repo
Default: false
allow_merge_commitbooleanOptionalWhether to allow merge commits for pull requests.
Default: true
allow_rebase_mergebooleanOptionalWhether to allow rebase merges for pull requests.
Default: true
allow_squash_mergebooleanOptionalWhether to allow squash merges for pull requests.
Default: true
archive_urlstringRequired within parent
archivedbooleanRequired within parentWhether the repository is archived.
Default: false
assignees_urlstringRequired within parent
blobs_urlstringRequired within parent
branches_urlstringRequired within parent
clone_urlstringRequired within parent
collaborators_urlstringRequired within parent
comments_urlstringRequired within parent
commits_urlstringRequired within parent
compare_urlstringRequired within parent
contents_urlstringRequired within parent
contributors_urlstringRequired within parentFormat: uri
created_atJSONRequired within parent
created_at (anyOf 1)stringAlternativeFormat: date-time
created_at (anyOf 2)nullAlternative
default_branchstringRequired within parentThe default branch of the repository.
delete_branch_on_mergebooleanOptionalWhether to delete head branches when pull requests are merged
Default: false
deployments_urlstringRequired within parentFormat: uri
descriptionJSONRequired within parent
description (anyOf 1)stringAlternative
description (anyOf 2)nullAlternative
disabledbooleanRequired within parentReturns whether or not this repository disabled.
downloads_urlstringRequired within parentFormat: uri
events_urlstringRequired within parentFormat: uri
forkbooleanRequired within parent
forksJSONRequired within parent
forks (anyOf 1)integerAlternative
forks (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
forks_countJSONRequired within parent
forks_count (anyOf 1)integerAlternative
forks_count (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
forks_urlstringRequired within parentFormat: uri
full_namestringRequired within parent
git_commits_urlstringRequired within parent
git_refs_urlstringRequired within parent
git_tags_urlstringRequired within parent
git_urlstringRequired within parent
has_issuesbooleanRequired within parentWhether issues are enabled.
Default: true
has_pagesbooleanRequired within parent
has_projectsbooleanRequired within parentWhether projects are enabled.
Default: true
has_wikibooleanRequired within parentWhether the wiki is enabled.
Default: true
homepageJSONRequired within parent
homepage (anyOf 1)stringAlternativeFormat: uri
homepage (anyOf 2)nullAlternative
hooks_urlstringRequired within parentFormat: uri
html_urlstringRequired within parentFormat: uri
idJSONRequired within parent
id (anyOf 1)integerAlternativeUnique identifier of the repository
id (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
is_templatebooleanOptionalWhether this repository acts as a template that can be used to generate new repositories.
Default: false
issue_comment_urlstringRequired within parent
issue_events_urlstringRequired within parent
issues_urlstringRequired within parent
keys_urlstringRequired within parent
labels_urlstringRequired within parent
languageJSONRequired within parent
language (anyOf 1)stringAlternative
language (anyOf 2)nullAlternative
languages_urlstringRequired within parentFormat: uri
licenseModelRequired within parentExpand Create a fork — response body — license
master_branchstringOptional
merges_urlstringRequired within parentFormat: uri
milestones_urlstringRequired within parent
mirror_urlJSONRequired within parent
mirror_url (anyOf 1)stringAlternativeFormat: uri
mirror_url (anyOf 2)nullAlternative
namestringRequired within parentThe name of the repository.
network_countJSONOptional
network_count (anyOf 1)integerAlternative
network_count (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
node_idstringRequired within parent
notifications_urlstringRequired within parent
open_issuesJSONRequired within parent
open_issues (anyOf 1)integerAlternative
open_issues (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
open_issues_countJSONRequired within parent
open_issues_count (anyOf 1)integerAlternative
open_issues_count (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
ownerModelRequired within parentExpand Get an issue — response body — user
permissionsobjectOptional
permissions.adminbooleanRequired within parent
permissions.maintainbooleanOptional
permissions.pullbooleanRequired within parent
permissions.pushbooleanRequired within parent
permissions.triagebooleanOptional
privatebooleanRequired within parentWhether the repository is private or public.
Default: false
pulls_urlstringRequired within parent
pushed_atJSONRequired within parent
pushed_at (anyOf 1)stringAlternativeFormat: date-time
pushed_at (anyOf 2)nullAlternative
releases_urlstringRequired within parent
role_namestringOptional
sizeJSONRequired within parent
size (anyOf 1)integerAlternative
size (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
ssh_urlstringRequired within parent
stargazers_countJSONRequired within parent
stargazers_count (anyOf 1)integerAlternative
stargazers_count (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
stargazers_urlstringRequired within parentFormat: uri
statuses_urlstringRequired within parent
subscribers_countJSONOptional
subscribers_count (anyOf 1)integerAlternative
subscribers_count (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
subscribers_urlstringRequired within parentFormat: uri
subscription_urlstringRequired within parentFormat: uri
svn_urlstringRequired within parentFormat: uri
tags_urlstringRequired within parentFormat: uri
teams_urlstringRequired within parentFormat: uri
temp_clone_tokenstringOptionalWhen present and non-empty, a temporary credential for read-only Git access to this repository.
It expires five minutes after generation and cannot be used to push changes.
Treat this value as sensitive and avoid recording it in logs.
topicsarrayOptional
topics[]stringEach item
trees_urlstringRequired within parent
updated_atJSONRequired within parent
updated_at (anyOf 1)stringAlternativeFormat: date-time
updated_at (anyOf 2)nullAlternative
urlstringRequired within parentFormat: uri
visibilitystringOptionalThe repository visibility: public, private, or internal.
Default: public
watchersJSONRequired within parent
watchers (anyOf 1)integerAlternative
watchers (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
watchers_countJSONRequired within parent
watchers_count (anyOf 1)integerAlternative
watchers_count (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
web_commit_signoff_requiredbooleanOptionalWhether to require contributors to sign off on web-based commits
Default: false

Referenced models: Create a fork — response body — license, Get an issue — response body — user

SDK function policy ID: github.teams_check_permissions_for_repo_legacy. Catalog operation: teams/check-permissions-for-repo-legacy. 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"}

No-content response statuses: [204]

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.