Fetch Content
Fetch the content of a source ingested.
This endpoint can return:
- File content directly (as string or base64)
- A presigned URL to access the file
- Both content and presigned URL
Examples
- API Request
- TypeScript
- Python (Sync)
Functionality
- Extracts user credentials and organization details from the API key
- Validates the file access permissions for the specified tenant
- Creates secure access tokens for file retrieval
- When
return_contentistrue: Returns the actual file content directly - When
return_contentisfalse: Generates time-limited download URLs for the requested file - Returns downloadable URLs that can be used to access the file content
Error Responses
All endpoints return consistent error responses following the standard format. For detailed error information, see our Error Responses documentation.Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
Request to fetch source file content.
Unique identifier for the tenant/organization
"tenant_1234"
Source ID of the file to fetch
"CortexDoc1234"
Optional sub-tenant identifier used to organize data within a tenant. If omitted, the default sub-tenant created during tenant setup will be used.
"sub_tenant_4567"
Fetch mode: 'content' returns file content, 'url' returns presigned URL, 'both' returns both
content, url, both Expiry time in seconds for presigned URL (60-604800, default: 3600)
60 <= x <= 6048001
Response
Successful Response
Response for file fetch request.
Source ID of the fetched file
"CortexDoc1234"
Whether the fetch was successful
true
File content as string (if mode includes 'content')
File content as base64 encoded string (for binary files, if mode includes 'content')
Presigned URL to access the file (if mode includes 'url')
Content type of the file
Size of the file in bytes
Response message
Error message if fetch failed