---
title: "Create or Update Document"
method: POST
path: "/voice/api/v1/documents"
tags: ["documents"]
---

# Create or Update Document

`POST /voice/api/v1/documents`

Create a new document on a session (omit `document_id` → `201`), or update an existing one (include `document_id` → `200`) — for example to save a doctor's edits to generated notes. Every response includes a presigned **PUT** URL: upload the document content (markdown) to that URL to store it.

## Request body

- CreateDocumentRequest
  - `session_id` string, required — The session this document belongs to.
  - `document_id` string — Omit to create a new document; include to update an existing one.
  - `template_id` string — Template the document is associated with, if any.
  - `type` 'context' | 'transcript' | 'custom' | 'notes' | 'integration' — Document category.
  - `document_name` string — Human-readable document name.
  - `status` string — Document status, e.g. `in-progress` or `success`.
  - `errors` unknown[]
    - unknown
  - `warnings` unknown[]
    - unknown
  - `usage_information` object

## Response `201`

Document created (also `200` when updating an existing document)

- DocumentEnvelopeResponse
  - `status` string
  - `data` Document
    - `document_id` string
    - `session_id` string
    - `template_id` string
    - `document_name` string
    - `type` string — Content format of the document.
    - `document_type` string — Document category (`template`, `custom`, `transcript`, ...).
    - `status` string
    - `errors` unknown[]
      - unknown
    - `warnings` unknown[]
      - unknown
    - `usage_information` object
    - `presigned_url` string — Presigned S3 URL. On Create/Update it is a **PUT** URL to upload content; on Get it is a **GET** URL to download content.
    - `created_at` string
    - `updated_at` string
    - `publish` object — Publish status per integration, when the document has been published.

## Other responses

- `404` — Session not found
- `422` — Validation error

---

[API](https://skmtc.net/eka/apis/eka-developer-apis.md) · [All operations](https://skmtc.net/eka/apis/eka-developer-apis/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/eka/eka-developer-apis/revisions/9ea23456f722/schema)
