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

# Search and list customers

> Paginated customer list with filters for name, email, phone, card code, tier, and RFM segment.



## OpenAPI

````yaml /api-reference/openapi.json get /api/v2/customers/
openapi: 3.0.3
info:
  title: Zupy API v2
  version: 2.0.0
  description: >-
    Zupy API v2 — versioned, gateway-aware API with envelope responses, RFC 7807
    errors, and multi-auth support (JWT, API Key, Device Key).
servers:
  - url: https://api.zupy.com
    description: Production
security: []
tags:
  - name: Authentication
    description: OTP request and verification endpoints
  - name: Customers
    description: Customer management, points, history, and data operations
  - name: Loyalty Programs
    description: Loyalty program configuration and details
  - name: Rewards
    description: Loyalty reward catalog (definitions redeemed with points)
  - name: Companies
    description: Company information and loyalty configuration
  - name: Coupons
    description: >-
      Issued coupons (RewardRedemption) — both loyalty-reward redemptions and
      marketing claims
  - name: Wallet
    description: Apple Wallet pass generation and notifications
  - name: Webhooks
    description: Partner integration webhook endpoints
  - name: Webhook Management
    description: Configure and test outbound webhook delivery
paths:
  /api/v2/customers/:
    get:
      tags:
        - Customers
      summary: Search and list customers
      description: >-
        Paginated customer list with filters for name, email, phone, card code,
        tier, and RFM segment.
      operationId: customers_list
      parameters:
        - in: query
          name: card_code
          schema:
            type: string
          description: Filter by card number/code (case-insensitive contains)
        - name: cursor
          required: false
          in: query
          description: Pagination cursor value from previous response.
          schema:
            type: string
        - in: query
          name: email
          schema:
            type: string
          description: Filter by email address (case-insensitive contains)
        - in: query
          name: name
          schema:
            type: string
          description: Filter by customer name (case-insensitive contains)
        - name: page_size
          required: false
          in: query
          description: Number of results to return per page.
          schema:
            type: integer
        - in: query
          name: phone
          schema:
            type: string
          description: Filter by phone number (digits only, case-insensitive contains)
        - in: query
          name: search
          schema:
            type: string
          description: General text search across name, email, phone, and card code
        - in: query
          name: segment
          schema:
            type: string
          description: Filter by RFM segment (champions, loyal, promising, at_risk, new)
        - in: query
          name: tier
          schema:
            type: string
          description: >-
            Filter by loyalty tier (exact match: default, bronze, silver, gold,
            platinum, vip)
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedCustomerList'
          description: ''
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: ''
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: ''
        '429':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: ''
      security:
        - apiKeyAuth: []
components:
  schemas:
    PaginatedCustomerList:
      type: object
      required:
        - data
        - meta
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/Customer'
        meta:
          type: object
          required:
            - cursor
            - has_next
            - count
          properties:
            cursor:
              type: string
              nullable: true
            has_next:
              type: boolean
            count:
              type: integer
              nullable: true
    Error:
      type: object
      description: RFC 7807 Problem Details error response.
      properties:
        type:
          type: string
          format: uri
        title:
          type: string
        status:
          type: integer
        detail:
          type: string
        instance:
          type: string
      required:
        - detail
        - instance
        - status
        - title
        - type
    Customer:
      type: object
      description: >-
        Customer profile with personal details, loyalty status, and contact
        information.
      properties:
        id:
          type: string
          readOnly: true
        full_name:
          type: string
          readOnly: true
        avatar_url:
          type: string
          readOnly: true
        email:
          type: string
          readOnly: true
        is_email_verified:
          type: boolean
          readOnly: true
          description: >-
            `true` when the customer has confirmed ownership of `email` (e.g.
            clicked a verification link). `false` for contacts imported from a
            partner (Repediu, Anota AI…) that were never proved by the owner.
            Use this to decide whether to trust `email` for transactional
            communication.
        phone:
          type: string
          readOnly: true
        is_phone_verified:
          type: boolean
          readOnly: true
          description: >-
            `true` when the customer has confirmed ownership of `phone` via
            WhatsApp OTP. Same imported-contact caveat as `is_email_verified` —
            unchecked contacts are 'on file' but never proved.
        cpf:
          type: string
          readOnly: true
        birth_date:
          type: string
          readOnly: true
        points_balance:
          type: integer
          readOnly: true
        points_earned:
          type: integer
          readOnly: true
          title: Total Points Earned
          description: Total points earned in this program.
        points_spent:
          type: integer
          readOnly: true
          title: Total Points Spent
          description: Total points spent in this program.
        tier:
          allOf:
            - $ref: '#/components/schemas/TierEnum'
          readOnly: true
        card_number:
          type: string
          readOnly: true
          description: >-
            Card identifier in format ZP-UNIQUEID-PID that matches the wallet
            card barcode
        join_date:
          type: string
          format: date-time
          readOnly: true
        last_activity_date:
          type: string
          format: date-time
          readOnly: true
          nullable: true
          description: Date of customer's last activity in the program
        is_active:
          type: boolean
          readOnly: true
        zupy_balance:
          type: string
          readOnly: true
        program_id:
          type: string
          title: Loyalty Program
          readOnly: true
        program_name:
          type: string
          readOnly: true
        rfm_segment:
          type: string
          readOnly: true
          nullable: true
          description: RFM segment name (e.g., Champions)
        company_id:
          type: string
          readOnly: true
        created_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
      required:
        - avatar_url
        - birth_date
        - card_number
        - company_id
        - cpf
        - created_at
        - email
        - full_name
        - id
        - is_active
        - join_date
        - last_activity_date
        - phone
        - points_balance
        - points_earned
        - points_spent
        - program_id
        - program_name
        - rfm_segment
        - tier
        - updated_at
        - zupy_balance
    TierEnum:
      enum:
        - default
        - bronze
        - silver
        - gold
        - platinum
        - vip
      type: string
      description: 'Loyalty tier levels: default, bronze, silver, gold, platinum, diamond.'
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: >-
        Per-company partner API key (zupy_pk_…). Validated by Zupy against the
        company integration key hash (Story 14.x); send it on every request as
        the X-API-Key header. Scoped read-write to the owning company's data.

````