# Archive a document subtree.

`POST /api/plugins/docs/documents/{id}/archive`

Authentication: no security requirement declared for this operation.

Parameters:

- `id` (path, string, required)
  Type: string

Responses:

- 200: Document archived successfully.

Content type: application/json

Type: object

Schema: [Document](https://sourcey-gauzy.pages.dev/api-reference/models/document/index.md)

- `deletedAt` (optional)
  Type: string, date-time
  
  Example:
  
  ```json
  "2018-11-21T06:20:32.232Z"
  ```

- `createdAt` (optional)
  Type: string, date-time
  
  The creation timestamp of the entity.
  
  Example:
  
  ```json
  "2018-11-21T06:20:32.232Z"
  ```

- `updatedAt` (optional)
  Type: string, date-time
  
  The last update timestamp of the entity.
  
  Example:
  
  ```json
  "2018-11-21T06:20:32.232Z"
  ```

- `id` (optional)
  Type: string

- `isActive` (optional)
  Type: boolean
  
  default: true

- `isArchived` (optional)
  Type: boolean
  
  default: false

- `archivedAt` (optional)
  Type: string, date-time
  
  Example:
  
  ```json
  "2018-11-21T06:20:32.232Z"
  ```

- `tenantId` (optional)
  Type: string

- `organizationId` (optional)
  Type: string

- `kind` (required)
  Type: string
  
  enum: ["FOLDER","PAGE","FILE"]

- `index` (required)
  Type: number
  
  Sibling sort order within the parent

- `name` (required)
  Type: string
  
  Display name / page title

- `icon` (optional)
  Type: string

- `color` (optional)
  Type: string

- `description` (optional)
  Type: string

- `contentJson` (optional)
  Type: object

- `contentHtml` (optional)
  Type: string

- `contentBinary` (optional)
  Type: string, binary

- `isLocked` (required)
  Type: boolean

- `storageProvider` (optional)
  Type: string
  
  enum: ["LOCAL","S3","WASABI","CLOUDINARY","DIGITALOCEAN"]

- `storageKey` (optional)
  Type: string

- `thumbKey` (optional)
  Type: string

- `mimeType` (optional)
  Type: string

- `fileSize` (optional)
  Type: number

- `sha256` (optional)
  Type: string

- `originalFilename` (optional)
  Type: string

- `version` (required)
  Type: number

- `extractedText` (optional)
  Type: string

- `extractedTextEdited` (required)
  Type: boolean

- `summary` (optional)
  Type: string

- `status` (required)
  Type: string
  
  enum: ["UPLOADED","PROCESSING","READY","FAILED"]

- `statusMessage` (optional)
  Type: string

- `source` (required)
  Type: string
  
  enum: ["UPLOAD","EDITOR","CHAT","EMAIL","INTEGRATION","SYSTEM","IMPORT"]

- `knowledgeStatus` (required)
  Type: string
  
  enum: ["NONE","QUEUED","INDEXING","INDEXED","FAILED","EXCLUDED"]

- `aiConfidence` (optional)
  Type: number

- `searchable` (required)
  Type: boolean

- `reviewStatus` (required)
  Type: string
  
  enum: ["NONE","PENDING","APPROVED","REJECTED"]

- `reviewReason` (optional)
  Type: string
  
  enum: ["extraction-failed","low-confidence","ai-generated","manual"]

- `reviewedAt` (optional)
  Type: string, date-time

- `visibility` (required)
  Type: string
  
  enum: ["ORGANIZATION","PRIVATE"]

- `externalSource` (optional)
  Type: string

- `externalId` (optional)
  Type: string

- `metadata` (optional)
  Type: object

- `parentId` (optional)
  Type: string

- `reviewedById` (optional)
  Type: string

## Examples

### cURL

```bash
curl -X POST 'http://localhost:3000/api/plugins/docs/documents/string/archive'
```

### JavaScript

```javascript
const response = await fetch('http://localhost:3000/api/plugins/docs/documents/string/archive', {
  method: 'POST',
});

const data = await response.text();
```

### Python

```python
import requests

response = requests.post('http://localhost:3000/api/plugins/docs/documents/string/archive')
print(response.text)
```
