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

# List the segments of a list



## OpenAPI

````yaml /api-reference/openapi.json get /api/v1/lists/{list}/segments
openapi: 3.1.0
info:
  title: Lekalao API
  version: 1.0.0
  description: >-
    Everything the interface does, your application can do too. Every call
    carries an API token (Settings → API tokens).
servers:
  - url: https://{host}
    description: Your installation
    variables:
      host:
        default: lekalao.example.com
        description: The domain of your own Lekalao
security:
  - bearer: []
tags:
  - name: Lists
  - name: Subscribers
  - name: Tags
  - name: Segments
  - name: Imports
  - name: Templates
  - name: Campaigns
  - name: Automations
  - name: Transactional e-mails
  - name: Revenue
  - name: Platform
paths:
  /api/v1/lists/{list}/segments:
    get:
      tags:
        - Segments
      summary: List the segments of a list
      operationId: api.segments.index
      parameters:
        - name: list
          in: path
          required: true
          schema:
            type: string
            format: uuid
          description: The list's identifier (uuid).
        - $ref: '#/components/parameters/Page'
        - $ref: '#/components/parameters/PerPage'
        - name: search
          in: query
          schema:
            type: string
      responses:
        '200':
          description: The segments, without their subscriber counts.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/Segment'
                  links:
                    $ref: '#/components/schemas/PaginationLinks'
                  meta:
                    $ref: '#/components/schemas/PaginationMeta'
        '401':
          $ref: '#/components/responses/Unauthenticated'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
components:
  parameters:
    Page:
      name: page
      in: query
      required: false
      schema:
        type: integer
        minimum: 1
        default: 1
    PerPage:
      name: per_page
      in: query
      required: false
      schema:
        type: integer
        minimum: 1
        maximum: 100
        default: 25
  schemas:
    Segment:
      type: object
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
          example: Active VIP customers
        list:
          type: string
          format: uuid
        conditions:
          $ref: '#/components/schemas/SegmentConditions'
        subscribers_count:
          type: integer
          description: 'Left out of paginated listings: counting costs something.'
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
    PaginationLinks:
      type: object
      properties:
        first:
          type: string
        last:
          type: string
        prev:
          type:
            - string
            - 'null'
        next:
          type:
            - string
            - 'null'
    PaginationMeta:
      type: object
      properties:
        current_page:
          type: integer
        from:
          type:
            - integer
            - 'null'
        last_page:
          type: integer
        path:
          type: string
        per_page:
          type: integer
        to:
          type:
            - integer
            - 'null'
        total:
          type: integer
    SegmentConditions:
      type: object
      required:
        - operator
        - rules
      description: >-
        A group of rules; a group may hold another one, two levels deep at most,
        50 rules at most.
      properties:
        operator:
          type: string
          enum:
            - and
            - or
        rules:
          type: array
          items:
            oneOf:
              - $ref: '#/components/schemas/SegmentRule'
              - type: object
                properties:
                  operator:
                    type: string
                    enum:
                      - and
                      - or
                  rules:
                    type: array
                    items:
                      $ref: '#/components/schemas/SegmentRule'
      example:
        operator: and
        rules:
          - type: tags
            operator: has_any
            value:
              - vip
          - type: engagement
            operator: active_within_days
            value: 60
    Message:
      type: object
      properties:
        message:
          type: string
    SegmentRule:
      type: object
      required:
        - type
        - operator
      properties:
        type:
          type: string
          enum:
            - email
            - first_name
            - last_name
            - tags
            - language
            - attribute
            - subscribed_at
            - campaign
            - automation_mail
            - link
            - engagement
            - list
          description: The kind of condition. See the "Segment conditions" guide.
        operator:
          type: string
          description: Depends on the type. See Developers → Segments.
        value:
          description: >-
            Depending on the type: text, a number of days, a YYYY-MM-DD date, a
            language code; tag names or uuids for "tags"; the uuid of the
            campaign, the automation e-mail, the link or the list for
            "campaign", "automation_mail", "link" and "list".
        key:
          type: string
          description: The attribute's name, for the "attribute" type.
  responses:
    Unauthenticated:
      description: No token, or an invalid or revoked one.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Message'
          example:
            message: Unauthenticated.
    Forbidden:
      description: The token lacks the ability needed, or the team is suspended.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Message'
    NotFound:
      description: Nothing of that uuid in the token's team.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Message'
    TooManyRequests:
      description: >-
        The token's limit is reached. Wait the number of seconds Retry-After
        gives.
      headers:
        X-RateLimit-Limit:
          schema:
            type: integer
          description: Calls allowed per minute for this token.
        X-RateLimit-Remaining:
          schema:
            type: integer
        Retry-After:
          schema:
            type: integer
  securitySchemes:
    bearer:
      type: http
      scheme: bearer
      description: >-
        An API token. The "read" ability: GET routes only. "read + write": every
        route.

````