Skip to main content

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:
  1. A Day Copilot account - Sign up here
  2. An HTTP client:

Step 1: Get Your Authentication Token

Via Dashboard

  1. Log in to Day Copilot
  2. Navigate to SettingsAPI Tokens
  3. Click Generate New Token
  4. Copy the token (it will only be shown once!)
Keep your token secret! Never commit it to version control or share it publicly. Treat it like a password.

Store Your Token Securely

Step 2: Make Your First Request

Let’s fetch your existing tasks to verify authentication works.

Expected Response

If you get an empty array, that’s perfect! It means authentication worked and you just don’t have any tasks yet.

Step 3: Create Your First Task

Now let’s create a task:

Success Response

Key Fields:
  • id: Unique identifier for this task
  • created_at: ISO 8601 timestamp
  • version_major/minor: Versioning info
  • is_published: Whether task is published (new tasks are auto-published)

Step 4: Retrieve Your Task

Use the id 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

Solutions:
  • Check token is valid (not expired)
  • Verify Authorization: Bearer TOKEN format
  • Ensure token has no extra whitespace

404 Not Found

Solutions:
  • Verify task ID is correct
  • Check task wasn’t deleted
  • Confirm you have access to this task (RLS)

429 Rate Limited

Solutions:
  • Wait retryAfter seconds before retry
  • Implement exponential backoff
  • Review rate limits

Next Steps: Full CRUD Example

Here’s a complete script demonstrating all operations:

Testing in Postman

  1. Import Collection: Download Day Copilot Postman Collection
  2. Set Environment Variable:
    • Key: DAY_COPILOT_TOKEN
    • Value: Your token
  3. 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