> ## Documentation Index
> Fetch the complete documentation index at: https://docs.writerzroom.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Verified Artifacts API

> Generate strict-schema legal analyses, clinical notes, and data briefs, or verify existing content independently.

The Artifacts API creates typed professional documents under strict JSON-schema decoding, renders them into Markdown, runs executable verifiers, and makes the final evidence and limitations visible. The same verifier surface can inspect content that WriterzRoom did not generate.

The product interface is available at **Artifacts** (`/artifacts`). API routes use the standard `https://api.writerzroom.com/api` base URL and a user API key.

## Supported Artifacts

| Type             | Structure                                                                                  | Required automated checks              | Important limit                                                               |
| ---------------- | ------------------------------------------------------------------------------------------ | -------------------------------------- | ----------------------------------------------------------------------------- |
| `legal_analysis` | Legal question, short answer, sections, structured citations, derived table of authorities | `legal.citations`, `legal.authorities` | Does not prove that an authority exists, is current, controlling, or good law |
| `clinical_note`  | SOAP note, coded diagnoses, coded procedures, disclaimer                                   | `clinical.codes`, `common.quantities`  | Does not prove clinical correctness, code existence, or billability           |
| `data_brief`     | Summary, findings, typed period-stamped statistics, sources, outlook                       | `common.quantities`                    | Does not prove that an external figure or source is factually correct         |

<Warning>
  Strict decoding proves that output conforms to a schema. Executable verifiers prove only the local rules they report as decided. Neither is a substitute for a citator, licensed clinical code set, source audit, or qualified professional review.
</Warning>

## Discover Capabilities

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
curl https://api.writerzroom.com/api/artifacts/types \
  -H "Authorization: Bearer YOUR_API_KEY"
```

`GET /artifacts/types` returns registered artifact types, compatible verticals and templates, verifier IDs, verifier limitations, the fixed generation mode, and the repair limit. Use this response instead of hard-coding the catalog.

## Generate an Artifact

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
curl -X POST https://api.writerzroom.com/api/artifacts/generate \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "artifact_type": "legal_analysis",
    "vertical": "legal",
    "prompt": "Analyze whether the stated facts support the contract claim. Separate the rule, application, counterarguments, and conclusion."
  }'
```

| Field           | Required | Description                                                                                             |
| --------------- | -------: | ------------------------------------------------------------------------------------------------------- |
| `artifact_type` |      Yes | `legal_analysis`, `clinical_note`, or `data_brief`                                                      |
| `prompt`        |      Yes | Generation instructions; minimum 20 characters                                                          |
| `vertical`      | Optional | Vertical policy used during verification                                                                |
| `model`         | Optional | One of the strict-output models returned by the deployed capability; arbitrary model names are rejected |

Artifact generation is always billed at the **Standard** generation cost. One API call includes the initial structured generation and, when a blocking verifier finding appears, at most one repair attempt. A provider or schema failure that delivers no usable result is refunded. A delivered artifact that fails verification is still charged because generation and verification ran.

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "ok": false,
  "content": "# Analysis\n\n...",
  "artifact_type": "legal_analysis",
  "artifact": { "artifact_type": "legal_analysis" },
  "verification": {
    "passed": false,
    "complete": true,
    "reports": []
  },
  "repair_rounds": 1,
  "errors": []
}
```

`ok: false` can be a successful HTTP 200 response. It means the document and its diagnosis are available, but a blocking finding survived, a required check was incomplete, or the artifact was otherwise not fully usable. Do not treat HTTP success as verifier success.

## Verify Existing Content

Use `POST /artifacts/verify` for a pasted draft, an imported document, or content generated before artifact-native workflows existed.

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
curl -X POST https://api.writerzroom.com/api/artifacts/verify \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "vertical": "legal",
    "requires_table_of_authorities": true,
    "content": "# Existing legal draft\n\n..."
  }'
```

If the selected vertical configures no executable verifiers, the endpoint returns `configured: false`; that is different from a configured verifier finding no violations. Reports include stable check IDs, verdicts (`verified`, `violation`, or `unverifiable`), severity, subject text, machine-readable evidence, coverage, and completeness.

<CardGroup cols={2}>
  <Card title="Content Governance" icon="shield-check" href="/architecture/content-governance">
    Understand assurance, evidence, policy, and review obligations.
  </Card>

  <Card title="Endpoints Reference" icon="route" href="/api/endpoints">
    Review the wider API surface.
  </Card>
</CardGroup>
