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
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
Mark a task complete
Webhooks
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:
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.
Related
TypeScript SDK (Preview)Action API v2 ReferenceWebhooksAutonomous AgentsLast updated
Was this helpful?