Upload
curl --request POST \
--url https://api.example.com/upload \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"save_to_memory": "<string>"
}
'import requests
url = "https://api.example.com/upload"
payload = { "save_to_memory": "<string>" }
headers = {
"Authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({save_to_memory: '<string>'})
};
fetch('https://api.example.com/upload', 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://api.example.com/upload",
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([
'save_to_memory' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"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://api.example.com/upload"
payload := strings.NewReader("{\n \"save_to_memory\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<authorization>")
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://api.example.com/upload")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"save_to_memory\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/upload")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"save_to_memory\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"upload_id": "upload_abc123",
"filename": "report.pdf",
"status": "processing",
"message": "File uploaded and queued for processing"
}
Endpoints
Upload
Upload a file for knowledge extraction
POST
/
upload
Upload
curl --request POST \
--url https://api.example.com/upload \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"save_to_memory": "<string>"
}
'import requests
url = "https://api.example.com/upload"
payload = { "save_to_memory": "<string>" }
headers = {
"Authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({save_to_memory: '<string>'})
};
fetch('https://api.example.com/upload', 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://api.example.com/upload",
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([
'save_to_memory' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"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://api.example.com/upload"
payload := strings.NewReader("{\n \"save_to_memory\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<authorization>")
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://api.example.com/upload")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"save_to_memory\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/upload")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"save_to_memory\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"upload_id": "upload_abc123",
"filename": "report.pdf",
"status": "processing",
"message": "File uploaded and queued for processing"
}
Upload a file to Vrin for automatic text extraction, chunking, and fact extraction. Accepts multipart form data.
string
required
Bearer token. Example:
Bearer vrin_live_abc123file
required
The file to upload (multipart form field).
string
default:"true"
If
"true", persist extracted knowledge to the knowledge base. Sent as a form field.{
"success": true,
"upload_id": "upload_abc123",
"filename": "report.pdf",
"status": "processing",
"message": "File uploaded and queued for processing"
}
Check upload status
GET /upload/{upload_id}/status
{
"upload_id": "upload_abc123",
"status": "completed",
"filename": "report.pdf",
"facts_extracted": 24,
"chunks_created": 8
}
Upload status values
| Status | Description |
|---|---|
processing | File is being processed |
completed | Processing finished successfully |
done | Alias for completed |
failed | Processing failed |
Supported file types
| Format | MIME Type |
|---|---|
application/pdf | |
| CSV | text/csv |
| Text | text/plain |
| Markdown | text/markdown |
cURL example
curl -X POST https://api.vrin.cloud/upload \
-H "Authorization: Bearer vrin_live_abc123" \
-F "file=@report.pdf" \
-F "save_to_memory=true"
SDK usage
# Upload from file path
result = client.upload_file("report.pdf")
# Upload raw bytes
result = client.upload_bytes(pdf_bytes, "report.pdf")
⌘I