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

# Edit team routing form routes

> Required membership role: `team admin`. PBAC permission: `routingForm.update`. Learn more about API access control at https://cal.com/docs/api-reference/v2/access-control. If accessed using an OAuth access token, the `TEAM_ROUTING_FORM_WRITE` scope is required. Previews by default (`dryRun` defaults to true); send `dryRun: false` with `expectedUpdatedAt` to save.



## OpenAPI

````yaml /api-reference/v2/openapi.json patch /v2/organizations/{orgId}/teams/{teamId}/routing-forms/{routingFormId}/routes
openapi: 3.0.0
info:
  title: Cal.com API v2
  description: ''
  version: 1.0.0
  contact: {}
servers: []
security: []
tags: []
paths:
  /v2/organizations/{orgId}/teams/{teamId}/routing-forms/{routingFormId}/routes:
    patch:
      tags:
        - Orgs / Teams / Routing forms
      summary: Edit team routing form routes
      description: >-
        Required membership role: `team admin`. PBAC permission:
        `routingForm.update`. Learn more about API access control at
        https://cal.com/docs/api-reference/v2/access-control. If accessed using
        an OAuth access token, the `TEAM_ROUTING_FORM_WRITE` scope is required.
        Previews by default (`dryRun` defaults to true); send `dryRun: false`
        with `expectedUpdatedAt` to save.
      operationId: OrganizationsTeamsRoutingFormsController_editTeamRoutingFormRoutes
      parameters:
        - name: Authorization
          in: header
          description: >-
            value must be `Bearer <token>` where `<token>` is api key prefixed
            with cal_
          required: true
          schema:
            type: string
        - name: orgId
          required: true
          in: path
          schema:
            type: number
        - name: teamId
          required: true
          in: path
          schema:
            type: number
        - name: routingFormId
          required: true
          in: path
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EditTeamRoutingFormRoutesInput'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EditTeamRoutingFormRoutesOutput'
components:
  schemas:
    EditTeamRoutingFormRoutesInput:
      type: object
      properties:
        operations:
          type: array
          minItems: 1
          maxItems: 50
          items:
            oneOf:
              - $ref: '#/components/schemas/AddRouteOperationInput'
              - $ref: '#/components/schemas/ReplaceRouteOperationInput'
              - $ref: '#/components/schemas/RemoveRouteOperationInput'
              - $ref: '#/components/schemas/MoveRouteOperationInput'
              - $ref: '#/components/schemas/SetFallbackOperationInput'
        examples:
          maxItems: 20
          type: array
          items:
            $ref: '#/components/schemas/RouteExampleInput'
        dryRun:
          type: boolean
          default: true
          description: Preview changes without saving. Defaults to true.
        expectedUpdatedAt:
          type: string
          format: date-time
          description: >-
            Required when dryRun is false: the updatedAt from the preview or
            from get_routing_form.
      required:
        - operations
    EditTeamRoutingFormRoutesOutput:
      type: object
      properties:
        status:
          enum:
            - success
            - error
          type: string
          example: success
        data:
          $ref: '#/components/schemas/EditTeamRoutingFormRoutesDataOutput'
      required:
        - status
        - data
    AddRouteOperationInput:
      type: object
      properties:
        type:
          type: string
          enum:
            - add
        route:
          $ref: '#/components/schemas/DraftRouteInput'
        position:
          type: number
          minimum: 0
      required:
        - type
        - route
    ReplaceRouteOperationInput:
      type: object
      properties:
        type:
          type: string
          enum:
            - replace
        routeId:
          type: string
          example: route-enterprise
        route:
          $ref: '#/components/schemas/DraftRouteInput'
      required:
        - type
        - routeId
        - route
    RemoveRouteOperationInput:
      type: object
      properties:
        type:
          type: string
          enum:
            - remove
        routeId:
          type: string
          example: route-enterprise
      required:
        - type
        - routeId
    MoveRouteOperationInput:
      type: object
      properties:
        type:
          type: string
          enum:
            - move
        routeId:
          type: string
          example: route-enterprise
        position:
          type: number
          minimum: 0
      required:
        - type
        - routeId
        - position
    SetFallbackOperationInput:
      type: object
      properties:
        type:
          type: string
          enum:
            - setFallback
        action:
          oneOf:
            - $ref: '#/components/schemas/EventTypeRedirectActionInput'
            - $ref: '#/components/schemas/CustomPageMessageActionInput'
            - $ref: '#/components/schemas/ExternalRedirectUrlActionInput'
      required:
        - type
        - action
    RouteExampleInput:
      type: object
      properties:
        answers:
          type: object
          additionalProperties:
            oneOf:
              - type: string
              - type: number
              - type: array
                items:
                  oneOf:
                    - type: string
                    - type: number
          example:
            Company size: 51-200
        expectedRoute:
          type: string
          nullable: true
          description: >-
            The route's exact name, or the event-type slug it redirects to. Null
            when the answers should fall through to the fallback; a route id is
            also accepted.
          example: route-enterprise
      required:
        - answers
        - expectedRoute
    EditTeamRoutingFormRoutesDataOutput:
      type: object
      properties:
        formId:
          type: string
          example: a1b2c3d4-...
        dryRun:
          type: boolean
          example: true
        changes:
          type: array
          items:
            $ref: '#/components/schemas/EditTeamRoutingFormRouteChangeOutput'
        warnings:
          type: array
          items:
            type: string
        before:
          type: array
          items:
            $ref: '#/components/schemas/EditTeamRoutingFormRoutesRouteOutput'
        after:
          type: array
          items:
            $ref: '#/components/schemas/EditTeamRoutingFormRoutesRouteOutput'
        updatedAt:
          type: string
          example: '2024-03-28T10:00:00.000Z'
          format: date-time
      required:
        - formId
        - dryRun
        - changes
        - warnings
        - before
        - after
        - updatedAt
    DraftRouteInput:
      type: object
      properties:
        name:
          type: string
          example: Enterprise
        match:
          default: all
          enum:
            - all
            - any
          type: string
        conditions:
          minItems: 1
          type: array
          items:
            $ref: '#/components/schemas/DraftConditionInput'
        action:
          oneOf:
            - $ref: '#/components/schemas/EventTypeRedirectActionInput'
            - $ref: '#/components/schemas/CustomPageMessageActionInput'
            - $ref: '#/components/schemas/ExternalRedirectUrlActionInput'
        memberFilter:
          $ref: '#/components/schemas/DraftMemberFilterInput'
      required:
        - conditions
        - action
    EventTypeRedirectActionInput:
      type: object
      properties:
        type:
          type: string
          enum:
            - eventTypeRedirectUrl
        eventTypeSlug:
          type: string
          example: acme/discovery-call
      required:
        - type
        - eventTypeSlug
    CustomPageMessageActionInput:
      type: object
      properties:
        type:
          type: string
          enum:
            - customPageMessage
        message:
          type: string
          example: Thanks for your interest
      required:
        - type
        - message
    ExternalRedirectUrlActionInput:
      type: object
      properties:
        type:
          type: string
          enum:
            - externalRedirectUrl
        url:
          type: string
          format: uri
          example: https://example.com/booking
      required:
        - type
        - url
    EditTeamRoutingFormRouteChangeOutput:
      type: object
      properties:
        type:
          enum:
            - add
            - replace
            - remove
            - move
            - setFallback
            - addMissingFallback
          type: string
        routeId:
          type: string
          example: route-enterprise
        description:
          type: string
          example: Added route "Enterprise" at position 0.
      required:
        - type
        - routeId
        - description
    EditTeamRoutingFormRoutesRouteOutput:
      type: object
      properties:
        id:
          type: string
          example: a1b2c3d4-...
        name:
          type: string
          nullable: true
          example: Enterprise leads
        kind:
          enum:
            - route
            - router
            - fallback
          type: string
        action:
          nullable: true
          type: object
          allOf:
            - $ref: '#/components/schemas/TeamRoutingFormRouteActionOutput'
        conditions:
          type: string
          nullable: true
          example: '"Company size" equals "51-200"'
          description: Human-readable description of the conditions a submission must match
        advancedRouting:
          description: >-
            Advanced routing settings on the route, e.g. attribute-based team
            member routing; empty for routers
          type: array
          items:
            type: string
      required:
        - id
        - name
        - kind
        - action
        - conditions
        - advancedRouting
    DraftConditionInput:
      type: object
      properties:
        field:
          type: string
          example: Company size
        operator:
          enum:
            - equals
            - not_equals
            - contains
            - not_contains
            - starts_with
            - ends_with
            - is_empty
            - is_not_empty
            - greater_than
            - less_than
            - greater_or_equal
            - less_or_equal
            - between
            - all_in
            - not_all_in
          type: string
        value:
          oneOf:
            - type: string
            - type: number
            - type: array
              items:
                oneOf:
                  - type: string
                  - type: number
      required:
        - field
        - operator
    DraftMemberFilterInput:
      type: object
      properties:
        match:
          default: all
          enum:
            - all
            - any
          type: string
        conditions:
          minItems: 1
          type: array
          items:
            $ref: '#/components/schemas/DraftMemberFilterConditionInput'
      required:
        - conditions
    TeamRoutingFormRouteActionOutput:
      type: object
      properties:
        type:
          enum:
            - customPageMessage
            - externalRedirectUrl
            - eventTypeRedirectUrl
          type: string
          description: >-
            For eventTypeRedirectUrl, value is the `team-slug/event-slug` path
            of the routed-to event type
        value:
          type: string
          example: acme/discovery-call
        eventTypeId:
          type: number
          nullable: true
          example: 123
      required:
        - type
        - value
        - eventTypeId
    DraftMemberFilterConditionInput:
      type: object
      properties:
        attribute:
          type: string
          example: Department
        operator:
          enum:
            - equals
            - not_equals
            - contains
            - not_contains
            - starts_with
            - ends_with
            - is_empty
            - is_not_empty
            - greater_than
            - less_than
            - greater_or_equal
            - less_or_equal
            - between
            - all_in
            - not_all_in
          type: string
        value:
          oneOf:
            - type: string
            - type: number
            - type: array
              items:
                oneOf:
                  - type: string
                  - type: number
      required:
        - attribute
        - operator

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.