---
title: "Create Document Artifact"
method: POST
path: "/workspaces/{workspace_id}/document-artifacts"
tags: ["artifacts"]
---

# Create Document Artifact

`POST /workspaces/{workspace_id}/document-artifacts`

Land an agent `write_document` turn — as a suggestion or a committed node.

Dispatched per actor by ``_suggestions_enabled_for``:

  * **enabled** (allowlisted user, or any non-prod env) -> suggestion
    flow (``_land_suggestion``); no node minted.
  * **disabled** (prod, non-allowlisted) -> pre-Phase-1 flow
    (``_land_committed_node``); mint a committed node.

Both share the dual-auth contract from ``require_turn_access_from_body``.

## Path parameters

- `workspace_id` string, required

## Headers

- `authorization` string, nullable

## Request body

- CreateDocumentArtifactRequest — Body for POST /document-artifacts. Sent by the agent service when `write_document` produces a new document artifact. The client UUID becomes the artifact's `document_artifact_id`. The Hocuspocus room id is built at the boundary as `<workspace_id>:<document_artifact_id>`; not stored in the schema.
  - `id` string, required
  - `turn_id` string, required
  - `label` string, nullable
  - `diff` ChangeEntry[], nullable
    - `changeType` 'added' | 'modified' | 'removed', required
    - `concept` string, required
    - `summary` string, required
    - `sectionHeading` string, nullable
  - `initial_blocks` unknown[], required
    - unknown
  - `initial_markdown` string, required

## Response `200`

Successful Response

- CreateDocumentArtifactResponse — Same shape as the document-only fields of `ArtifactSummary`, declared here to keep the write endpoint self-contained.
  - `id` string, required
  - `workspace_id` string, required
  - `name` string, nullable, required
  - `produced_at_turn_id` string, required
  - `created_at` string, date-time, required

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/tryscott/apis/one-shot-api.md) · [All operations](https://skmtc.net/tryscott/apis/one-shot-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/tryscott/one-shot-api/versions/28bdface01df/schema)
