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

# Listar clientes del segmento

> Lista los clientes del segmento y permite ordenarlos por el valor total comprado.



## OpenAPI

````yaml /openapi.es.json get /v1/segments/{segment_id}/customers
openapi: 3.1.0
info:
  title: API de Bevits
  version: 1.0.0
  description: >-
    API pública de solo lectura para consultar datos de CRM, compras y
    automatización de una organización de Bevits.
  license:
    name: Proprietary
    identifier: LicenseRef-Proprietary
servers:
  - url: https://api.bevits.com
    description: Producción
security:
  - bearerAuth: []
tags:
  - name: Sistema
    description: Disponibilidad de la API.
  - name: Identidad
    description: Identidad de la organización y de la clave API.
  - name: Clientes
    description: Clientes y sus relaciones.
  - name: Segmentos
    description: Segmentos de clientes.
  - name: Compras
    description: Compras importadas desde las integraciones.
  - name: Datos del CRM
    description: Etiquetas y definiciones de atributos.
  - name: Automatizaciones
    description: Flows de automatización.
  - name: Campañas
    description: Campañas de email.
paths:
  /v1/segments/{segment_id}/customers:
    get:
      tags:
        - Segmentos
        - Clientes
      summary: Listar clientes del segmento
      description: >-
        Lista los clientes del segmento y permite ordenarlos por el valor total
        comprado.
      operationId: listSegmentCustomers
      parameters:
        - $ref: '#/components/parameters/SegmentId'
        - $ref: '#/components/parameters/Limit'
        - $ref: '#/components/parameters/CustomerCursor'
        - $ref: '#/components/parameters/CustomerEmail'
        - $ref: '#/components/parameters/CustomerPhone'
        - $ref: '#/components/parameters/TagFilter'
        - $ref: '#/components/parameters/SubscribedFilter'
        - $ref: '#/components/parameters/CreatedSince'
        - $ref: '#/components/parameters/CreatedUntil'
        - $ref: '#/components/parameters/UpdatedSince'
        - $ref: '#/components/parameters/Search'
        - $ref: '#/components/parameters/CustomerSort'
      responses:
        '200':
          $ref: '#/components/responses/CustomerPage'
        '400':
          $ref: '#/components/responses/InvalidRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/ValidationError'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/InternalError'
