---
title: "Set the readable-name rule"
method: PATCH
path: "/v1/documents/display-name-rule"
tags: ["Documents"]
---

# Set the readable-name rule

`PATCH /v1/documents/display-name-rule`

## Request

- Base URL: `https://api.talonic.com`
- URL: `https://api.talonic.com/v1/documents/display-name-rule`
- Auth: HTTP bearer

`off` derives nothing and clears stored names, `default` tidies each filename, `lua` runs your `script` (reads `record.filename`, calls `record:set('display_name', value)`). Takes effect for new documents; apply it to existing ones with the backfill. Requires the `documents:write` scope. The key's person must be an Admin of the workspace (the `workspace` permission), as in the web app.

## Request body

- object
  - `mode` 'off' | 'default' | 'lua', required
  - `script` string

## Response `200`

OK

- object

## Other responses

- `400`: The request is invalid.
- `401`: Missing or invalid API key.
- `403`: The API key does not have the required scope.
- `429`: Daily rate limit exceeded.

## Changes

- **2026-11-26** `622d429de7ea`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/talonic/apis/talonic-api/changes/v1/documents/display-name-rule/patch.md)

---

[API](https://skmtc.dev/talonic/apis/talonic-api.md) - [All operations](https://skmtc.dev/talonic/apis/talonic-api/llms.txt) - [OpenAPI document](https://skmtc.dev/talonic/apis/talonic-api/revisions/9f6d53e2ab5e?raw)
