Todoist Tool

Home > Tools > Todoist

Getting Started with Todoist

Todoist is a powerful task manager that can be integrated into Gen’s ecosystem. Below you’ll find everything you need to connect, authenticate, and start adding tasks programmatically.

1. Create an API Token

1. Log in to Todoist 2. Go to Settings → Integrations 3. Click “Generate new token” 4. Copy the token – you’ll need it for the next steps.

2. Store the Token Securely

We recommend adding it to an environment variable or a .env file if you’re running your own instance of Gen locally. In this demo, we’ll just use a placeholder.

3. Example: Add a Task with JavaScript

The following snippet uses the Todoist REST API to create a new task. Replace YOUR_API_TOKEN with your actual token.

// Add a task to Todoist
const token = 'YOUR_API_TOKEN';
const payload = {
  content: 'Review Gen documentation',
  due_string: 'tomorrow at 10am',
  project_id: 1234567890 // optional, default project
};

fetch('https://api.todoist.com/rest/v1/tasks', {
  method: 'POST',
  headers: {
    'Authorization': `Bearer ${token}`,
    'Content-Type': 'application/json'
  },
  body: JSON.stringify(payload)
})
.then(r => r.json())
.then(data => console.log('Task created', data))
.catch(err => console.error(err));

4. Webhooks (Optional)

If you want to be notified whenever a task changes, set up a webhook:

// Register a webhook
const webhookUrl = 'https://your-domain.com/webhooks/todoist';
fetch('https://api.todoist.com/rest/v1/webhooks', {
  method: 'POST',
  headers: {
    'Authorization': `Bearer ${token}`,
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({ url: webhookUrl })
});

Gen will automatically receive POST requests at /webhooks/todoist when any task is updated.

5. Quick Demo GIF

Want to see it in action? Check out the GIF below.

Todoist Task Creation GIF

6. Common Issues

7. Next Steps

Explore the Todoist integrations page for official apps. Or dig into the full REST API docs for advanced features like labels, priorities, and custom fields.