> ## 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 fields

> 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}/fields
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}/fields:
    patch:
      tags:
        - Orgs / Teams / Routing forms
      summary: Edit team routing form fields
      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_editTeamRoutingFormFields
      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/EditTeamRoutingFormFieldsInput'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EditTeamRoutingFormFieldsOutput'
components:
  schemas:
    EditTeamRoutingFormFieldsInput:
      type: object
      properties:
        operations:
          type: array
          minItems: 1
          maxItems: 50
          items:
            oneOf:
              - $ref: '#/components/schemas/AddFieldOperationInput'
                title: Add question
              - $ref: '#/components/schemas/UpdateFieldOperationInput'
                title: Update question
              - $ref: '#/components/schemas/RemoveFieldOperationInput'
                title: Remove question
        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
    EditTeamRoutingFormFieldsOutput:
      type: object
      properties:
        status:
          enum:
            - success
            - error
          type: string
          example: success
        data:
          $ref: '#/components/schemas/EditTeamRoutingFormFieldsDataOutput'
      required:
        - status
        - data
    AddFieldOperationInput:
      type: object
      properties:
        type:
          type: string
          enum:
            - add
        field:
          $ref: '#/components/schemas/NewRoutingFormFieldInput'
        position:
          type: number
          minimum: 0
          example: 0
          description: 0-based position among the form's questions. Appends when omitted.
      required:
        - type
        - field
    UpdateFieldOperationInput:
      type: object
      properties:
        type:
          type: string
          enum:
            - update
        fieldId:
          type: string
          example: a1b2c3d4-...
          description: The question id from get_routing_form
        field:
          description: Only the properties to change
          allOf:
            - $ref: '#/components/schemas/RoutingFormFieldUpdateInput'
      required:
        - type
        - fieldId
        - field
    RemoveFieldOperationInput:
      type: object
      properties:
        type:
          type: string
          enum:
            - remove
        fieldId:
          type: string
          example: a1b2c3d4-...
          description: The question id from get_routing_form
      required:
        - type
        - fieldId
    EditTeamRoutingFormFieldsDataOutput:
      type: object
      properties:
        formId:
          type: string
          example: a1b2c3d4-...
        dryRun:
          type: boolean
          example: true
        changes:
          type: array
          items:
            $ref: '#/components/schemas/EditTeamRoutingFormFieldChangeOutput'
        warnings:
          type: array
          items:
            type: string
        before:
          type: array
          items:
            $ref: '#/components/schemas/TeamRoutingFormQuestionOutput'
        after:
          type: array
          items:
            $ref: '#/components/schemas/TeamRoutingFormQuestionOutput'
        updatedAt:
          type: string
          example: '2024-03-28T10:00:00.000Z'
          format: date-time
          description: >-
            Dry run: the form's current updatedAt, to send back as
            expectedUpdatedAt. Apply: the saved form's.
      required:
        - formId
        - dryRun
        - changes
        - warnings
        - before
        - after
        - updatedAt
    NewRoutingFormFieldInput:
      type: object
      properties:
        label:
          type: string
          example: Lead source
        type:
          enum:
            - text
            - number
            - textarea
            - select
            - multiselect
            - phone
            - email
          type: string
          example: select
        required:
          type: boolean
          default: false
        hidden:
          type: boolean
          default: false
          description: >-
            Not shown to the booker; the answer comes from a URL parameter named
            after the identifier. A hidden question can't be required.
        identifier:
          type: string
          example: lead_source
          description: The key that prefills and stores the answer. Defaults to the label.
        options:
          example:
            - Partner
            - Website
          description: >-
            Option labels in display order. Required for select and multiselect,
            forbidden otherwise.
          type: array
          items:
            type: string
      required:
        - label
        - type
    RoutingFormFieldUpdateInput:
      type: object
      properties:
        label:
          type: string
          example: Lead source
        identifier:
          type: string
          example: lead_source
        required:
          type: boolean
        hidden:
          type: boolean
          description: A hidden question can't be required.
        options:
          minItems: 1
          description: >-
            The complete option list in display order. A listed id keeps that
            option, renamed to its label; an existing option left out is
            removed.
          type: array
          items:
            $ref: '#/components/schemas/RoutingFormFieldOptionInput'
    EditTeamRoutingFormFieldChangeOutput:
      type: object
      properties:
        type:
          enum:
            - add
            - update
            - remove
          type: string
        fieldId:
          type: string
          example: a1b2c3d4-...
        description:
          type: string
          example: Added question "Lead source" (text) at position 2.
      required:
        - type
        - fieldId
        - description
    TeamRoutingFormQuestionOutput:
      type: object
      properties:
        id:
          type: string
          example: a1b2c3d4-...
        label:
          type: string
          example: Company size
        identifier:
          type: string
          example: companySize
          description: The key used to answer this question in a routing form response
        type:
          type: string
          example: select
        required:
          type: boolean
          example: true
        hidden:
          type: boolean
          example: false
          description: >-
            Not shown to the booker; the answer comes from a URL parameter named
            after the identifier
        options:
          type: array
          items:
            $ref: '#/components/schemas/TeamRoutingFormQuestionOptionOutput'
      required:
        - id
        - label
        - identifier
        - type
        - required
        - hidden
        - options
    RoutingFormFieldOptionInput:
      type: object
      properties:
        id:
          type: string
          nullable: true
          example: a1b2c3d4-...
          description: The option id from get_routing_form. Omit it for a new option.
        label:
          type: string
          example: Partner
      required:
        - label
    TeamRoutingFormQuestionOptionOutput:
      type: object
      properties:
        id:
          type: string
          nullable: true
          example: a1b2c3d4-...
        label:
          type: string
          example: 51-200
      required:
        - id
        - label

````

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