openapi: 3.0.2
info:
  title: SwaggerHub User Management API
  version: "1.20251215.2"
  description: >-
    The User Management API returns information about existing organizations and their members in SwaggerHub Cloud or On-Premise.

    ## Authentication

    All requests must include an API key in the `Authorization` header:

        Authorization: YOUR_API_KEY

    The API key can be found on the **API Keys** page in user settings.


    **Important:** Keep the API key secure and do not store it directly in your code.

  
    ## Pagination

    GET requests support pagination using the `pageSize` and `page` query parameters.
    The total number of available results is indicated by the `totalCount` value in the response.

    For example, `GET <basepath>/orgs?pageSize=10&page=0` returns the first 10 organizations.
  termsOfService: https://smartbear.com/terms-of-use/
  contact:
    name: SwaggerHub Support
    url: https://support.smartbear.com/swaggerhub/message/
servers:
  - url:  https://{swaggerhub-api}/user-management/v1
    description: >-
      SwaggerHub Cloud or On-Premise base URL.
      The format for SwaggerHub On-Premise will be '{host-address}/api'.
    variables:
      swaggerhub-api:
        default: api.swaggerhub.com
security:
  - ApiKeyAuth: []
tags:
  - name: Organizations
  - name: Organization Members
  - name: Access Control
  - name: Users
