---
title: "Draft a new clause from an instruction"
method: POST
path: "/api/v1/templates/compose"
tags: ["Templates"]
---

# Draft a new clause from an instruction

`POST /api/v1/templates/compose`

## Request

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

Returns a heading and a clause under it, as markdown. Every merge field in the draft is checked against the fields the product can fill, and the draft is refused if it invented one. Nothing is written to the template.

## Request body

- object
  - `instruction` string, required

## Response `200`

The draft.

- object
  - `ok` unknown, required
  - `data` object, required
    - `markdown` string, required: A heading and the clause under it, for the editor to show as a proposal.
  - `meta` object, required
    - `requestId` string, required: Echoed in the x-request-id header. Quote it in a bug report.

## Other responses

- `422`: The model returned nothing usable, and the reason why.
- `429`: Too many drafts.

---

[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)
