---
title: "Update Document Status in Batch"
method: PATCH
path: "/datasets/{dataset_id}/documents/status/{action}"
tags: ["Documents"]
---

# Update Document Status in Batch

`PATCH /datasets/{dataset_id}/documents/status/{action}`

Enables, disables, archives, or unarchives multiple documents in one request.

## Path parameters

- `dataset_id` string, uuid, required
- `action` 'enable' | 'disable' | 'archive' | 'un_archive', required

## Request body

- object
  - `document_ids` string[], required — Document IDs to update. Get them from [List Documents](/en/api-reference/documents/list-documents).

## Response `200`

Documents updated successfully.

- object
  - `result` string — Operation result.

## Other responses

- `400` — `invalid_action` : Invalid action, or a document is in a state that does not allow the action (e.g. still indexing, or not completed).
- `403` — `forbidden` : Knowledge base API access is not enabled.
- `404` — `not_found` : Knowledge base not found.

---

[API](https://skmtc.net/langgenius/apis/dify-service-api.md) · [All operations](https://skmtc.net/langgenius/apis/dify-service-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/langgenius/dify-service-api/revisions/361dc12484f4/schema)
