---
title: "Rewrite selected clinical text"
method: POST
path: "/api/v1/content/rewrite"
tags: ["/api/v1/content"]
---

# Rewrite selected clinical text

`POST /api/v1/content/rewrite`

## Request

- Base URL: `https://sdp.suki.ai`
- URL: `https://sdp.suki.ai/api/v1/content/rewrite`
- Auth: API key in header `sdp_suki_token`

Rewrites a selected span of clinical text using a server-defined instruction (`CONCISE`, `VERBOSE`, or `PATIENT_FRIENDLY`). Send the selected text with surrounding context and selection offsets so the rewrite preserves meaning. The response returns the rewritten replacement text, selection offsets for your UI to apply, and a `request_id` for support.

## Headers

- `sdp_provider_id` string

## Request body

- ControllersRewriteContentRequest: Request body for POST /api/v1/content/rewrite
  - `context` ControllersRewriteContext, required: Surrounding content plus selection offsets for a rewrite request.
    - `selection` ControllersRewriteSelection, required: Half-open `[start, end)` range in Unicode code points identifying the span of `surrounding_content` to rewrite.
      - `start` integer: Inclusive start offset in Unicode code points relative to `surrounding_content`.
      - `end` integer: Exclusive end offset in Unicode code points relative to `surrounding_content`.
    - `surrounding_content` string: Surrounding text that includes the selection. Maximum 5000 Unicode code points. Provide enough context before and after the selection so the rewrite preserves meaning.
  - `instruction` 'CONCISE' | 'VERBOSE' | 'PATIENT_FRIENDLY', required: Server-defined rewrite instruction. Must be exactly one of `CONCISE`, `VERBOSE`, or `PATIENT_FRIENDLY`.
  - `selected_text` string, required: Text span to rewrite. Must be a subset of `context.surrounding_content` when surrounding content is provided. Length must be 1 to 5000 Unicode code points.

## Response `200`

Request succeeded.

- ControllersRewriteContentResponse: Response body for POST /api/v1/content/rewrite
  - `content` string: Rewritten replacement for `selected_text`.
  - `request_id` string: Server-assigned correlation ID. Share this with Technical Support when debugging a rewrite request.
  - `selection` ControllersRewriteSelection: Half-open `[start, end)` range in Unicode code points identifying the span of `surrounding_content` to rewrite.
    - `start` integer: Inclusive start offset in Unicode code points relative to `surrounding_content`.
    - `end` integer: Exclusive end offset in Unicode code points relative to `surrounding_content`.

## Other responses

- `400`: Bad request. The request body or parameters failed validation.
- `401`: Unauthorized. The Suki access token is missing, expired, or invalid.
- `403`: Forbidden. The authenticated user cannot access this resource.
- `500`: Internal server error.

## Changes

- **2026-11-03** `2181be71d4dd`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/suki/apis/suki-developer-platform/changes/api/v1/content/rewrite/post.md)

---

[API](https://skmtc.dev/suki/apis/suki-developer-platform.md) - [All operations](https://skmtc.dev/suki/apis/suki-developer-platform/llms.txt) - [OpenAPI document](https://skmtc.dev/suki/apis/suki-developer-platform/revisions/2181be71d4dd?raw)
