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

# Update a segment



## OpenAPI

````yaml /openapi.json patch /api/public/segments/{id}
openapi: 3.1.0
info:
  title: Verbose API
  version: 1.0.0
  description: >-
    Programmatic access to the Verbose platform — contacts, lists, segments, SMS
    & voice campaigns, AI agents, messages and calls, numbers, registration,
    flows, analytics, and webhooks. All endpoints live under `/api/public` and
    authenticate with a workspace API key.
servers:
  - url: https://astrasend-mocha.vercel.app
    description: Production
security:
  - bearerAuth: []
tags:
  - name: General
    description: Key + workspace.
  - name: Contacts
    description: The people you reach.
  - name: Lists
    description: Static groups of contacts.
  - name: Segments
    description: Live, rule-based audiences.
  - name: Suppression
    description: Numbers to keep off your sends.
  - name: Campaigns
    description: SMS & voice campaigns.
  - name: Messages
    description: One-off SMS.
  - name: Calls
    description: One-off outbound voice calls.
  - name: Agents
    description: AI SMS & voice agents.
  - name: Conversations
    description: Inbox threads.
  - name: Numbers
    description: Phone numbers & pools.
  - name: Offers
    description: Destinations + conversion attribution.
  - name: Analytics
    description: Metrics & custom reports.
  - name: 10DLC
    description: US A2P brand + campaign registration.
  - name: Shortcode
    description: Short-code requests.
  - name: Flows
    description: Multi-step automations.
  - name: Webhooks
    description: Event subscriptions.
paths:
  /api/public/segments/{id}:
    parameters:
      - $ref: '#/components/parameters/Id'
    patch:
      tags:
        - Segments
      summary: Update a segment
      operationId: updateSegment
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                accept_orphans:
                  type: boolean
                definition:
                  $ref: '#/components/schemas/SegmentDefinition'
      responses:
        '200':
          $ref: '#/components/responses/Ok'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  parameters:
    Id:
      name: id
      in: path
      required: true
      schema:
        type: string
  schemas:
    SegmentDefinition:
      type: object
      description: >-
        A rule that defines a dynamic audience. Combine conditions directly, or
        in nested groups.
      properties:
        match:
          type: string
          enum:
            - all
            - any
          default: all
        base_lead_list_id:
          type:
            - string
            - 'null'
        conditions:
          type: array
          items:
            $ref: '#/components/schemas/Condition'
        groups:
          type: array
          items:
            $ref: '#/components/schemas/ConditionGroup'
        created_from:
          type:
            - string
            - 'null'
          format: date-time
        created_to:
          type:
            - string
            - 'null'
          format: date-time
    Condition:
      type: object
      required:
        - field
        - op
        - value
      properties:
        field:
          type: string
          description: >-
            clicks_total | campaigns_clicked | campaigns_replied |
            times_contacted | last_clicked | last_replied | last_contacted |
            source | opted_in | date_added | has_tag | converted_any |
            converted_offer | converted_vertical | total_revenue
        op:
          type: string
          description: gte | lte | eq | within | older | is | contains
        value:
          description: number | string | boolean (days for within/older)
    ConditionGroup:
      type: object
      properties:
        match:
          type: string
          enum:
            - all
            - any
        conditions:
          type: array
          items:
            $ref: '#/components/schemas/Condition'
    Error:
      type: object
      properties:
        ok:
          type: boolean
          example: false
        error:
          type: string
  responses:
    Ok:
      description: Success
      content:
        application/json:
          schema:
            type: object
            properties:
              ok:
                type: boolean
                example: true
            additionalProperties: true
    NotFound:
      description: Not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            ok: false
            error: Not found
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Your API key (`as_live_…`), created under Settings → API keys.

````