---
title: "Find and replace content"
method: POST
path: "/v1/models/{modelId}/content-validator"
tags: ["Content validator"]
---

# Find and replace content

`POST /v1/models/{modelId}/content-validator`

Performs find/replace operations on content using the specified model.

This endpoint allows you to replace views or fields across all documents associated with the model. This is useful when renaming model elements and need to update all references.

## Path parameters

- `modelId` string, uuid, required

## Query parameters

- `userId` string, uuid

## Request body

- object
  - `find` string, required — The value to find. Used with `find_or_replace_type` to scope the search: - `VIEW` - The name of the view to find - `FIELD` - The fully qualified name of the field to find, specified as `view_name.field_name` - `TOPIC` - The name of the topic to find
  - `replacement` string, required — The replacement value. - `VIEW` - The name of the replacement view - `FIELD` - The fully qualified name of the replacement field, specified as `view_name.field_name` - `TOPIC` - The name of the replacement topic
  - `find_or_replace_type` 'VIEW' | 'FIELD' | 'TOPIC', required — The type of find/replace operation. - `VIEW` - Replace view references - `FIELD` - Replace field references. `find` and `replacement` values must be the fully qualified name of the field, e.g. `view_name.field_name`. - `TOPIC` - Replace topic references
  - `branch_id` string, uuid — The branch ID to perform the operation on. If not provided, operates on the main model.
  - `include_personal_folders` boolean — When enabled, include personal folders.
  - `only_in_workbook_id` string, uuid — When provided, scopes the find/replace action to the specified workbook. Must be the workbook model's internal **UUID** — visible in the model IDE URL as `/model/{uuid}`. This is **not** the same as the document's URL identifier (slug) that appears in the dashboard or workbook URL (for example, `/dashboards/abc123`). **Passing a document identifier / slug will silently return 0 replacements instead of raising an error.**

## Response `200`

Find/replace operation completed successfully

- object
  - `replaced_queries_count` integer — The number of queries that had replacements made.
  - `replaced_documents_count` integer — The number of documents that had replacements made.
  - `replaced_workbook_models_count` integer — The number of workbook models that had replacements made.
  - `replaced_dashboard_filters_count` integer — The number of dashboard filters that had replacements made.
  - `skipped_pr_required_count` integer — The number of documents skipped because they require a pull request to publish.

## Other responses

- `400` — Bad Request Possible error messages: - `modelId: Invalid UUID` - `Find field must be scoped by view name.`
- `403` — Forbidden Possible error messages: - `User-scoped API keys cannot act on behalf of other users`
- `404` — Not Found Possible error messages: - `Shared model with id <modelId> does not exist`
- `405` — Method Not Allowed - Invalid HTTP method for this endpoint
- `429` — Too Many Requests - Rate limit exceeded (60 requests/minute)

---

[API](https://skmtc.net/omni/apis/omni-api.md) · [All operations](https://skmtc.net/omni/apis/omni-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/omni/omni-api/revisions/6b02f7349d0e/schema)