paths:
  /orgs:
    get:
      tags:
        - Organizations
      summary: Get organizations for a user
      description: >-
        Returns a list of organizations that the authenticating user is a member of.


        On-Premise admin gets a list of all organizations in the system.
      operationId: getOrganizations
      parameters:
        - name: q
          in: query
          description: Search organizations by partial or full name (case-insensitive).
          required: false
          schema:
            type: string
        - $ref: '#/components/parameters/orgSortBy'
        - $ref: '#/components/parameters/order'
        - $ref: '#/components/parameters/pageParam'
        - $ref: '#/components/parameters/pageSizeParam'
      responses:
        '200':
          description: A list of organizations. The list is possibly empty.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetOrganizationsResult'
        '401':
          $ref: '#/components/responses/UnauthorizedError'

  /orgs/{owner}/members:
    parameters:
      - $ref: '#/components/parameters/ownerPathParam'
    get:
      tags:
        - Organization Members
      summary: Get organization members
      description: >-
        Returns a list of organization members and their roles. The list contains details including member email addresses and last activity.
        The authenticating user must be the organization owner or On-Premise admin.
      operationId: getOrganizationMembers
      parameters:
        - name: q
          in: query
          description: >-
            Search members by first name, last name, or email address.
          required: false
          schema:
            type: string
        - $ref: '#/components/parameters/memberSortBy'
        - $ref: '#/components/parameters/order'
        - $ref: '#/components/parameters/pageParam'
        - $ref: '#/components/parameters/pageSizeParam'
      responses:
        '200':
          description: A list of organization members
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetOrganizationMembersResult'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '403':
          description: >-
            The authenticating user does not have permission to perform this action. Possible reasons:
            
             * The authenticating user is not a member of the specified organization
             * Cannot search members by email because the authenticating user is not the organization owner or admin
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '422':
          $ref: '#/components/responses/InvalidInputError'
    post:
      tags:
        - Organization Members
      summary: Invite users to an organization
      description: >-
        Invites the specified users to the organization by email address. No roles will be assigned automatically.

        If the organization uses Single Sign-On (SSO) and is configured to block external (non-SSO) users
        from joining, you can only invite email addresses from the domains associated with this organization.

        The authenticating user must be the organization owner or On-Premise admin.
      operationId: inviteMembers
      requestBody:
        description: List of members to invite.
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/InviteOrganizationMembers'
      responses:
        '200':
          description: Members invited successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InviteMembersResult'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '422':
          $ref: '#/components/responses/InvalidInputError'
    delete:
      tags:
        - Organization Members
      summary: Remove members from an organization
      description: >-
        Removes the specified users from the organization by email address.

        The authenticating user must be the organization owner or On-Premise admin.
        **Note:** The last owner of an organization cannot be removed.
      operationId: removeMembers
      parameters:
        - $ref: '#/components/parameters/removeMemberParam'
      responses:
        '200':
          description: Organization members removed
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/OrganizationMemberResult'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '409':
          description: The last owner of an organization cannot be removed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          $ref: '#/components/responses/InvalidInputError'

  '/orgs/{owner}/resources/{resourceName}/resource-type/{resourceType}/users':
    parameters:
      - $ref: '#/components/parameters/ownerPathParam'
      - $ref: '#/components/parameters/resourceNameParam'
      - $ref: '#/components/parameters/userResourceTypeParam'
    get:
      tags:
        - Access Control
      summary: Get users with access control assigned on the resource.
      description: >-
        Returns the lists of users that have been assigned access control
        on the referenced resource.
      operationId: getAccessControlUsers
      parameters:
        - $ref: '#/components/parameters/statusFilter'
        - $ref: '#/components/parameters/pageParam'
        - $ref: '#/components/parameters/pageSizeParam'
      responses:
        '200':
          description: Successfully returns a list of access control users.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetAccessControlUsersResult'
        '400':
          $ref: '#/components/responses/InvalidInputError'
        '403':
          $ref: '#/components/responses/PermissionDeniedError'
        '404':
          $ref: '#/components/responses/NotFoundError'
    post:
      tags:
        - Access Control
      summary: Assign access control to users on a resource.
      description: Assign access control roles to the users on the referenced resource.
      operationId: addAccessControlForUsers
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref:  '#/components/schemas/AccessControlUsers'
      responses:
        '201':
          description: Successfully added access control.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResponseUserAccessControl'
        '400':
          $ref: '#/components/responses/InvalidInputError'
        '403':
          $ref: '#/components/responses/PermissionDeniedError'
        '404':
          $ref: '#/components/responses/NotFoundError'
    patch:
      tags:
        - Access Control
      summary: Update access control for users.
      description: >-
        Updates the access control roles for users on the specified resource.
        Returns the lists of users whose roles have been updated in the organization.
      operationId: updateAccessControlUsers
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AccessControlUsers'
      responses:
        '200':
          description: Successfully updated access control.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResponseUserAccessControl'
        '403':
          $ref: '#/components/responses/PermissionDeniedError'
        '404':
          $ref: '#/components/responses/NotFoundError'
    delete:
      tags:
        - Access Control
      summary: Removes access control for users
      description: Removes access control for given users and returns list of removal statuses.
      operationId: removeAccessControlForUsers
      parameters:
        - $ref: '#/components/parameters/users'
      responses:
        '200':
          description: Access control successfully deleted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResponseUserAccessControl'
        '403':
          $ref: '#/components/responses/PermissionDeniedError'

  '/orgs/{owner}/resources/{resourceName}/resource-type/{resourceType}/teams':
    parameters:
      - $ref: '#/components/parameters/ownerPathParam'
      - $ref: '#/components/parameters/resourceNameParam'
      - $ref: '#/components/parameters/teamResourceTypeParam'
    post:
      tags:
        - Access Control
      summary: Assign access control to teams on a resource.
      description: Assign access control roles to the teams on the referenced resource.
      operationId: addAccessControlForTeams
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AccessControlTeams'
      responses:
        '201':
          description: Successfully added access control.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResponseTeamAccessControl'
        '400':
          $ref: '#/components/responses/InvalidInputError'
        '403':
          $ref: '#/components/responses/PermissionDeniedError'
        '404':
          $ref: '#/components/responses/NotFoundError'
    get:
      tags:
        - Access Control
      summary: Get teams with access control assigned on the resource.
      description: >-
        Returns the lists of teams that have been assigned access control
        on the referenced resource.
      operationId: getAccessControlTeams
      parameters:
        - $ref: '#/components/parameters/pageParam'
        - $ref: '#/components/parameters/pageSizeParam'
      responses:
        '200':
          description: Successfully returns a list of access control teams.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetAccessControlTeamsResult'
        '400':
          $ref: '#/components/responses/InvalidInputError'
        '403':
          $ref: '#/components/responses/PermissionDeniedError'
        '404':
          $ref: '#/components/responses/NotFoundError'
    patch:
      tags:
        - Access Control
      summary: Update access control for teams.
      description: >-
        Updates the access control roles for teams on the specified resource.
        Returns the lists of teams whose roles have been updated in the organization.
      operationId: updateAccessControlTeams
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AccessControlTeams'
      responses:
        '200':
          description: Successfully updated access control.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResponseTeamAccessControl'
        '403':
          $ref: '#/components/responses/PermissionDeniedError'
        '404':
          $ref: '#/components/responses/NotFoundError'
    delete:
      tags:
        - Access Control
      summary: Removes access control for teams
      description: Removes access control for given teams and returns list of removal statuses.
      operationId: removeAccessControlForTeams
      parameters:
        - $ref: '#/components/parameters/teams'
      responses:
        '200':
          description: Access control successfully deleted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResponseTeamAccessControl'
        '403':
          $ref: '#/components/responses/PermissionDeniedError'
  '/users':
    get:
      tags:
        - Users
      summary: List users
      description: >-
        On-premise only. Returns information about all users in the system.
      operationId: listUsers
      parameters:
        - name: q
          in: query
          description: Filter on member's username or email.
          required: false
          schema:
            type: string
        - $ref: '#/components/parameters/pageParam'
        - $ref: '#/components/parameters/pageSizeParam'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListUsersResults'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '403':
          $ref: '#/components/responses/PermissionDeniedError'
    delete:
      tags:
        - Users
      summary: Deletes users from the On-Premise system
      description: >-
        Deletes the specified users from the On-Premise system by email address.

        The authenticating user must be the On-Premise admin.
        Deleting the last owner of an organization will result in the organization also being deleted.
      operationId: deleteUsers
      parameters:
        - $ref: '#/components/parameters/deleteUsersParam'
      responses:
        '200':
          description: Users deleted successfully.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/DeleteUserResult'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '403':
          $ref: '#/components/responses/PermissionDeniedError'
        '422':
          $ref: '#/components/responses/InvalidInputError'
  '/orgs/{owner}/roles':
    get:
      tags:
        - Access Control
      description: >-
        Returns the lists of roles that have been assigned to the user
        in the organization.
      operationId: getUserRoles
      parameters:
        - $ref: '#/components/parameters/ownerPathParam'
        - $ref: '#/components/parameters/userEmail'
        - $ref: '#/components/parameters/pageParam'
        - $ref: '#/components/parameters/pageSizeParam'
      responses:
        '200':
          description: Successfully returns a list of roles.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetUserRolesResult'
        '400':
            $ref: '#/components/responses/InvalidInputError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '422':
            $ref: '#/components/responses/InvalidInputError'

  '/orgs/{owner}/resource-types':
    get:
      tags:
        - Access Control
      summary: Get all resource types and roles that can be assigned.
      description: >-
        Returns a dictionary that maps each resource type to a list of access
        control roles that users can be assigned.
      operationId: getResourceTypes
      parameters:
        - $ref: '#/components/parameters/ownerPathParam'
      responses:
        '200':
          description: Successfully return a list of resource types.
          content:
            application/json:
              schema:
                type: object
                description: >-
                  List of resource types and the role types that can be assigned to it.
                  For example, a user can be assigned as 'owner' on an 'organization'.
                additionalProperties:
                  type: array
                  items:
                    type: string
                example:
                  organization: [ "owner", "designer", "consumer" ]
                  team: [ "admin", "member" ]
                  api: [ "designer", "consumer" ]
        '400':
          $ref: '#/components/responses/InvalidInputError'
        '404':
          $ref: '#/components/responses/NotFoundError'
