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

# List Customer's Segments

> Returns the list of segments IDs to which the customer belongs to.  

If you pass a `customerId` which is not stored and recognized by Voucherify as an existing customer in the system, the response will generate a list of segments that the customer would potentialy qualify for if they were to become a customer tracked in the system.



## OpenAPI

````yaml /openapi/customers.json get /v1/customers/{customerId}/segments
openapi: 3.0.1
info:
  title: Voucherify API - Customers
  version: v2018-08-01
  description: >-
    Voucherify promotion engine REST API. Please see
    https://docs.voucherify.io/docs for more details.
  contact:
    name: Voucherify Team
    url: https://www.voucherify.io/contact-support
    email: support@voucherify.io
  termsOfService: https://www.voucherify.io/legal/subscription-agreement
  license:
    name: MIT
    url: https://github.com/voucherifyio/voucherify-js-sdk/blob/main/LICENSE
servers:
  - url: https://{cluster}.voucherify.io
    description: Base URL
    variables:
      cluster:
        default: api
        enum:
          - api
          - us1.api
          - as1.api
          - download
          - us1.download
          - as1.download
security: []
paths:
  /v1/customers/{customerId}/segments:
    parameters:
      - schema:
          $ref: '#/components/schemas/ParameterCustomerId'
        name: customerId
        in: path
        required: true
        description: >-
          Unique identifier of a customer represented by an internal customer ID
          or customer source ID.
    get:
      tags:
        - Customers
      summary: List Customer's Segments
      description: >-
        Returns the list of segments IDs to which the customer belongs to.  


        If you pass a `customerId` which is not stored and recognized by
        Voucherify as an existing customer in the system, the response will
        generate a list of segments that the customer would potentialy qualify
        for if they were to become a customer tracked in the system.
      operationId: list-customer-segments
      parameters: []
      responses:
        '200':
          description: >-
            The method returns segment(s) to which the given customer belongs
            to.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomersSegmentsListResponseBody'
              examples:
                Example:
                  value:
                    object: list
                    data_ref: data
                    data:
                      - id: seg_DNAOhUtJffvX0f57ajLMFBYR
                        name: area code not 123
                        object: segment
                      - id: seg_IPIYx96l92Op0Sy5MOaImhgw
                        name: not bob.smith@email.com
                        object: segment
                      - id: seg_1wc52c5z6r1kQ81brO8j9Hk2
                        name: Birthday After Dec 31
                        object: segment
                      - id: seg_ZEbbT4mq1ePpM9PzR02lcww2
                        name: Start with S
                        object: segment
                      - id: seg_WJv55MbzQwnr56ttJ2xUrSgt
                        name: Loyalty Card
                        object: segment
                    total: 5
      security:
        - X-App-Id: []
          X-App-Token: []
        - X-Voucherify-OAuth:
            - api
            - customers
