Skip to main content
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>"
  }
}
'
{
  "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, then pass the returned fileRef to Ingest Knowledge.

Endpoint

POST https://api.velt.dev/v2/memory/knowledge/upload-url

Headers

x-velt-api-key
string
required
Your API key.
x-velt-auth-token
string
required

Body

Params

data
object
required

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 to uploadUrl with an HTTP PUT, then pass fileRef to Ingest Knowledge. The URL expires at expiresAt (epoch ms).

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
  }
}