---
title: "Find and replace"
method: POST
path: "/api/v1/presentations/{slug}/replace"
tags: ["presentations"]
---

# Find and replace

`POST /api/v1/presentations/{slug}/replace`

## Request

- Base URL: `https://easeweb.host`
- URL: `https://easeweb.host/api/v1/presentations/{slug}/replace`
- Auth: one of:
  - HTTP bearer
  - API key in cookie `sessionid`

Find and replace words in a whole presentation you may edit, in one step: the texts of text, shape and button blocks
(in every language by default, or only "langs"), the slide names, and with "in_code": true the code of code blocks.
Formatting stays (the words are replaced inside it; a phrase split by formatting, like half of it bold, is not found).
The number of an automatic slide reference ({{slide:N}}) is not text and is not found: it changes by itself when
slides move; to point a reference to another slide, write the block's html with a new {{slide:N}}.
"regex": true makes "find" a Python regular expression ("replace" may use \1). "dry_run": true only counts.
Returns how many were replaced on which slides.

## Path parameters

- `slug` string, required: The presentation's slug (its address: /movie/<slug>/).

## Request body

- object
  - `find` string, required: What to find (at most 500 characters).
  - `replace` string, required: What to put instead (may be empty).
  - `regex` boolean: "find" is a regular expression (default: plain text).
  - `match_case` boolean: Case matters (default: true).
  - `langs` string[]: Only these languages of the texts (default: all).
  - `in_names` boolean: The names of the slides too (default: true).
  - `in_code` boolean: The code of code blocks too (default: false).
  - `from_number` integer: Only the slides from this number on (1-based).
  - `to_number` integer: Only the slides up to this number (inclusive).
  - `slide_ids` integer[]: Only these slides (ids).
  - `dry_run` boolean: Only count, change nothing.
  - `base_version` string: Optional: the "version" of the presentation as you read it; refused when it changed meanwhile.

## Response `200`

OK

- object

## Other responses

- `4XX`: Error

---

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