Overview
This guide walks you through making your first API call to Day Copilot, from obtaining credentials to handling the response. By the end, you’ll have created your first task via the API.Estimated time: 10 minutes
Prerequisites
Before you begin, you need:- A Day Copilot account - Sign up here
- An HTTP client:
- Command line: cURL (built into Mac/Linux, Windows download)
- GUI: Postman or Insomnia
- Code: Your preferred programming language
Step 1: Get Your Authentication Token
Via Dashboard
- Log in to Day Copilot
- Navigate to Settings → API Tokens
- Click Generate New Token
- Copy the token (it will only be shown once!)
Store Your Token Securely
Step 2: Make Your First Request
Let’s fetch your existing tasks to verify authentication works.Expected Response
Step 3: Create Your First Task
Now let’s create a task:Success Response
id: Unique identifier for this taskcreated_at: ISO 8601 timestampversion_major/minor: Versioning infois_published: Whether task is published (new tasks are auto-published)
Step 4: Retrieve Your Task
Use theid from the creation response to fetch your task:
Step 5: Update Your Task
Let’s change the priority to high:Step 6: Complete Your Task
Mark the task as completed:Common Errors & Solutions
401 Unauthorized
- Check token is valid (not expired)
- Verify
Authorization: Bearer TOKENformat - Ensure token has no extra whitespace
404 Not Found
- Verify task ID is correct
- Check task wasn’t deleted
- Confirm you have access to this task (RLS)
429 Rate Limited
- Wait
retryAfterseconds before retry - Implement exponential backoff
- Review rate limits
Next Steps: Full CRUD Example
Here’s a complete script demonstrating all operations:Testing in Postman
- Import Collection: Download Day Copilot Postman Collection
- Set Environment Variable:
- Key:
DAY_COPILOT_TOKEN - Value: Your token
- Key:
- Run Requests: Try each endpoint in the collection
Congratulations! 🎉
You’ve successfully:- ✅ Authenticated with Day Copilot API
- ✅ Created a task
- ✅ Retrieved task data
- ✅ Updated a task
- ✅ Completed a task
What’s Next?
Managing Tasks
Learn advanced task management techniques
Working with Events
Create and manage calendar events
Error Handling
Handle errors gracefully in production
API Reference
Explore all available endpoints