openapi: 3.1.0
info:
  title: User Management API
  version: 1.0.0
paths:
  /organizations/{organization_id}/organization_memberships:
    get:
      operationId: getAllOrganizationMemberships
      summary: Get all organization memberships
      description: >-
        Returns a paginated collection of all organization memberships. All organization members receive a scoped
        response.
      tags:
        - organizationMemberships
      parameters:
        - name: organization_id
          in: path
          description: The organization ID
          required: true
          schema:
            type: string
        - name: skip
          in: query
          description: Specify an offset to paginate through results
          required: false
          schema:
            type: integer
        - name: limit
          in: query
          description: Specify the maximum number of results (max 100)
          required: false
          schema:
            type: integer
        - name: order
          in: query
          description: Specify sort order of result set
          required: false
          schema:
            $ref: '#/components/schemas/OrganizationsOrganizationIdOrganizationMembershipsGetParametersOrder'
        - name: include
          in: query
          description: Specify linked resources to include in response
          required: false
          schema:
            $ref: '#/components/schemas/OrganizationsOrganizationIdOrganizationMembershipsGetParametersInclude'
        - name: query
          in: query
          description: Full-text search across multiple attributes
          required: false
          schema:
            type: string
        - name: role
          in: query
          description: Filter by organization role
          required: false
          schema:
            $ref: '#/components/schemas/OrganizationsOrganizationIdOrganizationMembershipsGetParametersRole'
        - name: sys.status
          in: query
          description: Filter by membership status
          required: false
          schema:
            $ref: '#/components/schemas/OrganizationsOrganizationIdOrganizationMembershipsGetParametersSysStatus'
        - name: Authorization
          in: header
          description: Bearer authentication
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK - Paginated list of organization memberships
          content:
            application/json:
              schema:
                type: object
                additionalProperties:
                  description: Any type
  /organizations/{organization_id}/organization_memberships/{organization_membership_id}:
    get:
      operationId: getAnOrganizationMembership
      summary: Get an organization membership
      description: Returns details about an existing organization membership. Accessible by all organization members.
      tags:
        - organizationMemberships
      parameters:
        - name: organization_id
          in: path
          description: The organization ID
          required: true
          schema:
            type: string
        - name: organization_membership_id
          in: path
          description: The organization membership ID
          required: true
          schema:
            type: string
        - name: Authorization
          in: header
          description: Bearer authentication
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK - Organization membership details
          content:
            application/json:
              schema:
                type: object
                additionalProperties:
                  description: Any type
    put:
      operationId: updateAnOrganizationMembership
      summary: Update an organization membership
      description: Updates the organizational role for a membership. Only organization admins and owners can update memberships.
      tags:
        - organizationMemberships
      parameters:
        - name: organization_id
          in: path
          description: The organization ID
          required: true
          schema:
            type: string
        - name: organization_membership_id
          in: path
          description: The organization membership ID
          required: true
          schema:
            type: string
        - name: Authorization
          in: header
          description: Bearer authentication
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK - Updated organization membership
          content:
            application/json:
              schema:
                type: object
                additionalProperties:
                  description: Any type
      requestBody:
        content:
          application/json:
            schema:
              type: object
              additionalProperties:
                description: Any type
    delete:
      operationId: deleteAnOrganizationMembership
      summary: Delete an organization membership
      description: >-
        Deletes an organization membership, revoking org access without removing the user account. Admins and owners can
        delete any membership; members can remove themselves, but the last owner membership cannot be deleted.
      tags:
        - organizationMemberships
      parameters:
        - name: organization_id
          in: path
          description: The organization ID
          required: true
          schema:
            type: string
        - name: organization_membership_id
          in: path
          description: The organization membership ID
          required: true
          schema:
            type: string
        - name: Authorization
          in: header
          description: Bearer authentication
          required: true
          schema:
            type: string
      responses:
        '204':
          description: No Content - Organization membership deleted successfully
          content:
            application/json:
              schema:
                type: object
                properties: {}
  /organizations/{organization_id}/invitations:
    post:
      operationId: createAnInvitation
      summary: Create an invitation
      description: >-
        Invites a user to the organization. Only admins and owners can send invitations; this endpoint is in alpha and
        may introduce breaking changes.
      tags:
        - invitations
      parameters:
        - name: organization_id
          in: path
          description: The organization ID
          required: true
          schema:
            type: string
        - name: Authorization
          in: header
          description: Bearer authentication
          required: true
          schema:
            type: string
      responses:
        '201':
          description: Created - Invitation created successfully
          content:
            application/json:
              schema:
                type: object
                additionalProperties:
                  description: Any type
      requestBody:
        content:
          application/json:
            schema:
              type: object
              additionalProperties:
                description: Any type
  /organizations/{organization_id}/invitations/{invitation_id}:
    get:
      operationId: getAnInvitation
      summary: Get an invitation
      description: >-
        Returns details about an existing invitation; `user` is `null` until accepted. Only organization admins and
        owners can access this endpoint (alpha).
      tags:
        - invitations
      parameters:
        - name: organization_id
          in: path
          description: The organization ID
          required: true
          schema:
            type: string
        - name: invitation_id
          in: path
          description: The invitation ID
          required: true
          schema:
            type: string
        - name: Authorization
          in: header
          description: Bearer authentication
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK - Invitation details
          content:
            application/json:
              schema:
                type: object
                additionalProperties:
                  description: Any type
  /organizations/{organization_id}/teams:
    get:
      operationId: getAllTeamsForAnOrganization
      summary: Get all teams for an organization
      description: Returns a paginated collection of all teams in the organization. Accessible by all organization members.
      tags:
        - teams
      parameters:
        - name: organization_id
          in: path
          description: The organization ID
          required: true
          schema:
            type: string
        - name: skip
          in: query
          description: Specify an offset to paginate through results
          required: false
          schema:
            type: integer
        - name: limit
          in: query
          description: Specify the maximum number of results
          required: false
          schema:
            type: integer
        - name: Authorization
          in: header
          description: Bearer authentication
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK - Paginated list of teams
          content:
            application/json:
              schema:
                type: object
                additionalProperties:
                  description: Any type
    post:
      operationId: createATeam
      summary: Create a team
      description: Creates a new team in the organization. Only organization admins and owners can create teams.
      tags:
        - teams
      parameters:
        - name: organization_id
          in: path
          description: The organization ID
          required: true
          schema:
            type: string
        - name: Authorization
          in: header
          description: Bearer authentication
          required: true
          schema:
            type: string
      responses:
        '201':
          description: Created - Team created successfully
          content:
            application/json:
              schema:
                type: object
                additionalProperties:
                  description: Any type
      requestBody:
        content:
          application/json:
            schema:
              type: object
              additionalProperties:
                description: Any type
  /spaces/{space_id}/teams:
    get:
      operationId: getAllTeamsForASpace
      summary: Get all teams for a space
      description: Returns a paginated collection of all teams in the space. Accessible by all space members.
      tags:
        - teams
      parameters:
        - name: space_id
          in: path
          description: The space ID
          required: true
          schema:
            type: string
        - name: skip
          in: query
          description: Specify an offset to paginate through results
          required: false
          schema:
            type: integer
        - name: limit
          in: query
          description: Specify the maximum number of results
          required: false
          schema:
            type: integer
        - name: Authorization
          in: header
          description: Bearer authentication
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK - Paginated list of teams in space
          content:
            application/json:
              schema:
                type: object
                additionalProperties:
                  description: Any type
  /organizations/{organization_id}/teams/{team_id}:
    get:
      operationId: getATeam
      summary: Get a team
      description: Returns details about an existing team. Accessible by all organization members.
      tags:
        - teams
      parameters:
        - name: organization_id
          in: path
          description: The organization ID
          required: true
          schema:
            type: string
        - name: team_id
          in: path
          description: The team ID
          required: true
          schema:
            type: string
        - name: Authorization
          in: header
          description: Bearer authentication
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK - Team details
          content:
            application/json:
              schema:
                type: object
                additionalProperties:
                  description: Any type
    put:
      operationId: updateATeam
      summary: Update a team
      description: Updates the data associated with a team. Only organization admins and owners can update teams.
      tags:
        - teams
      parameters:
        - name: organization_id
          in: path
          description: The organization ID
          required: true
          schema:
            type: string
        - name: team_id
          in: path
          description: The team ID
          required: true
          schema:
            type: string
        - name: Authorization
          in: header
          description: Bearer authentication
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK - Updated team
          content:
            application/json:
              schema:
                type: object
                additionalProperties:
                  description: Any type
      requestBody:
        content:
          application/json:
            schema:
              type: object
              additionalProperties:
                description: Any type
    delete:
      operationId: deleteATeam
      summary: Delete a team
      description: Deletes a team. Only organization admins and owners can delete teams.
      tags:
        - teams
      parameters:
        - name: organization_id
          in: path
          description: The organization ID
          required: true
          schema:
            type: string
        - name: team_id
          in: path
          description: The team ID
          required: true
          schema:
            type: string
        - name: Authorization
          in: header
          description: Bearer authentication
          required: true
          schema:
            type: string
      responses:
        '204':
          description: No Content - Team deleted successfully
          content:
            application/json:
              schema:
                type: object
                properties: {}
  /organizations/{organization_id}/teams/{team_id}/team_memberships:
    get:
      operationId: getAllTeamMembershipsForATeam
      summary: Get all team memberships for a team
      description: Returns a paginated collection of all memberships for the team. Accessible by all organization members.
      tags:
        - teamMemberships
      parameters:
        - name: organization_id
          in: path
          description: The organization ID
          required: true
          schema:
            type: string
        - name: team_id
          in: path
          description: The team ID
          required: true
          schema:
            type: string
        - name: skip
          in: query
          description: Specify an offset to paginate through results
          required: false
          schema:
            type: integer
        - name: limit
          in: query
          description: Specify the maximum number of results
          required: false
          schema:
            type: integer
        - name: order
          in: query
          description: Specify sort order of result set
          required: false
          schema:
            $ref: '#/components/schemas/OrganizationsOrganizationIdTeamsTeamIdTeamMembershipsGetParametersOrder'
        - name: include
          in: query
          description: Specify linked resources to include in response
          required: false
          schema:
            $ref: '#/components/schemas/OrganizationsOrganizationIdTeamsTeamIdTeamMembershipsGetParametersInclude'
        - name: Authorization
          in: header
          description: Bearer authentication
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK - Paginated list of team memberships
          content:
            application/json:
              schema:
                type: object
                additionalProperties:
                  description: Any type
    post:
      operationId: createATeamMembership
      summary: Create a team membership
      description: Creates a new team membership. Only organization admins and owners can manage team memberships.
      tags:
        - teamMemberships
      parameters:
        - name: organization_id
          in: path
          description: The organization ID
          required: true
          schema:
            type: string
        - name: team_id
          in: path
          description: The team ID
          required: true
          schema:
            type: string
        - name: Authorization
          in: header
          description: Bearer authentication
          required: true
          schema:
            type: string
      responses:
        '201':
          description: Created - Team membership created successfully
          content:
            application/json:
              schema:
                type: object
                additionalProperties:
                  description: Any type
      requestBody:
        content:
          application/json:
            schema:
              type: object
              additionalProperties:
                description: Any type
  /organizations/{organization_id}/team_memberships:
    get:
      operationId: getAllTeamMembershipsForAnOrganization
      summary: Get all team memberships for an organization
      description: >-
        Returns a paginated collection of all team memberships across all teams in the organization. Accessible by all
        organization members.
      tags:
        - teamMemberships
      parameters:
        - name: organization_id
          in: path
          description: The organization ID
          required: true
          schema:
            type: string
        - name: skip
          in: query
          description: Specify an offset to paginate through results
          required: false
          schema:
            type: integer
        - name: limit
          in: query
          description: Specify the maximum number of results
          required: false
          schema:
            type: integer
        - name: order
          in: query
          description: Specify sort order of result set
          required: false
          schema:
            $ref: '#/components/schemas/OrganizationsOrganizationIdTeamMembershipsGetParametersOrder'
        - name: include
          in: query
          description: Specify linked resources to include in response
          required: false
          schema:
            $ref: '#/components/schemas/OrganizationsOrganizationIdTeamMembershipsGetParametersInclude'
        - name: sys.organizationMembership.sys.id
          in: query
          description: Filter by organization membership ID
          required: false
          schema:
            type: string
        - name: Authorization
          in: header
          description: Bearer authentication
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK - Paginated list of team memberships across the organization
          content:
            application/json:
              schema:
                type: object
                additionalProperties:
                  description: Any type
  /organizations/{organization_id}/teams/{team_id}/team_memberships/{team_membership_id}:
    get:
      operationId: getATeamMembership
      summary: Get a team membership
      description: Returns details about an existing team membership. Accessible by all organization members.
      tags:
        - teamMemberships
      parameters:
        - name: organization_id
          in: path
          description: The organization ID
          required: true
          schema:
            type: string
        - name: team_id
          in: path
          description: The team ID
          required: true
          schema:
            type: string
        - name: team_membership_id
          in: path
          description: The team membership ID
          required: true
          schema:
            type: string
        - name: Authorization
          in: header
          description: Bearer authentication
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK - Team membership details
          content:
            application/json:
              schema:
                type: object
                additionalProperties:
                  description: Any type
    delete:
      operationId: deleteATeamMembership
      summary: Delete a team membership
      description: Deletes a team membership. Only organization admins and owners can delete team memberships.
      tags:
        - teamMemberships
      parameters:
        - name: organization_id
          in: path
          description: The organization ID
          required: true
          schema:
            type: string
        - name: team_id
          in: path
          description: The team ID
          required: true
          schema:
            type: string
        - name: team_membership_id
          in: path
          description: The team membership ID
          required: true
          schema:
            type: string
        - name: Authorization
          in: header
          description: Bearer authentication
          required: true
          schema:
            type: string
      responses:
        '204':
          description: No Content - Team membership deleted successfully
          content:
            application/json:
              schema:
                type: object
                properties: {}
  /spaces/{space_id}/space_memberships:
    get:
      operationId: getAllSpaceMembershipsForASpace
      summary: Get all space memberships for a space
      description: Returns a paginated list of all space memberships in the space. Accessible by all space members.
      tags:
        - spaceMemberships
      parameters:
        - name: space_id
          in: path
          description: The space ID
          required: true
          schema:
            type: string
        - name: skip
          in: query
          description: Specify an offset to paginate through results
          required: false
          schema:
            type: integer
        - name: limit
          in: query
          description: Specify the maximum number of results
          required: false
          schema:
            type: integer
        - name: include
          in: query
          description: Specify linked resources to include in response
          required: false
          schema:
            $ref: '#/components/schemas/SpacesSpaceIdSpaceMembershipsGetParametersInclude'
        - name: Authorization
          in: header
          description: Bearer authentication
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK - Paginated list of space memberships
          content:
            application/json:
              schema:
                type: object
                additionalProperties:
                  description: Any type
    post:
      operationId: createASpaceMembership
      summary: Create a space membership
      description: >-
        Creates a space membership, assigning the user as admin or to one or more roles. The user must exist in the
        organization and is identified by their email address.
      tags:
        - spaceMemberships
      parameters:
        - name: space_id
          in: path
          description: The space ID
          required: true
          schema:
            type: string
        - name: Authorization
          in: header
          description: Bearer authentication
          required: true
          schema:
            type: string
      responses:
        '201':
          description: Created - Space membership created successfully
          content:
            application/json:
              schema:
                type: object
                additionalProperties:
                  description: Any type
      requestBody:
        content:
          application/json:
            schema:
              type: object
              additionalProperties:
                description: Any type
  /organizations/{organization_id}/space_memberships:
    get:
      operationId: getAllSpaceMembershipsForAnOrganization
      summary: Get all space memberships for an organization
      description: >-
        Returns a paginated list of all space memberships across the organization. Only organization admins and owners
        can access this endpoint.
      tags:
        - spaceMemberships
      parameters:
        - name: organization_id
          in: path
          description: The organization ID
          required: true
          schema:
            type: string
        - name: skip
          in: query
          description: Specify an offset to paginate through results
          required: false
          schema:
            type: integer
        - name: limit
          in: query
          description: Specify the maximum number of results
          required: false
          schema:
            type: integer
        - name: order
          in: query
          description: Specify sort order of result set
          required: false
          schema:
            $ref: '#/components/schemas/OrganizationsOrganizationIdSpaceMembershipsGetParametersOrder'
        - name: include
          in: query
          description: Specify linked resources to include in response
          required: false
          schema:
            $ref: '#/components/schemas/OrganizationsOrganizationIdSpaceMembershipsGetParametersInclude'
        - name: query
          in: query
          description: Full-text search across multiple attributes
          required: false
          schema:
            type: string
        - name: admin
          in: query
          description: Filter by admin status
          required: false
          schema:
            type: boolean
        - name: roles.sys.id
          in: query
          description: Filter by role ID
          required: false
          schema:
            type: string
        - name: sys.space.sys.id
          in: query
          description: Filter by space ID
          required: false
          schema:
            type: string
        - name: Authorization
          in: header
          description: Bearer authentication
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK - Paginated list of space memberships across the organization
          content:
            application/json:
              schema:
                type: object
                additionalProperties:
                  description: Any type
  /spaces/{space_id}/space_memberships/{space_membership_id}:
    get:
      operationId: getASpaceMembershipForASpace
      summary: Get a space membership for a space
      description: Returns details about an existing space membership. Accessible by all space members.
      tags:
        - spaceMemberships
      parameters:
        - name: space_id
          in: path
          description: The space ID
          required: true
          schema:
            type: string
        - name: space_membership_id
          in: path
          description: The space membership ID
          required: true
          schema:
            type: string
        - name: Authorization
          in: header
          description: Bearer authentication
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK - Space membership details
          content:
            application/json:
              schema:
                type: object
                additionalProperties:
                  description: Any type
    put:
      operationId: updateASpaceMembership
      summary: Update a space membership
      description: >-
        Updates a space membership to change the user's roles or admin status. Only org admins, owners, and space admins
        can update memberships.
      tags:
        - spaceMemberships
      parameters:
        - name: space_id
          in: path
          description: The space ID
          required: true
          schema:
            type: string
        - name: space_membership_id
          in: path
          description: The space membership ID
          required: true
          schema:
            type: string
        - name: Authorization
          in: header
          description: Bearer authentication
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK - Updated space membership
          content:
            application/json:
              schema:
                type: object
                additionalProperties:
                  description: Any type
      requestBody:
        content:
          application/json:
            schema:
              type: object
              additionalProperties:
                description: Any type
    delete:
      operationId: deleteASpaceMembership
      summary: Delete a space membership
      description: >-
        Deletes a space membership, revoking space access. Admins, owners, and space admins can delete any membership;
        members can delete their own.
      tags:
        - spaceMemberships
      parameters:
        - name: space_id
          in: path
          description: The space ID
          required: true
          schema:
            type: string
        - name: space_membership_id
          in: path
          description: The space membership ID
          required: true
          schema:
            type: string
        - name: Authorization
          in: header
          description: Bearer authentication
          required: true
          schema:
            type: string
      responses:
        '204':
          description: No Content - Space membership deleted successfully
          content:
            application/json:
              schema:
                type: object
                properties: {}
  /organizations/{organization_id}/space_memberships/{space_membership_id}:
    get:
      operationId: getASpaceMembershipForAnOrganization
      summary: Get a space membership for an organization
      description: >-
        Returns details about an existing space membership. Only organization admins and owners can access this
        endpoint.
      tags:
        - spaceMemberships
      parameters:
        - name: organization_id
          in: path
          description: The organization ID
          required: true
          schema:
            type: string
        - name: space_membership_id
          in: path
          description: The space membership ID
          required: true
          schema:
            type: string
        - name: Authorization
          in: header
          description: Bearer authentication
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK - Space membership details
          content:
            application/json:
              schema:
                type: object
                additionalProperties:
                  description: Any type
  /spaces/{space_id}/team_space_memberships:
    get:
      operationId: getAllTeamSpaceMembershipsForASpace
      summary: Get all team space memberships for a space
      description: >-
        Returns a paginated collection of all team space memberships for the space. Only org admins, owners, and space
        admins can access this endpoint.
      tags:
        - teamSpaceMemberships
      parameters:
        - name: space_id
          in: path
          description: The space ID
          required: true
          schema:
            type: string
        - name: skip
          in: query
          description: Specify an offset to paginate through results
          required: false
          schema:
            type: integer
        - name: limit
          in: query
          description: Specify the maximum number of results
          required: false
          schema:
            type: integer
        - name: order
          in: query
          description: Specify sort order of result set
          required: false
          schema:
            $ref: '#/components/schemas/SpacesSpaceIdTeamSpaceMembershipsGetParametersOrder'
        - name: include
          in: query
          description: Specify linked resources to include in response
          required: false
          schema:
            $ref: '#/components/schemas/SpacesSpaceIdTeamSpaceMembershipsGetParametersInclude'
        - name: sys.id
          in: query
          description: Filter by team space membership ID
          required: false
          schema:
            type: string
        - name: Authorization
          in: header
          description: Bearer authentication
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK - Paginated list of team space memberships
          content:
            application/json:
              schema:
                type: object
                additionalProperties:
                  description: Any type
    post:
      operationId: createATeamSpaceMembership
      summary: Create a team space membership
      description: >-
        Creates a team space membership assigning the team as admin or to roles; all active team members inherit these
        permissions. Only org admins, owners, and space admins can create team space memberships.
      tags:
        - teamSpaceMemberships
      parameters:
        - name: space_id
          in: path
          description: The space ID
          required: true
          schema:
            type: string
        - name: Authorization
          in: header
          description: Bearer authentication
          required: true
          schema:
            type: string
        - name: X-Contentful-Team
          in: header
          description: The ID of the team for this membership
          required: true
          schema:
            type: string
      responses:
        '201':
          description: Created - Team space membership created successfully
          content:
            application/json:
              schema:
                type: object
                additionalProperties:
                  description: Any type
      requestBody:
        content:
          application/json:
            schema:
              type: object
              additionalProperties:
                description: Any type
  /organizations/{organization_id}/team_space_memberships:
    get:
      operationId: getAllTeamSpaceMembershipsForAnOrganization
      summary: Get all team space memberships for an organization
      description: >-
        Returns a paginated collection of all team space memberships across all spaces in the organization. Accessible
        by all organization members.
      tags:
        - teamSpaceMemberships
      parameters:
        - name: organization_id
          in: path
          description: The organization ID
          required: true
          schema:
            type: string
        - name: skip
          in: query
          description: Specify an offset to paginate through results
          required: false
          schema:
            type: integer
        - name: limit
          in: query
          description: Specify the maximum number of results
          required: false
          schema:
            type: integer
        - name: order
          in: query
          description: Specify sort order of result set
          required: false
          schema:
            $ref: '#/components/schemas/OrganizationsOrganizationIdTeamSpaceMembershipsGetParametersOrder'
        - name: include
          in: query
          description: Specify linked resources to include in response
          required: false
          schema:
            $ref: '#/components/schemas/OrganizationsOrganizationIdTeamSpaceMembershipsGetParametersInclude'
        - name: roles.name
          in: query
          description: Filter by role name
          required: false
          schema:
            type: string
        - name: sys.team.sys.id
          in: query
          description: Filter by team ID
          required: false
          schema:
            type: string
        - name: sys.space.sys.id
          in: query
          description: Filter by space ID
          required: false
          schema:
            type: string
        - name: Authorization
          in: header
          description: Bearer authentication
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK - Paginated list of team space memberships across the organization
          content:
            application/json:
              schema:
                type: object
                additionalProperties:
                  description: Any type
  /spaces/{space_id}/team_space_memberships/{team_space_membership_id}:
    get:
      operationId: getATeamSpaceMembershipForASpace
      summary: Get a team space membership for a space
      description: Returns details about an existing team space membership. Accessible by all space members.
      tags:
        - teamSpaceMemberships
      parameters:
        - name: space_id
          in: path
          description: The space ID
          required: true
          schema:
            type: string
        - name: team_space_membership_id
          in: path
          description: The team space membership ID
          required: true
          schema:
            type: string
        - name: Authorization
          in: header
          description: Bearer authentication
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK - Team space membership details
          content:
            application/json:
              schema:
                type: object
                additionalProperties:
                  description: Any type
    put:
      operationId: updateATeamSpaceMembership
      summary: Update a team space membership
      description: >-
        Updates a team space membership to change the team's roles or admin status. Only org admins, owners, and space
        admins can update team space memberships.
      tags:
        - teamSpaceMemberships
      parameters:
        - name: space_id
          in: path
          description: The space ID
          required: true
          schema:
            type: string
        - name: team_space_membership_id
          in: path
          description: The team space membership ID
          required: true
          schema:
            type: string
        - name: Authorization
          in: header
          description: Bearer authentication
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK - Updated team space membership
          content:
            application/json:
              schema:
                type: object
                additionalProperties:
                  description: Any type
      requestBody:
        content:
          application/json:
            schema:
              type: object
              additionalProperties:
                description: Any type
    delete:
      operationId: deleteATeamSpaceMembership
      summary: Delete a team space membership
      description: Deletes a team space membership. Only org admins, owners, and space admins can delete team space memberships.
      tags:
        - teamSpaceMemberships
      parameters:
        - name: space_id
          in: path
          description: The space ID
          required: true
          schema:
            type: string
        - name: team_space_membership_id
          in: path
          description: The team space membership ID
          required: true
          schema:
            type: string
        - name: Authorization
          in: header
          description: Bearer authentication
          required: true
          schema:
            type: string
      responses:
        '204':
          description: No Content - Team space membership deleted successfully
          content:
            application/json:
              schema:
                type: object
                properties: {}
  /organizations/{organization_id}/team_space_memberships/{team_space_membership_id}:
    get:
      operationId: getATeamSpaceMembershipForAnOrganization
      summary: Get a team space membership for an organization
      description: Returns details about an existing team space membership. Accessible by all organization members.
      tags:
        - teamSpaceMemberships
      parameters:
        - name: organization_id
          in: path
          description: The organization ID
          required: true
          schema:
            type: string
        - name: team_space_membership_id
          in: path
          description: The team space membership ID
          required: true
          schema:
            type: string
        - name: Authorization
          in: header
          description: Bearer authentication
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK - Team space membership details
          content:
            application/json:
              schema:
                type: object
                additionalProperties:
                  description: Any type
  /spaces/{space_id}/space_members:
    get:
      operationId: getAllSpaceMembers
      summary: Get all space members
      description: >-
        Returns a paginated collection of all space members — users in the organization with access to this space.
        Accessible by all space members.
      tags:
        - spaceMembers
      parameters:
        - name: space_id
          in: path
          description: The space ID
          required: true
          schema:
            type: string
        - name: skip
          in: query
          description: Specify an offset to paginate through results
          required: false
          schema:
            type: integer
        - name: limit
          in: query
          description: Specify the maximum number of results
          required: false
          schema:
            type: integer
        - name: include
          in: query
          description: Specify linked resources to include in response
          required: false
          schema:
            $ref: '#/components/schemas/SpacesSpaceIdSpaceMembersGetParametersInclude'
        - name: Authorization
          in: header
          description: Bearer authentication
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK - Paginated list of space members
          content:
            application/json:
              schema:
                type: object
                additionalProperties:
                  description: Any type
  /spaces/{space_id}/space_members/{space_member_id}:
    get:
      operationId: getASpaceMember
      summary: Get a space member
      description: Returns details about a space member. Accessible by all space members.
      tags:
        - spaceMembers
      parameters:
        - name: space_id
          in: path
          description: The space ID
          required: true
          schema:
            type: string
        - name: space_member_id
          in: path
          description: The space member ID
          required: true
          schema:
            type: string
        - name: Authorization
          in: header
          description: Bearer authentication
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK - Space member details
          content:
            application/json:
              schema:
                type: object
                additionalProperties:
                  description: Any type
  /organizations/{organization_id}/roles:
    get:
      operationId: getAllSpaceRoles
      summary: Get all space roles
      description: >-
        Returns a paginated list of all roles across all spaces in the organization. Accessible by all organization
        members.
      tags:
        - spaceRoles
      parameters:
        - name: organization_id
          in: path
          description: The organization ID
          required: true
          schema:
            type: string
        - name: skip
          in: query
          description: Specify an offset to paginate through results
          required: false
          schema:
            type: integer
        - name: limit
          in: query
          description: Specify the maximum number of results
          required: false
          schema:
            type: integer
        - name: include
          in: query
          description: Specify linked resources to include in response
          required: false
          schema:
            $ref: '#/components/schemas/OrganizationsOrganizationIdRolesGetParametersInclude'
        - name: Authorization
          in: header
          description: Bearer authentication
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK - Paginated list of space roles across all spaces in the organization
          content:
            application/json:
              schema:
                type: object
                additionalProperties:
                  description: Any type
  /organizations/{organization_id}/users:
    get:
      operationId: getAllUsersForAnOrganization
      summary: Get all users for an organization
      description: >-
        Returns a paginated collection of organization members. Admins and owners receive full user details; non-admin
        members receive a limited subset.
      tags:
        - users
      parameters:
        - name: organization_id
          in: path
          description: The organization ID
          required: true
          schema:
            type: string
        - name: skip
          in: query
          description: Specify an offset to paginate through results
          required: false
          schema:
            type: integer
        - name: limit
          in: query
          description: Specify the maximum number of results
          required: false
          schema:
            type: integer
        - name: query
          in: query
          description: Full-text search across multiple user attributes
          required: false
          schema:
            type: string
        - name: Authorization
          in: header
          description: Bearer authentication
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK - Paginated list of users in the organization
          content:
            application/json:
              schema:
                type: object
                additionalProperties:
                  description: Any type
  /spaces/{space_id}/users:
    get:
      operationId: getAllUsersForASpace
      summary: Get all users for a space
      description: >-
        Returns a paginated list of all users in the space, including those with access via direct membership or team
        membership. Accessible by all space members.
      tags:
        - users
      parameters:
        - name: space_id
          in: path
          description: The space ID
          required: true
          schema:
            type: string
        - name: skip
          in: query
          description: Specify an offset to paginate through results
          required: false
          schema:
            type: integer
        - name: limit
          in: query
          description: Specify the maximum number of results
          required: false
          schema:
            type: integer
        - name: Authorization
          in: header
          description: Bearer authentication
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK - Paginated list of users in the space
          content:
            application/json:
              schema:
                type: object
                additionalProperties:
                  description: Any type
  /organizations/{organization_id}/users/{user_id}:
    get:
      operationId: getAUserInAnOrganization
      summary: Get a user in an organization
      description: >-
        Returns details about an existing user in the context of an organization. Accessible to all organization
        members.
      tags:
        - users
      parameters:
        - name: organization_id
          in: path
          description: The organization ID
          required: true
          schema:
            type: string
        - name: user_id
          in: path
          description: The user ID
          required: true
          schema:
            type: string
        - name: Authorization
          in: header
          description: Bearer authentication
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK - User details
          content:
            application/json:
              schema:
                type: object
                additionalProperties:
                  description: Any type
  /spaces/{space_id}/users/{user_id}:
    get:
      operationId: getAUserInASpace
      summary: Get a user in a space
      description: Returns details about an existing user in the context of a space. Accessible to all members of that space.
      tags:
        - users
      parameters:
        - name: space_id
          in: path
          description: The space ID
          required: true
          schema:
            type: string
        - name: user_id
          in: path
          description: The user ID
          required: true
          schema:
            type: string
        - name: Authorization
          in: header
          description: Bearer authentication
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK - User details
          content:
            application/json:
              schema:
                type: object
                additionalProperties:
                  description: Any type