components:
  schemas:
    ListUsersResults:
      allOf:
        - $ref: '#/components/schemas/PagedResult'
        - type: object
          properties:
            items:
              type: array
              items:
                $ref: '#/components/schemas/ListUsersResult'
    ListUsersResult:
      type: object
      required:
        - username
        - email
        - blocked
        - organizations
      properties:
        email:
          type: string
          format: email
          description: The email address of the user.
          example: user@example.org
        blocked:
          type: boolean
          description: >-
            Indicates whether the user is blocked from accessing the system,
            due to over-usage of the license.
        licenseType:
          type: string
          enum:
            - DESIGNER
            - USER
          description: |-
            The license seat type used by this user. This is:
            - Null for invited users who have not yet signed up.
            - DESIGNER for users who have a designer seat assigned in any organization.
            - USER for all other users.
        lastLoggedIn:
          type: string
          format: date-time
          description: >-
            The last time the user logged in to the system.
        organizations:
          type: array
          description: >-
            A list of organizations that the user is a member of.
          items:
            type: object
            properties:
              name:
                type: string
                description: The name of the organization.
              isDesigner:
                type: boolean
                description: >-
                  Indicates whether the has a role in the organization that causes them to have a DESIGNER license type.
              lastActive:
                type: string
                format: date-time
                description: the time of the last user activity in this org
              lastActivePlace:
                type: string
                description: the area of the application that the user was last active in
    PagedResult:
      type: object
      description: Base type for paged results.
      required:
        - totalCount
        - pageSize
        - page
      properties:
        totalCount:
          description: The total number of results.
          type: integer
          minimum: 0
          example: 1
        pageSize:
          description: The requested number of results per page.
          type: integer
          format: int32
          minimum: 1
          example: 50
        page:
          description: 0-based index of the current page of results.
          type: integer
          minimum: 0
          example: 0
    OrganizationBaseProperties:
      type: object
      description: Basic organization properties - used as a base type for various organization representations.
      properties:
        name:
          type: string
          pattern: "^[a-zA-Z0-9]([\\.\\-_]?[a-zA-Z0-9]+)*$"
          description: Organization name.
          example: acme
        description:
          type: string
          description: A description of the organization.
          example: Acme Inc.
        email:
          type: string
          format: email
          description: The email address of the organization.
          example: apiteam@example.com
        url:
          type: string
          format: url
          description: The website of the organization.
          example: https://example.com

    OrganizationResult:
      description: Represents an organization.
      allOf:
        - $ref: '#/components/schemas/OrganizationBaseProperties'
        - type: object
          required:
            - id
            - name
          properties:
            id:
              type: string
              format: uuid
              description: The UUID of the organization.
              example: bbc55c38-b338-4201-bf4f-4e5e54681bce
            memberCount:
              type: integer
              minimum: 0
              example: 10
              description: >-
                Total number of members in the organization.
                If the caller is the organization owner or On-Premise admin, this number also includes pending member invites.

    GetOrganizationsResult:
      description: The result of the getOrganizations operation - a paged list of organizations.
      allOf:
        - $ref: '#/components/schemas/PagedResult'
        - type: object
          properties:
            items:
              description: A list of organizations
              type: array
              items:
                $ref: '#/components/schemas/OrganizationResult'

    OrganizationMembers:
      description: List of organization members
      type: object
      required:
        - members
      properties:
        members:
          type: array
          items:
            $ref: '#/components/schemas/OrganizationMember'

    InviteOrganizationMembers:
      description: List of invited organization members
      type: object
      required:
        - members
      properties:
        members:
          type: array
          items:
            $ref: '#/components/schemas/OrganizationMember'

    InviteMembersResult:
      description: Result of inviting organization members
      type: object
      properties:
        invited:
          type: array
          items:
            type: object
            properties:
              email:
                description: The email address of the invited user
                type: string
                format: email
              status:
                description: >-
                  Invitation status.
                  ADDED - user has been added as member.
                  PENDING - user has been sent an email to complete invitation.
                  EXISTING - user is already a member of the organization.
                  INVALID - email address is invalid or user's account cannot be added to organization.
                type: string
                enum:
                  - ADDED
                  - PENDING
                  - EXISTING
                  - INVALID

    OrganizationMemberResult:
      type: object
      properties:
        email:
          type: string
          format: email
          example: steve@example.org
        status:
          description: >-
            UPDATED - organization member was updated.
            REMOVED - organization member was removed.
            NON_MEMBER - user is not a member of the organization.
          type: string
          enum:
            - UPDATED
            - REMOVED
            - NON_MEMBER
          example: UPDATED

    DeleteUserResult:
      type: object
      properties:
        email:
          type: string
          format: email
          example: steve@example.org
        status:
          description: >-
            Deletion status.
            DELETED - user has been deleted successfully.
            NOT_FOUND - user does not exist.
            CONFLICTED - more than one user is active for email.
            NOT_PERMITTED - user cannot be deleted. (User is the On-Premise Admin)
          type: string
          enum:
            - DELETED
            - NOT_FOUND
            - CONFLICTED
            - NOT_PERMITTED
          example: DELETED

    GetOrganizationMembersResult:
      description: The result of the getOrganizationMembers operation - a paged list of organization members.
      allOf:
        - $ref: '#/components/schemas/PagedResult'
        - type: object
          properties:
            items:
              description: A list of organization members.
              type: array
              items:
                $ref: '#/components/schemas/OrganizationMember'

    ResponseUserAccessControl:
      description: A response list of users.
      type: object
      properties:
        users:
          type: array
          items:
            $ref: '#/components/schemas/UsersResponse'

    UsersResponse:
      type: object
      properties:
        email:
          type: string
          description: User's email address
          example: user@example.com
        status:
          $ref: '#/components/schemas/AccessControlResponseStatus'

    ResponseTeamAccessControl:
      description: A response list of teams.
      type: object
      properties:
        teams:
          type: array
          items:
            $ref: '#/components/schemas/TeamResponse'

    TeamResponse:
      type: object
      properties:
        name:
          type: string
          description: Team's name
          example: Polar Team
        status:
          $ref: '#/components/schemas/AccessControlResponseStatus'

    AccessControlResponseStatus:
      description: |-
        ADDED - member was granted access control on the resource.
        REMOVED - access control for the member has been removed.
        UPDATED - access control for the member has been updated.
        EXISTING - member was already granted access control on the resource.
        NOT_FOUND - member does not exist.
      type: string
      enum:
        - ADDED
        - REMOVED
        - UPDATED
        - EXISTING
        - NOT_FOUND
      example: ADDED

    BillingType:
      description: User's billing type for an organization.
      readOnly: true
      type: string
      enum:
        - DESIGNER
        - CONSUMER
        - COLLABORATOR

    OrganizationMember:
      type: object
      description: Represents an organization member.
      required:
        - email
      properties:
        userId:
          type: string
          format: uuid
          description: The UUID of the user.
          readOnly: true
          example: d4071a5f-dc63-4b51-b508-462ed664cec9
        email:
          type: string
          format: email
          minLength: 3
          maxLength: 320
          description: The email address of the user. Returned only if the caller is the organization owner or On-Premise admin.
          example: devops@example.com
        firstName:
          type: string
          description: The first name of the user
          readOnly: true
        lastName:
          type: string
          description: The last name of the user
          readOnly: true
        role:
          description: A user's role in an organization
          type: string
          enum:
            - CONSUMER
            - DESIGNER
            - OWNER
          readOnly: true
        billingType:
          $ref: '#/components/schemas/BillingType'
        inviteTime:
          type: string
          format: date-time
          description: UTC date and time when the user was invited to the organization
          readOnly: true
        startTime:
          type: string
          format: date-time
          description: >-
            UTC date and time when the user joined the organization.
            This property is not returned if the user was invited but has not joined yet.
          readOnly: true
        lastActive:
          type: string
          format: date-time
          description: >-
            UTC date and time of the last activity of the user.
          readOnly: true
        lastActivePlace:
          type: string
          description: the last place where the user was active
          readOnly: true
          example: PORTAL
        status:
          type: string
          enum:
            - ACTIVE
            - INVITED
          readOnly: true
          example: ACTIVE

    AccessControlUsers:
      description: List of users with assigned access control.
      type: object
      required:
        - users
      properties:
        users:
          type: array
          items:
            $ref: '#/components/schemas/AccessControlUser'

    AccessControlUser:
      type: object
      required:
        - email
        - role
      properties:
        email:
          type: string
          format: email
          minLength: 3
          maxLength: 320
          description: User's email address.
          example: user@example.com
        uuid:
          type: string
          minLength: 36
          maxLength: 36
          readOnly: true
          description: User's UUID.
          example: a2c4e6f8-a234-1b34-12c4-ab3de6gh9jk1
        role:
          type: string
          description: User's assigned role.
          example: designer
        status:
          type: string
          enum:
            - active
            - invited
          readOnly: true
          example: active
        blocked:
          type: boolean
          readOnly: true
          description: Whether the user is blocked due to exceeding plan limits.
          example: false

    AccessControlTeams:
      description: List of teams with assigned access control.
      type: object
      required:
        - teams
      properties:
        teams:
          type: array
          items:
            $ref: '#/components/schemas/AccessControlTeam'

    AccessControlTeam:
      type: object
      required:
        - name
        - role
      properties:
        name:
          type: string
          description: Team name.
          example: Polar Team
        role:
          type: string
          description: Team's assigned role.
          example: designer

    GetAccessControlUsersResult:
      description: A paged list of users granted an access role on a resource.
      allOf:
        - $ref: '#/components/schemas/PagedResult'
        - $ref: '#/components/schemas/AccessControlUsers'

    GetAccessControlTeamsResult:
      description: A paged list of teams granted an access role on a resource.
      allOf:
        - $ref: '#/components/schemas/PagedResult'
        - $ref: '#/components/schemas/AccessControlTeams'

    GetUserRolesResult:
      description: A paged list of users roles in the organization.
      allOf:
        - $ref: '#/components/schemas/PagedResult'
        - $ref: '#/components/schemas/UserRoles'

    UserRoles:
      type: object
      required:
        - items
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/UserRole'

    UserRole:
      type: object
      required:
        - resourceType
        - name
        - role
      properties:
        resourceType:
          $ref: '#/components/schemas/ResourceType'
        name:
          type: string
          description: Name of the resource assigned
          example: AwesomeTeam
        role:
          type: string
          description: Role assigned to the user for the resource
          example: owner

    ResourceType:
      description: Type of the resource assigned
      example: api
      type: string
      enum:
        - organization
        - api
        - domain
        - template
        - team
        - project
        - portal-product

    ErrorResponse:
      type: object
      properties:
        code:
          type: integer
          description: Error code
        message:
          type: string
          description: Description of the error

  responses:
    UnauthorizedError:
      description: API key is missing or invalid.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    PermissionDeniedError:
      description: The authenticating user does not have permission to perform this action.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    InvalidInputError:
      description: Invalid input. For example, incorrect value or values were specified for query parameters.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    NotFoundError:
      description: Organization or resource not found.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'

  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: >-
        Specify your SwaggerHub API key, found on the **API Keys** page in user settings.

        Note that POST, PATCH, and DELETE requests require the API key of an _organization owner_.

  parameters:
    orgSortBy:
      name: sortBy
      in: query
      description: The property to sort the results by
      required: false
      schema:
        type: string
        default: NAME
        enum:
          - NAME
          - EMAIL
    memberSortBy:
      name: sortBy
      in: query
      description: The property to sort the results by
      required: false
      schema:
        type: string
        default: NAME
        enum:
          - NAME
          - EMAIL
          - START_TIME
    order:
      name: order
      in: query
      description: Sort order
      required: false
      schema:
        type: string
        default: ASC
        enum:
          - ASC
          - DESC
    pageParam:
      name: page
      in: query
      description: 0-based index of the page to return
      schema:
        type: integer
        format: int32
        minimum: 0
        default: 0
    pageSizeParam:
      name: pageSize
      in: query
      description: Number of results per page to return
      schema:
        type: integer
        format: int32
        minimum: 1
        maximum: 1000
        default: 50
    statusFilter:
      name: statusFilter
      in: query
      description: Filter users by invitation status
      schema:
        type: string
        default: all
        enum:
          - all
          - active
          - invited
    userEmail:
      name: user
      in: query
      description: Email address of the user.
      required: true
      schema:
        type: string
        format: email
    users:
      name: users
      in: query
      description: Members' emails
      required: true
      schema:
        type: array
        items:
          type: string
        minItems: 1
    teams:
      name: teams
      in: query
      description: Team names
      required: true
      schema:
        type: array
        items:
          type: string
        minItems: 1
    ownerPathParam:
      name: owner
      description: Organization identifier
      in: path
      required: true
      schema:
        minLength: 2
        type: string
    removeMemberParam:
      name: user
      description: |-
        Email addresses of the users to delete. Example of use:

        ```
        /orgs/orgId/members?user=member1@example.com&user=member2@example.com
        ```
      in: query
      required: true
      schema:
        type: array
        items:
          type: string
          example: user@example.com

    deleteUsersParam:
      name: user
      description: |-
        Email addresses of the users to delete. Example of use:
        
        ```
        /users?user=member1@example.com&user=member2@example.com
        ```
      in: query
      required: true
      schema:
        type: array
        items:
          type: string
          format: email
          minLength: 3
          maxLength: 320
          description: The email address of the user.

    resourceNameParam:
      name: resourceName
      description: Name of organizational resource.
      in: path
      required: true
      schema:
        type: string

    userResourceTypeParam:
      name: resourceType
      description: Organizational resource type
      in: path
      required: true
      schema:
        type: string
        enum:
          - API
          - DOMAIN
          - PROJECT
          - ORGANIZATION
          - TEAM
          - PORTAL_PRODUCT

    teamResourceTypeParam:
      name: resourceType
      description: Organizational resource type
      in: path
      required: true
      schema:
        type: string
        enum:
          - API
          - DOMAIN
          - PROJECT
          - PORTAL_PRODUCT
