File Upload

Upload a file by URL to create a file search store. The returned store_name can be used in chat completions via file_search_store_names.

RAG File Upload

Uploads a file by URL to the AI backend for retrieval-augmented generation.

Endpoint: POST /api/v1/files

Auth: Required (X-API-Key or Authorization: Bearer) Timeout: 5 minutes

Request body:

Parameter
Type
Required
Description

url

string

Public URL to the file

store_name

string

Custom name for the vector store

Allowed file types:

Extension
MIME Type

.pdf

application/pdf

.txt

text/plain

.doc

application/msword

.docx

application/vnd.openxmlformats-officedocument.wordprocessingml.document

Request:

curl -X POST https://qolaba-server-b2b.up.railway.app/api/v1/files \
  -H "Content-Type: application/json" \
  -H "x-api-key: YOUR_API_KEY" \
  -d '{
    "url": "https://example.com/document.pdf",
    "store_name": "my-store"
  }'

Response 200 OK

Response 400 Bad Request

Using the store in Chat Completions

Pass the store_name from the upload response into file_search_store_names:

Request body:

Parameter
Type
Required
Description

messages

array

Chat messages

model

string

Model ID

file_search_store_names

string[]

Store names from uploadRagFile

thread_id

string

Conversation thread ID

user_id

string

User identifier

webhookUrl

string

Webhook for async results

metadata

object

Extra key/value metadata

Last updated