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

# Update Assignment Rule

> Replace an assignment rule's conditions and actions, and optionally set its display_order. Omitting display_order leaves it unchanged. Excluded from the generated MCP tools: Catalyst changes assignment rules through staged, human-published change sets, and an auto-generated tool would be an unstaged second path to the same rows.



## OpenAPI

````yaml /sections/api-reference/openapi-spec-v2.yaml put /v2/teams/{team_id}/assignment-rules/{id}
openapi: 3.1.0
info:
  title: Serval Public API
  description: Serval Public API
  contact:
    name: Serval
    url: https://serval.com
    email: support@serval.com
  license:
    name: Serval License
    url: https://serval.com/license
  version: 2.0.0
servers:
  - url: https://public.api.serval.com
security:
  - BearerAuth: []
tags:
  - name: Access Policy API
  - name: Access Policy Approval Procedure API
  - name: Access Profile API
  - name: Access Relationship API
  - name: Access Request API
  - name: Agent API
  - name: App Instance API
  - name: App Resource API
  - name: App Resource Role API
  - name: Approval Delegation API
  - name: Approval Request API
  - name: Assignment Rules API
  - name: Audit Log API
  - name: Change Blackout API
  - name: Change Model API
  - name: Custom Field API
  - name: Custom Service API
  - name: Entity API
  - name: Entity Field Mapping API
  - name: Entity Ingestion Config API
  - name: Entity Type API
  - name: Folder API
  - name: Forms API
  - name: Group API
  - name: Guidance API
  - name: Help Agent API
  - name: Journey API
  - name: Knowledge API
  - name: Knowledge Base API
  - name: Report API
  - name: SLA API
  - name: Schedule API
  - name: Tag API
  - name: Team API
  - name: Team Group API
  - name: Team User API
  - name: Ticket API
  - name: Topic API
  - name: User API
  - name: User Relationship API
  - name: Workflow API
  - name: Workflow Approval Procedure API
  - name: Workflow Run API
paths:
  /v2/teams/{team_id}/assignment-rules/{id}:
    put:
      tags:
        - Assignment Rules API
      summary: Update Assignment Rule
      description: >-
        Replace an assignment rule's conditions and actions, and optionally set
        its display_order. Omitting display_order leaves it unchanged. Excluded
        from the generated MCP tools: Catalyst changes assignment rules through
        staged, human-published change sets, and an auto-generated tool would be
        an unstaged second path to the same rows.
      operationId: svrelay.publicv2.PublicAPIServiceV2.UpdateAssignmentRule
      parameters:
        - name: team_id
          in: path
          required: true
          schema:
            type: string
            title: team_id
        - name: id
          in: path
          required: true
          schema:
            type: string
            title: id
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                conditions:
                  type: array
                  items:
                    $ref: >-
                      #/components/schemas/svhelp.pubapimodels.AssignmentRuleConditionGroup
                  title: conditions
                  description: >-
                    Replaced wholesale. Empty clears the rule's conditions,
                    which makes it
                     match every ticket.
                actions:
                  type: array
                  items:
                    $ref: >-
                      #/components/schemas/svhelp.pubapimodels.AssignmentRuleAction
                  title: actions
                  description: At least one is required.
                displayOrder:
                  type:
                    - integer
                    - 'null'
                  title: display_order
                  format: int32
                  description: Absent leaves the rule where it sorts.
              title: UpdateAssignmentRuleRequest
              additionalProperties: false
              description: >-
                Whole-rule replace, not a patch. A PATCH could not distinguish
                "leave the
                 conditions alone" from "clear them" without a field mask, and clearing them
                 silently is the dangerous direction: a rule with no conditions matches every
                 ticket. display_order is the exception and is genuinely optional, because it
                 has a meaningful "leave it where it is".
        required: true
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/svhelp.publicapi.UpdateAssignmentRuleResponse
      security:
        - BearerAuth: []
