Skip to main content
POST
/
agent-sessions
/
{session_id}
/
upload
Upload and link document
import requests

url = "https://app.ubik-agent.com/api/v1/agent-sessions/{session_id}/upload"

files = { "file": ("example-file", open("example-file", "rb")) }
headers = {"X-API-KEY": "<api-key>"}

response = requests.post(url, files=files, headers=headers)

print(response.text)
{
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "name": "<string>",
  "status": "<string>",
  "created_at": "2023-11-07T05:31:56Z",
  "updated_at": "2023-11-07T05:31:56Z",
  "file_type": "<string>",
  "processing_pipeline": "<string>",
  "error_message": "<string>",
  "file_name": "<string>",
  "markdown_content": "<string>"
}

Authorizations

X-API-KEY
string
header
required

Headers

X-End-User-ID
string | null

Path Parameters

session_id
string<uuid>
required

Body

multipart/form-data
file
file
required

Response

Successful Response

id
string<uuid>
required

The unique identifier for the document.

name
string
required

The display name of the document.

status
string
required

The current processing status of the document.

created_at
string<date-time>
required

The timestamp when the document was created.

updated_at
string<date-time>
required

The timestamp when the document was last updated.

file_type
string | null

The MIME type of the document file.

processing_pipeline
string | null

The name of the processing pipeline used for this document.

error_message
string | null

If processing failed, this field will contain the error message.

file_name
string | null

The original file name of the document.

markdown_content
string | null

The full content of the document converted to Markdown format.