# New Completed Task — Todoist

> Emit new event for each completed Todoist task, including recurring task completions. Non-recurring completions are polled via GET /tasks/completed/by_completion_date. Recurring completions don't appear there - Todoist reschedules a…

- Key: `todoist-completed-task`
- Type: Trigger (Polling)
- Version: 2.0.0
- App: Todoist (`todoist`) — https://pipedream.com/apps/todoist.md
- This page (HTML): https://pipedream.com/apps/todoist/triggers/completed-task
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/todoist/sources/completed-task/completed-task.mjs

## Description

Emit new event for each completed Todoist task, including recurring task completions. Non-recurring completions are polled via `GET /tasks/completed/by_completion_date`. Recurring completions don't appear there - Todoist reschedules a recurring task instead of marking it completed there - so they're additionally polled via the v1 Activity Log (`GET /api/v1/activities`), detected as an `item:completed` event with `extra_data.is_recurring` set to `true`. **Accessing recurring task completions older than 7 days requires a Todoist premium/business plan**.  Respects the Projects filter. [See the documentation](https://developer.todoist.com/api/v1/#tag/Activity/operation/get_activity_logs_api_v1_activities_get).

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `timer` | `$.interface.timer` | Yes | Pipedream will poll the Todoist API on this schedule |
| `selectProjects` | `string[]` | No | Filter for events that match one or more projects. Leave this blank to emit results for any project. Options are loaded from the connected account. |

## Returns

Events emitted by Todoist.

## Run it

**TypeScript**

```ts
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const deployed = await pd.triggers.deploy({
  id: "todoist-completed-task",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    todoist: { authProvisionId: "apn_xxxxxxx" },
    timer: { "intervalSeconds": 900 },
    selectProjects: ["Select Projects"],
  },
  webhookUrl: "https://example.com/webhooks/todoist",
})

console.log(deployed.id)
```

**cURL**

```bash
curl -X POST https://api.pipedream.com/v1/connect/{project_id}/triggers/deploy \
  -H "Content-Type: application/json" \
  -H "X-PD-Environment: production" \
  -H "Authorization: Bearer {access_token}" \
  -d '{
    "external_user_id": "{external_user_id}",
    "id": "todoist-completed-task",
    "webhook_url": "https://example.com/webhooks/todoist",
    "configured_props": {
      "todoist": { "authProvisionId": "apn_xxxxxxx" },
      "timer": { "intervalSeconds": 900 },
      "selectProjects": ["Select Projects"]
    }
  }'
```

**MCP**

MCP servers expose Todoist actions as on-demand tools.

New Completed Task is an event source, so your application deploys it with the Connect SDK or API and then either receives each event at a webhook URL or retrieves events on demand with the trigger events API.

## Event delivery

Every event is sent to the HTTP endpoint you choose when you deploy the source. Or: no webhook required — your app or agent can fetch recent events from the [trigger events API](https://pipedream.com/docs/connect/api-reference/list-trigger-events.md) instead.

---

- App: https://pipedream.com/apps/todoist.md · All apps: https://pipedream.com/apps