components:
  schemas:
    svhelp.pubapimodels.AssignmentRuleConditionGroup:
      type: object
      properties:
        conditions:
          type: array
          items:
            $ref: '#/components/schemas/svhelp.pubapimodels.AssignmentRuleCondition'
          title: conditions
          description: >-
            At least one. An empty group would match every ticket, which is what
            an
             empty `when` already says, so it is refused rather than given a second
             spelling.
          x-stainless-terraform-configurability: optional
      title: AssignmentRuleConditionGroup
      additionalProperties: false
      description: |-
        One node of a rule's condition expression: either a group that combines
         children with a single operator, or a leaf condition.

         Grouping is explicit here rather than inferred from position. The stored form
         is a flat list where each condition carries the operator joining it to the
         previous one, and the evaluator reads that as an OR of AND-groups -- so the
         same list can be read two ways and nothing on the wire said which. A tree has
         no precedence to infer.
         One AND-term: every condition in it must match.

         A message rather than a bare list because proto has no repeated-of-repeated,
         and so per-group settings can be added later without disturbing the
         conditions -- EntityFilterGroup grew source_filter that way.
    svhelp.pubapimodels.AssignmentRuleAction:
      type: object
      properties:
        assignedEntityId:
          type: string
          title: assigned_entity_id
          description: >-
            The user id or the group id, per assigned_entity_type. User ids come
            from
             GET /v2/users; assignable group ids from
             GET /v2/teams/{team_id}/assignment-groups.
          x-stainless-terraform-configurability: optional
        assignedEntityType:
          $ref: '#/components/schemas/svhelp.pubapimodels.AssignedEntityType'
          title: assigned_entity_type
          x-stainless-terraform-configurability: optional
      title: AssignmentRuleAction
      additionalProperties: false
      description: |-
        Who a matching ticket is assigned to.

         A rule names one or more users, or a single group, never both. A ticket
         records a single assigned group, and the evaluator keeps the first resolvable
         group and discards the rest -- so a rule naming two reads like it assigns to
         both and does not. Both shapes are rejected on write.
    svhelp.publicapi.UpdateAssignmentRuleResponse:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/svhelp.pubapimodels.AssignmentRule'
          title: data
          x-stainless-terraform-configurability: optional
      title: UpdateAssignmentRuleResponse
      additionalProperties: false
    svhelp.pubapimodels.AssignmentRuleCondition:
      type: object
      oneOf:
        - $ref: >-
            #/components/schemas/svhelp.pubapimodels.AssignmentRuleCondition.RequesterCustomField
        - $ref: >-
            #/components/schemas/svhelp.pubapimodels.AssignmentRuleCondition.RequesterGroup
        - $ref: >-
            #/components/schemas/svhelp.pubapimodels.AssignmentRuleCondition.Schedule
        - $ref: >-
            #/components/schemas/svhelp.pubapimodels.AssignmentRuleCondition.TicketCategory
        - $ref: >-
            #/components/schemas/svhelp.pubapimodels.AssignmentRuleCondition.TicketIntake
        - $ref: >-
            #/components/schemas/svhelp.pubapimodels.AssignmentRuleCondition.TicketLabel
        - $ref: >-
            #/components/schemas/svhelp.pubapimodels.AssignmentRuleCondition.TicketPriority
        - $ref: >-
            #/components/schemas/svhelp.pubapimodels.AssignmentRuleCondition.TicketStatus
        - $ref: >-
            #/components/schemas/svhelp.pubapimodels.AssignmentRuleCondition.TicketType
      title: AssignmentRuleCondition
      description: >-
        One condition on a rule. Exactly one variant is set, and the variant is
        the
         condition's type.

         A flat {type, value} pair cannot say that a category condition takes a
         category option id while a label condition takes a label name, so each variant
         names its own operand and where it comes from. Every referent must already
         exist on the team; this API never creates them.
    svhelp.pubapimodels.AssignedEntityType:
      type: string
      title: AssignedEntityType
      enum:
        - ASSIGNED_ENTITY_TYPE_UNSPECIFIED
        - ASSIGNED_ENTITY_TYPE_USER
        - ASSIGNED_ENTITY_TYPE_GROUP
    svhelp.pubapimodels.AssignmentRule:
      type: object
      properties:
        id:
          type: string
          title: id
          description: >-
            Server-assigned. Ignored in request bodies -- on update the path
            {id} is
             authoritative, and on create an id cannot be chosen.
          readOnly: true
          x-stainless-terraform-configurability: computed
        conditions:
          type: array
          items:
            $ref: >-
              #/components/schemas/svhelp.pubapimodels.AssignmentRuleConditionGroup
          title: conditions
          description: |-
            When the rule applies. Unset matches every ticket.

             OR between groups, AND within each group -- the same shape
             svstore.EntityFilterGroup uses on SearchEntities. Deeper nesting is not
             expressible, which is exactly the limit the evaluator computes and the
             settings UI can draw.
          x-stainless-terraform-configurability: optional
        actions:
          type: array
          items:
            $ref: '#/components/schemas/svhelp.pubapimodels.AssignmentRuleAction'
          title: actions
          description: >-
            At least one is required. A rule assigns to one or more users, or to
            a
             single group -- never both.
          x-stainless-terraform-configurability: optional
        displayOrder:
          type:
            - integer
            - 'null'
          title: display_order
          format: int32
          description: >-
            The rule's sort key within its team. Lower is evaluated first, and
            the
             first rule whose conditions match assigns the ticket.

             This is routing_rules.display_order as stored, written back verbatim. It
             is not a position: values are not renumbered around a write, so gaps are
             normal -- a soft-deleted rule leaves its value behind, and 10 of 140 teams
             carry gaps today. Two rules may share a value, in which case their
             relative order falls to created_at.

             Not durable against the settings UI: reordering rules there reassigns the
             whole team's display_order to 0..n-1, so a sparse value set here becomes
             an index the next time someone drags a rule in
             Settings -> Assignment Rules.

             Always returned on a read. Optional carries write presence only: on
             update, absent leaves the rule where it sorts, and 0 is a real value.
          x-stainless-terraform-configurability: optional
        createdAt:
          $ref: '#/components/schemas/google.protobuf.Timestamp'
          title: created_at
          description: |-
            Timestamp indicating when the rule was created. Will be in RFC 3339
             format (e.g., "2017-01-15T01:30:15.01Z").
          readOnly: true
          x-stainless-terraform-configurability: computed
        updatedAt:
          $ref: '#/components/schemas/google.protobuf.Timestamp'
          title: updated_at
          description: >-
            Timestamp indicating when the rule was last changed.
            Server-maintained,
             and moved by a display_order write as well as by a content edit.
          readOnly: true
          x-stainless-terraform-configurability: computed
      title: AssignmentRule
      additionalProperties: false
    svhelp.pubapimodels.AssignmentRuleCondition.RequesterCustomField:
      type: object
      title: Requester Custom Field
      properties:
        requesterCustomField:
          $ref: >-
            #/components/schemas/svhelp.pubapimodels.RequesterCustomFieldCondition
          title: requester_custom_field
          x-stainless-terraform-configurability: optional
      required:
        - requesterCustomField
      additionalProperties: false
    svhelp.pubapimodels.AssignmentRuleCondition.RequesterGroup:
      type: object
      title: Requester Group
      properties:
        requesterGroup:
          $ref: '#/components/schemas/svhelp.pubapimodels.RequesterGroupCondition'
          title: requester_group
          x-stainless-terraform-configurability: optional
      required:
        - requesterGroup
      additionalProperties: false
    svhelp.pubapimodels.AssignmentRuleCondition.Schedule:
      type: object
      title: Schedule
      properties:
        schedule:
          $ref: '#/components/schemas/svhelp.pubapimodels.ScheduleCondition'
          title: schedule
          x-stainless-terraform-configurability: optional
      required:
        - schedule
      additionalProperties: false
    svhelp.pubapimodels.AssignmentRuleCondition.TicketCategory:
      type: object
      title: Ticket Category
      properties:
        ticketCategory:
          $ref: '#/components/schemas/svhelp.pubapimodels.TicketCategoryCondition'
          title: ticket_category
          x-stainless-terraform-configurability: optional
      required:
        - ticketCategory
      additionalProperties: false
    svhelp.pubapimodels.AssignmentRuleCondition.TicketIntake:
      type: object
      title: Ticket Intake
      properties:
        ticketIntake:
          $ref: '#/components/schemas/svhelp.pubapimodels.TicketIntakeCondition'
          title: ticket_intake
          x-stainless-terraform-configurability: optional
      required:
        - ticketIntake
      additionalProperties: false
    svhelp.pubapimodels.AssignmentRuleCondition.TicketLabel:
      type: object
      title: Ticket Label
      properties:
        ticketLabel:
          $ref: '#/components/schemas/svhelp.pubapimodels.TicketLabelCondition'
          title: ticket_label
          x-stainless-terraform-configurability: optional
      required:
        - ticketLabel
      additionalProperties: false
    svhelp.pubapimodels.AssignmentRuleCondition.TicketPriority:
      type: object
      title: Ticket Priority
      properties:
        ticketPriority:
          $ref: '#/components/schemas/svhelp.pubapimodels.TicketPriorityCondition'
          title: ticket_priority
          x-stainless-terraform-configurability: optional
      required:
        - ticketPriority
      additionalProperties: false
    svhelp.pubapimodels.AssignmentRuleCondition.TicketStatus:
      type: object
      title: Ticket Status
      properties:
        ticketStatus:
          $ref: '#/components/schemas/svhelp.pubapimodels.TicketStatusCondition'
          title: ticket_status
          x-stainless-terraform-configurability: optional
      required:
        - ticketStatus
      additionalProperties: false
    svhelp.pubapimodels.AssignmentRuleCondition.TicketType:
      type: object
      title: Ticket Type
      properties:
        ticketType:
          $ref: '#/components/schemas/svhelp.pubapimodels.TicketTypeCondition'
          title: ticket_type
          x-stainless-terraform-configurability: optional
      required:
        - ticketType
      additionalProperties: false
    google.protobuf.Timestamp:
      type: string
      examples:
        - '2025-01-15T01:30:15.000Z'
        - '2025-06-01T00:00:00.000Z'
      format: date-time
      description: A timestamp in RFC 3339 format (e.g., "2025-01-15T01:30:15Z").
    svhelp.pubapimodels.RequesterCustomFieldCondition:
      type: object
      properties:
        fieldKey:
          type: string
          title: field_key
          x-stainless-terraform-configurability: optional
        operator:
          $ref: '#/components/schemas/svhelp.pubapimodels.RuleConditionOperator'
          title: operator
          x-stainless-terraform-configurability: optional
        values:
          type: array
          items:
            type: string
          title: values
          x-stainless-terraform-configurability: optional
      title: RequesterCustomFieldCondition
      additionalProperties: false
      description: >-
        Matches an attribute of the requester rather than of the ticket.
        field_key
         names a field on the org's Users extension; values are compared against that
         field's value on the requester.
    svhelp.pubapimodels.RequesterGroupCondition:
      type: object
      properties:
        operator:
          $ref: '#/components/schemas/svhelp.pubapimodels.RuleConditionOperator'
          title: operator
          x-stainless-terraform-configurability: optional
        groupIds:
          type: array
          items:
            type: string
          title: group_ids
          x-stainless-terraform-configurability: optional
      title: RequesterGroupCondition
      additionalProperties: false
      description: >-
        Matches whether the ticket's requester belongs to a group, by group id
        from
         GET /v2/groups. Org-level groups, validated against the caller's org.
    svhelp.pubapimodels.ScheduleCondition:
      type: object
      properties:
        operator:
          $ref: '#/components/schemas/svhelp.pubapimodels.RuleConditionOperator'
          title: operator
          x-stainless-terraform-configurability: optional
        scheduleIds:
          type: array
          items:
            type: string
          title: schedule_ids
          x-stainless-terraform-configurability: optional
      title: ScheduleCondition
      additionalProperties: false
      description: >-
        Matches whether the ticket arrived inside a schedule's window, by
        schedule id
         from GET /v2/teams/{team_id}/schedules.
    svhelp.pubapimodels.TicketCategoryCondition:
      type: object
      properties:
        operator:
          $ref: '#/components/schemas/svhelp.pubapimodels.RuleConditionOperator'
          title: operator
          x-stainless-terraform-configurability: optional
        categoryOptionIds:
          type: array
          items:
            type: string
          title: category_option_ids
          x-stainless-terraform-configurability: optional
      title: TicketCategoryCondition
      additionalProperties: false
      description: >-
        Matches the ticket's category, by category option id from GET
        /v2/categories.
         A condition naming a parent category also matches a ticket filed under one of
         its descendants, up to two levels down.
    svhelp.pubapimodels.TicketIntakeCondition:
      type: object
      properties:
        operator:
          $ref: '#/components/schemas/svhelp.pubapimodels.RuleConditionOperator'
          title: operator
          x-stainless-terraform-configurability: optional
        intakes:
          type: array
          items:
            type: string
          title: intakes
          x-stainless-terraform-configurability: optional
      title: TicketIntakeCondition
      additionalProperties: false
      description: >-
        Matches the intake the ticket arrived through: the configured inbox or
        chat
         channel that created it, as opposed to a ticket raised in the app directly.

         Each value is a prefixed compound naming one intake -- "email:<id>" for an
         email intake config, "channel:<id>" for a connected chat service.
    svhelp.pubapimodels.TicketLabelCondition:
      type: object
      properties:
        operator:
          $ref: '#/components/schemas/svhelp.pubapimodels.RuleConditionOperator'
          title: operator
          x-stainless-terraform-configurability: optional
        labelNames:
          type: array
          items:
            type: string
          title: label_names
          x-stainless-terraform-configurability: optional
      title: TicketLabelCondition
      additionalProperties: false
      description: >-
        Matches the ticket's labels by name, as returned by GET /v2/labels.
        Names,
         not ids -- the evaluator compares against the label name. GET /v2/tags is a
         different resource, owned by svflow, and unrelated to tickets.
    svhelp.pubapimodels.TicketPriorityCondition:
      type: object
      properties:
        operator:
          $ref: '#/components/schemas/svhelp.pubapimodels.RuleConditionOperator'
          title: operator
          x-stainless-terraform-configurability: optional
        priorities:
          type: array
          items:
            type: string
          title: priorities
          x-stainless-terraform-configurability: optional
      title: TicketPriorityCondition
      additionalProperties: false
      description: >-
        Matches the ticket's priority. Values are priority literals as the
        ticket
         carries them (for example "urgent"), not ids.
    svhelp.pubapimodels.TicketStatusCondition:
      type: object
      properties:
        operator:
          $ref: '#/components/schemas/svhelp.pubapimodels.RuleConditionOperator'
          title: operator
          x-stainless-terraform-configurability: optional
        statusNames:
          type: array
          items:
            type: string
          title: status_names
          x-stainless-terraform-configurability: optional
      title: TicketStatusCondition
      additionalProperties: false
      description: >-
        Matches the ticket's status by name, as returned by GET /v2/statuses.
        Names,
         not ids -- the evaluator compares against the status name.
    svhelp.pubapimodels.TicketTypeCondition:
      type: object
      properties:
        operator:
          $ref: '#/components/schemas/svhelp.pubapimodels.RuleConditionOperator'
          title: operator
          x-stainless-terraform-configurability: optional
        ticketTypes:
          type: array
          items:
            type: string
          title: ticket_types
          x-stainless-terraform-configurability: optional
      title: TicketTypeCondition
      additionalProperties: false
      description: Matches the ticket's type. Values are ticket type literals, not ids.
    svhelp.pubapimodels.RuleConditionOperator:
      type: string
      title: RuleConditionOperator
      enum:
        - RULE_CONDITION_OPERATOR_UNSPECIFIED
        - RULE_CONDITION_OPERATOR_EQUALS
        - RULE_CONDITION_OPERATOR_NOT_EQUALS
        - RULE_CONDITION_OPERATOR_IN
        - RULE_CONDITION_OPERATOR_NOT_IN
        - RULE_CONDITION_OPERATOR_HAS
        - RULE_CONDITION_OPERATOR_NOT_HAS
        - RULE_CONDITION_OPERATOR_HAS_ANY
        - RULE_CONDITION_OPERATOR_HAS_ALL
        - RULE_CONDITION_OPERATOR_IS_NULL
        - RULE_CONDITION_OPERATOR_IS_NOT_NULL
        - RULE_CONDITION_OPERATOR_IS_EMPTY
        - RULE_CONDITION_OPERATOR_IS_NOT_EMPTY
        - RULE_CONDITION_OPERATOR_IN_TIME_RANGE
        - RULE_CONDITION_OPERATOR_NOT_IN_TIME_RANGE
        - RULE_CONDITION_OPERATOR_MEMBER_OF
        - RULE_CONDITION_OPERATOR_GREATER_THAN
        - RULE_CONDITION_OPERATOR_GREATER_THAN_OR_EQUAL
        - RULE_CONDITION_OPERATOR_LESS_THAN
        - RULE_CONDITION_OPERATOR_LESS_THAN_OR_EQUAL
      description: |-
        The comparison a condition applies to its values.

         The enum carries the whole vocabulary, but each condition type accepts only
         the operators its handler honours -- a schedule takes the time-range pair, a
         tag takes the set operators -- and a write outside that set is refused with
         the accepted list. See condition.HandlerOperators.

         How many values each operator takes is fixed, and enforced on write:

           IN, NOT_IN, HAS_ANY, HAS_ALL                  one or more
           IS_NULL, IS_NOT_NULL, IS_EMPTY, IS_NOT_EMPTY  none
           UNSPECIFIED                                   none -- the boolean-style
                                                         condition types carry no
                                                         operator at all
           everything else                               exactly one
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````