Library API Overview
The Informer Library API provides comprehensive endpoints for managing document libraries, file storage, vector indexing, and AI assistant knowledge bases. Libraries support local file storage and cloud integrations (Google Drive, OneDrive, SharePoint, Dropbox) with automatic sync, versioning via snapshots, and semantic search through vector embeddings. All routes are prefixed with /api.
Features
- CRUD Operations - Create, read, update, and delete libraries
- File Management - Upload, list, read, write, and delete files with directory support
- Cloud Integration - Connect to Google Drive, OneDrive, SharePoint, Dropbox via OAuth
- Vector Indexing - Automatic embeddings generation for semantic search
- Snapshots - Point-in-time library backups with restore capability
- Sync Operations - Automatic and manual sync from connected cloud services
- Assistant Knowledge - Associate libraries with AI assistants for RAG
- Sharing & Permissions - Team-based access control with read/write levels
- Favorites - User-specific library favoriting
Library Types
Libraries are created with different driver types:
| Type | Description |
|---|---|
| local | Local file storage managed by Informer |
| google-drive | Integration with Google Drive |
| onedrive | Integration with Microsoft OneDrive |
| sharepoint | Integration with Microsoft SharePoint |
| dropbox | Integration with Dropbox |
Authentication
All Library API endpoints require authentication via session cookies or API tokens. Most endpoints verify library permissions before allowing access.
Common Permission Patterns
- Read access - View library metadata and indexed files (requires ownership or share)
- Write permission - Required for
library:write(create, update, delete, file uploads, sync) - Sync permission - Required for
library:sync(trigger sync from cloud integrations) - Connection access - Only connection owners can see unindexed files
File Indexing
Libraries automatically index uploaded files for semantic search:
- Supported Formats - PDF, DOCX, TXT, MD, CSV, XLSX, HTML, and more
- Vector Embeddings - Generated via OpenAI embeddings API
- Status Tracking -
indexed,indexingStartedAt,indexingErroredAtfields - Retry Logic - Manual retry via
POST /api/libraries/{id}/files/{fileId}/_retry-indexing
Indexing States
| State | Description |
|---|---|
indexed: true | File successfully indexed, searchable by assistants |
indexingStartedAt != null, indexed: false | Currently indexing |
indexingErroredAt != null | Indexing failed, see indexingErrorMessage |
indexed: false, indexingStartedAt: null | Not yet indexed or skipped (e.g., embedded libraries) |
Snapshots
Libraries support versioned snapshots for backup and restore:
- Create snapshot -
POST /api/libraries/{id}/snapshots - List snapshots -
GET /api/libraries/{id}/snapshots - Restore snapshot -
POST /api/libraries/{id}/snapshots/{snapshotId}/_restore - Delete snapshot -
DELETE /api/libraries/{id}/snapshots/{snapshotId}
Snapshots include:
- All files and directory structure
- Metadata (created date, trigger type)
- Automatic limit enforcement (default: keep 10 most recent)
Cloud Integration
Libraries can connect to cloud storage providers:
- Create library with cloud driver type (
google-drive,onedrive, etc.) - Connect via OAuth -
POST /api/libraries/{id}/integration - Sync files -
POST /api/libraries/{id}/_sync - Auto-sync - Configure
syncInterval(in minutes) for periodic updates
Integration Workflow
graph LR
A[Create Library] --> B[Set Integration]
B --> C[OAuth Connect]
C --> D[Sync Files]
D --> E[Index Files]
E --> F[Associate with Assistant]
Assistant Access
Libraries can be shared with AI assistants for knowledge retrieval:
- Enable assistant access -
PUT /api/libraries/{id}/assistant-accesswith{ "enabled": true } - Associate with assistant -
POST /api/libraries/{id}/assistantscreates embedded assistant - File-level RAG - Assistants use vector embeddings to answer questions about library content
File Paths
Files support hierarchical directory structure:
- Upload to path -
POST /_library-uploadwithpath: "assets/index.js" - List by directory -
GET /api/libraries/{id}/files?dir=/assets - Read by path -
GET /api/libraries/{id}/contents/{path*} - Write by path -
PUT /api/libraries/{id}/contents/{path*}(creates parent dirs)
Common Query Parameters
Many list endpoints support:
| Parameter | Type | Default | Description |
|---|---|---|---|
q | string | - | Search query (filters files by filename) |
start | integer | 0 | Pagination offset |
end | integer | 100 | Pagination limit (max results) |
sort | array | [{colId: "filename", sort: "ASC"}] | Sort configuration |
parentId | string | - | Filter files by parent directory ID |
dir | string | - | Filter files by directory path (e.g., /assets) |
dirOnly | boolean | false | Return only directories |
Error Responses
Standard HTTP status codes:
200- Success201- Created (resource created successfully)204- No Content (successful delete)400- Bad request (validation error)403- Forbidden (insufficient permissions)404- Resource not found409- Conflict (duplicate, constraint violation)500- Internal server error
Error responses include:
{
"statusCode": 403,
"error": "Forbidden",
"message": "Insufficient permissions to modify library"
}
Long-Running Operations
Several endpoints support long-running operations with progress tracking:
POST /api/libraries- Create with integration setupPOST /api/libraries/{id}/_sync- Sync from cloud integrationPOST /_library-upload- Upload and index files
These endpoints accept a progress parameter in the payload for progress updates.
Next Steps
Explore the specific endpoint categories:
- Core CRUD - Basic library operations
- File Management - File upload, read, write, delete
- Snapshots - Versioning and restore
- Integration & Sync - Cloud connections and sync
- Assistant Associations - AI knowledge integration
- Sharing - Access control
- Comments & Favorites - User interactions
- Drivers & Templates - Library type discovery