Skip to main content
POST
Fetch Source

When to use it

  • Download original files – PDFs, DOCX, etc. that you uploaded
  • Generate temporary share links – presigned URLs for client-side access
  • Re-extract content – rebuild downstream caches from the source of truth
  • Preview – display original content alongside recall results

Endpoint

  • Auth: Bearer token
  • Idempotency: Read-only
  • Async: No

Example

Request parameters

Modes

Use url for client-side downloads where you don’t want to proxy bytes through your backend. Use content when you need to process the file inline.

Response

Behavior notes

Binary vs text. For PDFs and other binaries, content is empty and the data is in content_base64. For markdown, plain text, or extracted text, content is populated directly.
Presigned URLs are time-limited. Once expiry_seconds elapses, the URL stops working. Generate a fresh URL for each long-lived integration rather than caching them.

Errors

Common codes: 400 INVALID_PARAMETERS, 404 SOURCE_NOT_FOUND, 422 VALIDATION_ERROR. See Error Responses for the full list.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

Request to fetch source file content.

tenant_id
string
required

Unique identifier for the tenant/organization

Example:

"tenant_1234"

source_id
string
required

Source ID of the file to fetch

Example:

"<source_id>"

sub_tenant_id
string | null

Optional sub-tenant identifier used to organize data within a tenant. If omitted, the default sub-tenant created during tenant setup will be used.

Example:

"sub_tenant_4567"

mode
enum<string>
default:content

Fetch mode: 'content' returns file content, 'url' returns presigned URL, 'both' returns both

Available options:
content,
url,
both
expiry_seconds
integer
default:3600

Expiry time in seconds for presigned URL (60-604800, default: 3600)

Required range: 60 <= x <= 604800
Example:

1

Response

Successful Response

Response for file fetch request.

source_id
string
required

Source ID of the fetched file

Example:

"<source_id>"

success
boolean
default:true

Whether the fetch was successful

Example:

true

content
string | null

File content as string (if mode includes 'content')

content_base64
string | null

File content as base64 encoded string (for binary files, if mode includes 'content')

presigned_url
string | null

Presigned URL to access the file (if mode includes 'url')

content_type
string | null

Content type of the file

size_bytes
integer | null

Size of the file in bytes

message
string
default:File fetched successfully

Response message

error
string | null

Error message if fetch failed