---
title: "Replace a document's content"
method: PUT
path: "/documents/{document_id}/content"
tags: ["Documents"]
---

# Replace a document's content

`PUT /documents/{document_id}/content`

## Request

- Base URL: `https://app.jitprompt.com`
- URL: `https://app.jitprompt.com/documents/{document_id}/content`
- Auth: HTTP bearer

Replace the source and re-ingest. Send either multipart/form-data with a
`file` field (a new filename is kept), or the raw text as the body with any
text/* content type (the filename stays).

## Path parameters

- `document_id` string, required

## Response `200`

Successful Response

- Document
  - `id` string, uuid, required
  - `namespace_id` string, uuid, required
  - `title` string, nullable, required
  - `summary` string, nullable, required
  - `source_name` string, required
  - `status` 'pending' | 'parsing' | 'structuring' | 'embedding' | 'ready' | 'failed', required
  - `error` string, nullable, required
  - `created_at` string, date-time, required
  - `updated_at` string, date-time, required
  - `section_count` integer, required

## Other responses

- `422`: Validation Error

---

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