The Document v1 API (Documentation Index
Fetch the complete documentation index at: https://support.agentrank.io/llms.txt
Use this file to discover all available pages before exploring further.
/document/v1/) provides HTTP access to document operations in Vespa. It supports creating, reading, updating, and deleting documents, as well as bulk operations through the visitor pattern.
Base URL
Document ID Structure
Vespa document IDs follow the format:Single Document Operations
Get Document
Retrieve a single document by ID.Document namespace
Document type as defined in your schema
User-specified document identifier
Target content cluster (required if multiple clusters exist)
Field set to retrieve. Examples:
[document]- All document fields[id]- Only document IDmusic:[document]- All fields from music document typeartist,title- Specific fields
Request timeout (e.g.,
5s, 1000ms)Trace level 0-9 for debugging
The request path
The full document ID
Document fields as key-value pairs
Put Document (Create/Replace)
Create a new document or replace an existing one.Document fields to set
If
true, only create document if it doesn’t exist (returns error if exists)Test-and-set condition that must be true for operation to succeed
Route string for the operation
Update Document
Partially update an existing document.- Assign
- Add to Array
- Remove from Array
- Increment
Set a field to a new value:
If
true, create document if it doesn’t existTest-and-set condition
Delete Document
Delete a document by ID.Test-and-set condition that must be true for deletion to succeed
Bulk Operations (Visitor)
The Document v1 API supports bulk operations through the visitor pattern.Visit Documents
Retrieve multiple documents matching a selection.Document selection expression (required for most bulk operations)
Target content cluster
Continuation token from previous visit response
Approximate number of documents to return
Number of parallel visitors (1-1024)
Bucket space:
default or globalFields to retrieve
Enable streaming mode for large result sets (JSONL format)
Number of slices for parallel processing
Specific slice to process (0 to slices-1)
Array of matching documents
Token to retrieve next batch (if more documents available)
Number of documents in this response
Bulk Update
Update multiple documents matching a selection.The
selection parameter is required for bulk updates to prevent accidental modification of all documents.Bulk Delete
Delete multiple documents matching a selection.Copy Documents
Copy documents from one cluster to another.Target cluster for copy operation
Advanced Features
Test-and-Set (Conditional Operations)
Use test-and-set to ensure operations only succeed when conditions are met:Grouping Documents
Use number or group distribution for data locality: Number GroupingTime-based Visiting
Visit documents modified within a time range:Unix timestamp (microseconds) - start of range
Unix timestamp (microseconds) - end of range
Include removed documents (tombstones)
Dry Run Mode
Test operations without actually executing them:If true, validate operation but don’t execute
Request Size Limits
The Document v1 API has configurable request size limits:- Default maximum request size: configurable per deployment
- Large documents should be split or use streaming
Performance Tips
- Use Streaming for Large Visits: Enable
stream=truefor large result sets to reduce memory usage - Parallel Visiting: Use
concurrencyparameter to speed up bulk operations - Field Sets: Request only needed fields using
fieldSetparameter - Batch Updates: Use bulk update operations instead of individual updates
- Connection Pooling: Reuse HTTP connections for better throughput
Error Handling
Error message describing what went wrong
| Status | Meaning |
|---|---|
| 400 | Invalid request format or parameters |
| 404 | Document not found |
| 412 | Test-and-set condition failed |
| 413 | Request size too large |
| 429 | Too many requests (rate limited) |
| 500 | Internal server error |
| 504 | Request timeout |
| 507 | Insufficient storage space |