Skip to main content
POST
/
legal
/
v1
/
draft
Draft a legal document
curl --request POST \
  --url https://api.case.dev/legal/v1/draft \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "instructions": "<string>",
  "vault_id": "<string>",
  "output_type": "md",
  "output_name": "<string>",
  "length": {
    "target": 123,
    "unit": "words"
  },
  "citations": false,
  "format": "<string>",
  "verified": false,
  "object_ids": [
    "<string>"
  ],
  "model": "<string>"
}
'
{
  "run_id": "<string>",
  "agent_id": "<string>",
  "status": "running",
  "message": "<string>"
}

Authorizations

Authorization
string
header
required

API key starting with sk_case_

Body

application/json

Structured drafting parameters

instructions
string
required

What to draft — the core task. E.g., "Motion to compel defendant to produce discovery responses"

Required string length: 10 - 50000
vault_id
string
required

Vault ID where the final document will be uploaded

output_type
enum<string>
default:md

Output file format

Available options:
pdf,
docx,
xlsx,
pptx,
md
output_name
string | null

Filename for the output document. Auto-generated if omitted.

length
object

Target document length

citations
boolean
default:false

Research and include legal citations

format
string | null

Court or jurisdiction formatting hint. Triggers a legal-skills search. E.g., "California Superior Court", "SDNY", "federal pleading"

verified
boolean
default:false

Verify all citations in a loop — re-run verification and repair bad citations until they pass

object_ids
string[] | null

Vault object IDs to use as source/reference documents

model
string | null

LLM model override. Defaults to anthropic/claude-sonnet-4.6

Response

Draft run started

run_id
string

Run ID — poll /agent/v1/run/:id/status for progress

agent_id
string

Ephemeral agent ID

status
enum<string>
Available options:
running
message
string