Overview
The API service provides comprehensive endpoints for:- Vault Management: Ciphers, folders, collections, and sync operations
- Account Operations: User registration, authentication, profile management
- Organization Administration: Organization and user management, groups, policies
- Secrets Manager: Service accounts, projects, and secrets
- Billing: Subscription management, payment processing
- Send: Secure file and text sharing
- Public API: Organization-level API for integrations
Architecture
Configuration
Application Settings
The API service is configured viaappsettings.json and environment variables:
appsettings.json
Rate Limiting
Rate limiting is automatically enabled for cloud deployments and can be configured per-endpoint.
Rate Limit Configuration
Key Endpoints
Vault Operations
Sync
GET /api/sync - Full vault synchronization for clientsCiphers
/api/ciphers/* - Vault item CRUD operationsFolders
/api/folders/* - Folder managementCollections
/api/collections/* - Organization collectionsAccount Management
1
Account Registration
POST /api/accounts/register - Create new user account2
Profile Management
GET/PUT /api/accounts/profile - User profile operations3
Two-Factor
/api/two-factor/* - 2FA configuration and verificationOrganization Administration
Located in/src/Api/AdminConsole/Controllers/:
Key Controllers
Public API
The Public API provides organization-level access for integrations:Service Configuration
Startup Configuration
Fromsrc/Api/Startup.cs:59:
Service Registration
Authentication Policies
The API uses multiple authorization policies:Middleware Pipeline
Fromsrc/Api/Startup.cs:234:
Request Pipeline
Secrets Manager
Secrets Manager endpoints are available in the commercial version only.
- Service Accounts: Machine identity for API access
- Projects: Logical grouping of secrets
- Secrets: Key-value pairs with versioning
- Access Policies: Fine-grained permissions
/src/Api/SecretsManager/Controllers/:
Health Checks
The API exposes two health check endpoints:/healthz- Basic health check/healthz/extended- Detailed health information including database connectivity
Swagger Documentation
API documentation is available via Swagger UI in development and self-hosted deployments:src/Api/Startup.cs:294:
Swagger Configuration
Background Jobs
The API service runs background jobs for:- Cache Synchronization: ServiceBus-based cache invalidation
- Event Processing: Handling event integrations (Slack, Teams)
- Scheduled Tasks: Cleanup and maintenance operations
src/Api/Startup.cs:219:
Job Services
Deployment
Environment Variables
Key environment variables for the API service:Docker
Performance Considerations
Distributed Cache
Uses Redis for distributed caching to improve performance across multiple instances
Rate Limiting
Endpoint-level rate limiting prevents abuse and ensures fair usage
Connection Pooling
Database connection pooling for efficient resource utilization
Async Operations
Fully async controllers and services for better throughput
Related Services
- Identity Service - Authentication and OAuth/OIDC
- Notifications Service - Real-time push notifications
- Events Service - Event collection and tracking
- Billing Service - Stripe webhook processing