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

# Update Contact Field

> Changes one of your own fields. Everything is editable except the key, which is fixed once the field exists. Seeded fields cannot be edited at all.

Changes one of your own contact fields. A partial update: only what you send changes.

## Overview

Everything about a field is editable except its key. Relabel it, retype it, add CSV aliases,
switch it in or out of the agent's contact summary, reorder it.

```javascript theme={null}
// Relabel
PATCH /contact-fields/{id}
{
  "label": "Order reference"
}

// Turn a loose string into a closed set
PATCH /contact-fields/{id}
{
  "dataType": "enum",
  "enumOptions": ["pricing page", "webinar", "referral"]
}

// Start volunteering it to the agent
PATCH /contact-fields/{id}
{
  "isPii": true,
  "allowPiiInContext": true
}

// Match two more CSV headers on import
PATCH /contact-fields/{id}
{
  "csvAliases": ["Order #", "OrderNo"]
}
```

## The key is not editable

There is no `key` property on this request. Sending one is a `400` naming it, rather than a
silent no-op.

The reason is that a key is the identity of two things that cannot be migrated in the same
step: every `{{contact.<key>}}` token already saved inside an agent's flow, and every value
already stored under that key on your contacts. A rename would blank the first and orphan the
second. To change a key,
[create a new field](/api-reference/contact-fields/create-contact-field), copy the values
across, update your agents, then
[delete the old one](/api-reference/contact-fields/delete-contact-field).

## Seeded fields cannot be edited

A field with `isSystem: true` belongs to the platform — editing it would change what
`{{contact.first_name}}` means for every company. `PATCH` on one is a `403`. To change a seeded
field's label or type for your company alone, **define your own field with the same key**: it
shadows the seeded one and comes back with `isCompanyOverride: true`.

## Changing a type

Changing `dataType` changes how **future** writes are validated. It does **not** re-validate or
convert values already stored — those keep whatever they were written as. If you are tightening
a field (say `string` to `enum`), read the existing values first.

Moving away from `enum` clears `enumOptions` automatically, so a field cannot keep a stale
option list that validation would then enforce against a string.

`tags` is worth calling out for the same reason: switching a `string` field to `tags` leaves
every stored value a plain string until it is next written, so a reader has to handle both
until then. Writing `"a, b"` to it once turns that contact's value into `["a","b"]`.

## Scopes

`write:contacts` (or its `write:candidates` alias).

## Error Scenarios

* **400 Bad Request**: a `key` property; an `enum` left with no options
* **403 Forbidden**: a seeded field; or the key lacks `write:contacts`
* **404 Not Found**: no such field in your company's catalog

## Related Resources

<CardGroup cols={2}>
  <Card title="List Contact Fields" icon="list" href="/api-reference/contact-fields/list-contact-fields">
    Find the field's id
  </Card>

  <Card title="Create Contact Field" icon="plus" href="/api-reference/contact-fields/create-contact-field">
    Define a new field
  </Card>
</CardGroup>


## OpenAPI

````yaml PATCH /contact-fields/{id}
openapi: 3.0.0
info:
  title: InstaView API
  description: |-
    InstaView API Documentation

    ## Authentication

    All endpoints require API key authentication using Bearer token:
    ```
    Authorization: Bearer sk_your_api_key_here
    ```

    ## API Key Management

    The API Key module provides comprehensive key management for:
    - **Direct Client Keys**: Company-scoped keys for your applications
    - **ATS Partner Keys**: Resource-scoped keys for ATS integrations

    ### Key Features
    - HMAC-SHA256 hashing for API key storage
    - Configurable rate limiting
    - Comprehensive audit logging
    - Company-level isolation
    - Resource scoping for ATS partners
  version: 1.0.0
  contact: {}
servers:
  - url: https://api.instaview.sk
    description: Production API Gateway
security: []
tags: []
paths:
  /contact-fields/{id}:
    patch:
      tags:
        - Public Contact Fields
      summary: Update a contact field (public API)
      description: >-
        Changes one of your own fields. Everything is editable except the key,
        which is fixed once the field exists. Seeded fields cannot be edited at
        all.
      operationId: PublicContactFieldsController_updateContactField_v1
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
        - name: companyId
          required: false
          in: query
          description: >-
            Required for ATS API keys to specify which company to access.
            Ignored for standard company API keys.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PublicUpdateContactFieldDto'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicContactFieldDto'
        '400':
          description: An ENUM left with no options
        '403':
          description: A seeded field, which the platform owns
        '404':
          description: No such field in your company's catalog
      security:
        - bearer: []
        - bearer: []
