---
title: "Set Field Value"
method: PATCH
path: "/fields/{column_id}/values"
tags: ["Fields"]
---

# Set Field Value

`PATCH /fields/{column_id}/values`

## Request

- Base URL: `https://be.graph8.com/api/v1`
- URL: `https://be.graph8.com/api/v1/fields/{column_id}/values`
- Auth: HTTP bearer

Write a custom column value to a single contact or company row.

Resolves ``column_id`` to the underlying ``column_name_db`` from
``dynamic_columns``, then performs an ``INSERT ... ON CONFLICT DO UPDATE``
against ``mashup_contact_attrs`` (or ``mashup_company_attrs`` for companies).

Pass ``value=null`` (or omit it) to clear the column for that row.

Notes:
    - The column must exist in ``dynamic_columns`` (not soft-deleted) for
      this org and the matching entity. Returns 404 otherwise.
    - The record (contact or company) must exist - the underlying foreign
      key constraint enforces this; a missing record yields a 404.
    - Custom column writes do NOT trigger view recreation; only column
      creation does (see ``CdpMashupContactRepository.create_column``).

## Path parameters

- `column_id` integer, required: Column ID from g8_list_fields or g8_create_field

## Headers

- `Authorization` string, nullable
- `X-Target-Org-Id` string, nullable

## Request body

- SetFieldValueRequest: Request body for writing a custom column value to a single contact or company row.
  - `record_id` integer, required: Contact ID (entity='contacts') or company ID (entity='companies')
  - `value` string, nullable: Value to write into the custom column. Pass null (or omit) to clear the field.
  - `entity` string: Target entity: 'contacts' or 'companies'

## Response `200`

Successful Response

- ApiResponseSetFieldValueResponse
  - `data` SetFieldValueResponse, required
    - `column_id` integer, required
    - `record_id` integer, required
    - `updated` boolean
  - `pagination` PaginationMeta
    - `page` integer, required: Current page number (1-indexed)
    - `limit` integer, required: Items per page
    - `total` integer, required: Total number of items
    - `has_next` boolean, required: Whether there are more pages
    - `next_cursor` string, nullable: Opaque cursor for the next page; null when there are no more items. Pass it back as the `cursor` query param to fetch the following page without computing page numbers.
    - `total_available` integer, nullable: Search endpoints only: how many records really match, when known. Can be larger than `total`, which is capped at the 10,000 results that can be paged. For company search this is a distinct-company estimate. Null when unknown; absent outside search.
    - `total_is_lower_bound` boolean, nullable: Search endpoints only: true when more records match than `total` shows (the result set is larger than the 10,000 results that can be paged). Absent outside search.
    - `notes` string[], nullable: Search endpoints only: plain-language notes about the result, e.g. that more records match than can be paged, or that a reversed `between` range was put in order.

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/graph8/apis/graph8-developer-api.md) · [All operations](https://skmtc.dev/graph8/apis/graph8-developer-api/llms.txt) · [OpenAPI document](https://skmtc.dev/graph8/apis/graph8-developer-api/revisions/89fc11143b70?raw)
