Swap (replace) the on-disk asset for an existing Upload
curl --request PUT \
--url https://pria.praxislxp.com/api/user/upload/{fileId}/swap-asset \
--header 'Content-Type: multipart/form-data' \
--form file='@example-file' \
--form updateOriginalName=falseimport requests
url = "https://pria.praxislxp.com/api/user/upload/{fileId}/swap-asset"
files = { "file": ("example-file", open("example-file", "rb")) }
payload = { "updateOriginalName": "false" }
response = requests.put(url, data=payload, files=files)
print(response.text)const form = new FormData();
form.append('file', '<string>');
form.append('updateOriginalName', 'false');
const options = {method: 'PUT'};
options.body = form;
fetch('https://pria.praxislxp.com/api/user/upload/{fileId}/swap-asset', 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://pria.praxislxp.com/api/user/upload/{fileId}/swap-asset",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"updateOriginalName\"\r\n\r\nfalse\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Content-Type: multipart/form-data"
],
]);
$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://pria.praxislxp.com/api/user/upload/{fileId}/swap-asset"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"updateOriginalName\"\r\n\r\nfalse\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("PUT", url, payload)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://pria.praxislxp.com/api/user/upload/{fileId}/swap-asset")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"updateOriginalName\"\r\n\r\nfalse\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://pria.praxislxp.com/api/user/upload/{fileId}/swap-asset")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"updateOriginalName\"\r\n\r\nfalse\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "<string>",
"data": {}
}User Files
Swap (replace) the on-disk asset for an existing Upload
Replaces the physical bytes under an existing Upload record without
regenerating embeddings or touching ingestion state. The Upload _id,
filename, and file_url stay byte-identical so any published links
continue to resolve. Existing embeddings, file_title, file_summary,
and vaultHealthScore are preserved — to re-index the new content,
call the Reprocess Content endpoint afterwards.
Two input modes (mutually exclusive):
- Multipart
filefield with the new asset bytes. - JSON
{ url }body — server fetches the URL and writes it into place. SSRF guard mirrors/api/user/url.
Authorization mirrors the rename endpoint: the caller must own the
upload, or hold files.edit on the upload’s institution.
PUT
/
api
/
user
/
upload
/
{fileId}
/
swap-asset
Swap (replace) the on-disk asset for an existing Upload
curl --request PUT \
--url https://pria.praxislxp.com/api/user/upload/{fileId}/swap-asset \
--header 'Content-Type: multipart/form-data' \
--form file='@example-file' \
--form updateOriginalName=falseimport requests
url = "https://pria.praxislxp.com/api/user/upload/{fileId}/swap-asset"
files = { "file": ("example-file", open("example-file", "rb")) }
payload = { "updateOriginalName": "false" }
response = requests.put(url, data=payload, files=files)
print(response.text)const form = new FormData();
form.append('file', '<string>');
form.append('updateOriginalName', 'false');
const options = {method: 'PUT'};
options.body = form;
fetch('https://pria.praxislxp.com/api/user/upload/{fileId}/swap-asset', 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://pria.praxislxp.com/api/user/upload/{fileId}/swap-asset",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"updateOriginalName\"\r\n\r\nfalse\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Content-Type: multipart/form-data"
],
]);
$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://pria.praxislxp.com/api/user/upload/{fileId}/swap-asset"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"updateOriginalName\"\r\n\r\nfalse\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("PUT", url, payload)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://pria.praxislxp.com/api/user/upload/{fileId}/swap-asset")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"updateOriginalName\"\r\n\r\nfalse\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://pria.praxislxp.com/api/user/upload/{fileId}/swap-asset")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"updateOriginalName\"\r\n\r\nfalse\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "<string>",
"data": {}
}Path Parameters
The Upload _id to swap the asset for
Pattern:
^[0-9a-fA-F]{24}$Body
multipart/form-dataapplication/json
Was this page helpful?
⌘I