> ## Documentation Index
> Fetch the complete documentation index at: https://docs.member.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Count Members



## OpenAPI

````yaml /openapi/mio-openapi.json get /api/v1/teams/{team_id}/segments/{segment_id}/members/count
openapi: 3.1.0
info:
  description: >-
    Production API reference for Membership.io. Use the authored guides for
    workflows and the generated endpoint pages for exact parameters and schemas.
  title: Membership.io API
  version: 0.1.0
servers:
  - description: Production
    url: https://api.member.dev
security:
  - bearerAuth: []
paths:
  /api/v1/teams/{team_id}/segments/{segment_id}/members/count:
    get:
      tags:
        - segments-admin
      summary: Count Members
      operationId: >-
        segments_admin.get_segments_admin_get_teams_by_team_id_segments_by_segment_id_members_count
      parameters:
        - in: path
          name: team_id
          required: true
          schema:
            title: Team Id
            type: string
        - in: path
          name: segment_id
          required: true
          schema:
            title: Segment Id
            type: string
      responses:
        '200':
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/MemberCountResponse'
          description: Successful Response
        '400':
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/JsonApiErrorResponse'
          description: Validation error
        '401':
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/JsonApiErrorResponse'
          description: Not authenticated
        '403':
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/JsonApiErrorResponse'
          description: Forbidden
        '404':
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/JsonApiErrorResponse'
          description: Resource not found
        '409':
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/JsonApiErrorResponse'
          description: Conflict (slug collision or referenced entities exist)
        '415':
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/JsonApiErrorResponse'
          description: Unsupported media type (requires application/vnd.api+json)
        '422':
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/JsonApiErrorResponse'
          description: Unprocessable entity (compile-time reference failures)
      security:
        - HTTPBearer: []
components:
  schemas:
    MemberCountResponse:
      additionalProperties: false
      properties:
        data:
          $ref: '#/components/schemas/MemberCountResource'
      required:
        - data
      title: MemberCountResponse
      type: object
    JsonApiErrorResponse:
      description: Error JSON:API response.
      properties:
        errors:
          items:
            $ref: '#/components/schemas/JsonApiError'
          title: Errors
          type: array
        meta:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Meta
      required:
        - errors
      title: JsonApiErrorResponse
      type: object
    MemberCountResource:
      additionalProperties: false
      properties:
        attributes:
          $ref: '#/components/schemas/MemberCountAttributes'
        id:
          title: Id
          type: string
        type:
          const: segment_member_count
          default: segment_member_count
          title: Type
          type: string
      required:
        - id
        - attributes
      title: MemberCountResource
      type: object
    JsonApiError:
      properties:
        code:
          anyOf:
            - type: string
            - type: 'null'
          title: Code
        detail:
          anyOf:
            - type: string
            - type: 'null'
          title: Detail
        id:
          anyOf:
            - type: string
            - type: 'null'
          title: Id
        meta:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Meta
        source:
          anyOf:
            - additionalProperties:
                type: string
              type: object
            - type: 'null'
          title: Source
        status:
          title: Status
          type: string
        title:
          title: Title
          type: string
      required:
        - status
        - title
      title: JsonApiError
      type: object
    MemberCountAttributes:
      additionalProperties: false
      properties:
        computed_at:
          format: date-time
          title: Computed At
          type: string
        count:
          minimum: 0
          title: Count
          type: integer
      required:
        - count
        - computed_at
      title: MemberCountAttributes
      type: object
  securitySchemes:
    bearerAuth:
      bearerFormat: JWT or mio_sk API key
      description: >-
        Send platform JWTs, contact JWTs, or team API keys as `Authorization:
        Bearer <token>`.
      scheme: bearer
      type: http
    HTTPBearer:
      scheme: bearer
      type: http

````