components:
  schemas:
    PublicUpdateContactFieldDto:
      type: object
      properties:
        label:
          type: string
          description: Human label
          example: Order reference
        dataType:
          type: string
          description: >-
            The value type. Changing it does not re-validate values already
            stored — those keep whatever they were written as. `tags` stores a
            `string[]` and accepts either an array or a comma-separated string,
            so one CSV cell maps onto one field.
          enum:
            - string
            - number
            - date
            - bool
            - enum
            - tags
        enumOptions:
          description: >-
            The allowed values. Cleared automatically when the type moves away
            from `ENUM`.
          type: array
          items:
            type: string
        isPii:
          type: boolean
          description: >-
            Mark the field as personal data. Personal data. Masked in logs, and
            EXCLUDED from everything that reaches the agent — the prompt and the
            generated contact document alike — unless `allowPiiInContext` is set
            on this field, or the platform lists it in the essential prompt set
            (`inEssentialPromptSet`).
        csvAliases:
          description: >-
            Extra CSV header names this field should also match Stored for the
            contact-field importer, which has not shipped: setting this changes
            no import behaviour today.
          type: array
          items:
            type: string
        allowPiiInContext:
          type: boolean
          description: >-
            Let this one personal field reach the agent anyway. It joins the
            generated contact document AND the prompt, because a queryable value
            is one the agent might never think to look up, and reliability is
            the point for a field like an outstanding balance. Only meaningful
            when `isPii` is true; sending it on a field that is not personal
            data is rejected rather than ignored.
          example: false
        description:
          type: string
          description: What the field means
          maxLength: 300
        displayOrder:
          type: number
          description: Ascending display order; ties break on key
    PublicContactFieldDto:
      type: object
      properties:
        id:
          type: string
          description: >-
            Field id. Needed only to address PATCH and DELETE; every other
            surface uses `key`.
          format: uuid
          example: 123e4567-e89b-12d3-a456-426614174000
        key:
          type: string
          description: >-
            The key you address this field by, in `{{contact.<key>}}` and in a
            values payload
          example: order_number
        label:
          type: string
          description: Human label, shown wherever the field is offered for editing
          example: Order number
        dataType:
          type: string
          description: >-
            The value type this field accepts. Writes are validated against it.
            `tags` is a `string[]` and accepts either an array or a
            comma-separated string, so one CSV cell maps onto one field.
          enum:
            - string
            - number
            - date
            - bool
            - enum
            - tags
          example: string
        category:
          type: string
          description: >-
            Which panel of the catalog this field belongs to — the grouping the
            dashboard's variable palette uses, and the first key this list is
            ordered by. Set by InstaView and not writable: a field you define is
            always `custom`, and a field of yours that shadows a seeded one
            reports the seeded field's category so the grouping is the same for
            every company.
          enum:
            - identity
            - organisation
            - commercial
            - relationship
            - scheduling
            - recruiting
            - platform
            - custom
          example: commercial
        enumOptions:
          description: The allowed values, for an ENUM field. Absent for every other type.
          example:
            - pricing page
            - webinar
            - referral
          type: array
          items:
            type: string
        isPii:
          type: boolean
          description: >-
            Personal data. Masked in logs, and EXCLUDED from everything that
            reaches the agent — the prompt and the generated contact document
            alike — unless `allowPiiInContext` is set on this field, or the
            platform lists it in the essential prompt set
            (`inEssentialPromptSet`).
          example: false
        isSystem:
          type: boolean
          description: >-
            A field the platform defines and every company shares. A seeded
            field cannot be edited or deleted directly; for most of them you can
            define your own field with the same key to override the label and
            type for your company alone. Eight keys are RESERVED and refuse even
            that (`first_name`, `last_name`, `email`, `phone`, `company_name`,
            `company_description`, `agent_name`, `profile`), because the
            platform resolves them itself.
          example: false
        csvAliases:
          description: >-
            Extra CSV header names this field also matches during an import
            Stored for the contact-field importer, which has not shipped:
            setting this changes no import behaviour today.
          example:
            - 'Order #'
            - OrderNo
          type: array
          items:
            type: string
        allowPiiInContext:
          type: boolean
          description: >-
            Let this one personal field reach the agent anyway. It joins the
            generated contact document AND the prompt, because a queryable value
            is one the agent might never think to look up, and reliability is
            the point for a field like an outstanding balance. Only meaningful
            when `isPii` is true; sending it on a field that is not personal
            data is rejected rather than ignored.
          example: false
        inEssentialPromptSet:
          type: boolean
          description: >-
            Read-only. Whether the platform puts this field in every
            context-enabled agent's prompt: a short set covering what an agent
            needs to open a call correctly. Not settable — everything else the
            contact has reaches the agent through the generated contact document
            instead, which is queried mid-call rather than paid for on every
            dial.
          example: false
        description:
          type: string
          description: What the field means
          example: The order this call is about
        displayOrder:
          type: number
          description: Ascending display order; ties break on key
          example: 50
        isCompanyOverride:
          type: boolean
          description: >-
            True when this is your own field overriding a seeded field of the
            same key
          example: false
        readOnly:
          type: boolean
          description: >-
            Catalogued so an agent author can use the token, but resolved by the
            platform on every call rather than stored per contact
            (`company_description` is your company's own blurb, not the
            contact's data). Sending a value for one is a 422. Note this is not
            the whole of what you can write — check `writable` for that.
          example: false
        writable:
          type: boolean
          description: >-
            Whether `fields` on `POST /contacts` or `PATCH /contacts/{id}`
            accepts a value for this key. The one flag to branch on before
            writing: `readOnly` alone is not enough, because a key the platform
            RESERVES (`email`, `first_name`, `phone` and the rest of the
            identity fields) reports `readOnly: false` and is still refused with
            a 422 — those are writable, but through the contact resource's own
            properties rather than as a field. False also for every read-only
            key, so a false here always means "do not send a value for this".
          example: true
      required:
        - id
        - key
        - label
        - dataType
        - category
        - isPii
        - isSystem
        - allowPiiInContext
        - inEssentialPromptSet
        - displayOrder
        - isCompanyOverride
        - readOnly
        - writable
  securitySchemes:
    bearer:
      type: http
      scheme: bearer
      description: API key for authentication using Bearer scheme

````