get:
  operationId: getSegmentById
  tags:
    - Segments
  summary: Get a Segment by its ID
  description: >-
    This API returns the segment specified by the given ID.


    A token with ORG_ADMIN or API authority is required to call this API.
  parameters:
    - in: path
      name: id
      schema:
        type: string
      required: true
      description: The ID of the Segment to retrieve.
      example: ef38f94347e94562b5bb8424a56397d8
  responses:
    '200':
      description: Segment
      content:
        application/json:
          schema:
            $ref: '../schemas/Segment.yaml'
    '401':
      $ref: '../../v3/responses/401.yaml'
    '403':
      $ref: '../../v3/responses/403.yaml'
    '404':
      $ref: '../../v3/responses/404.yaml'
    '429':
      $ref: '../../v3/responses/429.yaml'
    '500':
      $ref: '../../v3/responses/500.yaml'
delete:
  operationId: deleteSegmentById
  tags:
    - Segments
  summary: Delete Segment by ID
  description: >-
    This API deletes the segment specified by the given ID.


    Note that segment deletion may take some time to become effective.
    

    A token with ORG_ADMIN or API authority is required to call this API.
  parameters:
    - in: path
      name: id
      schema:
        type: string
      required: true
      description: The ID of the Segment to delete.
      example: ef38f94347e94562b5bb8424a56397d8
  responses:
    '204':
      description: No content.
    '401':
      $ref: '../../v3/responses/401.yaml'
    '403':
      $ref: '../../v3/responses/403.yaml'
    '404':
      $ref: '../../v3/responses/404.yaml'
    '429':
      $ref: '../../v3/responses/429.yaml'
    '500':
      $ref: '../../v3/responses/500.yaml'
patch:
  operationId: patchSegment
  tags:
    - Segments
  summary: Update a Segment
  description: >-
    Allows updating Segment fields using the [JSON Patch](https://tools.ietf.org/html/rfc6902) standard.


    Note that changes to a segment may take some time to propagate to all identities, and that segments will have no
    effect if segmentation is not enabled for your org.
    

    A token with ORG_ADMIN or API authority is required to call this API.
  parameters:
    - in: path
      name: id
      schema:
        type: string
      required: true
      description: The ID of the Segment being modified.
      example: ef38f94347e94562b5bb8424a56397d8
  requestBody:
    required: true
    description: |
      A list of Segment update operations according to the [JSON Patch](https://tools.ietf.org/html/rfc6902) standard.


      The following fields are patchable:
      * name
      * description
      * owner
      * visibilityCriteria
      * active
    content:
      application/json-patch+json:
        schema:
          type: array
          items:
            type: object
        examples:
            Set Visibility Criteria:
                description: Set the visibility criteria
                value:
                  - op: "replace"
                    path: "/visibilityCriteria"
                    value:
                      expression:
                        operator: "AND"
                        children:
                          - operator: "EQUALS"
                            attribute: "location"
                            value:
                              type: "STRING"
                              value: "Philadelphia"
                          - operator: "EQUALS"
                            attribute: "department"
                            value:
                              type: "STRING"
                              value: "HR"
                            
  responses:
    '200':
      description: >-
        Indicates the PATCH operation succeeded, and returns the Segment's new representation.
      content:
        application/json:
          schema:
            $ref: '../schemas/Segment.yaml'
    '400':
      $ref: '../../v3/responses/400.yaml'
    '401':
      $ref: '../../v3/responses/401.yaml'
    '403':
      $ref: '../../v3/responses/403.yaml'
    '404':
      $ref: '../../v3/responses/404.yaml'
    '429':
      $ref: '../../v3/responses/429.yaml'
    '500':
      $ref: '../../v3/responses/500.yaml'
