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

# Update a lookup table in the draft

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




## OpenAPI

````yaml https://app.herondata.io/swagger put /api/policy_version/draft/lookup_tables/{heron_id}
openapi: 3.0.0
info:
  contact:
    email: support@herondata.io
    name: Support
  title: Heron Data API
  version: '2021-07-19'
servers:
  - description: Production
    url: https://app.herondata.io
security:
  - ApiKeyAuth:
      - key_XXX
externalDocs:
  description: Read Tutorial
  url: https://docs.herondata.io/
paths:
  /api/policy_version/draft/lookup_tables/{heron_id}:
    put:
      tags:
        - Policy Versions
      summary: Update a lookup table in the draft
      description: >
        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.
      parameters:
        - in: path
          name: heron_id
          required: true
          schema:
            type: string
        - description: Account to act on. Honoured only for admins.
          in: query
          name: user_id
          required: false
          schema:
            type: integer
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LookupTableUpdateSchema'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  lookup_table:
                    $ref: '#/components/schemas/LookupTableSchema'
                type: object
          description: OK
        '404':
          description: No draft policy version, or the account has no such lookup table
        '422':
          description: >-
            The table is invalid. `errors` lists every problem with the path of
            the field it belongs to, a stable code and a message.
      security:
        - ApiKeyAuth: []
components:
  schemas:
    LookupTableUpdateSchema:
      properties:
        change_description:
          maxLength: 255
          nullable: true
          type: string
        definition:
          additionalProperties: {}
          description: >-
            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)
          type: object
      required:
        - definition
      type: object
    LookupTableSchema:
      properties:
        definition:
          description: >-
            The key attribute, columns, rows and default row, in the shape the
            create and update routes take
          readOnly: true
        heron_id:
          description: Heron ID of the lookup table
          type: string
        is_draft:
          description: True while the version can still be edited
          type: boolean
        name:
          type: string
        version:
          description: The table version this policy version pins
          type: integer
      required:
        - heron_id
        - is_draft
        - name
        - version
      type: object
  securitySchemes:
    ApiKeyAuth:
      in: header
      name: x-api-key
      type: apiKey

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.