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

# Update a Segment

> Update a specific segment by its ID.



## OpenAPI

````yaml https://api.useinvent.com/openapi.json patch /orgs/{org_id}/segments/{segment_id}
openapi: 3.1.0
info:
  version: 1.0.0
  title: Invent API
servers:
  - url: https://api.useinvent.com
security:
  - bearerAuth: []
paths:
  /orgs/{org_id}/segments/{segment_id}:
    patch:
      tags:
        - Orgs Segments
      summary: Update a Segment
      description: Update a specific segment by its ID.
      parameters:
        - schema:
            type: string
          required: true
          description: Org ID
          name: org_id
          in: path
        - schema:
            type: string
          required: true
          description: Segment ID
          name: segment_id
          in: path
      requestBody:
        description: ''
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateSegmentSchema'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/UpdateSegmentSchema'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SegmentSchema'
components:
  schemas:
    UpdateSegmentSchema:
      type: object
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 128
          description: Name of the segment
        color:
          $ref: '#/components/schemas/ColorNameSchema'
      description: Schema for updating a segment
    SegmentSchema:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        color:
          $ref: '#/components/schemas/ColorNameSchema'
        contacts_count:
          type: number
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
      required:
        - id
        - name
        - color
        - contacts_count
        - created_at
        - updated_at
      description: Schema for the segment
    ColorNameSchema:
      type: string
      enum:
        - red
        - orange
        - amber
        - yellow
        - lime
        - green
        - teal
        - cyan
        - sky
        - blue
        - indigo
        - violet
        - purple
        - fuchsia
        - pink
        - rose
        - neutral
      description: The name of the color to use in the UI
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: Bearer token authentication using your API key

````