---
title: "Draft a legal document"
method: POST
path: "/legal/v1/draft"
tags: ["Legal"]
---

# Draft a legal document

`POST /legal/v1/draft`

Generate a legal document with structured inputs. Powered by an agent that handles research, formatting, citation verification, and vault upload. Returns a run ID for polling.

## Request body

- object
  - `instructions` string, required — What to draft — the core task. E.g., "Motion to compel defendant to produce discovery responses"
  - `output_type` 'pdf' | 'docx' | 'xlsx' | 'pptx' | 'md' — Output file format
  - `output_name` string, nullable — Filename for the output document. Auto-generated if omitted.
  - `length` object, nullable — Target document length
    - `target` number — Target value (e.g., 2000 words or 5 pages)
    - `unit` 'words' | 'pages' — Whether the target length is measured in words or pages
  - `citations` boolean — Research and include legal citations
  - `format` string, nullable — Court or jurisdiction formatting hint. Triggers a legal-skills search. E.g., "California Superior Court", "SDNY", "federal pleading"
  - `verified` boolean — Verify all citations in a loop — re-run verification and repair bad citations until they pass
  - `vault_id` string, required — Vault ID where the final document will be uploaded
  - `object_ids` string[], nullable — Vault object IDs to use as source/reference documents
  - `model` string, nullable — LLM model override. Defaults to anthropic/claude-sonnet-4.6

## Response `200`

Draft run started

- object
  - `run_id` string — Run ID — poll /agent/v1/run/:id/status for progress
  - `agent_id` string — Ephemeral agent ID
  - `status` 'running'
  - `message` string

## Other responses

- `400` — Invalid request parameters
- `401` — Invalid API key
- `403` — Insufficient permissions
- `404` — Vault not found

---

[API](https://skmtc.net/casemark/apis/case-dev-api.md) · [All operations](https://skmtc.net/casemark/apis/case-dev-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/casemark/case-dev-api/versions/5b7e64e6d6f9/schema)
