---
title: "Apply chained text-cleanup operations"
method: POST
path: "/text-cleanup.php"
tags: ["text"]
---

# Apply chained text-cleanup operations

`POST /text-cleanup.php`

## Request

- Base URL: `https://mate.tools/api/v1`
- URL: `https://mate.tools/api/v1/text-cleanup.php`
- Auth: none declared

Apply a sequence of cleanup operations in order. Operations: trim, collapse_spaces, normalize_whitespace, remove_line_breaks, normalize_line_breaks, dedupe_lines, reverse_lines, strip_html, strip_emoji, strip_urls, strip_emails, normalize_quotes (smart-quote -> straight), normalize_dashes (em/en -> hyphen), lowercase, uppercase. Returns cleaned text plus per-step chars/lines removed.

## Request body

- object
  - `text` string, required
  - `operations` string[], required

## Response `200`

Success

## Other responses

- `400`: Malformed request
- `413`: Request body or text exceeds 1 MB
- `429`: Rate limit exceeded (60/min, 600/hour per IP). Includes Retry-After header.

---

[API](https://skmtc.dev/mate/apis/mate-tools-api.md) · [All operations](https://skmtc.dev/mate/apis/mate-tools-api/llms.txt) · [OpenAPI document](https://skmtc.dev/mate/apis/mate-tools-api/revisions/874670b78962?raw)
