GitHub Memberships API

The Memberships API from GitHub — 4 operation(s) for memberships.

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-memberships-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  version: 1.1.4
  title: GitHub Application About Memberships 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: Memberships
paths:
  /orgs/{org}/teams/{team_slug}/memberships/{username}:
    get:
      summary: GitHub Get Team Membership for User
      description: 'Team members will include the members of child teams.


        To get a user''s membership with a team, the team must be visible to the authenticated user.


        **Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/memberships/{username}`.


        **Note:**

        The response contains the `state` of the membership and the member''s `role`.


        The `role` for organization owners is set to `maintainer`. For more information about `maintainer` roles, see [Create a team](https://docs.github.com/enterprise-server@3.9/rest/teams/teams#create-a-team).'
      tags:
      - Memberships
      operationId: getTeamMembershipForUser
      externalDocs:
        description: API method documentation
        url: https://docs.github.com/enterprise-server@3.9/rest/teams/members#get-team-membership-for-a-user
      parameters:
      - $ref: '#/components/parameters/org'
      - $ref: '#/components/parameters/team-slug'
      - $ref: '#/components/parameters/username'
      responses:
        '200':
          description: Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/team-membership'
              examples:
                response-if-user-is-a-team-maintainer:
                  $ref: '#/components/examples/team-membership-response-if-user-is-a-team-maintainer'
        '404':
          description: if user has no team membership
      x-github:
        githubCloudOnly: false
        enabledForGitHubApps: true
        category: teams
        subcategory: members
      security:
      - bearerHttpAuthentication: []
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    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:
      - Memberships
      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
    delete:
      summary: GitHub Remove Team Membership for User
      description: 'To remove a membership between a user and a team, the authenticated user must have ''admin'' permissions to the team or be an owner of the organization that the team is associated with. Removing team membership does not delete the user, it just removes their membership from the 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/)."


        **Note:** You can also specify a team by `org_id` and `team_id` using the route `DELETE /organizations/{org_id}/team/{team_id}/memberships/{username}`.'
      tags:
      - Memberships
      operationId: removeTeamMembershipForUser
      externalDocs:
        description: API method documentation
        url: https://docs.github.com/enterprise-server@3.9/rest/teams/members#remove-team-membership-for-a-user
      parameters:
      - $ref: '#/components/parameters/org'
      - $ref: '#/components/parameters/team-slug'
      - $ref: '#/components/parameters/username'
      responses:
        '204':
          description: Response
        '403':
          description: Forbidden if team synchronization is set up
      x-github:
        githubCloudOnly: false
        enabledForGitHubApps: true
        category: teams
        subcategory: members
      security:
      - bearerHttpAuthentication: []
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /teams/{team_id}/memberships/{username}:
    get:
      summary: GitHub Get Team Membership for User (legacy)
      description: '**Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Get team membership for a user](https://docs.github.com/enterprise-server@3.9/rest/teams/members#get-team-membership-for-a-user) endpoint.


        Team members will include the members of child teams.


        To get a user''s membership with a team, the team must be visible to the authenticated user.


        **Note:**

        The response contains the `state` of the membership and the member''s `role`.


        The `role` for organization owners is set to `maintainer`. For more information about `maintainer` roles, see [Create a team](https://docs.github.com/enterprise-server@3.9/rest/teams/teams#create-a-team).'
      tags:
      - Memberships
      operationId: getTeamMembershipForUserLegacy
      externalDocs:
        description: API method documentation
        url: https://docs.github.com/enterprise-server@3.9/rest/teams/members#get-team-membership-for-a-user-legacy
      parameters:
      - $ref: '#/components/parameters/team-id'
      - $ref: '#/components/parameters/username'
      responses:
        '200':
          description: Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/team-membership'
              examples:
                response-if-user-is-a-team-maintainer:
                  $ref: '#/components/examples/team-membership-response-if-user-is-a-team-maintainer'
        '404':
          $ref: '#/components/responses/not_found'
      x-github:
        githubCloudOnly: false
        enabledForGitHubApps: true
        removalDate: '2021-02-01'
        deprecationDate: '2020-01-21'
        category: teams
        subcategory: members
      deprecated: true
      security:
      - bearerHttpAuthentication: []
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    put:
      summary: GitHub Add or Update Team Membership for User (legacy)
      description: '**Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Add or update team membership for a user](https://docs.github.com/enterprise-server@3.9/rest/teams/members#add-or-update-team-membership-for-a-user) endpoint.


        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.


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


        **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/)."


        If the user is unaffiliated with the team''s organization, this endpoint will send an invitation to the user via email. This newly-created membership will be in the "pending" state until the user 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. To add a membership between an unaffiliated user and a team, the authenticated user must be an organization owner.


        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.'
      tags:
      - Memberships
      operationId: addOrUpdateTeamMembershipForUserLegacy
      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-legacy
      parameters:
      - $ref: '#/components/parameters/team-id'
      - $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: Assign the member role for a user in a team
                value:
                  role: member
      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
        '404':
          $ref: '#/components/responses/not_found'
        '422':
          description: Unprocessable Entity if you attempt to add an organization to a team
      x-github:
        githubCloudOnly: false
        enabledForGitHubApps: true
        removalDate: '2021-02-01'
        deprecationDate: '2020-01-21'
        category: teams
        subcategory: members
      deprecated: true
      security:
      - bearerHttpAuthentication: []
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    delete:
      summary: GitHub Remove Team Membership for User (legacy)
      description: '**Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Remove team membership for a user](https://docs.github.com/enterprise-server@3.9/rest/teams/members#remove-team-membership-for-a-user) endpoint.


        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.


        To remove a membership between a user and a team, the authenticated user must have ''admin'' permissions to the team or be an owner of the organization that the team is associated with. Removing team membership does not delete the user, it just removes their membership from the team.


        **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/)."'
      tags:
      - Memberships
      operationId: removeTeamMembershipForUserLegacy
      externalDocs:
        description: API method documentation
        url: https://docs.github.com/enterprise-server@3.9/rest/teams/members#remove-team-membership-for-a-user-legacy
      parameters:
      - $ref: '#/components/parameters/team-id'
      - $ref: '#/components/parameters/username'
      responses:
        '204':
          description: Response
        '403':
          description: if team synchronization is set up
      x-github:
        githubCloudOnly: false
        enabledForGitHubApps: true
        removalDate: '2021-02-01'
        deprecationDate: '2020-01-21'
        category: teams
        subcategory: members
      deprecated: true
      security:
      - bearerHttpAuthentication: []
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /user/memberships/orgs:
    get:
      summary: GitHub List Organization Memberships for the Authenticated User
      description: Lists all of the authenticated user's organization memberships.
      tags:
      - Memberships
      operationId: listOrganizationMembershipsForTheAuthenticatedUser
      externalDocs:
        description: API method documentation
        url: https://docs.github.com/enterprise-server@3.9/rest/orgs/members#list-organization-memberships-for-the-authenticated-user
      parameters:
      - name: state
        description: Indicates the state of the memberships to return. If not specified, the API returns both active and pending memberships.
        in: query
        required: false
        schema:
          type: string
          enum:
          - active
          - pending
        example: active
      - $ref: '#/components/parameters/per-page'
      - $ref: '#/components/parameters/page'
      - 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
      responses:
        '200':
          description: Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/org-membership'
              examples:
                default:
                  $ref: '#/components/examples/org-membership-items'
          headers:
            Link:
              $ref: '#/components/headers/link'
        '304':
          $ref: '#/components/responses/not_modified'
        '401':
          $ref: '#/components/responses/requires_authentication'
        '403':
          $ref: '#/components/responses/forbidden'
        '422':
          $ref: '#/components/responses/validation_failed'
      x-github:
        githubCloudOnly: false
        enabledForGitHubApps: true
        category: orgs
        subcategory: members
      security:
      - bearerHttpAuthentication: []
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /user/memberships/orgs/{org}:
    get:
      summary: GitHub Get an Organization Membership for the Authenticated User
      description: If the authenticated user is an active or pending member of the organization, this endpoint will return the user's membership. If the authenticated user is not affiliated with the organization, a `404` is returned. This endpoint will return a `403` if the request is made by a GitHub App that is blocked by the organization.
      tags:
      - Memberships
      operationId: getAnOrganizationMembershipForTheAuthenticatedUser
      externalDocs:
        description: API method documentation
        url: https://docs.github.com/enterprise-server@3.9/rest/orgs/members#get-an-organization-membership-for-the-authenticated-user
      parameters:
      - $ref: '#/components/parameters/org'
      - 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
      responses:
        '200':
          description: Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/org-membership'
              examples:
                default:
                  $ref: '#/components/examples/org-membership'
        '403':
          $ref: '#/components/responses/forbidden'
        '404':
          $ref: '#/components/responses/not_found'
      x-github:
        githubCloudOnly: false
        enabledForGitHubApps: true
        category: orgs
        subcategory: members
      security:
      - bearerHttpAuthentication: []
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    patch:
      summary: GitHub Update an Organization Membership for the Authenticated User
      description: Converts the authenticated user to an active member of the organization, if that user has a pending invitation from the organization.
      tags:
      - Memberships
      operationId: updateAnOrganizationMembershipForTheAuthenticatedUser
      externalDocs:
        description: API method documentation
        url: https://docs.github.com/enterprise-server@3.9/rest/orgs/members#update-an-organization-membership-for-the-authenticated-user
      parameters:
      - $ref: '#/components/parameters/org'
      - 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: true
        content:
          application/json:
            schema:
              type: object
              properties:
                state:
                  type: string
                  description: The state that the membership should be in. Only `"active"` will be accepted.
                  enum:
                  - active
              required:
              - state
            examples:
              default:
                value:
                  state: active
      responses:
        '200':
          description: Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/org-membership'
              examples:
                default:
                  $ref: '#/components/examples/org-membership-2'
        '403':
          $ref: '#/components/responses/forbidden'
        '404':
          $ref: '#/components/responses/not_found'
        '422':
          $ref: '#/components/responses/validation_failed'
      x-github:
        githubCloudOnly: false
        enabledForGitHubApps: true
        category: orgs
        subcategory: members
      security:
      - bearerHttpAuthentication: []
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
components:
  schemas:
    nullable-simple-user:
      title: Simple User
      description: A GitHub user.
      type: object
      properties:
        name:
          nullable: true
          type: string
          example: octocat
        email:
          nullable: true
          type: string
          example: octocat@github.com
        login:
          type: string
          example: octocat
        id:
          type: integer
          example: 1
        node_id:
          type: string
          example: MDQ6VXNlcjE=
        avatar_url:
          type: string
          format: uri
          example: https://github.com/images/error/octocat_happy.gif
        gravatar_id:
          type: string
          example: 41d064eb2195891e12d0413f63227ea7
          nullable: true
        url:
          type: string
          format: uri
          example: https://api.github.com/users/octocat
        html_url:
          type: string
          format: uri
          example: https://github.com/octocat
        followers_url:
          type: string
          format: uri
          example: https://api.github.com/users/octocat/followers
        following_url:
          type: string
          example: https://api.github.com/users/octocat/following{/other_user}
        gists_url:
          type: string
          example: https://api.github.com/users/octocat/gists{/gist_id}
        starred_url:
          type: string
          example: https://api.github.com/users/octocat/starred{/owner}{/repo}
        subscriptions_url:
          type: string
          format: uri
          example: https://api.github.com/users/octocat/subscriptions
        organizations_url:
          type: string
          format: uri
          example: https://api.github.com/users/octocat/orgs
        repos_url:
          type: string
          format: uri
          example: https://api.github.com/users/octocat/repos
        events_url:
          type: string
          example: https://api.github.com/users/octocat/events{/privacy}
        received_events_url:
          type: string
          format: uri
          example: https://api.github.com/users/octocat/received_events
        type:
          type: string
          example: User
        site_admin:
          type: boolean
          example: true
        starred_at:
          type: string
          example: '"2020-07-09T00:17:55Z"'
      required:
      - avatar_url
      - events_url
      - followers_url
      - following_url
      - gists_url
      - gravatar_id
      - html_url
      - id
      - node_id
      - login
      - organizations_url
      - received_events_url
      - repos_url
      - site_admin
      - starred_url
      - subscriptions_url
      - type
      - url
      nullable: true
    org-membership:
      title: Org Membership
      description: Org Membership
      type: object
      properties:
        url:
          type: string
          format: uri
          example: https://api.github.com/orgs/octocat/memberships/defunkt
        state:
          type: string
          description: The state of the member in the organization. The `pending` state indicates the user has not yet accepted an invitation.
          example: active
          enum:
          - active
          - pending
        role:
          type: string
          description: The user's membership type in the organization.
          example: admin
          enum:
          - admin
          - member
          - billing_manager
        organization_url:
          type: string
          format: uri
          example: https://api.github.com/orgs/octocat
        organization:
          $ref: '#/components/schemas/organization-simple'
        user:
          $ref: '#/components/schemas/nullable-simple-user'
        permissions:
          type: object
          properties:
            can_create_repository:
              type: boolean
          required:
          - can_create_repository
      required:
      - state
      - role
      - organization_url
      - url
      - organization
      - user
    organization-simple:
      title: Organization Simple
      description: A GitHub organization.
      type: object
      properties:
        login:
          type: string
          example: github
        id:
          type: integer
          example: 1
        node_id:
          type: string
          example: MDEyOk9yZ2FuaXphdGlvbjE=
        url:
          type: string
          format: uri
          example: https://api.github.com/orgs/github
        repos_url:
          type: string
          format: uri
          example: https://api.github.com/orgs/github/repos
        events_url:
          type: string
          format: uri
          example: https://api.github.com/orgs/github/events
        hooks_url:
          type: string
          example: https://api.github.com/orgs/github/hooks
        issues_url:
          type: string
          example: https://api.github.com/orgs/github/issues
        members_url:
          type: string
          example: https://api.github.com/orgs/github/members{/member}
        public_members_url:
          type: string
          example: https://api.github.com/orgs/github/public_members{/member}
        avatar_url:
          type: string
          example: https://github.com/images/error/octocat_happy.gif
        description:
          type: string
          example: A great organization
          nullable: true
      required:
      - login
      - url
      - id
      - node_id
      - repos_url
      - events_url
      - hooks_url
      - issues_url
      - members_url
      - public_members_url
      - avatar_url
      - description
    basic-error:
      title: Basic Error
      description: Basic Error
      type: object
      properties:
        message:
          type: string
          example: Example body text
        documentation_url:
          type: string
          example: https://api.github.com/repos/octocat/Hello-World
        url:
          type: string
          example: https://api.github.com/repos/octocat/Hello-World
        status:
          type: string
          example: open
    validation-error:
      title: Validation Error
      description: Validation Error
      type: object
      required:
      - message
      - documentation_url
      properties:
        message:
          type: string
          example: Example body text
        documentation_url:
          type: string
          example: https://api.github.com/repos/octocat/Hello-World
        errors:
          type: array
          items:
            type: object
            required:
            - code
            properties:
              resource:
                type: string
              field:
                type: string
              message:
                type: string
              code:
                type: string
              index:
                type: integer
              value:
                oneOf:
                - type: string
                  nullable: true
                - type: integer
                  nullable: true
                - type: array
                  nullable: true
                  items:
                    type: string
    team-membership:
      title: Team Membership
      description: Team Membership
      type: object
      properties:
        url:
          type: string
          format: uri
          example: https://api.github.com/repos/octocat/Hello-World
        role:
          description: The role of the user in the team.
          enum:
          - member
          - maintainer
          default: member
          example: member
          type: string
        state:
          description: The state of the user's membership in the team.
          type: string
          enum:
          - active
          - pending
          example: active
      required:
      - role
      - state
      - url
  responses:
    not_found:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/basic-error'
    forbidden:
      description: Forbidden
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/basic-error'
    requires_authentication:
      description: Requires authe

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