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

> List contact segment definitions for the organization. Use when you need to discover what segments exist before checking membership or rendering a picker.

# List contact segments



## OpenAPI

````yaml get /contacts/segments
openapi: 3.1.0
info:
  title: OpenCX API
  description: >

    OpenCX is an AI-powered, all-in-one platform for customer support and
    outbound communications.


    Use this API to manage your OpenCX organization's AI agents, actions,
    conversations, contacts, and more.


    To get started, generate a new API key from the dashboard.


    ## Authentication

    All API endpoints require authentication using a Bearer token. You can
    generate an API key from your OpenCX dashboard.


    ## Rate Limiting

    API requests are rate limited to ensure fair usage. The current limits are:

    - 100 requests per minute for standard endpoints

    - 1000 requests per minute for streaming endpoints


    ## Error Handling

    The API uses standard HTTP status codes and returns detailed error messages
    in the response body.
  version: 1.0-beta
  license:
    name: MIT
    url: https://opensource.org/licenses/MIT
servers:
  - url: https://api.open.cx
    description: Production
security:
  - bearerAuth: []
paths:
  /contacts/segments:
    get:
      summary: List contact segments
      description: List contact segment definitions for the organization
      operationId: listContactSegments
      parameters:
        - schema:
            default: 1
            type: integer
            minimum: 1
            maximum: 9007199254740991
          in: query
          name: page
          required: false
        - schema:
            default: 20
            type: integer
            minimum: 1
            maximum: 100
          in: query
          name: limit
          required: false
      responses:
        '200':
          description: Default Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListContactSegmentsOutput'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDto'
components:
  schemas:
    ListContactSegmentsOutput:
      $schema: https://json-schema.org/draft/2020-12/schema
      $id: '#/components/schemas/ListContactSegmentsOutput'
      type: object
      properties:
        total:
          type: number
        page:
          type: number
        limit:
          type: number
        totalPages:
          type: number
        hasNextPage:
          type: boolean
        hasPrevPage:
          type: boolean
        data:
          type: array
          items:
            $ref: '#/components/schemas/ContactSegment'
      required:
        - total
        - page
        - limit
        - totalPages
        - hasNextPage
        - hasPrevPage
        - data
      additionalProperties: false
    ErrorDto:
      type: object
      properties:
        statusCode:
          type: integer
        message:
          type: string
        error:
          type: string
    ContactSegment:
      $schema: https://json-schema.org/draft/2020-12/schema
      $id: '#/components/schemas/ContactSegment'
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        description:
          anyOf:
            - type: string
            - type: 'null'
        definition:
          anyOf:
            - type: object
              properties:
                or:
                  minItems: 1
                  type: array
                  items:
                    type: object
                    properties:
                      and:
                        type: array
                        items:
                          $ref: '#/components/schemas/ContactsFilter'
                    required:
                      - and
                    additionalProperties: false
              required:
                - or
              additionalProperties: false
            - type: 'null'
        created_at:
          anyOf:
            - type: string
            - type: 'null'
          description: ISO 8601 timestamp of when the segment was created
        updated_at:
          anyOf:
            - type: string
            - type: 'null'
          description: ISO 8601 timestamp of when the segment was last updated
      required:
        - id
        - name
        - description
        - definition
        - created_at
        - updated_at
      additionalProperties: false
    ContactsFilter:
      $schema: https://json-schema.org/draft/2020-12/schema
      $id: '#/components/schemas/ContactsFilter'
      anyOf:
        - type: object
          properties:
            type:
              type: string
              const: all_contacts
          required:
            - type
          additionalProperties: false
        - type: object
          properties:
            type:
              type: string
              const: contact_id_in
            contact_ids:
              type: array
              items:
                type: string
                format: uuid
                pattern: >-
                  ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
          required:
            - type
            - contact_ids
          additionalProperties: false
        - type: object
          properties:
            type:
              type: string
              const: contacts_created_at_between
            after:
              type: string
              format: date-time
            before:
              type: string
              format: date-time
          required:
            - type
          additionalProperties: false
        - type: object
          properties:
            type:
              type: string
              const: contacts_email_domain_name_in
            domain_name_in:
              type: array
              items:
                type: string
          required:
            - type
            - domain_name_in
          additionalProperties: false
        - type: object
          properties:
            type:
              type: string
              const: contacts_affected_by_sequence
            sequence_id:
              type: string
          required:
            - type
            - sequence_id
          additionalProperties: false
        - type: object
          properties:
            type:
              type: string
              const: contacts_name_in
            name_in:
              type: array
              items:
                type: string
          required:
            - type
            - name_in
          additionalProperties: false
        - type: object
          properties:
            type:
              type: string
              const: contacts_phone_number_in
            phone_number_in:
              type: array
              items:
                type: string
          required:
            - type
            - phone_number_in
          additionalProperties: false
        - type: object
          properties:
            type:
              type: string
              const: contacts_email_in
            email_in:
              type: array
              items:
                type: string
          required:
            - type
            - email_in
          additionalProperties: false
        - type: object
          properties:
            type:
              type: string
              const: contacts_attributes_in
            attributes:
              type: array
              items:
                type: object
                propertyNames:
                  type: string
                additionalProperties:
                  type: string
          required:
            - type
          additionalProperties: false
        - type: object
          properties:
            type:
              type: string
              const: contacts_sessions_attributes_in
            attributes:
              type: array
              items:
                type: object
                propertyNames:
                  type: string
                additionalProperties:
                  type: string
          required:
            - type
          additionalProperties: false
        - type: object
          properties:
            type:
              type: string
              const: contact_belongs_to_segment
            segment_id:
              type: string
          required:
            - type
            - segment_id
          additionalProperties: false
        - type: object
          properties:
            type:
              type: string
              const: last_contacted_at_between
            after:
              type: string
              format: date-time
            before:
              type: string
              format: date-time
          required:
            - type
          additionalProperties: false
        - type: object
          properties:
            type:
              type: string
              const: last_contacted_at_with_handoff_between
            after:
              type: string
              format: date-time
            before:
              type: string
              format: date-time
          required:
            - type
          additionalProperties: false
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````