Skip to content

docs(write): add /v2/write/correct corrections-only endpoint#344

Open
healqq wants to merge 7 commits into
mainfrom
feat/write-correct-endpoint
Open

docs(write): add /v2/write/correct corrections-only endpoint#344
healqq wants to merge 7 commits into
mainfrom
feat/write-correct-endpoint

Conversation

@healqq
Copy link
Copy Markdown
Contributor

@healqq healqq commented May 14, 2026

Summary

Documents the new corrections-only mode on the Write API.

  • Adds /v2/write/correct path and a CorrectText tag to api-reference/openapi.yaml.
  • Adds api-reference/improve-text/correct-text.mdx, driven by the OpenAPI spec.
  • Updates the Improve text overview (api-reference/improve-text.mdx):
    • Describes both /write/rephrase and /write/correct and links to each.
    • Fixes the FAQ entry that previously said Corrections Only mode was UI-only.
  • Registers the new page in docs.json.

Behavior summary

/v2/write/correct performs a minimal-change correction pass on one or more texts. Unlike /v2/write/rephrase, it does not accept writing_style or tone and does not rewrite for style.

Request body (JSON or form-urlencoded):

Field Type Required Description
text array[string] yes Texts to correct
target_lang string no Target language (uses the same TargetLanguageWrite set as /write/rephrase)

Response: same improvements array shape as /write/rephrase, with text, target_language, and detected_source_language.

Validation (local PublicApi → dev upstreams)

Case Status
JSON body, EN-US 200 — "This are wrong sentence...""These are wrong sentences..."
Form-urlencoded body 200
Multiple texts 200 — each item corrected independently
German (DE) target 200 — "Ich gehen heute zum Schule.""Ich gehe heute zur Schule."
Empty text array 400 — Missing parameter text.
Unsupported Content-Type (text/plain) 415
Invalid target_lang 400 — Value for target_lang not supported.

Test plan

  • mint dev renders the new Improve text > Corrections Only page without errors
  • mint broken-links and mint broken-links --check-anchors pass
  • Try-it console on the new endpoint successfully calls the API and returns an improvements array
  • Overview page renders the updated FAQ entry and the link to the new page

Documents the new corrections-only mode on the Write API:

- New `/v2/write/correct` path and `CorrectText` tag in the OpenAPI spec.
- New `api-reference/improve-text/correct-text.mdx` page driven by the spec.
- Updated `improve-text.mdx` overview to describe both endpoints and link
  to the new one.
- Updated the FAQ entry that previously said Corrections Only mode was
  UI-only — it is now also available via `/write/correct`.
- Registered the new page in `docs.json` navigation.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@mintlify
Copy link
Copy Markdown
Contributor

mintlify Bot commented May 14, 2026

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
deepl-c950b784 🟢 Ready View Preview May 14, 2026, 6:07 AM

💡 Tip: Enable Workflows to automatically generate PRs for you.

healqq and others added 2 commits May 14, 2026 08:10
The /v2/write/rephrase endpoint returns target_language in each
improvements item, and the narrative MDX (improve-text.mdx) already
documents it as a required ResponseField. The OpenAPI spec's response
schema was missing it. Bring the spec in line with both the actual API
behavior and the narrative docs.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
healqq and others added 2 commits May 14, 2026 08:20
The rephrase and correct endpoint pages previously had only an `openapi:`
frontmatter directive, so the rendered pages opened straight into the
auto-generated request schema with no orientation. Add:

- A short paragraph at the top of each page explaining what the endpoint
  does, when to choose it over the sibling endpoint, and a link to the
  overview for shared details (supported languages, size limits).
- Frontmatter `title` and `description` so the page titles read naturally
  in the nav and in search results.
- Rename the rephrase endpoint's OpenAPI summary from "Request text
  improvement" to "Improve text" to match the new page title and read
  more naturally.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Drop the imperative second-person framing ("Send ... to", "use X
instead", "See the overview for...") on the rephrase and correct
endpoint pages. The intros and frontmatter descriptions now describe
what each endpoint does rather than instructing the reader.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants