GitHub Add API

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

Documentation

📖
Documentation
https://docs.github.com/en/rest/apps
📖
Documentation
https://raw.githubusercontent.com/api-evangelist/github/refs/heads/main/ https://docs.github.com/en/rest/authentication/authenticating-to-the-rest-api
📖
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.0.3
info:
  version: 1.1.4
  title: GitHub Application About Add API
  description: 'Use the REST API to retrieve information about GitHub Apps and GitHub App

    installations.'
  license:
    name: MIT
    url: https://spdx.org/licenses/MIT
  termsOfService: https://docs.github.com/articles/github-terms-of-service
  contact:
    name: Support
    url: https://support.github.com/contact?tags=dotcom-rest-api
  x-github-plan: ghes
  x-github-release: 3.9
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
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
  /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
  /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
  /repos/{owner}/{repo}/issues/{issue_number}/assignees:
    post:
      summary: GitHub Add Assignees to an Issue
      description: The Add Assignees To An Issue operation is a POST request to the /repos/{owner}/{repo}/issues/{issue_number}/assignees endpoint that allows you to add one or more assignees to an existing GitHub issue. You must specify the repository owner, repository name, and issue number in the URL path, and provide an array of usernames in the request body to designate which GitHub users should be assigned to the issue. This operation requires appropriate permissions to modify the issue, and the specified users must have access to the repository. Upon successful execution, the API returns the updated issue object including the newly added assignees in the assignees field, making it useful for task delegation and collaboration workflows within GitHub repositories.
      tags:
      - Add
      operationId: addAssigneesToAnIssue
      externalDocs:
        description: API method documentation
        url: https://docs.github.com/enterprise-server@3.9/rest/issues/assignees#add-assignees-to-an-issue
      parameters:
      - $ref: '#/components/parameters/owner'
      - $ref: '#/components/parameters/repo'
      - $ref: '#/components/parameters/issue-number'
      - in: header
        name: Authorization
        schema:
          type: string
        example: example_value
      - in: header
        name: X-GitHub-Api-Version
        schema:
          type: string
          default: '2022-11-28'
        example: example_value
      - in: header
        name: Accept
        schema:
          type: string
          default: application/vnd.github+json
        example: example_value
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                assignees:
                  type: array
                  description: 'Usernames of people to assign this issue to. _NOTE: Only users with push access can add assignees to an issue. Assignees are silently ignored otherwise._'
                  items:
                    type: string
            examples:
              default:
                value:
                  assignees:
                  - hubot
                  - other_user
      responses:
        '201':
          description: Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/issue'
              examples:
                default:
                  $ref: '#/components/examples/issue'
      x-github:
        githubCloudOnly: false
        enabledForGitHubApps: true
        category: issues
        subcategory: assignees
      x-api-evangelist-certified: '2025-07-18'
      x-api-naftiko-published: '2025-07-18'
      security:
      - bearerHttpAuthentication: []
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /repos/{owner}/{repo}/issues/{issue_number}/labels:
    post:
      summary: GitHub Add Labels to an Issue
      description: This POST endpoint adds one or more labels to a specific issue in a GitHub repository by specifying the repository owner, repository name, and issue number in the URL path. The request body should contain an array of label names to be added to the issue. Labels help categorize and organize issues for better project management and filtering. The authenticated user must have push access to the repository to add labels. Upon successful execution, the API returns a 200 status code with an array of all labels currently assigned to the issue, including both the newly added labels and any existing ones. This operation is idempotent, meaning adding a label that already exists on the issue will not create a duplicate.
      tags:
      - Add
      operationId: addLabelsToAnIssue
      externalDocs:
        description: API method documentation
        url: https://docs.github.com/enterprise-server@3.9/rest/issues/labels#add-labels-to-an-issue
      parameters:
      - $ref: '#/components/parameters/owner'
      - $ref: '#/components/parameters/repo'
      - $ref: '#/components/parameters/issue-number'
      - in: header
        name: Authorization
        schema:
          type: string
        example: example_value
      - in: header
        name: X-GitHub-Api-Version
        schema:
          type: string
          default: '2022-11-28'
        example: example_value
      - in: header
        name: Accept
        schema:
          type: string
          default: application/vnd.github+json
        example: example_value
      requestBody:
        required: false
        content:
          application/json:
            schema:
              oneOf:
              - type: object
                properties:
                  labels:
                    type: array
                    minItems: 1
                    description: The names of the labels to add to the issue's existing labels. You can pass an empty array to remove all labels. Alternatively, you can pass a single label as a `string` or an `array` of labels directly, but GitHub recommends passing an object with the `labels` key. You can also replace all of the labels for an issue. For more information, see "[Set labels for an issue](https://docs.github.com/enterprise-server@3.9/rest/issues/labels#set-labels-for-an-issue)."
                    items:
                      type: string
              - type: array
                minItems: 1
                items:
                  type: string
              - type: object
                properties:
                  labels:
                    type: array
                    minItems: 1
                    items:
                      type: object
                      properties:
                        name:
                          type: string
                      required:
                      - name
              - type: array
                minItems: 1
                items:
                  type: object
                  properties:
                    name:
                      type: string
                  required:
                  - name
              - type: string
            examples:
              default:
                value:
                  labels:
                  - bug
                  - enhancement
      responses:
        '200':
          description: Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/label'
              examples:
                default:
                  $ref: '#/components/examples/label-items'
        '301':
          $ref: '#/components/responses/moved_permanently'
        '404':
          $ref: '#/components/responses/not_found'
        '410':
          $ref: '#/components/responses/gone'
        '422':
          $ref: '#/components/responses/validation_failed'
      x-github:
        githubCloudOnly: false
        enabledForGitHubApps: true
        category: issues
        subcategory: labels
      x-api-evangelist-certified: '2025-07-18'
      x-api-naftiko-published: '2025-07-18'
      security:
      - bearerHttpAuthentication: []
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /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
  /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
  /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
  /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
  /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
  /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
  /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
  /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
  /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
              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
              nullable: true
            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
  /orgs/{org}/t

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