---
title: "Bulk Replace Entries"
method: PUT
path: "/v1/dictionaries/{dict_id}/entries"
---

# Bulk Replace Entries

`PUT /v1/dictionaries/{dict_id}/entries`

## Request

- Base URL: `https://api.kugelaudio.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.kugelaudio.com/v1/dictionaries/{dict_id}/entries`
- Auth: none declared
- TypeScript: <https://skmtc.dev/kugelaudio/apis/kugelaudio-tts-api/docs/v1/dictionaries/:dict_id/entries/put.ts> (a function with typed inputs; its response is checked against the schema)

Replace all entries in the dictionary with the supplied list.

Atomic semantics: upsert every supplied entry by
``(dictionary_id, word)``, then delete any existing entries whose
word is not in the payload. The cache is invalidated once at the
end.

## Path parameters

- `dict_id` integer, required

## Query parameters

- `project_id` integer, nullable

## Request body

- BulkReplaceEntriesRequest: Atomic upsert + delete-missing replacement of all entries in a dictionary. Idempotent: callers sending the same payload twice converge to the same final state. Entries in the existing dictionary whose ``word`` is not in ``entries`` are deleted; entries whose ``word`` matches are upserted.
  - `entries` EntryPayload[], required
    - `word` string, required
    - `replacement` string, required
    - `ipa` string, nullable
    - `case_sensitive` boolean

## Response `200`

Successful Response

- BulkReplaceResponse: Counts of what changed during bulk replace.
  - `upserted` integer, required
  - `deleted` integer, required
  - `total` integer, required

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/kugelaudio/apis/kugelaudio-tts-api.md) - [All operations](https://skmtc.dev/kugelaudio/apis/kugelaudio-tts-api/llms.txt) - [OpenAPI document](https://skmtc.dev/kugelaudio/apis/kugelaudio-tts-api/revisions/711945519e5c?raw)