components:
  parameters:
    SegmentId:
      name: segment_id
      in: path
      required: true
      description: ID público del segmento.
      schema:
        type: string
        pattern: ^seg_[A-Za-z0-9_-]+$
    Limit:
      name: limit
      in: query
      description: Cantidad máxima de elementos por página.
      schema:
        type: integer
        minimum: 1
        maximum: 100
        default: 25
    CustomerCursor:
      name: starting_after
      in: query
      description: ID del último cliente de la página anterior.
      schema:
        type: string
        pattern: ^cus_[A-Za-z0-9_-]+$
    CustomerEmail:
      name: email
      in: query
      description: Email exacto del cliente.
      schema:
        type: string
        format: email
    CustomerPhone:
      name: phone
      in: query
      description: Teléfono del cliente, de 3 a 32 caracteres.
      schema:
        type: string
        minLength: 3
        maxLength: 32
    TagFilter:
      name: tag_id
      in: query
      description: Filtra clientes por etiqueta.
      schema:
        type: string
        pattern: ^tag_[A-Za-z0-9_-]+$
    SubscribedFilter:
      name: is_subscribed
      in: query
      description: Filtra clientes por el estado de la suscripción.
      schema:
        type: boolean
    CreatedSince:
      name: created_since
      in: query
      description: Incluye elementos creados desde este instante, inclusive.
      schema:
        type: string
        format: date-time
    CreatedUntil:
      name: created_until
      in: query
      description: Incluye elementos creados hasta este instante, inclusive.
      schema:
        type: string
        format: date-time
    UpdatedSince:
      name: updated_since
      in: query
      description: Incluye clientes actualizados desde este instante, inclusive.
      schema:
        type: string
        format: date-time
    Search:
      name: q
      in: query
      description: Texto de búsqueda, con hasta 256 caracteres.
      schema:
        type: string
        minLength: 1
        maxLength: 256
    CustomerSort:
      name: sort
      in: query
      description: Ordena por actualización o valor total comprado.
      schema:
        type: string
        enum:
          - updated
          - total_spent
        default: updated
  responses:
    CustomerPage:
      description: Página de clientes.
      headers:
        ETag:
          $ref: '#/components/headers/ETag'
        X-Request-Id:
          $ref: '#/components/headers/RequestId'
        X-RateLimit-Limit:
          $ref: '#/components/headers/RateLimitLimit'
        X-RateLimit-Remaining:
          $ref: '#/components/headers/RateLimitRemaining'
        X-RateLimit-Reset:
          $ref: '#/components/headers/RateLimitReset'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/CustomerPage'
    InvalidRequest:
      description: Parámetro de ruta inválido.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Unauthorized:
      description: Clave API ausente, inválida, expirada o revocada.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error:
              type: authentication_error
              message: Invalid API key.
              request_id: req_07f6cdc3c20249d6afcd90b4
    NotFound:
      description: El recurso no existe o pertenece a otra organización.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    ValidationError:
      description: Un parámetro no superó la validación.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error:
              type: validation_error
              message: Invalid query parameters.
              param: limit
              request_id: req_07f6cdc3c20249d6afcd90b4
    RateLimited:
      description: Límite de solicitudes superado.
      headers:
        Retry-After:
          $ref: '#/components/headers/RetryAfter'
        X-RateLimit-Limit:
          $ref: '#/components/headers/RateLimitLimit'
        X-RateLimit-Remaining:
          $ref: '#/components/headers/RateLimitRemaining'
        X-RateLimit-Reset:
          $ref: '#/components/headers/RateLimitReset'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/RateLimitErrorResponse'
    InternalError:
      description: Error inesperado en el servidor.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  headers:
    ETag:
      description: Identificador de la versión del contenido para caché condicional.
      schema:
        type: string
        example: '"v1-4ad31f5efb6b8f35"'
    RequestId:
      description: Identificador de la solicitud para soporte y rastreo.
      schema:
        type: string
        pattern: ^req_[a-f0-9]{24}$
    RateLimitLimit:
      description: Límite total de la ventana actual.
      schema:
        type: integer
        example: 600
    RateLimitRemaining:
      description: Solicitudes restantes en la ventana actual.
      schema:
        type: integer
        example: 599
    RateLimitReset:
      description: Instante UTC en que termina la ventana actual.
      schema:
        type: string
        format: date-time
    RetryAfter:
      description: Segundos antes de volver a intentarlo.
      schema:
        type: integer
        minimum: 1
  schemas:
    CustomerPage:
      allOf:
        - $ref: '#/components/schemas/Page'
        - type: object
          required:
            - data
          properties:
            data:
              type: array
              items:
                $ref: '#/components/schemas/CustomerSummary'
    ErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          $ref: '#/components/schemas/Error'
    RateLimitErrorResponse:
      allOf:
        - $ref: '#/components/schemas/ErrorResponse'
        - type: object
          required:
            - retry_after
          properties:
            retry_after:
              type: integer
              minimum: 1
              description: Segundos antes de volver a intentarlo.
    Page:
      type: object
      required:
        - data
        - has_more
      properties:
        has_more:
          type: boolean
          description: Indica si existe una página siguiente.
    CustomerSummary:
      type: object
      required:
        - object
        - id
        - created_at
        - updated_at
        - html_url
      properties:
        object:
          type: string
          const: customer
        id:
          type: string
          pattern: ^cus_[A-Za-z0-9_-]+$
        name:
          type: string
        email:
          type: string
          format: email
        phone:
          type: string
          description: Teléfono con código de país, cuando esté disponible.
        source:
          type: string
        is_subscribed:
          type: boolean
        is_subscribed_to_email:
          type: boolean
        total_spent_in_cents:
          type: integer
        total_orders:
          type: integer
        first_purchase_date:
          type: string
          format: date-time
        last_purchase_date:
          type: string
          format: date-time
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
        html_url:
          type: string
          format: uri
    Error:
      type: object
      required:
        - type
        - message
        - request_id
      properties:
        type:
          type: string
          enum:
            - authentication_error
            - conflict
            - internal_error
            - invalid_request
            - not_found
            - permission_denied
            - rate_limited
            - validation_error
        message:
          type: string
        param:
          type: string
        request_id:
          type: string
          pattern: ^req_[a-f0-9]{24}$
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: bvt_live_...
      description: Clave API creada en la configuración de la organización.

````