---
title: "Delete index of encrypted files"
method: POST
path: "/files/encrypted/delete-index"
tags: ["Files Encrypted", "dev-api"]
---

# Delete index of encrypted files

`POST /files/encrypted/delete-index`

## Request

- Base URL: `https://gateway.prem.io`
- URL: `https://gateway.prem.io/files/encrypted/delete-index`
- Auth: HTTP bearer and API key in header `Authorization`

Remove encrypted files from the retrieval index. The files themselves are kept.

## Request body

- DeleteIndexFileEncryptedRequest: Request body for deleting index of encrypted files from RAG
  - `cipher_text` string, required: Cipher text for encryption context
  - `encrypted_rag_dek` string, required: Encrypted RAG data encryption key
  - `rag_dek_nonce` string, required: Nonce used for RAG DEK encryption
  - `fileIds` string[], required: Array of file IDs to delete from index

## Response `200`

File indexes deleted successfully

- object: Response containing the file index deletion status
  - `status` 200 | 201 | 202, required: Status code of the response
  - `data` object, nullable, required
    - `results` object[], required: Array of deletion results for each file
      - `file_id` string, required: The ID of the encrypted file
      - `success` boolean, required: Whether the file index was successfully queued for deletion
      - `error` string: Error message if file failed to be queued
    - `async_task_id` string: ID of the async task that will clean up the Qdrant collection
  - `error` string, nullable: Error message of the response, human readable
  - `message` string, nullable, required: Message of the response, human readable
  - `env` 'development' | 'production', required: API environment
  - `log` union: Useful informaiton, not always present, to debug the response
    - string
    - object
  - `validator` union: Validator response object, each key is the field name and value is the error message
    - object
    - unknown[]
      - unknown
  - `support_id` string, uuid, nullable: Support ID linked to the response, used to identify it when talking with our team.

## Other responses

- `400`: Bad request
- `401`: Access token is missing or invalid
- `403`: You do not have the required permissions to access this resource
- `404`: Resource not found

## Changes

- **2026-11-13** `d46bc3931b34`: 12 warning
  - added the new `405.00` enum value to the `allOf[subschema #1]/status` response property for the response status `401`
  - added the new `405.00` enum value to the `allOf[subschema #1]/status` response property for the response status `403`
  - added the new `405.00` enum value to the `allOf[subschema #1]/status` response property for the response status `404`
  - added the new `405.00` enum value to the `status` response property for the response status `400`
  - …8 more
- **2026-10-16** `d5b1beb33be5`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/premai-io/apis/prem-studio-api/changes/files/encrypted/delete-index/post.md)

---

[API](https://skmtc.dev/premai-io/apis/prem-studio-api.md) - [All operations](https://skmtc.dev/premai-io/apis/prem-studio-api/llms.txt) - [OpenAPI document](https://skmtc.dev/premai-io/apis/prem-studio-api/revisions/d46bc3931b34?raw)
