---
title: "Update document metadata"
method: PATCH
path: "/documents/{document_id}"
tags: ["documents"]
---

# Update document metadata

`PATCH /documents/{document_id}`

Update document metadata (source_url, description, author, tags).

## Path parameters

- `document_id` string, uuid, required

## Request body

- DocumentUpdateRequest — Request for partial document update.
  - `source_url` string, nullable
  - `description` string, nullable
  - `author` string, nullable
  - `tags` string[], nullable
  - `original_date` string, nullable

## Response `200`

Document updated

- DocumentUpdateResponse — Response for document update.
  - `document` Document, required — Workspace-scoped document. Documents are persisted after ingestion so they can be re-extracted to different POTs without re-uploading.
    - `id` string, uuid, required — Document ID (UUID v7)
    - `workspace_id` string, uuid, required — Workspace that owns this document
    - `filename` string, required — Original filename or path
    - `content` string, nullable — Inline text content (legacy/small docs)
    - `content_hash` string, required — SHA-256 hash for dedup
    - `size_bytes` integer, required — Content size in bytes
    - `type` 'markdown' | 'text' | 'pdf' | 'html' | 'docx' | 'pptx' | 'xlsx' | 'image' — Document type
    - `mime_type` string, nullable — MIME type of the original file
    - `original_s3_key` string, nullable — S3 key for original file
    - `markdown_s3_key` string, nullable — S3 key for converted markdown
    - `original_size_bytes` integer, nullable — Original file size in bytes
    - `conversion_status` 'not_required' | 'pending' | 'completed' | 'failed' — Status of format conversion
    - `conversion_error` string, nullable — Error message if conversion failed
    - `converted_at` string, date-time, nullable — When conversion completed
    - `uploaded_by_contributor_id` string, uuid, nullable — Contributor who uploaded this document (for ownership tracking)
    - `author` string, nullable — Document author
    - `tags` string[] — Tags for organization
    - `source_url` string, nullable — URL of the original source (e.g. Confluence, SharePoint, Google Drive)
    - `description` string, nullable — User-provided description of the document
    - `original_date` string, date-time, nullable — Original creation date of the document (may differ from upload date)
    - `created_at` string, date-time, required — When document was first stored
    - `updated_at` string, date-time, required — Last update timestamp
    - `extraction_history` ExtractionRecord[] — History of extractions performed
      - `pot_id` string, uuid, required — POT where facts were extracted to
      - `job_id` string, uuid, required — Ingestion job ID
      - `facts_created` integer, required — Number of facts created
      - `extracted_at` string, date-time, required — When extraction was performed
    - `scope_summary` object, nullable — Per-scope fact counts for this document (own/third_party/mixed_context/unknown). None when there are no scoped facts — covers both pre-Approach-D documents AND post-Approach-D docs whose facts all happen to be legacy.

## Other responses

- `404` — Document not found
- `422` — Validation Error

---

[API](https://skmtc.dev/scipot/apis/scipot-core-api.md) · [All operations](https://skmtc.dev/scipot/apis/scipot-core-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/scipot/scipot-core-api/revisions/e8712e9ffeae/schema)