components:
  schemas:
    ParameterCustomerId:
      type: string
      example: cust_nk0N1uNQ1YnupAoJGOgvsODC
    CustomersSegmentsListResponseBody:
      type: object
      title: Customers Segments List Response Body
      description: Response body schema for **GET** `v1/customers/{customerId}/segments`.
      allOf:
        - $ref: '#/components/schemas/CustomerSegmentsList'
    CustomerSegmentsList:
      type: object
      title: Customer Segments List
      description: List of customer's segments
      properties:
        object:
          type: string
          description: >-
            The type of the object represented by JSON. This object stores
            information about customer segments.
          default: list
        data_ref:
          type: string
          description: >-
            Identifies the name of the JSON property that contains the array of
            segment IDs.
          default: data
        data:
          type: array
          description: A dictionary that contains an array of segment IDs and names.
          items:
            $ref: '#/components/schemas/SimpleSegment'
        total:
          type: integer
          description: Total number of segments the customer belongs to.
      required:
        - object
        - data_ref
        - data
        - total
    SimpleSegment:
      title: Simple Segment
      type: object
      properties:
        id:
          type: string
          description: Unique segment ID.
          example: seg_DNAOhUtJffvX0f57ajLMFBYR
        name:
          type: string
          description: Segment name.
        object:
          type: string
          description: The type of the object represented by the ID.
          default: segment
          enum:
            - segment
      required:
        - id
        - name
        - object
  securitySchemes:
    X-App-Id:
      type: apiKey
      name: X-App-Id
      in: header
    X-App-Token:
      type: apiKey
      name: X-App-Token
      in: header
    X-Voucherify-OAuth:
      type: oauth2
      flows:
        implicit:
          authorizationUrl: https://api.voucherify.io/v1/oauth/token
          scopes:
            api: Gives access to whole server-side API.
            vouchers: >-
              Gives access to all endpoints and methods starting with
              `v1/vouchers`.
            client_api: Gives access to whole client-side API.
            client_vouchers: >-
              Gives access to all endpoints and methods starting with
              `/client/v1/vouchers`.
            promotions: >-
              Gives access to all endpoints and methods starting with
              `/v1/promotions`.
            client_promotions: >-
              Gives access to all endpoints and methods starting with
              `/client/v1/promotions`
            campaigns: >-
              Gives access to all endpoints and methods starting with
              `v1/campaigns`.
            client_publish: >-
              Gives access to all endpoints and methods starting with
              `/client/v1/publish`.
            exports: >-
              Gives access to all endpoints and methods starting with
              `/v1/exports`.
            publications: >-
              Gives access to all endpoints and methods starting with
              `/v1/publications`.
            client_validate: >-
              Gives access to all endpoints and methods starting with
              `/client/v1/validate`.
            validations: >-
              Gives access to all endpoints and methods starting with
              `/v1/validations`.
            client_validations: >-
              Gives access to all endpoints and methods starting with
              `/client/v1/validations`.
            qualifications: >-
              Gives access to all endpoints and methods starting with
              `/v1/qualifications`.
            client_qualifications: >-
              Gives access to all endpoints and methods starting with
              `/client/v1/qualifications`.
            client_redeem: >-
              Gives access to all endpoints and methods starting with
              `/client/v1/redeem
            redemptions: >-
              Gives access to all endpoints and methods starting with
              `/v1/redemptions`.
            client_redemptions: >-
              Gives access to all endpoints and methods starting with
              `/client/v1/redemptions`
            customers: >-
              Gives access to all endpoints and methods starting with
              `/v1/customers`.
            client_customers: >-
              Gives access to all endpoints and methods starting with
              `/client/v1/customers`.
            orders: >-
              Gives access to all endpoints and methods starting with
              `/v1/orders`.
            products: >-
              Gives access to all endpoints and methods starting with
              `/v1/products`.
            skus: >-
              Gives access to all endpoints and methods starting with
              `/v1/SKUs`.
            validation-rules: >-
              Gives access to all endpoints and methods starting with
              `/v1/validation-rules`.
            validation-rules-assignments: >-
              Gives access to all endpoints and methods starting with
              `/v1/validation-rules-assignments
            segments: >-
              Gives access to all endpoints and methods starting with
              `/v1/segments`.
            events: >-
              Gives access to all endpoints and methods starting with
              `/v1/events`.
            client_events: >-
              Gives access to all endpoints and methods starting with
              `client/v1/events`.
            rewards: >-
              Gives access to all endpoints and methods starting with
              `/v1/rewards`.
            assets: >-
              Gives access to all endpoints and methods starting with
              `/v1/assets`.
            task-results: >-
              Gives access to all endpoints and methods starting with
              `/v1/task-results`.
            loyalties: >-
              Gives access to all endpoints and methods starting with
              `/v1/loyalties`.
            client_consents: >-
              Gives access to all endpoints and methods starting with
              `client/v1/consents`.
            consents: >-
              Gives access to all endpoints and methods starting with
              `/v1/consents`.
            async-actions: >-
              Gives access to all endpoints and methods starting with
              `/v1/async-actions`.
            product-collections: >-
              Gives access to all endpoints and methods starting with
              `/v1/product-collections`.
            categories: >-
              Gives access to all endpoints and methods starting with
              `/v1/categories`.
            metadata-schemas: >-
              Gives access to all endpoints and methods starting with
              `/v1/metadata-schemas`.
            locations: >-
              Gives access to all endpoints and methods starting with
              `/v1/locations`.
            referrals: >-
              Gives access to all endpoints and methods starting with
              `/v1/referrals`.
            trash-bin: >-
              Gives access to all endpoints and methods starting with
              `/v1/trash-bin`.
            templates: >-
              Gives access to all endpoints and methods starting with
              `/v1/templates`.

````