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

# Update Extraction Field

> Update an existing data extraction field.



## OpenAPI

````yaml https://api.usetuner.ai/public/openapi.json put /api/v1/workspaces/{workspace_id}/agents/{agent_id}/settings/data-extraction/{field_id}
openapi: 3.1.0
info:
  title: My Public API
  version: 1.0.0
servers:
  - url: https://api.usetuner.ai
security: []
tags:
  - name: calls
    x-group: Calls
  - name: workspaces
    x-group: Workspaces
  - name: agent-settings
    x-group: Agent Settings
  - name: agents
    x-group: Agents
  - name: simulation
    x-group: Simulation
  - name: providers
    x-group: Providers
paths:
  /api/v1/workspaces/{workspace_id}/agents/{agent_id}/settings/data-extraction/{field_id}:
    put:
      tags:
        - agent-settings
      summary: Update Extraction Field
      description: Update an existing data extraction field.
      operationId: >-
        update_data_extraction_field_api_v1_workspaces__workspace_id__agents__agent_id__settings_data_extraction__field_id__put
      parameters:
        - name: field_id
          in: path
          required: true
          schema:
            type: integer
            title: Field Id
        - name: agent_id
          in: path
          required: true
          schema:
            type: integer
            description: Tuner's internal numeric ID for the agent.
            title: Agent Id
          description: Tuner's internal numeric ID for the agent.
        - name: workspace_id
          in: path
          required: true
          schema:
            type: integer
            description: Workspace ID. Find this in Workspace > General Settings.
            title: Workspace Id
          description: Workspace ID. Find this in Workspace > General Settings.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DataExtractionFieldInput'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DataExtractionFieldResponse'
        '401':
          description: Missing or invalid API key.
          content:
            application/json:
              example:
                detail: Not authenticated
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: The field is a system default and cannot be modified.
          content:
            application/json:
              example:
                detail: System data extraction fields cannot be modified
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: >-
            Agent not found, or no data extraction field with this ID exists for
            it.
          content:
            application/json:
              example:
                detail: Data extraction field with ID 8 not found for agent 17
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '409':
          description: >-
            A data extraction field with this label already exists for this
            agent.
          content:
            application/json:
              example:
                detail: >-
                  A data extraction field with label 'Order Number' already
                  exists for this agent.
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - Bearer: []
components:
  schemas:
    DataExtractionFieldInput:
      properties:
        label:
          type: string
          maxLength: 200
          minLength: 1
          title: Label
          description: >-
            Display name for this field, and the key it appears under on call
            records.
        field_type:
          type: string
          enum:
            - text
            - number
            - boolean
            - enum
          title: Field Type
          description: >-
            Type of the extracted value: `text`, `number`, `boolean`, or `enum`.
            Use `enum` to restrict the value to a fixed set.
        prompt_definition:
          type: string
          minLength: 1
          title: Prompt Definition
          description: >-
            Instruction the AI uses to find this value in the transcript. Name
            what to look for and the form it takes.
        enum_options:
          anyOf:
            - type: string
            - items:
                type: string
              type: array
            - type: 'null'
          title: Enum Options
          description: >-
            Allowed values, required when `field_type` is `enum`. Must be
            omitted otherwise — providing it with any other `field_type` returns
            a 422. Accepts an array or a comma-separated string.
      type: object
      required:
        - label
        - field_type
        - prompt_definition
      title: DataExtractionFieldInput
      description: Input schema for data extraction field.
    DataExtractionFieldResponse:
      properties:
        id:
          type: integer
          title: Id
          description: Unique identifier for the data extraction field.
          examples:
            - 42
        label:
          type: string
          title: Label
          description: >-
            Display name for this field, and the key it appears under on call
            records.
          examples:
            - Customer name
        field_type:
          type: string
          enum:
            - text
            - number
            - boolean
            - enum
          title: Field Type
          description: >-
            Type of the extracted value: `text`, `number`, `boolean`, or `enum`.
            Use `enum` to restrict the value to a fixed set.
          examples:
            - text
        prompt_definition:
          type: string
          title: Prompt Definition
          description: >-
            Instruction the AI uses to find this value in the transcript. Name
            what to look for and the form it takes.
          examples:
            - >-
              The full name the caller provides when asked to identify
              themselves.
        enum_options:
          anyOf:
            - type: string
            - type: 'null'
          title: Enum Options
          description: >-
            Allowed values, present when `field_type` is `enum` and null
            otherwise, returned as a comma-separated string.
          examples:
            - Sales,Support,Billing
        is_system:
          type: boolean
          title: Is System
          description: >-
            Whether this field was added automatically as a system default.
            System fields cannot be modified or deleted.
          default: false
          examples:
            - false
      type: object
      required:
        - id
        - label
        - field_type
        - prompt_definition
      title: DataExtractionFieldResponse
      description: Response schema for data extraction field.
    ErrorResponse:
      properties:
        detail:
          type: string
          title: Detail
          description: Human-readable description of what went wrong.
      type: object
      required:
        - detail
      title: ErrorResponse
      description: Error body returned when a request fails.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    Bearer:
      type: http
      description: >-
        Use Tuner API key (tr_api_...) or user session token. Find your API key
        in Workspace Settings > API Keys.
      scheme: bearer

````