> ## 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 Entity Type Field

> Update an entity type field: rename it (set name) and/or change its data type (set data_type, plus enum_options when the new type is ENUM/MULTI_SELECT). At most one attribute may change per request. This is an asynchronous schema migration: the response contains schema_migration_id, which you poll via Get Schema Migration to track completion.



## OpenAPI

````yaml /sections/api-reference/openapi-spec-v2.yaml put /v2/entity-type-fields/{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: 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: 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 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/entity-type-fields/{id}:
    put:
      tags:
        - Entity Type API
      summary: Update Entity Type Field
      description: >-
        Update an entity type field: rename it (set name) and/or change its data
        type (set data_type, plus enum_options when the new type is
        ENUM/MULTI_SELECT). At most one attribute may change per request. This
        is an asynchronous schema migration: the response contains
        schema_migration_id, which you poll via Get Schema Migration to track
        completion.
      operationId: svrelay.publicv2.PublicAPIServiceV2.UpdateEntityTypeField
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            title: id
            description: The ID of the entity type field to update.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  title: name
                  description: >-
                    New display name. When provided and different from the
                    current name, the
                     field is renamed (key re-derived via slugify). Omit to leave unchanged.
                  nullable: true
                dataType:
                  $ref: '#/components/schemas/svstore.EntityTypeField.DataType'
                  title: data_type
                  description: >-
                    New data type. When provided and different from the current
                    type, the
                     field's type is changed and existing values are converted. Omit to leave
                     unchanged.
                  nullable: true
                enumOptions:
                  type: array
                  items:
                    $ref: '#/components/schemas/svstore.EnumOptionInput'
                  title: enum_options
                  description: >-
                    Required when data_type is changing to ENUM or MULTI_SELECT:
                    the option
                     set for the converted field.
              title: UpdateEntityTypeFieldRequest
              additionalProperties: false
        required: true
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/svstore.publicapi.UpdateEntityTypeFieldResponse
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/connect.error'
      security:
        - BearerAuth: []
components:
  schemas:
    svstore.EntityTypeField.DataType:
      type: string
      title: DataType
      enum:
        - DATA_TYPE_UNSPECIFIED
        - TEXT
        - NUMBER
        - BOOL
        - TIMESTAMP
        - ENUM
        - ENTITY_REF
        - USER_REF
        - UNIQUE
        - MULTI_SELECT
        - FILE
    svstore.EnumOptionInput:
      type: object
      properties:
        value:
          type: string
          title: value
          x-stainless-terraform-configurability: optional
        displayName:
          type: string
          title: display_name
          x-stainless-terraform-configurability: optional
        displayOrder:
          type: integer
          title: display_order
          format: int32
          x-stainless-terraform-configurability: optional
      title: EnumOptionInput
      additionalProperties: false
      description: Input for creating an enum option.
    svstore.publicapi.UpdateEntityTypeFieldResponse:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/svstore.publicapi.SchemaMigrationRef'
          title: data
          description: |-
            Reference to the staged migration applying the change.
             data.schema_migration_id is empty if the request was a no-op. At most one
             attribute may change per
             request; changing both name and data_type at once returns InvalidArgument.
          x-stainless-terraform-configurability: optional
      title: UpdateEntityTypeFieldResponse
      additionalProperties: false
    connect.error:
      type: object
      properties:
        code:
          type: string
          examples:
            - not_found
          enum:
            - canceled
            - unknown
            - invalid_argument
            - deadline_exceeded
            - not_found
            - already_exists
            - permission_denied
            - resource_exhausted
            - failed_precondition
            - aborted
            - out_of_range
            - unimplemented
            - internal
            - unavailable
            - data_loss
            - unauthenticated
          description: >-
            The status code, which should be an enum value of
            [google.rpc.Code][google.rpc.Code].
          x-stainless-terraform-configurability: optional
        message:
          type: string
          description: >-
            A developer-facing error message, which should be in English. Any
            user-facing error message should be localized and sent in the
            [google.rpc.Status.details][google.rpc.Status.details] field, or
            localized by the client.
          x-stainless-terraform-configurability: optional
        detail:
          $ref: '#/components/schemas/google.protobuf.Any'
          x-stainless-terraform-configurability: optional
      title: Connect Error
      additionalProperties: true
      description: >-
        Error type returned by Connect:
        https://connectrpc.com/docs/go/errors/#http-representation
    svstore.publicapi.SchemaMigrationRef:
      type: object
      properties:
        schemaMigrationId:
          type: string
          title: schema_migration_id
          description: |-
            The ID of the schema migration. Empty when the request was a no-op
             (e.g. an Update that changed nothing).
          x-stainless-terraform-configurability: optional
      title: SchemaMigrationRef
      additionalProperties: false
      description: >-
        SchemaMigrationRef references the migration produced by a field
        mutation.
         Poll its state via GetSchemaMigration.
    google.protobuf.Any:
      type: object
      properties:
        type:
          type: string
          x-stainless-terraform-configurability: optional
        value:
          type: string
          format: binary
          x-stainless-terraform-configurability: optional
        debug:
          type: object
          additionalProperties: true
          x-stainless-terraform-configurability: optional
      additionalProperties: true
      description: >-
        Contains an arbitrary serialized message along with a @type that
        describes the type of the serialized message.
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer

````