---
title: "Set a custom column value"
method: PATCH
path: "/v1/custom_column_values"
tags: ["Custom column"]
---

# Set a custom column value

`PATCH /v1/custom_column_values`

## Request

- Base URL: `https://api.cardda.com`
- URL: `https://api.cardda.com/v1/custom_column_values`
- Auth: HTTP bearer

Sets the value of a custom column on a specific source record (identified by `source_id` —
for a transaction this is its `accounting_ledger_tx_id`). The caller must belong to the
record's company. For option-type columns, `value` must be one of the column's option keys.

Returns the updated source record with its recomputed custom-column values.

**Note:** only an unknown `custom_column_id` yields a `404`. An unknown/mismatched
`source_id` is not currently guarded and results in a `500` (server error) rather than a
`404` — this is a known server-side bug, not the intended contract.

## Headers

- `company-id` string, uuid, required

## Request body

- CustomColumnValueUpdate: Payload to set the value of a custom column on a specific source record (e.g. a transaction). The `custom_column_id` identifies the column and `source_id` the record it is being set on; the column's applicable model classes are searched to locate the record.
  - `custom_column_id` string, uuid, required: The custom column whose value is being set.
  - `source_id` string, uuid, required: The id of the record the value is set on (e.g. a transaction's `accounting_ledger_tx_id`).
  - `value` string, nullable: The value to store. For option-type columns this must be one of the column's option keys.

## Response `200`

The updated source record

- object: The updated source record (e.g. a transaction), with its custom column values.

## Other responses

- `401`: Unauthorized
- `404`: Custom column not found (unknown `custom_column_id`).
- `422`: Validation error (e.g. value not in the column options). When the value of a column required on purchase orders is emptied on a purchase order, `error_code` is `validation/required_custom_column` and the body also carries the column's `label` and `custom_column_id`; branch on `error_code`, not on `message`.
- `500`: Server error. Returned when `source_id` is unknown/mismatched: it is not currently guarded, so the lookup on a nil record raises instead of returning a `404`. This is a known server-side bug, not the intended contract.

---

[API](https://skmtc.dev/cardda/apis/accounting-api.md) - [All operations](https://skmtc.dev/cardda/apis/accounting-api/llms.txt) - [OpenAPI document](https://skmtc.dev/cardda/apis/accounting-api/revisions/49cf78d0f7ab?raw)
