Files Encrypted
dev-api

Upload an encrypted file

Changed on

Upload a new encrypted file to the organization's secure file storage with client-side encryption

post/files/encrypted/upload

Request

  • Base URL
    https://gateway.prem.io
  • Auth
    HTTP bearer and API key in header Authorization

Request body

encrypted_contentstring required

The encrypted file content as hexadecimal string

encrypted_namestring required

The encrypted original filename

client_hashstring required

Client-side hash for duplicate detection

kidstring required

Key identifier used for encryption

wrapped_dekstring required

Wrapped data encryption key

mime_typestring required

MIME type of the original file (encrypted on client side before sending)

incognitoboolean

Whether the file is incognito (optional)

encrypted_rag_dekstring

Encrypted RAG data encryption key

rag_dek_noncestring

Nonce used for RAG DEK encryption

cipher_textstring

Cipher text for RAG encryption context

encrypted_file_dekstring

Encrypted file data encryption key

file_noncestring

Nonce used for file encryption

Example request

{
  "encrypted_content": "0123456789abcdef...",
  "encrypted_name": "encrypted_filename",
  "client_hash": "04b9e2ec43133ae7287f97764c0beda19f304374e1d6bfe4fcc36ad54502e5dc",
  "kid": "key_01234567-89ab-cdef-0123-456789abcdef",
  "wrapped_dek": "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef",
  "mime_type": "encrypted_mime_type_data",
  "incognito": true,
  "encrypted_rag_dek": "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef",
  "rag_dek_nonce": "0123456789abcdef0123456789abcdef",
  "cipher_text": "cipher_text_data",
  "encrypted_file_dek": "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef",
  "file_nonce": "0123456789abcdef0123456789abcdef"
}

Response

Encrypted file uploaded successfully

status200 | 201 | 202 required

Status code of the response

errorstring nullable

Error message of the response, human readable

messagestring nullable required

Message of the response, human readable

env'development' | 'production' required

API environment

support_idstring uuid nullable

Support ID linked to the response, used to identify it when talking with our team.

Example response

{
  "data": {
    "id": "file_0198042e-6dde-7b9c-bc91-452a7e0c833b",
    "version": "1",
    "kid": "key_01234567-89ab-cdef-0123-456789abcdef",
    "wrapped_dek": "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef",
    "file_name": "0198042e-6dde-76e0-b817-3afb324e29ac.enc",
    "file_path": "encrypted/org_0196b0e9-11d8-7f26-b1d2-bd47054e4827/user_0196b0e9-11d8-7f26-b1d2-bd47054e4827/0198042e-6dde-76e0-b817-3afb324e29ac.enc",
    "file_size": 1060793,
    "type": "encrypted",
    "mime_type": "encrypted_mime_type_data",
    "is_duplicate": false,
    "created_at": "2025-07-13 16:26:48.415",
    "updated_at": null,
    "original_name": "encrypted-original-filename"
  }
}

Changes

    • warning

      added the new 405.00 enum value to the / response property for the response status

    • warning

      added the new 405.00 enum value to the / response property for the response status

    • warning

      added the new 405.00 enum value to the response property for the response status

    • warning

      added the new 409.00 enum value to the / response property for the response status

    • warning

      added the new 409.00 enum value to the / response property for the response status

    • warning

      added the new 409.00 enum value to the response property for the response status

    • warning

      added the new 500.00 enum value to the / response property for the response status

    • warning

      added the new 500.00 enum value to the / response property for the response status

    • warning

      added the new 500.00 enum value to the response property for the response status

    • info

      endpoint added