---
title: "Write or rework a reply with Dardaris"
method: POST
path: "/api/v1/handling/{threadId}/compose"
tags: ["Dardaris"]
---

# Write or rework a reply with Dardaris

`POST /api/v1/handling/{threadId}/compose`

## Request

- Base URL: `http://localhost:5180`
- URL: `http://localhost:5180/api/v1/handling/{threadId}/compose`
- Auth: API key in cookie `better-auth.session_token`

Writes the reply to a conversation, or improves, shortens, elaborates or otherwise changes the one the owner is writing. It reads the latest message, the earlier letters with that correspondent, and only the facts their role allows them to be told, and nothing it writes is sent: the text comes back for the owner to edit.

A version that states a figure found in none of that is refused rather than returned.

## Path parameters

- `threadId` string, required

## Request body

- object
  - `action` 'write' | 'improve' | 'shorten' | 'elaborate' | 'custom', required: `write` drafts the reply from the conversation; the others rework `text`. With `text` empty, every action writes.
  - `text` string, required: What the owner has written so far.
  - `instruction` string: What to change, in the owner’s words. Required for `custom`.

## Response `200`

The text, or why there is none.

- object
  - `ok` unknown, required
  - `data` object, required
    - `body` string, nullable, required: The reply as the model wrote it. Null where its version was refused or no model answered.
    - `trouble` 'unavailable' | 'unreadable' | 'ran_long' | 'invented_a_figure' | 'too_long' | 'sounded_generated': Why there is no body. `invented_a_figure` means the model stated a figure that nothing it was given says, and its version was thrown away.
    - `figure` string: The figure it invented, as it wrote it.
  - `meta` object, required
    - `requestId` string, required: Echoed in the x-request-id header. Quote it in a bug report.

## Other responses

- `400`: The action, the text or the instruction was not shaped right, or `custom` came without an instruction.
- `401`: No session. Sign in first.
- `404`: No conversation with that id belongs to you.
- `429`: Asking faster than the model answers.

---

[API](https://skmtc.dev/dardaris/apis/dardaris-api.md) · [All operations](https://skmtc.dev/dardaris/apis/dardaris-api/llms.txt) · [OpenAPI document](https://skmtc.dev/dardaris/apis/dardaris-api/revisions/4aff33835c73?raw)
