curl --request POST \
--url https://gateway.prem.io/files/encrypted/delete-index \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"cipher_text": "cipher_text_data",
"encrypted_rag_dek": "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef",
"rag_dek_nonce": "0123456789abcdef0123456789abcdef",
"fileIds": [
"file_0198042e-6dde-7b9c-bc91-452a7e0c833b"
]
}
'import requests
url = "https://gateway.prem.io/files/encrypted/delete-index"
payload = {
"cipher_text": "cipher_text_data",
"encrypted_rag_dek": "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef",
"rag_dek_nonce": "0123456789abcdef0123456789abcdef",
"fileIds": ["file_0198042e-6dde-7b9c-bc91-452a7e0c833b"]
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
cipher_text: 'cipher_text_data',
encrypted_rag_dek: '0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef',
rag_dek_nonce: '0123456789abcdef0123456789abcdef',
fileIds: ['file_0198042e-6dde-7b9c-bc91-452a7e0c833b']
})
};
fetch('https://gateway.prem.io/files/encrypted/delete-index', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://gateway.prem.io/files/encrypted/delete-index",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'cipher_text' => 'cipher_text_data',
'encrypted_rag_dek' => '0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef',
'rag_dek_nonce' => '0123456789abcdef0123456789abcdef',
'fileIds' => [
'file_0198042e-6dde-7b9c-bc91-452a7e0c833b'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://gateway.prem.io/files/encrypted/delete-index"
payload := strings.NewReader("{\n \"cipher_text\": \"cipher_text_data\",\n \"encrypted_rag_dek\": \"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\",\n \"rag_dek_nonce\": \"0123456789abcdef0123456789abcdef\",\n \"fileIds\": [\n \"file_0198042e-6dde-7b9c-bc91-452a7e0c833b\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://gateway.prem.io/files/encrypted/delete-index")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"cipher_text\": \"cipher_text_data\",\n \"encrypted_rag_dek\": \"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\",\n \"rag_dek_nonce\": \"0123456789abcdef0123456789abcdef\",\n \"fileIds\": [\n \"file_0198042e-6dde-7b9c-bc91-452a7e0c833b\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://gateway.prem.io/files/encrypted/delete-index")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"cipher_text\": \"cipher_text_data\",\n \"encrypted_rag_dek\": \"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\",\n \"rag_dek_nonce\": \"0123456789abcdef0123456789abcdef\",\n \"fileIds\": [\n \"file_0198042e-6dde-7b9c-bc91-452a7e0c833b\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"status": 200,
"data": {
"results": [
{
"file_id": "file_0198042e-6dde-7b9c-bc91-452a7e0c833b",
"success": true
},
{
"file_id": "file_0198042e-6dde-7b9c-bc91-452a7e0c833c",
"success": true
}
],
"async_task_id": "task_0198042e-6dde-7b9c-bc91-452a7e0c833d"
},
"error": null,
"log": null,
"validator": null,
"support_id": null,
"message": "Resource created successfully",
"env": "development"
}{
"status": 400,
"error": "Some error message",
"message": null,
"env": "development",
"log": {
"request_id": "req_1234567890"
},
"support_id": "support_uuidv7-something-else",
"data": {},
"validator": {
"email": "Invalid email address",
"password": "Password is required"
}
}{
"status": 401,
"error": "Some error message",
"message": null,
"env": "development",
"log": {
"request_id": "req_1234567890"
},
"support_id": "support_uuidv7-something-else",
"data": {},
"validator": {
"email": "Invalid email address",
"password": "Password is required"
}
}{
"status": 403,
"error": "Some error message",
"message": null,
"env": "development",
"log": {
"request_id": "req_1234567890"
},
"support_id": "support_uuidv7-something-else",
"data": {},
"validator": {
"email": "Invalid email address",
"password": "Password is required"
}
}{
"status": 404,
"error": "Some error message",
"message": null,
"env": "development",
"log": {
"request_id": "req_1234567890"
},
"support_id": "support_uuidv7-something-else",
"data": {},
"validator": {
"email": "Invalid email address",
"password": "Password is required"
}
}Delete index of encrypted files
Remove encrypted files from the retrieval index. The files themselves are kept.
curl --request POST \
--url https://gateway.prem.io/files/encrypted/delete-index \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"cipher_text": "cipher_text_data",
"encrypted_rag_dek": "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef",
"rag_dek_nonce": "0123456789abcdef0123456789abcdef",
"fileIds": [
"file_0198042e-6dde-7b9c-bc91-452a7e0c833b"
]
}
'import requests
url = "https://gateway.prem.io/files/encrypted/delete-index"
payload = {
"cipher_text": "cipher_text_data",
"encrypted_rag_dek": "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef",
"rag_dek_nonce": "0123456789abcdef0123456789abcdef",
"fileIds": ["file_0198042e-6dde-7b9c-bc91-452a7e0c833b"]
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
cipher_text: 'cipher_text_data',
encrypted_rag_dek: '0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef',
rag_dek_nonce: '0123456789abcdef0123456789abcdef',
fileIds: ['file_0198042e-6dde-7b9c-bc91-452a7e0c833b']
})
};
fetch('https://gateway.prem.io/files/encrypted/delete-index', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://gateway.prem.io/files/encrypted/delete-index",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'cipher_text' => 'cipher_text_data',
'encrypted_rag_dek' => '0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef',
'rag_dek_nonce' => '0123456789abcdef0123456789abcdef',
'fileIds' => [
'file_0198042e-6dde-7b9c-bc91-452a7e0c833b'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://gateway.prem.io/files/encrypted/delete-index"
payload := strings.NewReader("{\n \"cipher_text\": \"cipher_text_data\",\n \"encrypted_rag_dek\": \"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\",\n \"rag_dek_nonce\": \"0123456789abcdef0123456789abcdef\",\n \"fileIds\": [\n \"file_0198042e-6dde-7b9c-bc91-452a7e0c833b\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://gateway.prem.io/files/encrypted/delete-index")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"cipher_text\": \"cipher_text_data\",\n \"encrypted_rag_dek\": \"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\",\n \"rag_dek_nonce\": \"0123456789abcdef0123456789abcdef\",\n \"fileIds\": [\n \"file_0198042e-6dde-7b9c-bc91-452a7e0c833b\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://gateway.prem.io/files/encrypted/delete-index")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"cipher_text\": \"cipher_text_data\",\n \"encrypted_rag_dek\": \"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\",\n \"rag_dek_nonce\": \"0123456789abcdef0123456789abcdef\",\n \"fileIds\": [\n \"file_0198042e-6dde-7b9c-bc91-452a7e0c833b\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"status": 200,
"data": {
"results": [
{
"file_id": "file_0198042e-6dde-7b9c-bc91-452a7e0c833b",
"success": true
},
{
"file_id": "file_0198042e-6dde-7b9c-bc91-452a7e0c833c",
"success": true
}
],
"async_task_id": "task_0198042e-6dde-7b9c-bc91-452a7e0c833d"
},
"error": null,
"log": null,
"validator": null,
"support_id": null,
"message": "Resource created successfully",
"env": "development"
}{
"status": 400,
"error": "Some error message",
"message": null,
"env": "development",
"log": {
"request_id": "req_1234567890"
},
"support_id": "support_uuidv7-something-else",
"data": {},
"validator": {
"email": "Invalid email address",
"password": "Password is required"
}
}{
"status": 401,
"error": "Some error message",
"message": null,
"env": "development",
"log": {
"request_id": "req_1234567890"
},
"support_id": "support_uuidv7-something-else",
"data": {},
"validator": {
"email": "Invalid email address",
"password": "Password is required"
}
}{
"status": 403,
"error": "Some error message",
"message": null,
"env": "development",
"log": {
"request_id": "req_1234567890"
},
"support_id": "support_uuidv7-something-else",
"data": {},
"validator": {
"email": "Invalid email address",
"password": "Password is required"
}
}{
"status": 404,
"error": "Some error message",
"message": null,
"env": "development",
"log": {
"request_id": "req_1234567890"
},
"support_id": "support_uuidv7-something-else",
"data": {},
"validator": {
"email": "Invalid email address",
"password": "Password is required"
}
}Authorizations
Send your access token as header Authorization: Bearer {accessToken}
Your API key that starts with sk_live or sk_test. You can create yours at go.prem.io/api-keys.
Body
Request body for deleting index of encrypted files from RAG
Cipher text for encryption context
"cipher_text_data"
Encrypted RAG data encryption key
"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"
Nonce used for RAG DEK encryption
"0123456789abcdef0123456789abcdef"
Array of file IDs to delete from index
1File ID
Response
File indexes deleted successfully
Response containing the file index deletion status
Status code of the response
200, 201, 202 Response data containing the requested object
Show child attributes
Show child attributes
Message of the response, human readable
"Resource created successfully"
API environment
development, production Error message of the response, human readable
"Invalid email address"
Useful informaiton, not always present, to debug the response
{ "request_id": "req_1234567890" }
"Some pertinent log message"
Validator response object, each key is the field name and value is the error message
{
"email": "Invalid email address",
"password": "Password is required"
}
Support ID linked to the response, used to identify it when talking with our team
"support_uuidv7-something-else"