GitHub Add API

The Add API from GitHub — 27 operation(s) for add.

Documentation

📖
Documentation
https://docs.github.com/en/rest/apps
📖
Documentation
https://docs.github.com/en/rest/codes-of-conduct/codes-of-conduct
📖
Documentation
https://docs.github.com/en/rest/emojis
📖
Documentation
https://docs.github.com/en/rest/gitignore
📖
Documentation
https://docs.github.com/en/rest/apps/installations
📖
Documentation
https://docs.github.com/en/rest/enterprise-admin
📖
Documentation
https://docs.github.com/en/rest/activity/events
📖
Documentation
https://docs.github.com/en/rest/orgs
📖
Documentation
https://docs.github.com/en/rest/rate-limit
📖
Documentation
https://docs.github.com/en/enterprise-cloud@latest/rest/scim
📖
Documentation
https://docs.github.com/en/rest/using-the-rest-api/getting-started-with-the-rest-api
📖
Documentation
https://docs.github.com/en/rest/teams
📖
Documentation
https://docs.github.com/en/rest/meta/meta
📖
Documentation
https://docs.github.com/en/rest/actions
📖
Documentation
https://docs.github.com/en/rest/branches
📖
Documentation
https://docs.github.com/en/rest/code-scanning
📖
Documentation
https://docs.github.com/en/rest/collaborators
📖
Documentation
https://docs.github.com/en/rest/dependabot
📖
Documentation
https://docs.github.com/en/rest/webhooks
📖
Documentation
https://docs.github.com/en/rest/pulls
📖
Documentation
https://docs.github.com/en/rest/git/tags
📖
Documentation
https://docs.github.com/en/rest/repos/autolinks
📖
Documentation
https://docs.github.com/en/rest/collaborators/invitations

Specifications

Other Resources

OpenAPI Specification

github-add-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Github Add API
  version: 1.1.4
  license:
    name: MIT
    url: https://spdx.org/licenses/MIT
  termsOfService: https://docs.github.com/articles/github-terms-of-service
  description: 'Operations tagged Add across 11 of this provider''s published API definitions: github-app-api-openapi.yml, github-auth-api-openapi.yml, github-installation-openapi.yml, github-organizations-openapi.yml, github-projects-openapi.yml, github-repo-actions-api-openapi.yml, github-repo-branches-api-openapi.yml, github-repo-collaborators-api-openapi.yml, github-repo-issues-api-openapi.yml, github-setup-openapi.yml, github-teams-openapi.yml. Each path carries the servers of the definition it was published in.'
servers:
- url: '{protocol}://{hostname}/api/v3'
  variables:
    hostname:
      description: Self-hosted Enterprise Server hostname
      default: HOSTNAME
    protocol:
      description: Self-hosted Enterprise Server protocol
      default: http
- url: '{protocol}://{hostname}'
  variables:
    hostname:
      description: Self-hosted Enterprise Server hostname
      default: api.github.com
    protocol:
      description: Self-hosted Enterprise Server protocol
      default: https
