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

# Set Ticket Custom Field Values

> Set custom field values on a ticket. Uses the ticket's extension entity to store field values.



## OpenAPI

````yaml /sections/api-reference/openapi-spec-v2.yaml put /v2/tickets/{ticket_id}/custom-field-values
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/tickets/{ticket_id}/custom-field-values:
    put:
      tags:
        - Ticket API
      summary: Set Ticket Custom Field Values
      description: >-
        Set custom field values on a ticket. Uses the ticket's extension entity
        to store field values.
      operationId: svrelay.publicv2.PublicAPIServiceV2.SetTicketCustomFieldValues
      parameters:
        - name: ticket_id
          in: path
          required: true
          schema:
            type: string
            title: ticket_id
            description: The ID of the ticket to set custom field values for.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                fieldValues:
                  type: array
                  items:
                    $ref: '#/components/schemas/svstore.EntityFieldValueInput'
                  title: field_values
                  description: >-
                    The field values to set. Use field_key to identify fields
                    (e.g. "custom-gmin").
              title: SetTicketCustomFieldValuesRequest
              additionalProperties: false
        required: true
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/svhelp.publicapi.SetTicketCustomFieldValuesResponse
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/connect.error'
      security:
        - BearerAuth: []
components:
  schemas:
    svstore.EntityFieldValueInput:
      type: object
      properties:
        fieldId:
          type: string
          title: field_id
          description: Identify the field by ID or key. At least one is required.
          x-stainless-terraform-configurability: optional
        fieldKey:
          type: string
          title: field_key
          x-stainless-terraform-configurability: optional
        value:
          $ref: '#/components/schemas/google.protobuf.Value'
          title: value
          description: |-
            The field value. Null or absent clears the field.
             Type is determined by the field's data_type in the schema:
               TEXT, UNIQUE, ENUM, ENTITY_REF, USER_REF → string
               NUMBER → number
               BOOL → bool
               TIMESTAMP → string (ISO 8601, e.g. "2024-03-15T10:30:00Z")
               MULTI_SELECT → list of strings (enum option IDs)
          x-stainless-terraform-configurability: optional
        pinned:
          type: boolean
          title: pinned
          description: |-
            Pin this value to prevent ingestion from overwriting it.
             Default false = ingestion can overwrite. True = sticky.
          x-stainless-terraform-configurability: computed_optional
      title: EntityFieldValueInput
      additionalProperties: false
      description: |-
        Input for setting a field value on an entity (create/update requests).
         At least one of field_id or field_key is required to identify the target field.
         The field's data type is resolved from the schema — callers don't need to specify it.
    svhelp.publicapi.SetTicketCustomFieldValuesResponse:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/svstore.EntityFieldValue'
          title: data
          description: The updated field values for the ticket.
          x-stainless-terraform-configurability: optional
      title: SetTicketCustomFieldValuesResponse
      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
    google.protobuf.Value:
      oneOf:
        - type: 'null'
        - type: number
        - type: string
        - type: boolean
        - type: array
        - type: object
          additionalProperties: true
      description: |-
        `Value` represents a dynamically typed value which can be either
         null, a number, a string, a boolean, a recursive struct value, or a
         list of values. A producer of value is expected to set one of these
         variants. Absence of any variant indicates an error.

         The JSON representation for `Value` is JSON value.
    svstore.EntityFieldValue:
      type: object
      properties:
        id:
          type: string
          title: id
          description: >-
            The EAV row id. NOT populated on entity read paths
            (Entity.field_values:
             search / list / get / create / update) since the v4 slim document_json
             dropped it — it has no consumer there. It IS populated on the
             listEntityFieldValueHistory RPC, which reads EAV rows directly.
          x-stainless-terraform-configurability: optional
        entityId:
          type: string
          title: entity_id
          x-stainless-terraform-configurability: optional
        fieldId:
          type: string
          title: field_id
          x-stainless-terraform-configurability: optional
        fieldKey:
          type: string
          title: field_key
          x-stainless-terraform-configurability: optional
        fieldName:
          type: string
          title: field_name
          x-stainless-terraform-configurability: optional
        dataType:
          $ref: '#/components/schemas/svstore.EntityTypeField.DataType'
          title: data_type
          x-stainless-terraform-configurability: optional
        value:
          $ref: '#/components/schemas/google.protobuf.Value'
          title: value
          description: |-
            The field value as a JSON-compatible value. Type interpretation is
             determined by data_type:
               TEXT, UNIQUE, ENUM, ENTITY_REF, USER_REF → string
               NUMBER → number
               BOOL → bool
               TIMESTAMP → string (ISO 8601, e.g. "2024-03-15T10:30:00Z")
               MULTI_SELECT → list of strings (enum option IDs)
          x-stainless-terraform-configurability: optional
        setByUserId:
          type: string
          title: set_by_user_id
          description: |-
            Attribution: who/what set this field value. Stored in the slim
             document_json and populated on ALL entity read paths (search / list / get
             / create / update) as well as field-value history.
          nullable: true
          x-stainless-terraform-configurability: optional
        setByAppInstanceId:
          type: string
          title: set_by_app_instance_id
          nullable: true
          x-stainless-terraform-configurability: optional
        createdAt:
          $ref: '#/components/schemas/google.protobuf.Timestamp'
          title: created_at
          description: >-
            Temporal context. NOT populated on entity read paths
            (Entity.field_values)
             since the v4 slim document_json dropped created_at — it has no consumer
             there. It IS populated on the listEntityFieldValueHistory RPC. The current
             value for a field has deleted_at unset.
          x-stainless-terraform-configurability: optional
        deletedAt:
          $ref: '#/components/schemas/google.protobuf.Timestamp'
          title: deleted_at
          nullable: true
          x-stainless-terraform-configurability: optional
        pinned:
          type: boolean
          title: pinned
          description: >-
            When true, ingestion cannot overwrite this user-set value. Stored in
            the
             slim document_json and populated on ALL entity read paths.
          x-stainless-terraform-configurability: computed_optional
      title: EntityFieldValue
      additionalProperties: false
      description: |-
        EntityFieldValue represents a concrete field value on a specific entity.
         Used for both current values (on Entity.field_values) and historical values
         (in field value history responses).
    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.
    svstore.EntityTypeField.DataType:
      type: string
      title: DataType
      enum:
        - DATA_TYPE_UNSPECIFIED
        - TEXT
        - NUMBER
        - BOOL
        - TIMESTAMP
        - ENUM
        - ENTITY_REF
        - USER_REF
        - UNIQUE
        - MULTI_SELECT
        - FILE
    google.protobuf.Timestamp:
      type: string
      format: date-time
      description: A timestamp in RFC 3339 format (e.g., "2025-01-15T01:30:15Z").
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer

````