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

# Get Segment

> Get detailed information about a specific segment, including its filter configuration, description, and metadata. Accepts either a UUID or a preset ID for system segments.



## OpenAPI

````yaml https://www.greenflash.ai/api/openapi get /segments/{segmentId}
openapi: 3.1.0
info:
  title: Greenflash API Reference
  version: 1.0.0
  description: >-
    Greenflash endpoints for capturing interactions, managing prompts, and
    identifying users.
servers:
  - url: https://www.greenflash.ai/api/v1
    description: Greenflash API v1
security: []
tags:
  - name: Interactions
    description: Capture interactions between users and AI
  - name: Business Events
    description: Capture business events
  - name: Analytics
    description: Understand chat and agentic interactions analyses
  - name: Inbox
    description: Review flagged conversations
  - name: Segments
    description: Manage user segments
  - name: Prompts
    description: Manage prompts
  - name: Chat
    description: Stream chat and agentic conversations
  - name: Models
    description: Manage AI models
  - name: Products
    description: Manage products
  - name: Users
    description: Manage users
  - name: Organizations
    description: Manage organizations
paths:
  /segments/{segmentId}:
    get:
      tags:
        - Segments
      summary: Get Segment
      description: >-
        Get detailed information about a specific segment, including its filter
        configuration, description, and metadata. Accepts either a UUID or a
        preset ID for system segments.
      parameters:
        - schema:
            type: string
            description: The segment ID (UUID) or preset ID for system segments.
          required: true
          description: The segment ID (UUID) or preset ID for system segments.
          name: segmentId
          in: path
      responses:
        '200':
          description: Segment retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetSegmentResponse'
              example:
                id: 123e4567-e89b-12d3-a456-426614174000
                name: Power Users
                type: system
                presetId: power-users
                memberCount: 234
                isFavorited: true
                description: >-
                  Users who have had more than 10 conversations and exhibit high
                  engagement patterns.
                icon: zap
                filters:
                  operator: AND
                  conditions:
                    - field: conversationCount
                      operator: gte
                      value: 10
                    - field: avgSentiment
                      operator: gte
                      value: 0.3
                createdBy: null
                createdAt: '2025-06-01T00:00:00Z'
                updatedAt: '2025-10-15T12:00:00Z'
        '404':
          description: Segment not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    description: Whether the API call was successful (false for errors).
                  error:
                    type: string
                    description: Error message describing what went wrong.
                description: Error response for get segment operations.
              example:
                success: false
                error: Segment not found
        '500':
          description: Server error
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    description: Whether the API call was successful (false for errors).
                  error:
                    type: string
                    description: Error message describing what went wrong.
                description: Error response for get segment operations.
      security:
        - bearerAuth: []
      x-codeSamples:
        - lang: JavaScript
          source: |-
            import Greenflash from 'greenflash';

            const client = new Greenflash({
              apiKey: process.env['GREENFLASH_API_KEY'], // This is the default and can be omitted
            });

            const getSegmentResponse = await client.segments.get('segmentId');

            console.log(getSegmentResponse.id);
        - lang: Python
          source: |-
            import os
            from greenflash import Greenflash

            client = Greenflash(
                api_key=os.environ.get("GREENFLASH_API_KEY"),  # This is the default and can be omitted
            )
            get_segment_response = client.segments.get(
                "segmentId",
            )
            print(get_segment_response.id)
components:
  schemas:
    GetSegmentResponse:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: The segment ID.
        name:
          type: string
          description: The segment name.
        type:
          type: string
          enum:
            - system
            - custom
          description: Whether the segment is system-defined or custom.
        presetId:
          type:
            - string
            - 'null'
          description: Preset identifier for system segments.
        memberCount:
          type: number
          description: Number of participants in this segment.
        isFavorited:
          type: boolean
          description: Whether the segment is favorited.
        description:
          type:
            - string
            - 'null'
          description: A description of the segment.
        icon:
          type:
            - string
            - 'null'
          description: Icon identifier for the segment.
        filters:
          type: object
          additionalProperties: {}
          description: The filter/rule configuration for the segment.
        createdBy:
          type:
            - string
            - 'null'
          format: uuid
          description: The user ID who created this segment.
        createdAt:
          type: string
          format: date-time
          description: When the segment was created.
        updatedAt:
          type: string
          format: date-time
          description: When the segment was last updated.
      required:
        - id
        - name
        - type
        - presetId
        - memberCount
        - isFavorited
        - description
        - icon
        - filters
        - createdBy
        - createdAt
        - updatedAt
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````