---
title: "Update a lookup table in the draft"
method: PUT
path: "/api/policy_version/draft/lookup_tables/{heron_id}"
tags: ["Policy Versions"]
---

# Update a lookup table in the draft

`PUT /api/policy_version/draft/lookup_tables/{heron_id}`

## Request

- Base URL: `https://app.herondata.io`
- URL: `https://app.herondata.io/api/policy_version/draft/lookup_tables/{heron_id}`
- Auth: API key in header `x-api-key`

Replace a lookup table's definition. Edits the table's draft version, or starts the next version and pins it in the draft when the pinned version is published. A table the draft doesn't pin is pinned again, starting from its newest version.

## Path parameters

- `heron_id` string, required

## Query parameters

- `user_id` integer

## Request body

- LookupTableUpdateSchema
  - `change_description` string, nullable
  - `definition` object, required: The whole table, replacing the current one: key (the attribute the table is looked up by), columns (may be empty for a plain list), rows (each with keys and values) and unlisted (behaviour and values for a key not in the table)

## Response `200`

OK

- object
  - `lookup_table` LookupTableSchema
    - `definition` unknown
    - `heron_id` string, required: Heron ID of the lookup table
    - `is_draft` boolean, required: True while the version can still be edited
    - `name` string, required
    - `version` integer, required: The table version this policy version pins

## Other responses

- `404`: No draft policy version, or the account has no such lookup table
- `422`: The table is invalid. `errors` lists every problem with the path of the field it belongs to, a stable code and a message.

## Changes

- **2026-11-03** `bd8008e49534`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/herondata/apis/heron-data-api/changes/api/policy_version/draft/lookup_tables/:heron_id/put.md)

---

[API](https://skmtc.dev/herondata/apis/heron-data-api.md) - [All operations](https://skmtc.dev/herondata/apis/heron-data-api/llms.txt) - [OpenAPI document](https://skmtc.dev/herondata/apis/heron-data-api/revisions/1ec936e17fef?raw)
