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

# Get a segment

> Retrieve a single segment by ID.



## OpenAPI

````yaml GET /segments/{id}
openapi: 3.1.0
info:
  title: SendKit API
  description: The SendKit API allows you to send transactional emails programmatically.
  version: 1.0.0
servers:
  - url: https://api.sendkit.dev
security:
  - bearerAuth: []
paths:
  /segments/{id}:
    get:
      tags:
        - Segments
      summary: Get a segment
      description: Retrieve a single segment by ID.
      operationId: getSegment
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid
          description: The segment ID.
      responses:
        '200':
          description: The segment object
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Segment'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  schemas:
    Segment:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: Unique identifier.
          example: 550e8400-e29b-41d4-a716-446655440000
        name:
          type: string
          description: The name of the segment.
          example: VIP Customers
        match_type:
          type: string
          enum:
            - all
            - any
          description: >-
            How to match the filter groups. `all` requires all groups to match,
            `any` requires at least one.
          example: all
        filters:
          type: object
          description: The filter configuration for the segment.
          properties:
            groups:
              type: array
              items:
                $ref: '#/components/schemas/SegmentFilterGroup'
        created_at:
          type: string
          format: date-time
          description: When the segment was created.
          example: '2026-03-03 10:00:00'
        updated_at:
          type: string
          format: date-time
          description: When the segment was last updated.
          example: '2026-03-03 10:00:00'
    SegmentFilterGroup:
      type: object
      properties:
        match_type:
          type: string
          enum:
            - all
            - any
          description: How to match conditions within this group.
          example: all
        conditions:
          type: array
          items:
            $ref: '#/components/schemas/SegmentCondition'
    ErrorResponse:
      type: object
      properties:
        name:
          type: string
          description: Error type identifier.
          example: validation_error
        message:
          type: string
          description: Human-readable error message.
          example: The from address domain is not verified.
    SegmentCondition:
      type: object
      properties:
        field:
          type: string
          description: >-
            The field to evaluate. For reserved fields use names like `email`,
            `first_name`, `last_name`. For custom properties use the property
            key.
          example: email
        type:
          type: string
          enum:
            - reserved
            - property
          description: >-
            Whether this condition targets a reserved field or a custom
            property.
          example: reserved
        operator:
          type: string
          enum:
            - equals
            - not_equals
            - contains
            - not_contains
            - starts_with
            - ends_with
            - greater_than
            - less_than
            - greater_than_or_equal
            - less_than_or_equal
            - is_set
            - is_not_set
          description: The comparison operator.
          example: contains
        value:
          type:
            - string
            - 'null'
          description: >-
            The value to compare against. Not required for `is_set` and
            `is_not_set` operators.
          example: '@example.com'
        property_id:
          type:
            - string
            - 'null'
          format: uuid
          description: The property ID when `type` is `property`.
          example: null
  responses:
    Unauthorized:
      description: Unauthorized — missing or invalid API key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            message: Invalid API key.
    NotFound:
      description: The requested resource was not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            message: Not found.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        API key from your SendKit dashboard. Pass it as a Bearer token in the
        Authorization header.

````