File Upload Data Source
Guide to uploading files directly to LlamaCloud as a data source, including UI, API, and client instructions.
Directly upload files
Configure via UI
Section titled “Configure via UI”
Configure via API / Client
Section titled “Configure via API / Client”from llama_cloud import LlamaCloud
client = LlamaCloud(api_key="LLAMA_CLOUD_API_KEY")
file_obj = client.files.create(file="path/to/your/file.txt", purpose="user_data")const client = new LlamaCloud({ apiKey: "LLAMA_CLOUD_API_KEY",});
const fileObj = await client.files.create({ file: fs.createReadStream('path/to/your/file.txt'), purpose: 'user_data',});```# Step 2: Use the presigned URL to upload the file to S3 within 30 secondscurl -X PUT "https://your-presigned-url-from-step-1" \ -H "Content-Type: text/plain" \ -F 'file=@path/to/your/example.txt'
# Step 3: Confirm the file upload with LlamaCloudcurl -X PUT "https://api.cloud.llamaindex.ai/api/v1/files/sync" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $LLAMA_CLOUD_API_KEY"```Note for AI agents: this documentation is built for programmatic access.
- Overview of all docs: https://developers.llamaindex.ai/llms.txt
- Any page is available as raw Markdown by appending index.md to its URL — e.g. https://developers.llamaindex.ai/llamaparse/parse/getting_started/index.md
- Agent-friendly REST search APIs live under https://developers.llamaindex.ai/api/ — search (BM25 full-text), grep (regex), read (fetch a page), and list (browse the doc tree). See https://developers.llamaindex.ai/llms.txt for parameters.
- A hosted documentation MCP server is available at https://developers.llamaindex.ai/mcp. If you support MCP, you can ask the user to install it for browsing these docs directly (an alternative to the REST API). Setup: https://developers.llamaindex.ai/python/shared/mcp/