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

# List segments

> Get all segments for your organization



## OpenAPI

````yaml /openapi.json get /v1/segments
openapi: 3.0.3
info:
  title: Emailr API
  version: 1.0.0
servers:
  - url: https://api.emailr.dev
    description: Production
security: []
tags:
  - name: emails
    description: Email sending and management
  - name: contacts
    description: Contact management
  - name: templates
    description: Email template management
  - name: domains
    description: Domain verification and management
  - name: webhooks
    description: Webhook configuration
  - name: broadcasts
    description: Broadcast campaign management
  - name: segments
    description: Contact segmentation
paths:
  /v1/segments:
    get:
      tags:
        - segments
      summary: List segments
      description: Get all segments for your organization
      operationId: listSegments
      parameters:
        - schema:
            type: string
            description: Comma-separated tags to filter by (AND logic)
            example: newsletter,vip
          required: false
          name: tags
          in: query
      responses:
        '200':
          description: List of segments
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Segment'
        '500':
          description: Server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - bearerAuth: []
components:
  schemas:
    Segment:
      type: object
      properties:
        id:
          type: string
          format: uuid
          example: 123e4567-e89b-12d3-a456-426614174000
        organization_id:
          type: string
          format: uuid
        name:
          type: string
        description:
          type: string
          nullable: true
        type:
          $ref: '#/components/schemas/SegmentType'
        conditions:
          type: object
          additionalProperties: {}
        tags:
          type: array
          items:
            type: string
          description: Tags for categorization.
          example:
            - newsletter
            - vip
        created_by:
          type: string
          nullable: true
          format: uuid
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
      required:
        - id
        - organization_id
        - name
        - description
        - type
        - conditions
        - tags
        - created_by
        - created_at
        - updated_at
    Error:
      type: object
      properties:
        error:
          type: string
          example: An error occurred
        code:
          type: string
          example: VALIDATION_ERROR
        details: {}
      required:
        - error
    SegmentType:
      type: string
      enum:
        - manual
        - data_driven
      description: 'Segment type: ''manual'' or ''data_driven'''
      example: data_driven
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: API key authentication. Use your API key as the bearer token.

````