Overview
DayCopilot is an AI-powered productivity platform that automatically processes emails to extract tasks and events, and provides a comprehensive REST API for building productivity applications.This document focuses on the aspects of DayCopilot’s architecture that are relevant for API integrators. Internal implementation details are omitted for clarity.
System Architecture
Core Services
DayCopilot exposes the following services through the API:REST API
- Standards-compliant REST endpoints
- OpenAPI 3.0 specification
- JSON request/response format
- Comprehensive error handling
OAuth Service
- Industry-standard OAuth 2.0
- Fine-grained permission scopes
- JWT token-based authentication
- Automatic token refresh
Email Processing
- AI-powered email parsing
- Automatic task/event extraction
- Async processing pipeline
- Real-time notifications
Calendar Sync
- Bidirectional CalDAV integration
- RFC 5545 compliant (iCalendar)
- Timezone handling
- RSVP status tracking
Data Model
Understanding the core data model helps you build effective integrations:Tasks
Tasks represent actionable items that need to be completed. Key Properties:- Unique ID (UUID)
- Title and description
- Priority levels (low, medium, high, urgent)
- Status (pending, in_progress, completed, canceled)
- Due dates and time estimates
- Assignees (multiple users)
- Parent context
- Draft/publish versioning
Events
Events represent calendar appointments and scheduled activities. Key Properties:- Unique ID (UUID)
- Title, description, and location
- Start and end timestamps
- All-day event flag
- Attendees list with RSVP status
- Recurrence rules (coming soon)
- Parent context
Contexts
Contexts organize related tasks and events into logical groups. Key Properties:- Unique ID (UUID)
- Name and description
- Associated tasks and events
- Collaborators with permissions
- Sharing settings
- Activity feed
Authentication & Security
Access Control
DayCopilot implements database-level access control to ensure data security: What this means for you:- You don’t need to filter by user ID in your queries
- All queries are automatically scoped to the authenticated user
- Shared resources are handled transparently
- No risk of accidentally accessing other users’ data
JWT Tokens
All API requests use JSON Web Tokens (JWT) for authentication:API Design Principles
DayCopilot’s API follows REST best practices:Resource-Oriented
Consistent Response Format
All successful responses follow this structure:Predictable Errors
All error responses include:Draft/Publish Workflow
DayCopilot implements a versioning system for collaborative editing: Key Concepts:version_major: Published version numberversion_minor: Draft version numberis_published: Whether current version is livelast_live: Snapshot of last published state
Email Processing Flow
When users forward emails to DayCopilot, the platform processes them through an AI pipeline: API Integration Points:- Tasks and events created via email appear in the API immediately
- API-created items don’t trigger email processing
- You can query email metadata for items created from emails
Calendar Integration (CalDAV)
DayCopilot supports bidirectional calendar sync via CalDAV:- Two-way sync with external calendars
- RFC 5545 compliant (iCalendar format)
- Support for recurring events
- Timezone handling
- RSVP status tracking
Performance & Scalability
Caching Strategy
DayCopilot implements intelligent caching:- API responses are cacheable (check
Cache-Controlheaders) - ETags for conditional requests
- Pagination for large datasets
Rate Limits
See Rate Limits for detailed information on request limits by tier.Pagination
All list endpoints support pagination:Integration Patterns
Webhooks (Coming Soon)
Subscribe to real-time updates instead of polling:Batch Operations
For efficiency, batch multiple operations:Best Practices
Use Appropriate HTTP Methods
Use Appropriate HTTP Methods
GETfor fetching data (never modify)POSTfor creating resourcesPUTfor full updatesPATCHfor partial updatesDELETEfor removing resources
Handle Errors Gracefully
Handle Errors Gracefully
Always check response status codes and handle errors appropriately. Use the
correlationId when contacting support for faster troubleshooting.Respect Rate Limits
Respect Rate Limits
Monitor
X-RateLimit-* headers and implement backoff strategies. Cache responses when possible.Use Pagination
Use Pagination
Don’t fetch all records at once. Use
limit and offset parameters to paginate through large datasets.Keep Tokens Secure
Keep Tokens Secure
Never expose JWT tokens in client-side code, URLs, or version control. Use environment variables and secure storage.