Skip to content

Transform Text

POST
/api/creative/hawken/transform

Return a deterministic analytical report for the selection.

Post-M5 this endpoint no longer rewrites prose. It dispatches on the command label to the Divinity Engine’s analytical surfaces (sentence metrics, sentiment, register) and streams a human- readable diagnosis back. The response shape stays text/plain so existing editor callers keep working.

TransformRequest

Request body for /transform.

object
selectedText
required
Selectedtext
string
command
required
TransformCommand

Available command labels. Preserved from the pre-M5 contract so existing callers bind to the same enum values; post-M5 every value dispatches to a deterministic analytical surface instead of a rewrite.

string
Allowed values: rewrite extend shorten continue fix_grammar simplify adjust_tone custom
contextBefore
Contextbefore
string
""
contextAfter
Contextafter
string
""
tone
Any of:
string
customPrompt
Any of:
string

Successful Response

Validation Error

HTTPValidationError
object
detail
Detail
Array<object>
ValidationError
object
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
input
Input
ctx
Context
object