---
title: "List encrypted files"
method: GET
path: "/files/encrypted"
tags: ["Files Encrypted", "dev-api"]
---

# List encrypted files

`GET /files/encrypted`

## Request

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

Retrieve a paginated list of encrypted files for the authenticated organization and user

## Query parameters

- `limit` integer
- `offset` integer
- `search` string
- `type` 'image' | 'document' | 'video' | 'audio' | 'archive' | 'general'
- `from` string
- `to` string

## Response `200`

List of encrypted files retrieved successfully

- object: Response containing a paginated list of encrypted files
  - `status` 200 | 201 | 202, required: Status code of the response
  - `data` object, nullable, required
    - `files` FileEncrypted[], required: Array of encrypted file objects
      - `id` string: Unique identifier for the encrypted file
      - `user_id` string, nullable: User identifier that owns the file
      - `organization_id` string, nullable: Organization identifier that owns the file
      - `api_key_id` string, nullable: API Key identifier that owns the file
      - `hash` string, nullable: File hash for duplicate detection
      - `version` string: Encryption version
      - `kid` string: Key identifier used for encryption
      - `wrapped_dek` string: Wrapped data encryption key
      - `original_name` string: Original filename, encrypted by the client
      - `mime_type` string: MIME type, encrypted by the client
      - `file_name` string: Generated filename for storage
      - `file_path` string, nullable: Full path to the encrypted file in storage
      - `file_size` integer: File size in bytes
      - `chat_id` string, nullable: ID of the chat this file belongs to
      - `message_id` string, nullable: ID of the message this file belongs to
      - `type` string: Type of the file - always 'encrypted' for fully encrypted files
      - `created_at` string, mysql-date-time: Timestamp when the file was created
      - `rag_status` 'running' | 'stopped' | 'failure' | 'success' | 'pending' | 'null', nullable: Status of the RAG processing
      - `updated_at` string, mysql-date-time, nullable: Timestamp when the file was last updated
      - `url` string, uri, nullable: Signed URL for accessing the encrypted file resource (only included when url=true query parameter is set)
      - `is_duplicate` boolean: Indicates if the file is a duplicate (only included in upload response)
      - `chat_wrapped_dek` string, nullable: File DEK encrypted with chat DEK (hex), for shared chat file access
    - `pagination` Pagination, required: Pagination information for list responses
      - `total` integer, required: Total number of items
      - `page` integer, required: Current page number
      - `limit` integer, required: Number of items per page
      - `pages` integer, required: Total number of pages
  - `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

## Changes

- **2026-11-13** `d46bc3931b34`: 9 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 `status` response property for the response status `400`
  - added the new `409.00` enum value to the `allOf[subschema #1]/status` response property for the response status `401`
  - …5 more
- **2026-10-16** `d5b1beb33be5`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/premai-io/apis/prem-studio-api/changes/files/encrypted/get.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)
