---
title: "Put Document"
method: PUT
path: "/v1/cases/{case_id}/documents/{doc_id}"
tags: ["cases"]
---

# Put Document

`PUT /v1/cases/{case_id}/documents/{doc_id}`

## Request

- Base URL: `https://api.bitpoort.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.bitpoort.com/v1/cases/{case_id}/documents/{doc_id}`
- Auth: one of:
  - API key in header `X-API-Key`
  - HTTP bearer

The ~debounced autosave. Logs NO event (ambient, the graph_session-PATCH
precedent). Optimistic concurrency: a stale ``rev`` is a typed 409 — two
tabs must conflict loudly, never last-write-wins a document.

## Path parameters

- `case_id` integer, required
- `doc_id` integer, required

## Request body

- DocumentPut
  - `title` string, nullable
  - `doc` DocBody, required
    - `v` 1
    - `blocks` DocBlock[]
      - `id` string, required
      - `t` 'h1' | 'h2' | 'p' | 'li' | 'pagebreak' | 'evidence', required
      - `text` string, nullable
      - `hash` string, nullable
    - `cover` DocCover
      - `case_reference` string, nullable
      - `purpose_of_request` string, nullable
      - `requesting_institution` string, nullable
      - `analyst_of_record` string, nullable
  - `rev` integer, required

## Response `200`

Successful Response

- object

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/bitpoort/apis/bitpoort-api.md) · [All operations](https://skmtc.dev/bitpoort/apis/bitpoort-api/llms.txt) · [OpenAPI document](https://skmtc.dev/bitpoort/apis/bitpoort-api/revisions/1a51d8566777?raw)
