> ## 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 every segment a specific contact currently belongs to. A contact can be a member of multiple segments at once.

# List segments for a contact



## OpenAPI

````yaml get /contacts/segments/contacts/{contact_id}
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/contacts/{contact_id}:
    get:
      summary: List segments for a contact
      description: List all segments that a contact currently belongs to
      operationId: listSegmentsForContact
      parameters:
        - schema:
            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)$
          in: path
          name: contact_id
          required: true
      responses:
        '200':
          description: Default Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListSegmentsForContactOutput'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDto'
components:
  schemas:
    ListSegmentsForContactOutput:
      $schema: https://json-schema.org/draft/2020-12/schema
      $id: '#/components/schemas/ListSegmentsForContactOutput'
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/ContactSegment'
      required:
        - 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
            belongs:
              type: boolean
          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
        - type: object
          properties:
            type:
              type: string
              const: contact_has_phone
            has:
              type: boolean
          required:
            - type
            - has
          additionalProperties: false
        - type: object
          properties:
            type:
              type: string
              const: contact_has_email
            has:
              type: boolean
          required:
            - type
            - has
          additionalProperties: false
        - type: object
          properties:
            type:
              type: string
              const: contact_is_blocked
            blocked:
              type: boolean
          required:
            - type
            - blocked
          additionalProperties: false
        - type: object
          properties:
            type:
              type: string
              const: contact_is_unsubscribed
            unsubscribed:
              type: boolean
          required:
            - type
            - unsubscribed
          additionalProperties: false
        - type: object
          properties:
            type:
              type: string
              const: contacts_custom_data
            conditions:
              minItems: 1
              type: array
              items:
                type: object
                properties:
                  key:
                    type: string
                    minLength: 1
                  op:
                    type: string
                    enum:
                      - exists
                      - not_exists
                      - eq
                      - neq
                      - contains
                  value:
                    type: string
                required:
                  - key
                  - op
                additionalProperties: false
          required:
            - type
            - conditions
          additionalProperties: false
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````