Overview
DayCopilot implements automatic access control to ensure data security and privacy. All data records are scoped to the owning user and those who have active share permissions.Access control is automatic and transparent. As an API integrator, you don’t need to filter by user ID manually - this is handled for you.
How Access Control Works
Automatic Data Scoping
When you make API requests, you only see data you have permission to access:- Impossible to access other users’ data
- No manual filtering needed
- Security enforced automatically
- Works consistently across all queries
Authentication Flow
Data Access Rules
Your Own Data
You have full access to all resources you create:When you attempt to access a resource that doesn’t exist or you don’t have permission to access, you’ll receive a 404 error (not 403) for security reasons.
Shared Resources
When someone shares a context with you, you automatically gain access to its contents:Permission Levels
DayCopilot supports three permission levels for shared contexts:| Permission | Read Tasks/Events | Create Tasks/Events | Update Tasks/Events | Delete Tasks/Events |
|---|---|---|---|---|
read | ✅ | ❌ | ❌ | ❌ |
write | ✅ | ✅ | ✅ | ❌ |
admin | ✅ | ✅ | ✅ | ✅ |
Read Permission
Users withread permission can:
- View all tasks and events in the shared context
- See task details and event information
- View comments and activity
- Create new tasks or events
- Modify existing tasks or events
- Delete anything
Write Permission
Users withwrite permission can:
- Everything included in
readpermission - Create new tasks and events in the context
- Update existing tasks and events
- Add comments
- Delete tasks or events
- Change context sharing settings
- Remove the context
Admin Permission
Users withadmin permission have full control:
- Everything included in
writepermission - Delete tasks and events
- Manage context sharing settings
- Remove collaborators
- Delete the context
Sharing & Collaboration
Context Sharing
When you share a context, collaborators get access to all items within it:- All tasks in the context
- All events in the context
- Ability to add new items (if permission allows)
- Activity history
Task Assignment vs. Sharing
- Create a shared context
- Add the task to that context
- Share the context with the assignee
Event Attendees
Adding someone as an event attendee automatically gives them access to that specific event:API Behavior
Creating Resources
You can only create resources for yourself:Querying with Filters
All queries automatically respect access control:Updating Resources
You can only update resources you own or have write/admin permission to:Deleting Resources
You can only delete resources you own or have admin permission to:Security Guarantees
Data Isolation
Data Isolation
Guarantee: You can only access your own data and data explicitly shared with you.Even if you guess or enumerate resource IDs, you cannot access resources you don’t have permission to view.
Automatic Filtering
Automatic Filtering
Guarantee: All queries are automatically scoped to your user account.You don’t need to add user ID filters - attempting to access other users’ data will be blocked automatically.
Permission Enforcement
Permission Enforcement
Guarantee: Permission levels are strictly enforced.Read-only access prevents modifications, write access prevents deletions, and only admin access allows full control.
Secure by Default
Secure by Default
Guarantee: Access denials return 404 (not 403) for non-existent resources.This prevents information disclosure about the existence of resources you don’t have access to.
Best Practices
Don't Filter by User ID
Don't Filter by User ID
The API automatically scopes data to the authenticated user. Adding user_id filters is redundant and may cause confusion.
Use Shared Contexts for Collaboration
Use Shared Contexts for Collaboration
Handle 404 Gracefully
Handle 404 Gracefully
When you receive a 404 error, it could mean the resource doesn’t exist OR you don’t have access. Handle both cases gracefully.
Test with Multiple Users
Test with Multiple Users
Always test integrations with multiple user accounts to verify access control works correctly and data is properly isolated.
Debugging Access Issues
Common Problems
Problem: Can’t see tasks in a shared context Solution:- Verify the context was shared with you:
GET /api/v1/contexts/context-uuid/collaborators - Check that tasks are in the correct context:
GET /api/v1/tasks?context_id=context-uuid - Confirm your permission level allows the action you’re trying to perform
Problem: Getting 404 for a resource you think should exist Solution:
- Verify you’re using the correct resource ID
- Check if the resource is in a context shared with you
- Confirm you have the right permission level (read/write/admin)
- Validate your JWT token is current and valid
Problem: Can’t create tasks in a shared context Solution:
- Verify you have at least
writepermission:GET /api/v1/contexts/context-uuid - Ensure you’re specifying the correct
context_idin the request body - Check that the context still exists and hasn’t been deleted