servers:
  - url: https://api.contentful.com
    description: User Management API server
components:
  schemas:
    OrganizationsOrganizationIdOrganizationMembershipsGetParametersOrder:
      type: string
      enum:
        - role
        - sys.createdAt
        - sys.lastActiveAt
        - sys.user.firstName
        - sys.user.lastName
        - sys.user.email
      title: OrganizationsOrganizationIdOrganizationMembershipsGetParametersOrder
    OrganizationsOrganizationIdOrganizationMembershipsGetParametersInclude:
      type: string
      enum:
        - sys.user
        - sys.createdBy
        - sys.updatedBy
      title: OrganizationsOrganizationIdOrganizationMembershipsGetParametersInclude
    OrganizationsOrganizationIdOrganizationMembershipsGetParametersRole:
      type: string
      enum:
        - owner
        - admin
        - developer
        - member
      title: OrganizationsOrganizationIdOrganizationMembershipsGetParametersRole
    OrganizationsOrganizationIdOrganizationMembershipsGetParametersSysStatus:
      type: string
      enum:
        - pending
        - active
      title: OrganizationsOrganizationIdOrganizationMembershipsGetParametersSysStatus
    OrganizationsOrganizationIdTeamsTeamIdTeamMembershipsGetParametersOrder:
      type: string
      enum:
        - sys.createdAt
        - sys.updatedAt
      title: OrganizationsOrganizationIdTeamsTeamIdTeamMembershipsGetParametersOrder
    OrganizationsOrganizationIdTeamsTeamIdTeamMembershipsGetParametersInclude:
      type: string
      enum:
        - sys.createdBy
        - sys.updatedBy
        - sys.organizationMembership
        - sys.user
      title: OrganizationsOrganizationIdTeamsTeamIdTeamMembershipsGetParametersInclude
    OrganizationsOrganizationIdTeamMembershipsGetParametersOrder:
      type: string
      enum:
        - sys.createdAt
        - sys.updatedAt
      title: OrganizationsOrganizationIdTeamMembershipsGetParametersOrder
    OrganizationsOrganizationIdTeamMembershipsGetParametersInclude:
      type: string
      enum:
        - sys.team
      title: OrganizationsOrganizationIdTeamMembershipsGetParametersInclude
    SpacesSpaceIdSpaceMembershipsGetParametersInclude:
      type: string
      enum:
        - sys.user
      title: SpacesSpaceIdSpaceMembershipsGetParametersInclude
    OrganizationsOrganizationIdSpaceMembershipsGetParametersOrder:
      type: string
      enum:
        - sys.createdAt
        - sys.user.firstName
        - sys.user.lastName
        - sys.user.email
      title: OrganizationsOrganizationIdSpaceMembershipsGetParametersOrder
    OrganizationsOrganizationIdSpaceMembershipsGetParametersInclude:
      type: string
      enum:
        - roles
        - sys.user
        - sys.createdBy
        - sys.updatedBy
        - sys.space
      title: OrganizationsOrganizationIdSpaceMembershipsGetParametersInclude
    SpacesSpaceIdTeamSpaceMembershipsGetParametersOrder:
      type: string
      enum:
        - sys.updatedAt
        - sys.createdAt
      title: SpacesSpaceIdTeamSpaceMembershipsGetParametersOrder
    SpacesSpaceIdTeamSpaceMembershipsGetParametersInclude:
      type: string
      enum:
        - roles
        - sys.team
      title: SpacesSpaceIdTeamSpaceMembershipsGetParametersInclude
    OrganizationsOrganizationIdTeamSpaceMembershipsGetParametersOrder:
      type: string
      enum:
        - sys.updatedAt
        - sys.createdAt
      title: OrganizationsOrganizationIdTeamSpaceMembershipsGetParametersOrder
    OrganizationsOrganizationIdTeamSpaceMembershipsGetParametersInclude:
      type: string
      enum:
        - roles
        - sys.createdBy
        - sys.updatedBy
        - sys.space
        - sys.team
      title: OrganizationsOrganizationIdTeamSpaceMembershipsGetParametersInclude
    SpacesSpaceIdSpaceMembersGetParametersInclude:
      type: string
      enum:
        - sys.user
      title: SpacesSpaceIdSpaceMembersGetParametersInclude
    OrganizationsOrganizationIdRolesGetParametersInclude:
      type: string
      enum:
        - sys.space
      title: OrganizationsOrganizationIdRolesGetParametersInclude
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
