For the complete documentation index, see llms.txt. This page is also available as Markdown.

SDK Cookbook

Integration patterns for Taskade — agents, automations, projects, bundles, error handling, pagination, and testing.

Production patterns for integrating with Taskade.

Table of Contents


Setup & Authentication

A tiny HTTP helper

Until the SDK ships, the cleanest pattern is a small typed wrapper around the Action API v2 — every operation is a POST /{operation} with a JSON body. The recipes below all build on this one helper:

Per-request token override

For multi-tenant apps where each request acts on behalf of a different user, pass the caller's token in instead of reading it from the environment:


TypeScript Types

Declare the shapes you consume so responses stay type-safe. (When the generated client ships, it exports a TaskadePublicApi plus request/response types for each v2 operation — see the SDK Preview quickstart.)

Use type guards on the { ok } union that v2 returns:


Agents

Prompt an agent

promptAgent sends one prompt and returns a synchronous text response in summary:

Review past conversations

Attach knowledge to an agent

Handle rate limits with retry

The helper throws with a status property, so back off on 429:


Automations

There is no "run automation" API operation. Automations run inside Taskade, fired by a Taskade trigger (such as task added or task completed) and acting through built-in steps including an outbound HTTP Request action.

Kick off an automation from code

To start a flow from your integration, create the object its trigger watches — the automation fires on its own. For example, a "task added → notify" automation runs when you create a task via the REST API v1:

To push external data into an automation, point it at an inbound Webhook trigger and POST your payload to the URL Taskade gives you.


Projects & Tasks

Create a project from Markdown

v2 createProject seeds a whole project — outline and all — from a Markdown string:

Add tasks

Tasks are read-only in v2 (listTasks, listBlocks). To create, update, complete, or delete tasks use the REST API v1.

Mark a task complete


Webhooks

There is no event-subscription API (no POST /api/v2/webhooks). To react to Taskade events, build an automation with a Taskade trigger (e.g. task completed) and an outbound HTTP action that calls your endpoint. See the Webhooks guide for the full model and the task.added / task.completed payloads.

Receive an event in your app

Your endpoint receives whatever JSON body the automation's HTTP action sends. Make your handler idempotent — automations may retry on failure:

To send data into Taskade instead, use an inbound webhook trigger — see Inbound Webhooks.


Bundles (Import/Export)

Export a Taskade Genesis app as a portable bundle, then import elsewhere. See Bundles & App Kits for the full schema.


Error Handling Taxonomy

v2 reports failures with an HTTP error status and an { ok: false, message, code } body. The taskade helper above attaches status to the thrown error, so you can branch on it:

err.status
Retry?
Typical Fix

400

No

Fix request body

401

No

Refresh or regenerate token

402

No

Top up credits or change model

403

No

Token needs additional scope

404

No

Verify ID and workspace access

429

Yes

Exponential backoff

5xx

Yes

Retry up to 3 times


Pagination

Tasks and blocks use cursor pagination: pass after set to the last item's id to get the next page; stop when a page comes back smaller than limit. (Members, conversations, and projects use page / limit instead — see the Action API v2 Reference.)


Testing & Mocking

Environment-based client

Wrap the helper so tests don't hit the network:

Mock with vitest / jest

Since every call goes through one fetch, stub fetch (or the taskade helper) and return a { ok: true, ... } body:

Integration tests with a sandbox workspace

Create a dedicated "SDK Test" workspace with a scoped token. Your CI pipeline runs against the live API on this isolated workspace — avoiding production pollution while verifying real behavior.


TypeScript SDK (Preview)Action API v2 ReferenceWebhooksAutonomous Agents

Last updated

Was this helpful?