tags:
- name: Add
paths:
  /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps:
    post:
      summary: GitHub Add App Access Restrictions
      description: 'Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub''s products](https://docs.github.com/enterprise-server@3.9/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.


        Grants the specified apps push access for this branch. Only GitHub Apps that are installed on the repository and that have been granted write access to the repository contents can be added as authorized actors on a protected branch.'
      tags:
      - Add
      operationId: addAppAccessRestrictions
      externalDocs:
        description: API method documentation
        url: https://docs.github.com/enterprise-server@3.9/rest/branches/branch-protection#add-app-access-restrictions
      parameters:
      - $ref: '#/components/parameters/owner'
      - $ref: '#/components/parameters/repo'
      - $ref: '#/components/parameters/branch'
      requestBody:
        required: false
        content:
          application/json:
            schema:
              oneOf:
              - type: object
                properties:
                  apps:
                    type: array
                    description: 'The GitHub Apps that have push access to this branch. Use the slugified version of the app name. **Note**: The list of users, apps, and teams in total is limited to 100 items.'
                    items:
                      type: string
                required:
                - apps
                example:
                  apps:
                  - my-app
              - type: array
                items:
                  type: string
            examples:
              default:
                value:
                  apps:
                  - octoapp
      responses:
        '200':
          description: Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/integration'
              examples:
                default:
                  $ref: '#/components/examples/integration-items'
        '422':
          $ref: '#/components/responses/validation_failed'
      x-github:
        githubCloudOnly: false
        enabledForGitHubApps: true
        requestBodyParameterName: apps
        category: branches
        subcategory: branch-protection
      security:
      - bearerHttpAuthentication: []
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    servers:
    - url: '{protocol}://{hostname}/api/v3'
      variables:
        hostname:
          description: Self-hosted Enterprise Server hostname
          default: HOSTNAME
        protocol:
          description: Self-hosted Enterprise Server protocol
          default: http
  /setup/api/settings/authorized-keys:
    post:
      summary: GitHub Add an Authorized Ssh Key
      description: '**Note:** The request body for this operation must be submitted as `application/x-www-form-urlencoded` data. You can submit a parameter value as a string, or you can use a tool such as `curl` to submit a parameter value as the contents of a text file. For more information, see the [`curl` documentation](https://curl.se/docs/manpage.html#--data-urlencode).'
      operationId: addAnAuthorizedSshKey
      tags:
      - Add
      externalDocs:
        description: API method documentation
        url: https://docs.github.com/enterprise-server@3.9/rest/enterprise-admin/management-console#add-an-authorized-ssh-key
      servers:
      - url: '{protocol}://{hostname}'
        variables:
          hostname:
            default: HOSTNAME
            description: Self-hosted Enterprise Server hostname
          protocol:
            default: http
            description: Self-hosted Enterprise Server protocol
      responses:
        '201':
          description: Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ssh-key'
              examples:
                default:
                  $ref: '#/components/examples/ssh-key-items'
        '401':
          description: Unauthorized
      requestBody:
        required: true
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              properties:
                authorized_key:
                  type: string
                  description: The public SSH key.
              required:
              - authorized_key
            examples:
              default:
                value:
                  authorized_key: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQCssTL/Vtu/ODLTj0VtZoRAbvf7uiv5997GyDq0MoAZUjb5jmA5wYe2/wF6sFuhiZTnZoF1ZtCHunPp0hM/GHrn6VySBhNncx14YO8FPt1CIhEeRMSEjUK9cY3xAbS365oXY8vnUHJsS9+1tr/2bx/+4NJfcUt/Ezf1OR/0LStQXw==
      x-github:
        githubCloudOnly: false
        enabledForGitHubApps: false
        category: enterprise-admin
        subcategory: management-console
      security:
      - bearerHttpAuthentication: []
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    servers:
    - url: '{protocol}://{hostname}/api/v3'
      variables:
        hostname:
          description: Self-hosted Enterprise Server hostname
          default: api.github.com
        protocol:
          description: Self-hosted Enterprise Server protocol
          default: https
  /user/installations/{installation_id}/repositories/{repository_id}:
    put:
      summary: GitHub Add Repository to an App Installation
      description: Add a single repository to an installation. The authenticated user must have admin access to the repository.
      tags:
      - Add
      operationId: addrepositoryToAnAppInstallation
      externalDocs:
        description: API method documentation
        url: https://docs.github.com/enterprise-server@3.9/rest/apps/installations#add-a-repository-to-an-app-installation
      parameters:
      - $ref: '#/components/parameters/installation-id'
      - $ref: '#/components/parameters/repository-id'
      responses:
        '204':
          description: Response
        '304':
          $ref: '#/components/responses/not_modified'
        '403':
          $ref: '#/components/responses/forbidden'
        '404':
          $ref: '#/components/responses/not_found'
      x-github:
        githubCloudOnly: false
        enabledForGitHubApps: false
        category: apps
        subcategory: installations
      security:
      - bearerHttpAuthentication: []
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    servers:
    - url: '{protocol}://{hostname}/api/v3'
      variables:
        hostname:
          description: Self-hosted Enterprise Server hostname
          default: HOSTNAME
        protocol:
          description: Self-hosted Enterprise Server protocol
          default: http
  /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}:
    put:
      summary: GitHub Add Repository Access to Self-hosted Runner Group in an Organization
      description: 'Adds a repository to the list of repositories that can access a self-hosted runner group. The runner group must have `visibility` set to `selected`. For more information, see "[Create a self-hosted runner group for an organization](#create-a-self-hosted-runner-group-for-an-organization)."


        OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.'
      operationId: addRepositoryAccessToSelfhostedRunnerGroupInAnOrganization
      tags:
      - Add
      externalDocs:
        description: API method documentation
        url: https://docs.github.com/enterprise-server@3.9/rest/actions/self-hosted-runner-groups#add-repository-access-to-a-self-hosted-runner-group-in-an-organization
      parameters:
      - $ref: '#/components/parameters/org'
      - $ref: '#/components/parameters/runner-group-id'
      - $ref: '#/components/parameters/repository-id'
      responses:
        '204':
          description: Response
      x-github:
        enabledForGitHubApps: true
        githubCloudOnly: true
        category: actions
        subcategory: self-hosted-runner-groups
      security:
      - bearerHttpAuthentication: []
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    servers:
    - url: '{protocol}://{hostname}/api/v3'
      variables:
        hostname:
          description: Self-hosted Enterprise Server hostname
          default: HOSTNAME
        protocol:
          description: Self-hosted Enterprise Server protocol
          default: http
  /orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}:
    put:
      summary: GitHub Add Self-hosted Runner to Group for an Organization
      description: 'Adds a self-hosted runner to a runner group configured in an organization.


        OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.'
      operationId: addSelfhostedRunnerToGroupForAnOrganization
      tags:
      - Add
      externalDocs:
        description: API method documentation
        url: https://docs.github.com/enterprise-server@3.9/rest/actions/self-hosted-runner-groups#add-a-self-hosted-runner-to-a-group-for-an-organization
      parameters:
      - $ref: '#/components/parameters/org'
      - $ref: '#/components/parameters/runner-group-id'
      - $ref: '#/components/parameters/runner-id'
      responses:
        '204':
          description: Response
      x-github:
        enabledForGitHubApps: true
        githubCloudOnly: true
        category: actions
        subcategory: self-hosted-runner-groups
      security:
      - bearerHttpAuthentication: []
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    servers:
    - url: '{protocol}://{hostname}/api/v3'
      variables:
        hostname:
          description: Self-hosted Enterprise Server hostname
          default: HOSTNAME
        protocol:
          description: Self-hosted Enterprise Server protocol
          default: http
  /orgs/{org}/actions/runners/{runner_id}/labels:
    post:
      summary: GitHub Add Custom Labels to Self-hosted Runner for an Organization
      description: 'Adds custom labels to a self-hosted runner configured in an organization.


        Authenticated users must have admin access to the organization to use this endpoint.


        OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.'
      tags:
      - Add
      operationId: addCustomLabelsToSelfhostedRunnerForAnOrganization
      externalDocs:
        description: API method documentation
        url: https://docs.github.com/enterprise-server@3.9/rest/actions/self-hosted-runners#add-custom-labels-to-a-self-hosted-runner-for-an-organization
      parameters:
      - $ref: '#/components/parameters/org'
      - $ref: '#/components/parameters/runner-id'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - labels
              properties:
                labels:
                  type: array
                  minItems: 1
                  maxItems: 100
                  description: The names of the custom labels to add to the runner.
                  items:
                    type: string
            examples:
              default:
                value:
                  labels:
                  - gpu
                  - accelerated
      responses:
        '200':
          $ref: '#/components/responses/actions_runner_labels'
        '404':
          $ref: '#/components/responses/not_found'
        '422':
          $ref: '#/components/responses/validation_failed_simple'
      x-github:
        githubCloudOnly: false
        enabledForGitHubApps: true
        category: actions
        subcategory: self-hosted-runners
      security:
      - bearerHttpAuthentication: []
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    servers:
    - url: '{protocol}://{hostname}/api/v3'
      variables:
        hostname:
          description: Self-hosted Enterprise Server hostname
          default: HOSTNAME
        protocol:
          description: Self-hosted Enterprise Server protocol
          default: http
  /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}:
    put:
      summary: GitHub Add Selected Repository to an Organization Secret
      description: 'Adds a repository to an organization secret when the `visibility` for

        repository access is set to `selected`. For more information about setting the visibility, see [Create or

        update an organization secret](https://docs.github.com/enterprise-server@3.9/rest/actions/secrets#create-or-update-an-organization-secret).


        Authenticated users must have collaborator access to a repository to create, update, or read secrets.


        OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.'
      tags:
      - Add
      operationId: addSelectedRepositoryToAnOrganizationSecret
      externalDocs:
        description: API method documentation
        url: https://docs.github.com/enterprise-server@3.9/rest/actions/secrets#add-selected-repository-to-an-organization-secret
      parameters:
      - $ref: '#/components/parameters/org'
      - $ref: '#/components/parameters/secret-name'
      - name: repository_id
        in: path
        required: true
        schema:
          type: integer
        example: 42
      responses:
        '204':
          description: No Content when repository was added to the selected list
        '409':
          description: Conflict when visibility type is not set to selected
      x-github:
        githubCloudOnly: false
        enabledForGitHubApps: true
        category: actions
        subcategory: secrets
      security:
      - bearerHttpAuthentication: []
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    servers:
    - url: '{protocol}://{hostname}/api/v3'
      variables:
        hostname:
          description: Self-hosted Enterprise Server hostname
          default: HOSTNAME
        protocol:
          description: Self-hosted Enterprise Server protocol
          default: http
  /orgs/{org}/actions/variables/{name}/repositories/{repository_id}:
    put:
      summary: GitHub Add Selected Repository to an Organization Variable
      description: 'Adds a repository to an organization variable that is available to selected repositories.

        Organization variables that are available to selected repositories have their `visibility` field set to `selected`.


        Authenticated users must have collaborator access to a repository to create, update, or read secrets.


        OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.'
      tags:
      - Add
      operationId: addSelectedRepositoryToAnOrganizationVariable
      externalDocs:
        description: API method documentation
        url: https://docs.github.com/enterprise-server@3.9/rest/actions/variables#add-selected-repository-to-an-organization-variable
      parameters:
      - $ref: '#/components/parameters/org'
      - $ref: '#/components/parameters/variable-name'
      - name: repository_id
        in: path
        required: true
        schema:
          type: integer
        example: 42
      responses:
        '204':
          description: Response
        '409':
          description: Response when the visibility of the variable is not set to `selected`
      x-github:
        githubCloudOnly: false
        enabledForGitHubApps: true
        category: actions
        subcategory: variables
      security:
      - bearerHttpAuthentication: []
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    servers:
    - url: '{protocol}://{hostname}/api/v3'
      variables:
        hostname:
          description: Self-hosted Enterprise Server hostname
          default: HOSTNAME
        protocol:
          description: Self-hosted Enterprise Server protocol
          default: http
  /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id}:
    put:
      summary: GitHub Add Selected Repository to an Organization Secret
      description: 'Adds a repository to an organization secret when the `visibility` for

        repository access is set to `selected`. The visibility is set when you [Create or

        update an organization secret](https://docs.github.com/enterprise-server@3.9/rest/dependabot/secrets#create-or-update-an-organization-secret).


        OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.'
      tags:
      - Add
      operationId: addSelectedRepositoryToAnOrganizationSecret
      externalDocs:
        description: API method documentation
        url: https://docs.github.com/enterprise-server@3.9/rest/dependabot/secrets#add-selected-repository-to-an-organization-secret
      parameters:
      - $ref: '#/components/parameters/org'
      - $ref: '#/components/parameters/secret-name'
      - name: repository_id
        in: path
        required: true
        schema:
          type: integer
        example: 42
      responses:
        '204':
          description: No Content when repository was added to the selected list
        '409':
          description: Conflict when visibility type is not set to selected
      x-github:
        githubCloudOnly: false
        enabledForGitHubApps: true
        category: dependabot
        subcategory: secrets
      security:
      - bearerHttpAuthentication: []
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    servers:
    - url: '{protocol}://{hostname}/api/v3'
      variables:
        hostname:
          description: Self-hosted Enterprise Server hostname
          default: HOSTNAME
        protocol:
          description: Self-hosted Enterprise Server protocol
          default: http
  /orgs/{org}/security-managers/teams/{team_slug}:
    put:
      summary: GitHub Add Security Manager Team
      description: 'Adds a team as a security manager for an organization. For more information, see "[Managing security for an organization](https://docs.github.com/enterprise-server@3.9/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization) for an organization."


        The authenticated user must be an administrator for the organization to use this endpoint.


        OAuth app tokens and personal access tokens (classic) need the `write:org` scope to use this endpoint.'
      tags:
      - Add
      operationId: addSecurityManagerTeam
      externalDocs:
        description: API method documentation
        url: https://docs.github.com/enterprise-server@3.9/rest/orgs/security-managers#add-a-security-manager-team
      parameters:
      - $ref: '#/components/parameters/org'
      - $ref: '#/components/parameters/team-slug'
      responses:
        '204':
          description: Response
        '409':
          description: The organization has reached the maximum number of security manager teams.
      x-github:
        githubCloudOnly: false
        enabledForGitHubApps: true
        previews: []
        category: orgs
        subcategory: security-managers
      security:
      - bearerHttpAuthentication: []
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    servers:
    - url: '{protocol}://{hostname}/api/v3'
      variables:
        hostname:
          description: Self-hosted Enterprise Server hostname
          default: HOSTNAME
        protocol:
          description: Self-hosted Enterprise Server protocol
          default: http
  /orgs/{org}/teams/{team_slug}/memberships/{username}:
    put:
      summary: GitHub Add or Update Team Membership for User
      description: 'Adds an organization member to a team. An authenticated organization owner or team maintainer can add organization members to a team.


        Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub''s products](https://docs.github.com/enterprise-server@3.9/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.


        **Note:** When you have team synchronization set up for a team with your organization''s identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team''s membership. If you have access to manage group membership in your IdP, you can manage GitHub Enterprise Server team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see "[Synchronizing teams between your identity provider and GitHub Enterprise Server](https://docs.github.com/enterprise-server@3.9/articles/synchronizing-teams-between-your-identity-provider-and-github/)."


        An organization owner can add someone who is not part of the team''s organization to a team. When an organization owner adds someone to a team who is not an organization member, this endpoint will send an invitation to the person via email. This newly-created membership will be in the "pending" state until the person accepts the invitation, at which point the membership will transition to the "active" state and the user will be added as a member of the team.


        If the user is already a member of the team, this endpoint will update the role of the team member''s role. To update the membership of a team member, the authenticated user must be an organization owner or a team maintainer.


        **Note:** You can also specify a team by `org_id` and `team_id` using the route `PUT /organizations/{org_id}/team/{team_id}/memberships/{username}`.'
      tags:
      - Add
      operationId: addOrUpdateTeamMembershipForUser
      externalDocs:
        description: API method documentation
        url: https://docs.github.com/enterprise-server@3.9/rest/teams/members#add-or-update-team-membership-for-a-user
      parameters:
      - $ref: '#/components/parameters/org'
      - $ref: '#/components/parameters/team-slug'
      - $ref: '#/components/parameters/username'
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                role:
                  type: string
                  description: The role that this user should have in the team.
                  enum:
                  - member
                  - maintainer
                  default: member
            examples:
              default:
                summary: Add or update team membership for an organization member
                value:
                  role: maintainer
      responses:
        '200':
          description: Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/team-membership'
              examples:
                response-if-users-membership-with-team-is-now-pending:
                  $ref: '#/components/examples/team-membership-response-if-users-membership-with-team-is-now-pending'
        '403':
          description: Forbidden if team synchronization is set up
        '422':
          description: Unprocessable Entity if you attempt to add an organization to a team
      x-github:
        githubCloudOnly: false
        enabledForGitHubApps: true
        category: teams
        subcategory: members
      security:
      - bearerHttpAuthentication: []
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    servers:
    - url: '{protocol}://{hostname}/api/v3'
      variables:
        hostname:
          description: Self-hosted Enterprise Server hostname
          default: HOSTNAME
        protocol:
          description: Self-hosted Enterprise Server protocol
          default: http
  /orgs/{org}/teams/{team_slug}/projects/{project_id}:
    put:
      summary: GitHub Add or Update Team Project Permissions
      description: 'Adds an organization project to a team. To add a project to a team or update the team''s permission on a project, the authenticated user must have `admin` permissions for the project. The project and team must be part of the same organization.


        **Note:** You can also specify a team by `org_id` and `team_id` using the route `PUT /organizations/{org_id}/team/{team_id}/projects/{project_id}`.'
      tags:
      - Add
      operationId: addOrUpdateTeamProjectPermissions
      externalDocs:
        description: API method documentation
        url: https://docs.github.com/enterprise-server@3.9/rest/teams/teams#add-or-update-team-project-permissions
      parameters:
      - $ref: '#/components/parameters/org'
      - $ref: '#/components/parameters/team-slug'
      - $ref: '#/components/parameters/project-id'
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type:
              - object
              - 'null'
              properties:
                permission:
                  type: string
                  description: 'The permission to grant to the team for this project. Default: the team''s `permission` attribute will be used to determine what permission to grant the team on this project. Note that, if you choose not to pass any parameters, you''ll need to set `Content-Length` to zero when calling this endpoint. For more information, see "[HTTP method](https://docs.github.com/enterprise-server@3.9/rest/guides/getting-started-with-the-rest-api#http-method)."'
                  enum:
                  - read
                  - write
                  - admin
            examples:
              default:
                summary: Updates the permissions for the team to write for the project
                value:
                  permission: write
      responses:
        '204':
          description: Response
        '403':
          description: Forbidden if the project is not owned by the organization
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                  documentation_url:
                    type: string
              examples:
                response-if-the-project-is-not-owned-by-the-organization:
                  value:
                    message: Must have admin rights to Repository.
                    documentation_url: https://docs.github.com/enterprise-server@3.9/rest/teams/teams#add-or-update-team-project-permissions
      x-github:
        githubCloudOnly: false
        enabledForGitHubApps: true
        category: teams
        subcategory: teams
      security:
      - bearerHttpAuthentication: []
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    servers:
    - url: '{protocol}://{hostname}/api/v3'
      variables:
        hostname:
          description: Self-hosted Enterprise Server hostname
          default: HOSTNAME
        protocol:
          description: Self-hosted Enterprise Server protocol
          default: http
  /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}:
    put:
      summary: GitHub Add or Update Team Repository Permissions
      description: 'To add a repository to a team or update the team''s permission on a repository, the authenticated user must have admin access to the repository, and must be able to see the team. The repository must be owned by the organization, or a direct fork of a repository owned by the organization. You will get a `422 Unprocessable Entity` status if you attempt to add a repository to a team that is not owned by the organization. Note that, if you choose not to pass any parameters, you''ll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see "[HTTP method](https://docs.github.com/enterprise-server@3.9/rest/guides/getting-started-with-the-rest-api#http-method)."


        **Note:** You can also specify a team by `org_id` and `team_id` using the route `PUT /organizations/{org_id}/team/{team_id}/repos/{owner}/{repo}`.


        For more information about the permission levels, see "[Repository permission levels for an organization](https://docs.github.com/enterprise-server@3.9/github/setting-up-and-managing-organizations-and-teams/repository-permission-levels-for-an-organization#permission-levels-for-repositories-owned-by-an-organization)".'
      tags:
      - Add
      operationId: addOrUpdateTeamRepositoryPermissions
      externalDocs:
        description: API method documentation
        url: https://docs.github.com/enterprise-server@3.9/rest/teams/teams#add-or-update-team-repository-permissions
      parameters:
      - $ref: '#/components/parameters/org'
      - $ref: '#/components/parameters/team-slug'
      - $ref: '#/components/parameters/owner'
      - $ref: '#/components/parameters/repo'
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                permission:
                  type: string
                  description: 'The permission to grant the team on this repository. We accept the following permissions to be set: `pull`, `triage`, `push`, `maintain`, `admin` and you can also specify a custom repository role name, if the owning organization has defined any. If no permission is specified, the team''s `permission` attribute will be used to determine what permission to grant the team on this repository.'
                  default: push
            examples:
              default:
                summary: Adding a team to an organization repository with the write role
                value:
                  permission: push
      responses:
        '204':
          description: Response
      x-github:
        githubCloudOnly: false
        enabledForGitHubApps: true
        category: teams
        subcategory: teams
      security:
      - bearerHttpAuthentication: []
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    servers:
    - url: '{protocol}://{hostname}/api/v3'
      variables:
        hostname:
          description: Self-hosted Enterprise Server hostname
          default: HOSTNAME
        protocol:
          description: Self-hosted Enterprise Server protocol
          default: http
  /projects/{project_id}/collaborators/{username}:
    put:
      summary: GitHub Add Project Collaborator
      description: Adds a collaborator to an organization proje

# --- truncated at 32 KB (150 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/github/refs/heads/main/openapi/github-add-api-openapi.yml