Data Operations
Upload Text Data
Upload text documents to a text namespace for semantic search and AI-powered operations.
POST
Overview
Upload text documents to a text namespace, enabling semantic search, similarity matching, and AI-powered question answering. The API supports various formats and automatic text processing with metadata enrichment.Documents are automatically processed to generate embeddings using Amazon Bedrock for optimal search performance.
Authentication
Your API key for authentication
Must be
application/jsonPath Parameters
Name of the text namespace to upload documents to
Body Parameters
Array of document objects. Each object in the array is a flat object with
id, text, and optional metadata fields as direct properties.Document Object Properties
Each object in thedocuments array is a flat object with these properties:
Unique identifier for the document. Must be a non-empty string or number. This is a direct property of the document object, not a nested object.
The main text content of the document. This is a direct property of the document object, not a nested object.
Optional metadata fields for filtering and organization. Any additional fields beyond id and text are treated as metadata.
Metadata:
- All key-value pairs other than
idandtextare considered as metadata - Metadata is optional, but recommended
- You can add any additional metadata fields as key-value pairs according to your preference for filtering and organization
Response Fields
Success Response (202)
Status of the upload (“success” for successful uploads)
Human-readable confirmation message
Unique identifier for tracking this upload batch
Name of the namespace where documents were uploaded
Number of documents successfully processed
Current status: “in_progress”, “completed”, or “failed”
Estimated ISO 8601 timestamp when processing will complete
Array of uploaded document status objects
Document Status Object
Document identifier
Processing status: “processing”, “completed”, or “failed”
Number of characters in the document text
Processing Pipeline
Document Limits
Text Length
Min: 10 characters
Max: 50,000 characters per document
Batch Size
Max: 100 documents per request
Recommended: 25-50 documents for optimal performance
Metadata Size
Max: 2KB per document
Keys: Up to 50 metadata keys
Processing Time
Typical: 1-5 seconds per document
Large batches: 30-120 seconds
Best Practices
Optimal Document Structure
Optimal Document Structure
- Keep documents focused on a single topic
- Include meaningful titles and metadata
- Use consistent metadata schemas across documents
- Break large documents into logical chunks
Metadata Strategy
Metadata Strategy
- Use consistent key naming conventions
- Include searchable categories and tags
- Add temporal metadata (created_at, updated_at)
- Consider user access levels in metadata
Performance Optimization
Performance Optimization
- Upload in batches of 25-50 documents
- Use meaningful document IDs for easier management
- Monitor processing status for large uploads
- Implement retry logic for failed uploads
Use Cases
- Knowledge Base: Build searchable documentation and knowledge repositories
- Content Management: Store and organize articles, blog posts, and content
- Customer Support: Upload support documents for AI-powered assistance
- Research: Organize and search through research papers and publications
- Legal Documents: Store and search legal documents with metadata filtering
- Training Materials: Upload educational content for learning applications
Related Endpoints
- Search - Search uploaded text documents
- Get Documents - Retrieve document information
- Delete Data - Remove uploaded documents
- Create Namespace - Create text namespaces for uploads