Get Upload URL
curl --request POST \
--url https://api.velt.dev/v2/memory/knowledge/upload-url \
--header 'Content-Type: application/json' \
--header 'x-velt-api-key: <x-velt-api-key>' \
--header 'x-velt-auth-token: <x-velt-auth-token>' \
--data '
{
"data": {
"mimeType": "<string>",
"fileSize": 123,
"fileName": "<string>",
"organizationId": "<string>",
"documentId": "<string>"
}
}
'import requests
url = "https://api.velt.dev/v2/memory/knowledge/upload-url"
payload = { "data": {
"mimeType": "<string>",
"fileSize": 123,
"fileName": "<string>",
"organizationId": "<string>",
"documentId": "<string>"
} }
headers = {
"x-velt-api-key": "<x-velt-api-key>",
"x-velt-auth-token": "<x-velt-auth-token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-velt-api-key': '<x-velt-api-key>',
'x-velt-auth-token': '<x-velt-auth-token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
data: {
mimeType: '<string>',
fileSize: 123,
fileName: '<string>',
organizationId: '<string>',
documentId: '<string>'
}
})
};
fetch('https://api.velt.dev/v2/memory/knowledge/upload-url', 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.velt.dev/v2/memory/knowledge/upload-url",
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([
'data' => [
'mimeType' => '<string>',
'fileSize' => 123,
'fileName' => '<string>',
'organizationId' => '<string>',
'documentId' => '<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-velt-api-key: <x-velt-api-key>",
"x-velt-auth-token: <x-velt-auth-token>"
],
]);
$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.velt.dev/v2/memory/knowledge/upload-url"
payload := strings.NewReader("{\n \"data\": {\n \"mimeType\": \"<string>\",\n \"fileSize\": 123,\n \"fileName\": \"<string>\",\n \"organizationId\": \"<string>\",\n \"documentId\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-velt-api-key", "<x-velt-api-key>")
req.Header.Add("x-velt-auth-token", "<x-velt-auth-token>")
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.velt.dev/v2/memory/knowledge/upload-url")
.header("x-velt-api-key", "<x-velt-api-key>")
.header("x-velt-auth-token", "<x-velt-auth-token>")
.header("Content-Type", "application/json")
.body("{\n \"data\": {\n \"mimeType\": \"<string>\",\n \"fileSize\": 123,\n \"fileName\": \"<string>\",\n \"organizationId\": \"<string>\",\n \"documentId\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.velt.dev/v2/memory/knowledge/upload-url")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-velt-api-key"] = '<x-velt-api-key>'
request["x-velt-auth-token"] = '<x-velt-auth-token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"data\": {\n \"mimeType\": \"<string>\",\n \"fileSize\": 123,\n \"fileName\": \"<string>\",\n \"organizationId\": \"<string>\",\n \"documentId\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"result": {
"uploadUrl": "https://storage.googleapis.com/...signed...",
"fileRef": "gs://bucket/path/original.pdf",
"expiresAt": 1731432600000
}
}
Knowledge
Get Upload URL
POST
/
v2
/
memory
/
knowledge
/
upload-url
Get Upload URL
curl --request POST \
--url https://api.velt.dev/v2/memory/knowledge/upload-url \
--header 'Content-Type: application/json' \
--header 'x-velt-api-key: <x-velt-api-key>' \
--header 'x-velt-auth-token: <x-velt-auth-token>' \
--data '
{
"data": {
"mimeType": "<string>",
"fileSize": 123,
"fileName": "<string>",
"organizationId": "<string>",
"documentId": "<string>"
}
}
'import requests
url = "https://api.velt.dev/v2/memory/knowledge/upload-url"
payload = { "data": {
"mimeType": "<string>",
"fileSize": 123,
"fileName": "<string>",
"organizationId": "<string>",
"documentId": "<string>"
} }
headers = {
"x-velt-api-key": "<x-velt-api-key>",
"x-velt-auth-token": "<x-velt-auth-token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-velt-api-key': '<x-velt-api-key>',
'x-velt-auth-token': '<x-velt-auth-token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
data: {
mimeType: '<string>',
fileSize: 123,
fileName: '<string>',
organizationId: '<string>',
documentId: '<string>'
}
})
};
fetch('https://api.velt.dev/v2/memory/knowledge/upload-url', 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.velt.dev/v2/memory/knowledge/upload-url",
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([
'data' => [
'mimeType' => '<string>',
'fileSize' => 123,
'fileName' => '<string>',
'organizationId' => '<string>',
'documentId' => '<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-velt-api-key: <x-velt-api-key>",
"x-velt-auth-token: <x-velt-auth-token>"
],
]);
$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.velt.dev/v2/memory/knowledge/upload-url"
payload := strings.NewReader("{\n \"data\": {\n \"mimeType\": \"<string>\",\n \"fileSize\": 123,\n \"fileName\": \"<string>\",\n \"organizationId\": \"<string>\",\n \"documentId\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-velt-api-key", "<x-velt-api-key>")
req.Header.Add("x-velt-auth-token", "<x-velt-auth-token>")
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.velt.dev/v2/memory/knowledge/upload-url")
.header("x-velt-api-key", "<x-velt-api-key>")
.header("x-velt-auth-token", "<x-velt-auth-token>")
.header("Content-Type", "application/json")
.body("{\n \"data\": {\n \"mimeType\": \"<string>\",\n \"fileSize\": 123,\n \"fileName\": \"<string>\",\n \"organizationId\": \"<string>\",\n \"documentId\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.velt.dev/v2/memory/knowledge/upload-url")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-velt-api-key"] = '<x-velt-api-key>'
request["x-velt-auth-token"] = '<x-velt-auth-token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"data\": {\n \"mimeType\": \"<string>\",\n \"fileSize\": 123,\n \"fileName\": \"<string>\",\n \"organizationId\": \"<string>\",\n \"documentId\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"result": {
"uploadUrl": "https://storage.googleapis.com/...signed...",
"fileRef": "gs://bucket/path/original.pdf",
"expiresAt": 1731432600000
}
}
Use this API to mint a short-lived signed URL for uploading a file up to 30 MB. Use it for the by-reference ingestion flow: get the URL, PUT the raw file bytes to it with a
Content-Type header matching the mimeType you sent, then pass the returned fileRef to Ingest Knowledge.
Endpoint
POST https://api.velt.dev/v2/memory/knowledge/upload-url
Rate limit: 100 requests per minute per API key.
Headers
string
required
Your API key.
string
required
Your Auth Token.
Body
Params
object
required
Show properties
Show properties
string
required
One of the supported types:
application/pdf, text/csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, or text/plain.integer
required
File size in bytes. Maximum 30 MB (31,457,280 bytes).
string
1 to 255 characters.
string
Scope the source to one organization.
string
Scope the source to one document. Requires
organizationId.A workspace can hold at most 50 outstanding upload URLs. Past that, this call returns
RESOURCE_EXHAUSTED. Each URL holds a slot until you ingest its fileRef, so request URLs only for files you are about to upload. This endpoint also rejects unrecognized fields, so a misspelled key returns INVALID_ARGUMENT.Example Requests
Request an upload URL for a PDF
{
"data": {
"mimeType": "application/pdf",
"fileSize": 8421376,
"fileName": "brand-guidelines.pdf"
}
}
Response
Upload the raw file bytes touploadUrl with an HTTP PUT. Set the Content-Type header to the same mimeType you passed to this endpoint. The signed URL is bound to that value, so a PUT with a missing or different Content-Type is rejected before it reaches Velt.
Then pass fileRef to Ingest Knowledge, repeating the same organizationId and documentId you sent here. A scope mismatch returns PERMISSION_DENIED. The URL expires at expiresAt (epoch ms), 15 minutes after it is minted.
Success Response
{
"result": {
"uploadUrl": "https://storage.googleapis.com/...signed...",
"fileRef": "gs://bucket/path/original.pdf",
"expiresAt": 1731432600000
}
}
Failure Response
{
"error": {
"message": "ERROR_MESSAGE",
"status": "INVALID_ARGUMENT"
}
}
{
"result": {
"uploadUrl": "https://storage.googleapis.com/...signed...",
"fileRef": "gs://bucket/path/original.pdf",
"expiresAt": 1731432600000
}
}
Was this page helpful?
⌘I

